@shytv/ai-chart 0.0.12 → 0.0.13

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.
@@ -57,48 +57,48 @@ Check the top-level render call using <`+n+`>.`)}return t}function Ne(e,t){if(e.
57
57
  .block-interactivity-${e} {pointer-events: none;}
58
58
  .allow-interactivity-${e} {pointer-events: all;}
59
59
  `},QE=0,$E=[];function eD(e){var n=t.useRef([]),r=t.useRef([0,0]),i=t.useRef(),a=t.useState(QE++)[0],o=t.useState(SE)[0],s=t.useRef(e);t.useEffect(function(){s.current=e},[e]),t.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${a}`);var t=ZT([e.lockRef.current],(e.shards||[]).map(YE),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${a}`)}),function(){document.body.classList.remove(`block-interactivity-${a}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${a}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=t.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var n=qE(e),a=r.current,o=`deltaX`in e?e.deltaX:a[0]-n[0],c=`deltaY`in e?e.deltaY:a[1]-n[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=BE(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=BE(d,u)),!m)return!1;if(!i.current&&`changedTouches`in e&&(o||c)&&(i.current=l),!l)return!0;var h=i.current||l;return KE(h,t,e,h===`h`?o:c,!0)},[]),l=t.useCallback(function(e){var t=e;if($E.length&&$E[$E.length-1]===o){var r=`deltaY`in t?JE(t):qE(t),i=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&XE(e.delta,r)})[0];if(i&&i.should)t.cancelable&&t.preventDefault();else if(!i){var a=(s.current.shards||[]).map(YE).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?c(t,a[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=t.useCallback(function(e,t,r,i){var a={name:e,delta:t,target:r,should:i,shadowParent:tD(r)};n.current.push(a),setTimeout(function(){n.current=n.current.filter(function(e){return e!==a})},1)},[]),d=t.useCallback(function(e){r.current=qE(e),i.current=void 0},[]),f=t.useCallback(function(t){u(t.type,JE(t),t.target,c(t,e.lockRef.current))},[]),p=t.useCallback(function(t){u(t.type,qE(t),t.target,c(t,e.lockRef.current))},[]);t.useEffect(function(){return $E.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,FE),document.addEventListener(`touchmove`,l,FE),document.addEventListener(`touchstart`,d,FE),function(){$E=$E.filter(function(e){return e!==o}),document.removeEventListener(`wheel`,l,FE),document.removeEventListener(`touchmove`,l,FE),document.removeEventListener(`touchstart`,d,FE)}},[]);var m=e.removeScrollBar,h=e.inert;return t.createElement(t.Fragment,null,h?t.createElement(o,{styles:ZE(a)}):null,m?t.createElement(ME,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var nD=dE(fE,eD),rD=t.forwardRef(function(e,n){return t.createElement(mE,YT({},e,{ref:n,sideCar:nD}))});rD.classNames=mE.classNames,j();var iD=[`__scopeMenu`],aD=[`forceMount`],oD=[`__scopeMenu`,`loop`,`trapFocus`,`onOpenAutoFocus`,`onCloseAutoFocus`,`disableOutsidePointerEvents`,`onEntryFocus`,`onEscapeKeyDown`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`,`onDismiss`,`disableOutsideScroll`],sD=[`disabled`,`onSelect`],cD=[`__scopeMenu`,`disabled`,`textValue`],lD=[`__scopeMenu`],uD=Object.defineProperty,dD=(e,t)=>uD(e,`name`,{value:t,configurable:!0}),fD=[`Enter`,` `],pD=[`ArrowDown`,`PageUp`,`Home`],mD=[`ArrowUp`,`PageDown`,`End`],hD=[...pD,...mD];[...fD],[...fD];var gD=`Menu`,[_D,vD,yD]=Tb(gD),[bD,xD]=mb(gD,[yD,Cw,ET]),SD=Cw(),CD=ET(),[wD,TD]=bD(gD),[ED,DD]=bD(gD),OD=dD(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=SD(t),[c,l]=h.useState(null),u=h.useRef(!1),d=Jb(a),f=Ux(i);return h.useEffect(()=>{let e=dD(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=dD(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;let e=dD(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,X.jsx)(Ew,A(A({},s),{},{children:(0,X.jsx)(wD,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,X.jsx)(ED,{scope:t,onClose:h.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})}))},`Menu`),kD=h.forwardRef(dD(function(e,t){let{__scopeMenu:n}=e,r=G(e,iD),i=SD(n);return(0,X.jsx)(Ow,A(A(A({},i),r),{},{ref:t}))},`MenuAnchor`)),AD=`MenuPortal`,[jD,MD]=bD(AD,{forceMount:void 0}),ND=dD(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=TD(AD,t);return(0,X.jsx)(jD,{scope:t,forceMount:n,children:(0,X.jsx)(Hw,{present:n||a.open,children:(0,X.jsx)(Rw,{asChild:!0,container:i,children:r})})})},`MenuPortal`),PD=`MenuContent`,[FD,ID]=bD(PD),LD=h.forwardRef(dD(function(e,t){let n=MD(PD,e.__scopeMenu),{forceMount:r=n.forceMount}=e,i=G(e,aD),a=TD(PD,e.__scopeMenu),o=DD(PD,e.__scopeMenu);return(0,X.jsx)(_D.Provider,{scope:e.__scopeMenu,children:(0,X.jsx)(Hw,{present:r||a.open,children:(0,X.jsx)(_D.Slot,{scope:e.__scopeMenu,children:o.modal?(0,X.jsx)(RD,A(A({},i),{},{ref:t})):(0,X.jsx)(zD,A(A({},i),{},{ref:t}))})})})},`MenuContent`)),RD=h.forwardRef(dD(function(e,t){let n=TD(PD,e.__scopeMenu),r=h.useRef(null),i=Ry(t,r);return h.useEffect(()=>{let e=r.current;if(e)return JT(e)},[]),(0,X.jsx)(VD,A(A({},e),{},{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Bb(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))},`MenuRootContentModal`)),zD=h.forwardRef(dD(function(e,t){let n=TD(PD,e.__scopeMenu);return(0,X.jsx)(VD,A(A({},e),{},{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))},`MenuRootContentNonModal`)),BD=Hy(`MenuContent.ScrollLock`),VD=h.forwardRef(dD(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m}=e,g=G(e,oD),_=TD(PD,n),v=DD(PD,n),y=SD(n),b=CD(n),x=vD(n),[S,C]=h.useState(null),w=h.useRef(null),[T,E]=h.useState(null);Dx(T);let{nodes:D,registry:O}=Ex(),k=!!(i||m),j=Ry(t,w,_.onContentChange,E),M=h.useRef(0),N=h.useRef(``),P=h.useRef(0),F=h.useRef(null),I=h.useRef(`right`),L=h.useRef(0),R=h.useMemo(()=>m?[w,...D.map(e=>({current:e}))]:[],[w,D,m]),z=m?rD:h.Fragment,B=m?{as:BD,allowPinchZoom:!0,shards:R}:void 0,ee=dD(e=>{var t,n;let r=N.current+e,i=x().filter(e=>!e.disabled),a=document.activeElement,o=(t=i.find(e=>e.ref.current===a))==null?void 0:t.textValue,s=iO(i.map(e=>e.textValue),r,o),c=(n=i.find(e=>e.textValue===s))==null?void 0:n.ref.current;function l(e){N.current=e,window.clearTimeout(M.current),e!==``&&(M.current=window.setTimeout(()=>l(``),1e3))}dD(l,`updateSearch`),l(r),c&&setTimeout(()=>c.focus())},`handleTypeaheadSearch`);h.useEffect(()=>()=>window.clearTimeout(M.current),[]),hx();let V=h.useCallback(e=>{var t,n;return I.current===((t=F.current)==null?void 0:t.side)&&oO(e,(n=F.current)==null?void 0:n.area)},[]);return(0,X.jsx)(FD,{scope:n,searchRef:N,onItemEnter:h.useCallback(e=>{V(e)&&e.preventDefault()},[V]),onItemLeave:h.useCallback(e=>{var t;V(e)||((t=w.current)==null||t.focus(),C(null))},[V]),onTriggerLeave:h.useCallback(e=>{V(e)&&e.preventDefault()},[V]),pointerGraceTimerRef:P,onPointerGraceIntentChange:h.useCallback(e=>{F.current=e},[]),children:(0,X.jsx)(Tx,{registry:k?O:null,children:(0,X.jsx)(z,A(A({},B),{},{children:(0,X.jsx)(Cx,{asChild:!0,trapped:i,branches:D,onMountAutoFocus:Bb(a,e=>{var t;e.preventDefault(),(t=w.current)==null||t.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,X.jsx)(rx,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,X.jsx)(jT,A(A({asChild:!0},b),{},{dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Bb(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,X.jsx)(Mw,A(A(A({role:`menu`,"aria-orientation":`vertical`,"data-state":$D(_.open),"data-radix-menu-content":``,dir:v.dir},y),g),{},{ref:j,style:A({outline:`none`},g.style),onKeyDown:Bb(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=w.current;if(e.target!==i||!hD.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);mD.includes(e.key)&&a.reverse(),nO(a)}),onBlur:Bb(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),N.current=``)}),onPointerMove:Bb(e.onPointerMove,sO(e=>{let t=e.target,n=L.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>L.current?`right`:`left`;I.current=t,L.current=e.clientX}}))}))}))})})}))})})},`MenuContentImpl`)),HD=`MenuItem`,UD=`menu.itemSelect`,WD=h.forwardRef(dD(function(e,t){let{disabled:n=!1,onSelect:r}=e,i=G(e,sD),a=h.useRef(null),o=DD(HD,e.__scopeMenu),s=ID(HD,e.__scopeMenu),c=Ry(t,a),l=h.useRef(!1),u=dD(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(UD,{bubbles:!0,cancelable:!0});e.addEventListener(UD,e=>r==null?void 0:r(e),{once:!0}),cb(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,X.jsx)(GD,A(A({},i),{},{ref:c,disabled:n,onClick:Bb(e.onClick,u),onPointerDown:t=>{var n;(n=e.onPointerDown)==null||n.call(e,t),l.current=!0},onPointerUp:Bb(e.onPointerUp,e=>{var t;l.current||(t=e.currentTarget)==null||t.click()}),onKeyDown:Bb(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&fD.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})}))},`MenuItem`)),GD=h.forwardRef(dD(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i}=e,a=G(e,cD),o=ID(HD,n),s=CD(n),c=h.useRef(null),l=Ry(t,c),[u,d]=h.useState(!1),[f,p]=h.useState(``);return h.useEffect(()=>{let e=c.current;if(e){var t;p(((t=e.textContent)==null?``:t).trim())}},[a.children]),(0,X.jsx)(_D.ItemSlot,{scope:n,disabled:r,textValue:i==null?f:i,children:(0,X.jsx)(PT,A(A({asChild:!0},s),{},{focusable:!r,children:(0,X.jsx)(sb.div,A(A({role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0},a),{},{ref:l,onPointerMove:Bb(e.onPointerMove,sO(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Bb(e.onPointerLeave,sO(e=>o.onItemLeave(e))),onFocus:Bb(e.onFocus,()=>d(!0)),onBlur:Bb(e.onBlur,()=>d(!1))}))}))})},`MenuItemImpl`)),[KD,qD]=bD(`MenuRadioGroup`,{value:void 0,onValueChange:dD(()=>{},`onValueChange`)}),[JD,YD]=bD(`MenuItemIndicator`,{checked:!1}),XD=h.forwardRef(dD(function(e,t){let{__scopeMenu:n}=e,r=G(e,lD);return(0,X.jsx)(sb.div,A(A({role:`separator`,"aria-orientation":`horizontal`},r),{},{ref:t}))},`MenuSeparator`)),[ZD,QD]=bD(`MenuSub`);function $D(e){return e?`open`:`closed`}dD($D,`getOpenState`);function eO(e){return e===`indeterminate`}dD(eO,`isIndeterminate`);function tO(e){return eO(e)?`indeterminate`:e?`checked`:`unchecked`}dD(tO,`getCheckedState`);function nO(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}dD(nO,`focusFirst`);function rO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}dD(rO,`wrapArray`);function iO(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=rO(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}dD(iO,`getNextMatch`);function aO(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}dD(aO,`isPointInPolygon`);function oO(e,t){return t?aO({x:e.clientX,y:e.clientY},t):!1}dD(oO,`isPointerInGraceArea`);function sO(e){return t=>t.pointerType===`mouse`?e(t):void 0}dD(sO,`whenMouse`);var cO=Object.defineProperty,lO=(e,t)=>cO(e,`name`,{value:t,configurable:!0});function uO(e,t=(()=>{var e;return(e=globalThis)==null?void 0:e.document})()){let n=Jb(e);h.useEffect(()=>{let e=lO(e=>{e.key===`Escape`&&n(e)},`handleKeyDown`);return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}lO(uO,`useEscapeKeydown`);var dO=sb;dO.dispatchDiscreteCustomEvent=cb,dO.Root=sb;var fO=Object.defineProperty,pO=(e,t)=>{let n={};for(var r in e)fO(n,r,{get:e[r],enumerable:!0});return t||fO(n,Symbol.toStringTag,{value:`Module`}),n};j();var mO=[`__scopeDropdownMenu`,`disabled`],hO=[`__scopeDropdownMenu`],gO=[`__scopeDropdownMenu`],_O=[`__scopeDropdownMenu`],vO=[`__scopeDropdownMenu`],yO=Object.defineProperty,bO=(e,t)=>yO(e,`name`,{value:t,configurable:!0}),xO=`DropdownMenu`,[SO,CO]=mb(xO,[xD]),wO=xD(),[TO,EO]=SO(xO),DO=bO(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=wO(t),l=h.useRef(null),[u,d]=nT({prop:i,defaultProp:a!=null&&a,onChange:o,caller:xO});return(0,X.jsx)(TO,{scope:t,triggerId:Jx(),triggerRef:l,contentId:Jx(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,X.jsx)(OD,A(A({},c),{},{open:u,onOpenChange:d,dir:r,modal:s,children:n}))})},`DropdownMenu`),OO=`DropdownMenuTrigger`,kO=h.forwardRef(bO(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1}=e,i=G(e,mO),a=EO(OO,n),o=wO(n),s=Ry(t,a.triggerRef);return(0,X.jsx)(kD,A(A({asChild:!0},o),{},{children:(0,X.jsx)(sb.button,A(A({type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r},i),{},{ref:s,onPointerDown:Bb(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Bb(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})}))}))},`DropdownMenuTrigger`)),AO=bO(e=>{let{__scopeDropdownMenu:t}=e,n=G(e,hO),r=wO(t);return(0,X.jsx)(ND,A(A({},r),n))},`DropdownMenuPortal`),jO=`DropdownMenuContent`,MO=h.forwardRef(bO(function(e,t){let{__scopeDropdownMenu:n}=e,r=G(e,gO),i=EO(jO,n),a=wO(n),o=h.useRef(!1);return(0,X.jsx)(LD,A(A(A({id:i.contentId,"aria-labelledby":i.triggerId},a),r),{},{ref:t,onCloseAutoFocus:Bb(e.onCloseAutoFocus,e=>{var t;o.current||(t=i.triggerRef.current)==null||t.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Bb(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:A(A({},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`)),NO=h.forwardRef(bO(function(e,t){let{__scopeDropdownMenu:n}=e,r=G(e,_O),i=wO(n);return(0,X.jsx)(WD,A(A(A({},i),r),{},{ref:t}))},`DropdownMenuItem`)),PO=h.forwardRef(bO(function(e,t){let{__scopeDropdownMenu:n}=e,r=G(e,vO),i=wO(n);return(0,X.jsx)(XD,A(A(A({},i),r),{},{ref:t}))},`DropdownMenuSeparator`));j();var FO=[`render`,`asChild`,`children`],IO=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`];function LO(e,t){return In(e,void 0,t===void 0?e.props.children:t)}function RO(e,t,n){return(0,X.jsx)(Uy,A(A({},n),{},{children:LO(e,t)}))}function zO(e){var t,n;let r=Mn((t,n)=>{let r=J(17),i,a,o,s;if(r[0]!==t){var c=t;({render:o,asChild:i,children:a}=c),s=G(c,FO),r[0]=t,r[1]=i,r[2]=a,r[3]=o,r[4]=s}else i=r[1],a=r[2],o=r[3],s=r[4];let l=e;if(o&&Ln(o)){let e=s,t;r[5]!==a||r[6]!==o?(t=LO(o,a),r[5]=a,r[6]=o,r[7]=t):t=r[7];let i;return r[8]!==n||r[9]!==e||r[10]!==t?(i=(0,X.jsx)(l,A(A({},e),{},{asChild:!0,ref:n,children:t})),r[8]=n,r[9]=e,r[10]=t,r[11]=i):i=r[11],i}let u=s,d;return r[12]!==i||r[13]!==a||r[14]!==n||r[15]!==u?(d=(0,X.jsx)(l,A(A({},u),{},{asChild:i,ref:n,children:a})),r[12]=i,r[13]=a,r[14]=n,r[15]=u,r[16]=d):d=r[16],d});return r.displayName=typeof e==`string`?e:(t=(n=e.displayName)==null?e.name:n)==null?`Component`:t,r}function BO(e){let t=dO[e],n=zO(t);return n.displayName=`Primitive.${e}`,n}var VO=IO.reduce((e,t)=>(e[t]=BO(t),e),{}),HO={Hidden:`hidden`,Floating:`floating`,Normal:`normal`},UO=e=>{let t=J(5),{hideWhenRunning:n,autohide:r,autohideFloat:i,forceVisible:a}=e,o;return t[0]!==r||t[1]!==i||t[2]!==a||t[3]!==n?(o=e=>{if(n&&e.thread.isRunning)return HO.Hidden;let t=r===`always`||r===`not-last`&&!e.message.isLast,o=a||e.message.isHovering;return t?o?i===`always`||i===`single-branch`&&e.message.branchCount<=1?HO.Floating:HO.Normal:HO.Hidden:HO.Normal},t[0]=r,t[1]=i,t[2]=a,t[3]=n,t[4]=o):o=t[4],Y(o)},WO=Hn(null),GO=()=>Wn(WO);j();var KO=[`hideWhenRunning`,`autohide`,`autohideFloat`],qO=Mn((e,t)=>{let n=J(18),r,i,a,o;if(n[0]!==e){var s=e;({hideWhenRunning:a,autohide:r,autohideFloat:i}=s),o=G(s,KO),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o}else r=n[1],i=n[2],a=n[3],o=n[4];let[c,l]=xn(0),u;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{let e=!1;return l(JO),()=>{e||(e=!0,l(YO))}},n[5]=u):u=n[5];let d=u,f;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(f={acquireInteractionLock:d},n[6]=f):f=n[6];let p=f,m=c>0,h;n[7]!==r||n[8]!==i||n[9]!==a||n[10]!==m?(h={hideWhenRunning:a,autohide:r,autohideFloat:i,forceVisible:m},n[7]=r,n[8]=i,n[9]=a,n[10]=m,n[11]=h):h=n[11];let g=UO(h);if(g===HO.Hidden)return null;let _;n[12]===g?_=n[13]:(_=g===HO.Floating?{"data-floating":`true`}:null,n[12]=g,n[13]=_);let v;return n[14]!==t||n[15]!==o||n[16]!==_?(v=(0,X.jsx)(WO.Provider,{value:p,children:(0,X.jsx)(VO.div,A(A(A({},_),o),{},{ref:t}))}),n[14]=t,n[15]=o,n[16]=_,n[17]=v):v=n[17],v});qO.displayName=`ActionBarPrimitive.Root`;function JO(e){return e+1}function YO(e){return Math.max(0,e-1)}j();var XO=[`copiedDuration`,`onClick`,`disabled`],ZO=e=>{let t=J(4),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{copiedDuration:r}=n,i=r===void 0?3e3:r,a;t[2]===i?a=t[3]:(a={copiedDuration:i,copyToClipboard:$O},t[2]=i,t[3]=a);let{copy:o,disabled:s}=jv(a);return s?null:o},QO=Mn((e,t)=>{let n=J(20),r,i,a,o;if(n[0]!==e){var s=e;({copiedDuration:r,onClick:a,disabled:i}=s),o=G(s,XO),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o}else r=n[1],i=n[2],a=n[3],o=n[4];let c=Y(ek),l;n[5]===r?l=n[6]:(l={copiedDuration:r},n[5]=r,n[6]=l);let u=ZO(l),d;n[7]===c?d=n[8]:(d=c?{"data-copied":`true`}:{},n[7]=c,n[8]=d);let f=i||!u,p;n[9]===u?p=n[10]:(p=()=>{u==null||u()},n[9]=u,n[10]=p);let m;n[11]!==a||n[12]!==p?(m=Bb(a,p),n[11]=a,n[12]=p,n[13]=m):m=n[13];let h;return n[14]!==t||n[15]!==o||n[16]!==d||n[17]!==f||n[18]!==m?(h=(0,X.jsx)(VO.button,A(A(A({type:`button`},d),o),{},{ref:t,disabled:f,onClick:m})),n[14]=t,n[15]=o,n[16]=d,n[17]=f,n[18]=m,n[19]=h):h=n[19],h});QO.displayName=`ActionBarPrimitive.Copy`;function $O(e){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API is unavailable`)):navigator.clipboard.writeText(e)}function ek(e){return e.message.isCopied}j();var tk=(e,t,n=[])=>{let r=Mn((e,r)=>{var i;let a=J(6),o={},s={};Object.keys(e).forEach(t=>{n.includes(t)?o[t]=e[t]:s[t]=e[t]});let c=(i=t(o))==null?void 0:i,l=VO,u=s.disabled||!c,d=Bb(s.onClick,c),f;return a[0]!==r||a[1]!==s||a[2]!==l.button||a[3]!==u||a[4]!==d?(f=(0,X.jsx)(l.button,A(A({type:`button`},s),{},{ref:r,disabled:u,onClick:d})),a[0]=r,a[1]=s,a[2]=l.button,a[3]=u,a[4]=d,a[5]=f):f=a[5],f});return r.displayName=e,r},nk=tk(`ActionBarPrimitive.Reload`,()=>{let{disabled:e,reload:t}=Rv();return e?null:t}),rk=tk(`ActionBarPrimitive.Edit`,()=>{let{disabled:e,edit:t}=Lv();return e?null:t}),ik=tk(`ActionBarPrimitive.Speak`,()=>{let{disabled:e,speak:t}=Uv();return e?null:t});j();var ak=()=>{let{disabled:e,stopSpeaking:t}=Wv();return e?null:t},ok=Mn((e,t)=>{let n=J(10),r=ak(),i=!r,a;n[0]===r?a=n[1]:(a=()=>{r==null||r()},n[0]=r,n[1]=a);let o;n[2]!==e.onClick||n[3]!==a?(o=Bb(e.onClick,a),n[2]=e.onClick,n[3]=a,n[4]=o):o=n[4];let s;return n[5]!==e||n[6]!==t||n[7]!==i||n[8]!==o?(s=(0,X.jsx)(VO.button,A(A({type:`button`,disabled:i},e),{},{ref:t,onClick:o})),n[5]=e,n[6]=t,n[7]=i,n[8]=o,n[9]=s):s=n[9],s});ok.displayName=`ActionBarPrimitive.StopSpeaking`,j();var sk=[`onClick`,`disabled`],ck=()=>{let{submit:e}=zv();return e},lk=Mn((e,t)=>{let n=J(18),r,i,a;if(n[0]!==e){var o=e;({onClick:i,disabled:r}=o),a=G(o,sk),n[0]=e,n[1]=r,n[2]=i,n[3]=a}else r=n[1],i=n[2],a=n[3];let s=Y(uk),c=ck(),l;n[4]===s?l=n[5]:(l=s?{"data-submitted":`true`}:{},n[4]=s,n[5]=l);let u=r||!c,d;n[6]===c?d=n[7]:(d=()=>{c==null||c()},n[6]=c,n[7]=d);let f;n[8]!==i||n[9]!==d?(f=Bb(i,d),n[8]=i,n[9]=d,n[10]=f):f=n[10];let p;return n[11]!==t||n[12]!==s||n[13]!==a||n[14]!==l||n[15]!==u||n[16]!==f?(p=(0,X.jsx)(VO.button,A(A(A({type:`button`,"aria-pressed":s},l),a),{},{ref:t,disabled:u,onClick:f})),n[11]=t,n[12]=s,n[13]=a,n[14]=l,n[15]=u,n[16]=f,n[17]=p):p=n[17],p});lk.displayName=`ActionBarPrimitive.FeedbackPositive`;function uk(e){var t;return((t=e.message.metadata.submittedFeedback)==null?void 0:t.type)===`positive`}j();var dk=[`onClick`,`disabled`],fk=()=>{let{submit:e}=Bv();return e},pk=Mn((e,t)=>{let n=J(18),r,i,a;if(n[0]!==e){var o=e;({onClick:i,disabled:r}=o),a=G(o,dk),n[0]=e,n[1]=r,n[2]=i,n[3]=a}else r=n[1],i=n[2],a=n[3];let s=Y(mk),c=fk(),l;n[4]===s?l=n[5]:(l=s?{"data-submitted":`true`}:{},n[4]=s,n[5]=l);let u=r||!c,d;n[6]===c?d=n[7]:(d=()=>{c==null||c()},n[6]=c,n[7]=d);let f;n[8]!==i||n[9]!==d?(f=Bb(i,d),n[8]=i,n[9]=d,n[10]=f):f=n[10];let p;return n[11]!==t||n[12]!==s||n[13]!==a||n[14]!==l||n[15]!==u||n[16]!==f?(p=(0,X.jsx)(VO.button,A(A(A({type:`button`,"aria-pressed":s},l),a),{},{ref:t,disabled:u,onClick:f})),n[11]=t,n[12]=s,n[13]=a,n[14]=l,n[15]=u,n[16]=f,n[17]=p):p=n[17],p});pk.displayName=`ActionBarPrimitive.FeedbackNegative`;function mk(e){var t;return((t=e.message.metadata.submittedFeedback)==null?void 0:t.type)===`negative`}j();var hk=[`filename`,`onExport`,`onClick`,`disabled`],gk=e=>{let t=J(6),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{filename:r,onExport:i}=n,a=Xa(),o=Y(yk),s;return t[2]!==a.message||t[3]!==r||t[4]!==i?(s=O(function*(){let e=a.message.getCopyText();if(!e)return;if(i){yield i(e);return}let t=new Blob([e],{type:`text/markdown`}),n=URL.createObjectURL(t),o=document.createElement(`a`);o.href=n,o.download=r==null?`message-${Date.now()}.md`:r,o.rel=`noopener`,document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>URL.revokeObjectURL(n),4e4)}),t[2]=a.message,t[3]=r,t[4]=i,t[5]=s):s=t[5],o?s:null},_k=Mn((e,t)=>{let n=J(19),r,i,a,o,s;if(n[0]!==e){var c=e;({filename:i,onExport:o,onClick:a,disabled:r}=c),s=G(c,hk),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s}else r=n[1],i=n[2],a=n[3],o=n[4],s=n[5];let l;n[6]!==i||n[7]!==o?(l={filename:i,onExport:o},n[6]=i,n[7]=o,n[8]=l):l=n[8];let u=gk(l),d=r||!u,f;n[9]===u?f=n[10]:(f=()=>{u==null||u().catch(bk)},n[9]=u,n[10]=f);let p;n[11]!==a||n[12]!==f?(p=Bb(a,f),n[11]=a,n[12]=f,n[13]=p):p=n[13];let m;return n[14]!==t||n[15]!==s||n[16]!==d||n[17]!==p?(m=(0,X.jsx)(VO.button,A(A({type:`button`},s),{},{ref:t,disabled:d,onClick:p})),n[14]=t,n[15]=s,n[16]=d,n[17]=p,n[18]=m):m=n[18],m});_k.displayName=`ActionBarPrimitive.ExportMarkdown`;function vk(e){return e.type===`text`&&e.text.length>0}function yk(e){var t;return(e.message.role!==`assistant`||((t=e.message.status)==null?void 0:t.type)!==`running`)&&e.message.parts.some(vk)}function bk(e){console.error(`[assistant-ui] markdown export failed:`,e)}var xk=pO({Copy:()=>QO,Edit:()=>rk,ExportMarkdown:()=>_k,FeedbackNegative:()=>pk,FeedbackPositive:()=>lk,Reload:()=>nk,Root:()=>qO,Speak:()=>ik,StopSpeaking:()=>ok}),Sk=CO();j();var Ck=[`__scopeActionBarMore`,`open`,`onOpenChange`],wk=e=>{let t=J(25),n,r,i,a;if(t[0]!==e){var o=e;({__scopeActionBarMore:n,open:i,onOpenChange:r}=o),a=G(o,Ck),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];let s=Sk(n),c=GO(),l=K(null),u=i!==void 0,d;t[5]===c?d=t[6]:(d=e=>{var t;if(e){var n;if(l.current)return;l.current=(n=c==null?void 0:c.acquireInteractionLock())==null?null:n}else(t=l.current)==null||t.call(l),l.current=null},t[5]=c,t[6]=d);let f=d,p;t[7]!==u||t[8]!==r||t[9]!==f?(p=e=>{u||f(e),r==null||r(e)},t[7]=u,t[8]=r,t[9]=f,t[10]=p):p=t[10];let m=p,h,g;t[11]!==u||t[12]!==i||t[13]!==f?(h=()=>{u&&f(!!i)},g=[u,i,f],t[11]=u,t[12]=i,t[13]=f,t[14]=h,t[15]=g):(h=t[14],g=t[15]),q(h,g);let _,v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>()=>{var e;(e=l.current)==null||e.call(l),l.current=null},v=[],t[16]=_,t[17]=v):(_=t[16],v=t[17]),q(_,v);let y;t[18]===i?y=t[19]:(y=i===void 0?null:{open:i},t[18]=i,t[19]=y);let b;return t[20]!==m||t[21]!==a||t[22]!==s||t[23]!==y?(b=(0,X.jsx)(DO,A(A(A(A({},s),a),y),{},{onOpenChange:m})),t[20]=m,t[21]=a,t[22]=s,t[23]=y,t[24]=b):b=t[24],b};wk.displayName=`ActionBarMorePrimitive.Root`;var Tk=zO(kO),Ek=zO(MO),Dk=zO(NO),Ok=zO(PO);j();var kk=[`__scopeActionBarMore`],Ak=Mn((e,t)=>{let n=J(7),r,i;if(n[0]!==e){var a=e;({__scopeActionBarMore:r}=a),i=G(a,kk),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let o=Sk(r),s;return n[3]!==t||n[4]!==i||n[5]!==o?(s=(0,X.jsx)(Tk,A(A(A({},o),i),{},{ref:t})),n[3]=t,n[4]=i,n[5]=o,n[6]=s):s=n[6],s});Ak.displayName=`ActionBarMorePrimitive.Trigger`,j();var jk=[`__scopeActionBarMore`,`portalProps`,`sideOffset`],Mk=Mn((e,t)=>{let n=J(14),r,i,a,o;if(n[0]!==e){var s=e;({__scopeActionBarMore:r,portalProps:i,sideOffset:o}=s),a=G(s,jk),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o}else r=n[1],i=n[2],a=n[3],o=n[4];let c=o===void 0?4:o,l=Sk(r),u;n[5]!==t||n[6]!==a||n[7]!==l||n[8]!==c?(u=(0,X.jsx)(Ek,A(A(A({},l),a),{},{ref:t,sideOffset:c})),n[5]=t,n[6]=a,n[7]=l,n[8]=c,n[9]=u):u=n[9];let d;return n[10]!==i||n[11]!==l||n[12]!==u?(d=(0,X.jsx)(AO,A(A(A({},l),i),{},{children:u})),n[10]=i,n[11]=l,n[12]=u,n[13]=d):d=n[13],d});Mk.displayName=`ActionBarMorePrimitive.Content`,j();var Nk=[`__scopeActionBarMore`],Pk=Mn((e,t)=>{let n=J(7),r,i;if(n[0]!==e){var a=e;({__scopeActionBarMore:r}=a),i=G(a,Nk),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let o=Sk(r),s;return n[3]!==t||n[4]!==i||n[5]!==o?(s=(0,X.jsx)(Dk,A(A(A({},o),i),{},{ref:t})),n[3]=t,n[4]=i,n[5]=o,n[6]=s):s=n[6],s});Pk.displayName=`ActionBarMorePrimitive.Item`,j();var Fk=[`__scopeActionBarMore`],Ik=Mn((e,t)=>{let n=J(7),r,i;if(n[0]!==e){var a=e;({__scopeActionBarMore:r}=a),i=G(a,Fk),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let o=Sk(r),s;return n[3]!==t||n[4]!==i||n[5]!==o?(s=(0,X.jsx)(Ok,A(A(A({},o),i),{},{ref:t})),n[3]=t,n[4]=i,n[5]=o,n[6]=s):s=n[6],s});Ik.displayName=`ActionBarMorePrimitive.Separator`;var Lk=pO({Content:()=>Mk,Item:()=>Pk,Root:()=>wk,Separator:()=>Ik,Trigger:()=>Ak});j();var Rk=Mn((e,t)=>{let n=J(3),r;return n[0]!==e||n[1]!==t?(r=(0,X.jsx)(VO.div,A(A({},e),{},{ref:t})),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});Rk.displayName=`AttachmentPrimitive.Root`,j();var zk=Mn((e,t)=>{var n;let r=J(4),i=Y(Bk),a=(n=e.children)==null?i:n,o;return r[0]!==e||r[1]!==t||r[2]!==a?(o=(0,X.jsx)(VO.div,A(A({},e),{},{ref:t,children:a})),r[0]=e,r[1]=t,r[2]=a,r[3]=o):o=r[3],o});zk.displayName=`AttachmentPrimitive.unstable_Thumb`;function Bk(e){let t=e.attachment.name,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?`.${t.slice(n+1)}`:e.attachment.type}var Vk=()=>{let e=J(2),t=Y(Hk),n;return e[0]===t?n=e[1]:(n=(0,X.jsx)(X.Fragment,{children:t}),e[0]=t,e[1]=n),n};Vk.displayName=`AttachmentPrimitive.Name`;function Hk(e){return e.attachment.name}var Uk=tk(`AttachmentPrimitive.Remove`,()=>{let e=J(2),t=Xa(),n;return e[0]===t.attachment?n=e[1]:(n=()=>{t.attachment.remove()},e[0]=t.attachment,e[1]=n),n}),Wk=pO({Name:()=>Vk,Remove:()=>Uk,Root:()=>Rk,unstable_Thumb:()=>zk}),Gk=tk(`BranchPickerPrimitive.Next`,()=>{let{disabled:e,next:t}=Kv();return e?null:t}),Kk=tk(`BranchPickerPrimitive.Previous`,()=>{let{disabled:e,previous:t}=qv();return e?null:t}),qk=()=>Y(Yk),Jk=()=>{let e=J(2),t=qk(),n;return e[0]===t?n=e[1]:(n=(0,X.jsx)(X.Fragment,{children:t}),e[0]=t,e[1]=n),n};Jk.displayName=`BranchPickerPrimitive.Count`;function Yk(e){return e.message.branchCount}var Xk=()=>Y(Qk),Zk=()=>{let e=J(2),t=Xk(),n;return e[0]===t?n=e[1]:(n=(0,X.jsx)(X.Fragment,{children:t}),e[0]=t,e[1]=n),n};Zk.displayName=`BranchPickerPrimitive.Number`;function Qk(e){return e.message.branchNumber}j();var $k=[`hideWhenSingleBranch`],eA=Mn((e,t)=>{let n=J(11),r,i;if(n[0]!==e){var a=e;({hideWhenSingleBranch:r}=a),i=G(a,$k),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let o;n[3]===r?o=n[4]:(o=e=>!r||e.message.branchCount>=2,n[3]=r,n[4]=o);let s;n[5]!==t||n[6]!==i?(s=(0,X.jsx)(VO.div,A(A({},i),{},{ref:t})),n[5]=t,n[6]=i,n[7]=s):s=n[7];let c;return n[8]!==o||n[9]!==s?(c=(0,X.jsx)(Td,{condition:o,children:s}),n[8]=o,n[9]=s,n[10]=c):c=n[10],c});eA.displayName=`BranchPickerPrimitive.Root`;var tA=pO({Count:()=>Jk,Next:()=>Gk,Number:()=>Zk,Previous:()=>Kk,Root:()=>eA}),nA=Hn(null),rA=()=>Wn(nA),iA=e=>{let t=J(8),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Map,t[0]=r):r=t[0];let i=K(r),a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[1]=a):a=t[1];let o=K(a),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=Array.from(i.current.entries());e.sort(aA),o.current=e.map(oA)},t[2]=s):s=t[2];let c=s,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(e,t)=>{var n;let r=(n=t==null?void 0:t.priority)==null?0:n;return i.current.set(e,r),c(),()=>{i.current.delete(e),c()}},t[3]=l):l=t[3];let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o.current,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p={register:u,getPlugins:f},t[5]=p):p=t[5];let m=p,h;return t[6]===n?h=t[7]:(h=(0,X.jsx)(nA.Provider,{value:m,children:n}),t[6]=n,t[7]=h),h};function aA(e,t){return t[1]-e[1]}function oA(e){let[t]=e;return t}var sA=Hn(null),cA=Hn(null),lA=()=>{let e=Wn(sA);if(!e)throw Error(`useTriggerPopoverRootContext must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},uA=()=>Wn(sA),dA=()=>{let e=Wn(cA);if(!e)throw Error(`useTriggerPopoverAriaPublish must be used within ComposerPrimitive.TriggerPopoverRoot`);return e},fA=()=>{let e=lA();return Dn(e.subscribe,e.getTriggers,e.getTriggers)},pA=new Map,mA=()=>()=>{},hA=()=>pA,gA=()=>{let e=uA();return Dn(e?e.subscribe:mA,e?e.getTriggers:hA,e?e.getTriggers:hA)},_A=()=>null,vA=()=>{let e=uA();return Dn(e?e.subscribeAria:mA,e?e.getActiveAria:_A,e?e.getActiveAria:_A)};function yA(){let e=J(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=new Set,e[0]=t):t=e[0];let n=K(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{for(let e of n.current)e()},e[1]=r):r=e[1];let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>(n.current.add(e),()=>{n.current.delete(e)}),e[2]=a):a=e[2];let o=a,s;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={notify:i,subscribe:o},e[3]=s):s=e[3],s}var bA=e=>{let t=J(21),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Map,t[0]=r):r=t[0];let i=K(r),a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=new Set,t[1]=a):a=t[1];let o=K(a),{notify:s,subscribe:c}=yA(),l;t[2]===s?l=t[3]:(l=e=>{let{char:t}=e;if(i.current.has(t))return process.env.NODE_ENV!==`production`&&console.warn(`[assistant-ui] Duplicate TriggerPopover for char "${t}". Ignoring the second registration.`),SA;if(process.env.NODE_ENV!==`production`)for(let e of i.current.values())(t.startsWith(e.char)||e.char.startsWith(t))&&console.warn(`[assistant-ui] Trigger prefix collision between "${e.char}" and "${t}". One char is a prefix of the other; only one will match reliably.`);let n=new Map(i.current);n.set(t,e),i.current=n,s();for(let t of o.current)t.added(e);return()=>{let e=new Map(i.current);e.delete(t),i.current=e,s();for(let e of o.current)e.removed(t)}},t[2]=s,t[3]=l);let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>i.current,t[4]=d):d=t[4];let f=d,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>(o.current.add(e),()=>{o.current.delete(e)}),t[5]=p):p=t[5];let m=p,h=K(null),g=K(null),{notify:_,subscribe:v}=yA(),y;t[6]===_?y=t[7]:(y=(e,t)=>{if(t===null){if(g.current!==e)return;h.current=null,g.current=null,_();return}let n=h.current;(g.current!==e||n===null||n.popoverId!==t.popoverId||n.highlightedItemId!==t.highlightedItemId)&&(h.current=t,g.current=e,_())},t[6]=_,t[7]=y);let b=y,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>h.current,t[8]=x):x=t[8];let S=x,C;t[9]!==u||t[10]!==c||t[11]!==v?(C={register:u,getTriggers:f,subscribe:c,subscribeLifecycle:m,getActiveAria:S,subscribeAria:v},t[9]=u,t[10]=c,t[11]=v,t[12]=C):C=t[12];let w=C,T;t[13]===b?T=t[14]:(T={setActiveAria:b},t[13]=b,t[14]=T);let E=T,D;t[15]!==E||t[16]!==n?(D=(0,X.jsx)(cA.Provider,{value:E,children:n}),t[15]=E,t[16]=n,t[17]=D):D=t[17];let O;return t[18]!==D||t[19]!==w?(O=(0,X.jsx)(sA.Provider,{value:w,children:D}),t[18]=D,t[19]=w,t[20]=O):O=t[20],O},xA=e=>{let t=J(4),{children:n}=e;if(rA()){let e;return t[0]===n?e=t[1]:(e=(0,X.jsx)(bA,{children:n}),t[0]=n,t[1]=e),e}let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(iA,{children:(0,X.jsx)(bA,{children:n})}),t[2]=n,t[3]=r),r};xA.displayName=`ComposerPrimitive.TriggerPopoverRoot`;function SA(){}var CA=/\s/u;function wA(e,t,n,r){if(r===null)return null;let{query:i,offset:a,endOffset:o}=r;return a<0||a+t.length>n||!e.startsWith(t,a)||o<a+t.length||o>e.length?null:{query:i,offset:a,endOffset:o}}function TA(e,t,n,r){if(r)return wA(e,t,n,r(e,t,n));let i=e.slice(0,n);for(let e=i.length-1;e>=0;e--){let r=i[e];if(CA.test(r))return null;if(i.startsWith(t,e)){if(e>0&&!CA.test(i[e-1]))continue;return{query:i.slice(e+t.length),offset:e,endOffset:n}}}return null}var EA=Gr(e=>{var t;let n=J(8),{text:r,triggerChar:i,matcher:a}=e,[o,s]=xn(r.length),c=Math.min(o,r.length),l;n[0]!==a||n[1]!==c||n[2]!==r||n[3]!==i?(l=TA(r,i,c,a),n[0]=a,n[1]=c,n[2]=r,n[3]=i,n[4]=l):l=n[4];let u=l,d=(t=u==null?void 0:u.query)==null?``:t,f;return n[5]!==d||n[6]!==u?(f={trigger:u,query:d,setCursorPosition:s},n[5]=d,n[6]=u,n[7]=f):f=n[7],f});function DA(e){return`type`in e}var OA=Gr(e=>{let t=J(22),{navigableList:n,isSearchMode:r,activeCategoryId:i,query:a,popoverId:o,open:s,selectItem:c,selectCategory:l,goBack:u,close:d}=e,[f,p]=xn(0),m;t[0]!==i||t[1]!==r||t[2]!==n?(m={navigableList:n,isSearchMode:r,activeCategoryId:i},t[0]=i,t[1]=r,t[2]=n,t[3]=m):m=t[3];let[h,g]=xn(m);(h.navigableList!==n||h.isSearchMode!==r||h.activeCategoryId!==i)&&(g({navigableList:n,isSearchMode:r,activeCategoryId:i}),p(0));let _;t[4]!==f||t[5]!==n.length?(_=e=>{e<0||e>=n.length||e!==f&&p(e)},t[4]=f,t[5]=n.length,t[6]=_):_=t[6];let v=En(_),y;t[7]!==i||t[8]!==d||t[9]!==u||t[10]!==f||t[11]!==n||t[12]!==s||t[13]!==a||t[14]!==l||t[15]!==c?(y=e=>{if(!s)return!1;switch(e.key){case`ArrowDown`:return e.preventDefault(),p(e=>{let t=n.length;return t===0?0:e<t-1?e+1:0}),!0;case`ArrowUp`:return e.preventDefault(),p(e=>{let t=n.length;return t===0?0:e>0?e-1:t-1}),!0;case`Enter`:case`Tab`:{if(e.shiftKey)return!1;e.preventDefault();let t=n[f];return t&&(DA(t)?c(t):l(t.id)),!0}case`Escape`:return e.preventDefault(),d(),!0;case`Backspace`:return i&&a===``?(e.preventDefault(),u(),!0):!1;default:return!1}},t[7]=i,t[8]=d,t[9]=u,t[10]=f,t[11]=n,t[12]=s,t[13]=a,t[14]=l,t[15]=c,t[16]=y):y=t[16];let b=En(y),x=n[f],S=s&&x?`${o}-option-${x.id}`:void 0,C;return t[17]!==b||t[18]!==v||t[19]!==f||t[20]!==S?(C={highlightedIndex:f,highlightedItemId:S,highlightIndex:v,handleKeyDown:b},t[17]=b,t[18]=v,t[19]=f,t[20]=S,t[21]=C):C=t[21],C});function kA(e,t){var n,r;return!t||e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||(n=(r=e.description)==null?void 0:r.toLowerCase().includes(t))!=null&&n}var AA=Gr(e=>{let t=J(35),{adapter:n,query:r,open:i}=e,[a,o]=xn(null),[s,c]=xn(i);s!==i&&(c(i),i||o(null));let l;bb0:{if(!i||!n){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],l=e;break bb0}let e;t[1]===n?e=t[2]:(e=n.categories(),t[1]=n,t[2]=e),l=e}let u=l,d=i?a:null,f;bb1:{if(!d||!n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[3]=e):e=t[3],f=e;break bb1}let e;t[4]!==n||t[5]!==d?(e=n.categoryItems(d),t[4]=n,t[5]=d,t[6]=e):e=t[6],f=e}let p=f,m;bb2:{if(!i||!n||d||!r&&u.length>0){m=null;break bb2}if(n.search){let e;t[7]!==n||t[8]!==r?(e=n.search(r),t[7]=n,t[8]=r,t[9]=e):e=t[9],m=e;break bb2}let e;if(t[10]!==n||t[11]!==u||t[12]!==r){e=[];let i=r.toLowerCase();for(let t of u)for(let r of n.categoryItems(t.id))kA(r,i)&&e.push(r);t[10]=n,t[11]=u,t[12]=r,t[13]=e}else e=t[13];m=e}let h=m,g=h!==null,_;bb3:{if(g){let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[14]=e):e=t[14],_=e;break bb3}if(!r){_=u;break bb3}let e;if(t[15]!==u||t[16]!==r){let n=r.toLowerCase();e=u.filter(e=>e.label.toLowerCase().includes(n)),t[15]=u,t[16]=r,t[17]=e}else e=t[17];_=e}let v=_,y;bb4:{if(g){let e;t[18]===h?e=t[19]:(e=h==null?[]:h,t[18]=h,t[19]=e),y=e;break bb4}if(!r){y=p;break bb4}let e;if(t[20]!==p||t[21]!==r){let n=r.toLowerCase();e=p.filter(e=>kA(e,n)),t[20]=p,t[21]=r,t[22]=e}else e=t[22];y=e}let b=y,x;bb5:{if(g){let e;t[23]===h?e=t[24]:(e=h==null?[]:h,t[23]=h,t[24]=e),x=e;break bb5}if(d){x=b;break bb5}x=v}let S=x,C;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{o(e)},t[25]=C):C=t[25];let w=En(C),T;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{o(null)},t[26]=T):T=t[26];let E=En(T),D;return t[27]!==d||t[28]!==v||t[29]!==b||t[30]!==E||t[31]!==g||t[32]!==S||t[33]!==w?(D={categories:v,items:b,isSearchMode:g,activeCategoryId:d,navigableList:S,selectCategory:w,goBack:E},t[27]=d,t[28]=v,t[29]=b,t[30]=E,t[31]=g,t[32]=S,t[33]=w,t[34]=D):D=t[34],D}),jA=Gr(e=>{let t=J(15),{behavior:n,trigger:r,aui:i,setCursorPosition:a,onSelected:o}=e,s=K(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>(s.current=e,()=>{s.current===e&&(s.current=null)}),t[0]=c):c=t[0];let l=En(c),u;t[1]!==i||t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==r?(u=e=>{var t;if(!r||!n)return;if((t=s.current)!=null&&t.call(s,e,()=>{var t;n.kind===`directive`&&((t=n.onInserted)==null||t.call(n,e))})){o();return}let c=i.composer.getState().text,l=c.slice(0,r.offset),u=c.slice(r.endOffset),d=()=>{let t=n.formatter.serialize(e);i.composer.setText(l+t+(u.startsWith(` `)?u:` ${u}`),{origin:`user`}),a(l.length+t.length+1)};if(n.kind===`directive`){var f;d(),(f=n.onInserted)==null||f.call(n,e)}else n.removeOnExecute?(i.composer.setText(l+(u.startsWith(` `)?u.slice(1):u),{origin:`user`}),a(l.length)):d(),n.onExecute(e);o()},t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=r,t[6]=u):u=t[6];let d=En(u),f;t[7]!==o||t[8]!==a||t[9]!==r?(f=()=>{o(),r&&a(r.offset)},t[7]=o,t[8]=a,t[9]=r,t[10]=f):f=t[10];let p=En(f),m;return t[11]!==p||t[12]!==l||t[13]!==d?(m={selectItem:d,close:p,registerSelectItemOverride:l},t[11]=p,t[12]=l,t[13]=d,t[14]=m):m=t[14],m}),MA=Gr(e=>{let t=J(47),{adapter:n,text:r,triggerChar:i,matcher:a,behavior:o,aui:s,popoverId:c,isLoading:l}=e,u;t[0]!==a||t[1]!==r||t[2]!==i?(u=EA({text:r,triggerChar:i,matcher:a}),t[0]=a,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=Jr(u),f=d.trigger!==null&&n!==void 0&&o!==void 0,p;t[4]!==n||t[5]!==d.query||t[6]!==f?(p=AA({adapter:n,query:d.query,open:f}),t[4]=n,t[5]=d.query,t[6]=f,t[7]=p):p=t[7];let m=Jr(p),h;t[8]===m?h=t[9]:(h=()=>{m.goBack()},t[8]=m,t[9]=h);let g=En(h),_;t[10]!==s||t[11]!==o||t[12]!==d.setCursorPosition||t[13]!==d.trigger||t[14]!==g||t[15]!==i?(_=jA({behavior:o,trigger:d.trigger,aui:s,triggerChar:i,setCursorPosition:d.setCursorPosition,onSelected:g}),t[10]=s,t[11]=o,t[12]=d.setCursorPosition,t[13]=d.trigger,t[14]=g,t[15]=i,t[16]=_):_=t[16];let v=Jr(_),y;t[17]!==d.query||t[18]!==m.activeCategoryId||t[19]!==m.goBack||t[20]!==m.isSearchMode||t[21]!==m.navigableList||t[22]!==m.selectCategory||t[23]!==f||t[24]!==c||t[25]!==v.close||t[26]!==v.selectItem?(y=OA({navigableList:m.navigableList,isSearchMode:m.isSearchMode,activeCategoryId:m.activeCategoryId,query:d.query,popoverId:c,open:f,selectItem:v.selectItem,selectCategory:m.selectCategory,goBack:m.goBack,close:v.close}),t[17]=d.query,t[18]=m.activeCategoryId,t[19]=m.goBack,t[20]=m.isSearchMode,t[21]=m.navigableList,t[22]=m.selectCategory,t[23]=f,t[24]=c,t[25]=v.close,t[26]=v.selectItem,t[27]=y):y=t[27];let b=Jr(y),x;return t[28]!==d.query||t[29]!==d.setCursorPosition||t[30]!==l||t[31]!==b.handleKeyDown||t[32]!==b.highlightIndex||t[33]!==b.highlightedIndex||t[34]!==b.highlightedItemId||t[35]!==m.activeCategoryId||t[36]!==m.categories||t[37]!==m.goBack||t[38]!==m.isSearchMode||t[39]!==m.items||t[40]!==m.selectCategory||t[41]!==f||t[42]!==c||t[43]!==v.close||t[44]!==v.registerSelectItemOverride||t[45]!==v.selectItem?(x={open:f,query:d.query,activeCategoryId:m.activeCategoryId,categories:m.categories,items:m.items,highlightedIndex:b.highlightedIndex,isSearchMode:m.isSearchMode,isLoading:l,popoverId:c,highlightedItemId:b.highlightedItemId,selectCategory:m.selectCategory,goBack:m.goBack,selectItem:v.selectItem,close:v.close,highlightIndex:b.highlightIndex,handleKeyDown:b.handleKeyDown,setCursorPosition:d.setCursorPosition,registerSelectItemOverride:v.registerSelectItemOverride},t[28]=d.query,t[29]=d.setCursorPosition,t[30]=l,t[31]=b.handleKeyDown,t[32]=b.highlightIndex,t[33]=b.highlightedIndex,t[34]=b.highlightedItemId,t[35]=m.activeCategoryId,t[36]=m.categories,t[37]=m.goBack,t[38]=m.isSearchMode,t[39]=m.items,t[40]=m.selectCategory,t[41]=f,t[42]=c,t[43]=v.close,t[44]=v.registerSelectItemOverride,t[45]=v.selectItem,t[46]=x):x=t[46],x});j();var NA=[`char`,`matcher`,`adapter`,`isLoading`,`aria-label`,`children`],PA=Hn(null),FA=()=>{let e=Wn(PA);if(!e)throw Error(`useTriggerPopoverScopeContext must be used within ComposerPrimitive.TriggerPopover`);return e},IA=()=>Wn(PA),LA=Hn(null),RA=()=>{let e=Wn(LA);if(!e)throw Error(`TriggerPopover.Directive / TriggerPopover.Action must be rendered inside ComposerPrimitive.TriggerPopover`);return e},zA=Mn((e,t)=>{let n=J(70),r,i,a,o,s,c,l;if(n[0]!==e){var u=e;({char:a,matcher:s,adapter:r,isLoading:l,"aria-label":i,children:o}=u),c=G(u,NA),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l}else r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7];let d=l!==void 0&&l,f=Xa(),p=Y(BA),m=An(),h=K(s),g;n[8]===s?g=n[9]:(g=()=>{h.current=s},n[8]=s,n[9]=g),q(g);let _;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>(e,t,n)=>h.current(e,t,n),n[10]=_):_=n[10];let[v]=xn(_),y=s!==void 0,b=K(null),[x,S]=xn(null),C=K(0),w;n[11]===a?w=n[12]:(w=e=>(C.current+=1,process.env.NODE_ENV!==`production`&&C.current>1&&console.warn(`[assistant-ui] TriggerPopover "${a}" received more than one behavior child. Exactly one <TriggerPopover.Directive> or <TriggerPopover.Action> is allowed per TriggerPopover; the last registration wins.`),b.current=e,S(e),()=>{C.current=Math.max(0,C.current-1),b.current===e&&(b.current=null,S(null))}),n[11]=a,n[12]=w);let T=w,E;n[13]===T?E=n[14]:(E={register:T},n[13]=T,n[14]=E);let D=E,O=x==null?void 0:x,k;n[15]!==r||n[16]!==f||n[17]!==a||n[18]!==d||n[19]!==s||n[20]!==m||n[21]!==O||n[22]!==p?(k=MA({adapter:r,text:p,triggerChar:a,matcher:s,behavior:O,aui:f,popoverId:m,isLoading:d}),n[15]=r,n[16]=f,n[17]=a,n[18]=d,n[19]=s,n[20]=m,n[21]=O,n[22]=p,n[23]=k):k=n[23];let j=Jr(k),M;n[24]===j?M=n[25]:(M=()=>j,n[24]=j,n[25]=M);let N=En(M),P=lA(),F;n[26]!==x||n[27]!==a||n[28]!==N||n[29]!==y||n[30]!==v||n[31]!==P?(F=()=>P.register(A(A(A({char:a},y?{matcher:v}:{}),x?{behavior:x}:{}),{},{resource:N()})),n[26]=x,n[27]=a,n[28]=N,n[29]=y,n[30]=v,n[31]=P,n[32]=F):F=n[32];let I;n[33]!==x||n[34]!==a||n[35]!==y||n[36]!==v||n[37]!==P?(I=[P,a,y,v,x],n[33]=x,n[34]=a,n[35]=y,n[36]=v,n[37]=P,n[38]=I):I=n[38],q(F,I);let L=rA(),R;n[39]!==N||n[40]!==L?(R=()=>{if(L)return L.register(N())},n[39]=N,n[40]=L,n[41]=R):R=n[41];let z;n[42]===L?z=n[43]:(z=[L],n[42]=L,n[43]=z),q(R,z);let B=x!==null&&j.open,ee=dA(),V,te;n[44]!==ee||n[45]!==a||n[46]!==B?(V=()=>{if(B)return()=>{ee.setActiveAria(a,null)}},te=[ee,a,B],n[44]=ee,n[45]=a,n[46]=B,n[47]=V,n[48]=te):(V=n[47],te=n[48]),q(V,te);let ne,H;n[49]!==ee||n[50]!==a||n[51]!==B||n[52]!==m||n[53]!==j.highlightedItemId?(ne=()=>{B&&ee.setActiveAria(a,{popoverId:m,highlightedItemId:j.highlightedItemId})},H=[ee,a,m,B,j.highlightedItemId],n[49]=ee,n[50]=a,n[51]=B,n[52]=m,n[53]=j.highlightedItemId,n[54]=ne,n[55]=H):(ne=n[54],H=n[55]),q(ne,H);let U;if(n[56]!==i||n[57]!==o||n[58]!==t||n[59]!==B||n[60]!==m||n[61]!==c||n[62]!==j.highlightedItemId){var re;U=B?(0,X.jsx)(VO.div,A(A({role:`listbox`,id:m,"aria-label":(re=i)==null?`Suggestions`:re,"aria-activedescendant":j.highlightedItemId,"data-state":`open`},c),{},{ref:t,children:o})):o,n[56]=i,n[57]=o,n[58]=t,n[59]=B,n[60]=m,n[61]=c,n[62]=j.highlightedItemId,n[63]=U}else U=n[63];let ie;n[64]!==j||n[65]!==U?(ie=(0,X.jsx)(PA.Provider,{value:j,children:U}),n[64]=j,n[65]=U,n[66]=ie):ie=n[66];let W;return n[67]!==D||n[68]!==ie?(W=(0,X.jsx)(LA.Provider,{value:D,children:ie}),n[67]=D,n[68]=ie,n[69]=W):W=n[69],W});zA.displayName=`ComposerPrimitive.TriggerPopover`;function BA(e){return e.composer.text}var VA=()=>{let e=J(2),{disabled:t,send:n}=wv(),r;return e[0]===n?r=e[1]:(r=()=>n(),e[0]=n,e[1]=r),t?null:r},HA=tk(`ComposerPrimitive.Send`,VA),UA=Hn(null),WA=()=>Wn(UA),GA=`[contenteditable]:not([contenteditable='false'])`,KA=`textarea:not(:disabled), ${GA}`;j();var qA=[`onSubmit`,`onMouseDown`,`compact`,`inert`],JA=[`a`,`audio[controls]`,`button`,`details`,`embed`,`iframe`,`input`,`label`,`select`,`summary`,`textarea`,`video[controls]`,GA,`[tabindex]`].join(`, `),YA=vn.version.startsWith(`18.`),XA=Mn((e,t)=>{let n=J(27),r,i,a,o,s;if(n[0]!==e){var c=e;({onSubmit:o,onMouseDown:a,compact:r,inert:i}=c),s=G(c,qA),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s}else r=n[1],i=n[2],a=n[3],o=n[4],s=n[5];let l=VA(),u=Y(ZA),[d,f]=xn(!1),p;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(p={setMultiline:f},n[6]=p):p=n[6];let m=p,h;n[7]===r?h=n[8]:(h=e=>r?e.composer.attachments.length===0&&e.composer.quote==null&&e.composer.queue.length===0&&e.composer.dictation==null&&!e.composer.text.includes(`
60
- `):!1,n[7]=r,n[8]=h);let g=Y(h)&&!d,_=YA&&typeof i==`boolean`?i?``:void 0:i,v;n[9]===l?v=n[10]:(v=e=>{e.preventDefault(),l&&l()},n[9]=l,n[10]=v);let y=v,b=QA,x=r?m:null,S=_,C=g?``:void 0,w;n[11]!==y||n[12]!==o?(w=Bb(o,y),n[11]=y,n[12]=o,n[13]=w):w=n[13];let T;n[14]===a?T=n[15]:(T=Bb(a,b),n[14]=a,n[15]=T);let E;n[16]!==u||n[17]!==t||n[18]!==s||n[19]!==S||n[20]!==C||n[21]!==w||n[22]!==T?(E=(0,X.jsx)(VO.form,A(A({},s),{},{inert:S,"data-aui-composer-type":u,"data-compact":C,ref:t,onSubmit:w,onMouseDown:T})),n[16]=u,n[17]=t,n[18]=s,n[19]=S,n[20]=C,n[21]=w,n[22]=T,n[23]=E):E=n[23];let D;return n[24]!==x||n[25]!==E?(D=(0,X.jsx)(UA.Provider,{value:x,children:E}),n[24]=x,n[25]=E,n[26]=D):D=n[26],D});XA.displayName=`ComposerPrimitive.Root`;function ZA(e){return e.composer.type}function QA(e){if(e.button!==0)return;let t=e.target;if(!(t instanceof Element)||!e.currentTarget.contains(t))return;let n=t.closest(JA);if(n&&e.currentTarget.contains(n))return;let r=e.currentTarget.querySelector(KA);r&&(e.preventDefault(),r.focus())}var $A=e=>{let t=J(4),n=Jb(e),r=cy(ej),i,a;t[0]!==n||t[1]!==r?(i=()=>r(n),a=[r,n],t[0]=n,t[1]=r,t[2]=i,t[3]=a):(i=t[2],a=t[3]),q(i,a)};function ej(e){return e.onScrollToBottom}var tj=()=>!1,nj=()=>{},rj=e=>{let t=J(4),n;t[0]===e?n=t[1]:(n=t=>{if(typeof window>`u`||e===null||!window.matchMedia)return nj;let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},t[0]=e,t[1]=n);let r=n,i;return t[2]===e?i=t[3]:(i=()=>typeof window>`u`||e===null||!window.matchMedia?!1:window.matchMedia(e).matches,t[2]=e,t[3]=i),Dn(r,i,tj)},ij=e=>e.isComposing||e.keyCode===229,aj=Hn(void 0),oj=()=>Wn(aj),sj=`[data-aui-composer-type]`,cj=`[data-aui-thread-root]`,lj=e=>{let t=J(4),n=Xa(),r=oj(),i;return t[0]!==n.composer||t[1]!==e||t[2]!==r?(i=t=>{let i=r==null?void 0:r.current,a=t==null?void 0:t.ownerDocument,o=a==null?void 0:a.activeElement,s=t==null?void 0:t.closest(sj),c=n.composer.getState().type===`edit`&&i&&o&&(s==null?void 0:s.getAttribute(`data-aui-composer-type`))===`edit`&&s.contains(o)&&s.closest(cj)===i,l=c?Array.from(i.querySelectorAll(KA)).filter(e=>{var t;return e.closest(cj)===i&&((t=e.closest(sj))==null?void 0:t.getAttribute(`data-aui-composer-type`))===`thread`}):[];if(e(),a&&o&&c&&(a.activeElement===o||a.activeElement===a.body)){for(let e of l)if(e.isConnected&&!e.closest(`[hidden], [inert]`)&&(e.focus({preventScroll:!0}),a.activeElement!==o&&a.activeElement!==a.body))break}},t[0]=n.composer,t[1]=e,t[2]=r,t[3]=i):i=t[3],i};function uj(){return Y(dj)}function dj(e){return e.composer.isEditing?e.composer.text:``}function fj(e){return!!Y(pj)||!!e}function pj(e){var t;return e.thread.isDisabled||((t=e.composer.dictation)==null?void 0:t.inputDisabled)}function mj(){let e=J(4),t=vA();if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={},e[0]=t):t=e[0],t}let n;return e[1]!==t.highlightedItemId||e[2]!==t.popoverId?(n={"aria-controls":t.popoverId,"aria-expanded":!0,"aria-haspopup":`listbox`,"aria-activedescendant":t.highlightedItemId},e[1]=t.highlightedItemId,e[2]=t.popoverId,e[3]=n):n=e[3],n}function hj(){return hj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hj.apply(null,arguments)}function gj(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _j=t.useLayoutEffect,vj=function(e){var n=t.default.useRef(e);return _j(function(){n.current=e}),n},yj=function(e,t){typeof e==`function`?e(t):e.current=t},bj=function(e,n){var r=t.default.useRef();return t.default.useCallback(function(t){e.current=t,r.current&&yj(r.current,null),r.current=n,n&&yj(n,t)},[n])},xj={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},Sj=function(e){Object.keys(xj).forEach(function(t){e.style.setProperty(t,xj[t],`important`)})},Cj=null,wj=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function Tj(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Cj||(Cj=document.createElement(`textarea`),Cj.setAttribute(`tabindex`,`-1`),Cj.setAttribute(`aria-hidden`,`true`),Sj(Cj)),Cj.parentNode===null&&document.body.appendChild(Cj);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;Cj.style[t]=o[t]}),Sj(Cj),Cj.value=t;var c=wj(Cj,e);Cj.value=t,c=wj(Cj,e),Cj.value=`x`;var l=Cj.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var Ej=function(){},Dj=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},Oj=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],kj=!!document.documentElement.currentStyle,Aj=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Dj(Oj,t),r=n.boxSizing;return r===``?null:(kj&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function jj(e,n,r){var i=vj(r);t.useLayoutEffect(function(){var t=function(e){return i.current(e)};if(e)return e.addEventListener(n,t),function(){return e.removeEventListener(n,t)}},[])}var Mj=function(e,t){jj(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},Nj=function(e){jj(window,`resize`,e)},Pj=function(e){jj(document.fonts,`loadingdone`,e)},Fj=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],Ij=t.forwardRef(function(e,n){var r=e.cacheMeasurements,i=e.maxRows,a=e.minRows,o=e.onChange,s=o===void 0?Ej:o,c=e.onHeightChange,l=c===void 0?Ej:c,u=gj(e,Fj),d=u.value!==void 0,f=t.useRef(null),p=bj(f,n),m=t.useRef(0),h=t.useRef(),g=function(){var e=f.current,t=r&&h.current?h.current:Aj(e);if(t){h.current=t;var n=Tj(t,e.value||e.placeholder||`x`,a,i),o=n[0],s=n[1];m.current!==o&&(m.current=o,e.style.setProperty(`height`,o+`px`,`important`),l(o,{rowHeight:s}))}};return t.useLayoutEffect(g),Mj(f,function(){if(!d){var e=f.current.value;requestAnimationFrame(function(){var t=f.current;t&&e!==t.value&&g()})}}),Nj(g),Pj(g),t.createElement(`textarea`,hj({},u,{onChange:function(e){d||g(),s(e)},ref:p}))});j();var Lj=[`autoFocus`,`asChild`,`render`,`disabled`,`onChange`,`onKeyDown`,`onPaste`,`onSelect`,`submitOnEnter`,`submitMode`,`cancelOnEscape`,`unstable_focusOnRunStart`,`unstable_focusOnScrollToBottom`,`unstable_focusOnThreadSwitched`,`unstable_insertNewlineOnTouchEnter`,`addAttachmentOnPaste`,`onHeightChange`],Rj=`(pointer: coarse) and (not (any-pointer: fine))`,zj=Mn((e,t)=>{let{autoFocus:n=!1,asChild:r,render:i,disabled:a,onChange:o,onKeyDown:s,onPaste:c,onSelect:l,submitOnEnter:u,submitMode:d,cancelOnEscape:f=!0,unstable_focusOnRunStart:p=!0,unstable_focusOnScrollToBottom:m=!0,unstable_focusOnThreadSwitched:h=!0,unstable_insertNewlineOnTouchEnter:g=!1,addAttachmentOnPaste:_=!0,onHeightChange:v}=e,y=G(e,Lj),b=Xa(),x=oj(),S=rA(),C=WA(),w=d==null?u===!1?`none`:`enter`:d,T=rj(g?Rj:null),E=g&&T&&w===`enter`?`none`:w,D=uj(),k=fj(a),j=K(null),M=lj(wn(()=>b.composer.cancel(),[b])),N=Ry(t,j),P=K(!1);uO(e=>{var t;if((t=j.current)!=null&&t.contains(e.target)&&!ij(e)){if(S){for(let t of S.getPlugins())if(t.handleKeyDown(e))return}f&&b.composer.getState().canCancel&&(M(j.current),e.preventDefault())}});let F=e=>{if(!k&&!ij(e.nativeEvent)){if(S){for(let t of S.getPlugins())if(t.handleKeyDown(e))return}if(e.key===`Enter`){let n=b.thread.getState(),r=n.capabilities.queue;if(e.shiftKey&&(e.ctrlKey||e.metaKey)&&r&&w!==`none`&&b.composer.getState().canSend){e.preventDefault(),b.composer.send({steer:!0});return}if(e.shiftKey||n.isRunning&&!r&&n.voice===void 0)return;let i=!1;if(E===`ctrlEnter`?i=e.ctrlKey||e.metaKey:E===`enter`&&(i=!0),i){var t;e.preventDefault(),(t=j.current)==null||(t=t.closest(`form`))==null||t.requestSubmit()}}}},I=function(){var e=O(function*(e){var t;if(!_)return;let n=b.thread.getState().capabilities,r=Array.from(((t=e.clipboardData)==null?void 0:t.files)||[]);n.attachments&&r.length>0&&(e.preventDefault(),yield Promise.all(r.map(function(){var e=O(function*(e){try{yield b.composer.addAttachment(e)}catch(e){}});return function(t){return e.apply(this,arguments)}}())))});return function(t){return e.apply(this,arguments)}}(),L=(e,t)=>{if(v==null||v(e,t),!C)return;let n=j.current;if(!n||n.value===``)return;let r=getComputedStyle(n),i=r.boxSizing===`border-box`?e-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderTopWidth)-parseFloat(r.borderBottomWidth):e;Math.round(i/t.rowHeight)>1&&C.setMultiline(!0)},R=n&&!k,z=wn(()=>{let e=j.current;e&&R&&(e.focus({preventScroll:!0}),e.setSelectionRange(e.value.length,e.value.length))},[R]),B=wn(()=>{let e=j.current;if(!e)return;let t=e.ownerDocument,n=t.activeElement;if(n===e)return;let r=x==null?void 0:x.current,i=e.closest(`[data-aui-composer-type]`);(!n||n===t.body||i!=null&&i.contains(n)||r!=null&&r.contains(n)&&n.closest(`[data-aui-thread-root]`)===r)&&z()},[z,x]);q(()=>z(),[z]),$A(()=>{b.composer.getState().type===`thread`&&m&&z()}),q(()=>{if(b.composer.getState().type===`thread`&&p)return b.on(`thread.runStart`,B)},[p,B,b]),q(()=>{if(b.composer.getState().type===`thread`&&h&&b.optional.threads)return b.on(`threads.selectionChanged`,z)},[h,z,b]),q(()=>{D===``&&(C==null||C.setMultiline(!1))},[D,C]);let ee=mj(),V=A(A(A({name:`input`,value:D},y),ee),{},{ref:N,disabled:k,onChange:Bb(o,e=>{var t;if(!b.composer.getState().isEditing)return;let n=e.nativeEvent.isComposing===!0;P.current&&!n&&(P.current=!1);let r=n||P.current;if(sr(()=>{b.composer.setText(e.target.value,{origin:`user`})}),r)return;let i=(t=e.target.selectionStart)==null?e.target.value.length:t;if(S)for(let e of S.getPlugins())e.setCursorPosition(i)}),onKeyDown:Bb(s,F),onCompositionStart:Bb(y.onCompositionStart,()=>{P.current=!0}),onCompositionEnd:Bb(y.onCompositionEnd,e=>{var t;if(P.current=!1,!b.composer.getState().isEditing)return;let n=e.target;sr(()=>{b.composer.setText(n.value,{origin:`user`})});let r=(t=n.selectionStart)==null?n.value.length:t;if(S)for(let e of S.getPlugins())e.setCursorPosition(r)}),onSelect:Bb(l,e=>{var t;if(P.current)return;let n=e.target,r=(t=n.selectionStart)==null?n.value.length:t;if(S)for(let e of S.getPlugins())e.setCursorPosition(r)}),onPaste:Bb(c,I)},C?{onHeightChange:L}:v===void 0?{}:{onHeightChange:v});if(i&&Ln(i))return RO(i,y.children,V);let te=r?Uy:Ij;return(0,X.jsx)(te,A({},V))});zj.displayName=`ComposerPrimitive.Input`;var Bj=tk(`ComposerPrimitive.Resume`,()=>{let e=J(2),{disabled:t,resume:n}=Tv(),r;return e[0]===n?r=e[1]:(r=()=>n(),e[0]=n,e[1]=r),t?null:r}),Vj=tk(`ComposerPrimitive.Cancel`,()=>{let e=J(2),{disabled:t,cancel:n}=Ev(),r=lj(n);if(t)return null;let i;return e[0]===r?i=e[1]:(i=e=>r(e.detail===0?e.currentTarget:null),e[0]=r,e[1]=i),i}),Hj=tk(`ComposerPrimitive.AddAttachment`,e=>{let t=J(10),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{multiple:r}=n,i=r===void 0||r,{disabled:a,addAttachment:o}=kv(),s=Xa(),c=K(0),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>()=>{c.current+=1},t[2]=l):l=t[2];let u;t[3]!==s.composer||t[4]!==s.optional.threadListItem?(u=[s.composer,s.optional.threadListItem],t[3]=s.composer,t[4]=s.optional.threadListItem,t[5]=u):u=t[5],kn(l,u);let d;return t[6]!==o||t[7]!==s.composer||t[8]!==i?(d=()=>{let e=c.current,t=document.createElement(`input`);t.type=`file`,t.multiple=i,t.hidden=!0;let n=s.composer.getState().attachmentAccept;n!==`*`&&(t.accept=n),document.body.appendChild(t),t.onchange=function(){var n=O(function*(n){let r=n.target.files;if(!r)return;let i=Array.from(r,function(){var t=O(function*(t){try{if(c.current!==e)return;yield o(t)}catch(e){}});return function(e){return t.apply(this,arguments)}}());document.body.removeChild(t),yield Promise.all(i)});return function(e){return n.apply(this,arguments)}}(),t.oncancel=()=>{t.files&&t.files.length!==0||document.body.removeChild(t)},t.click()},t[6]=o,t[7]=s.composer,t[8]=i,t[9]=d):d=t[9],a?null:d},[`multiple`]);j();var Uj=[`disabled`,`asChild`,`render`,`children`],Wj=Mn((e,t)=>{let{disabled:n,asChild:r=!1,render:i,children:a}=e,o=G(e,Uj),[s,c]=xn(!1),l=Xa(),u=Y(e=>e.thread.isDisabled),d=n||u;q(()=>{d&&c(!1)},[d]);let f=wn(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),d||!l.thread.getState().capabilities.attachments?e.dataTransfer.dropEffect=`none`:c(!0))},[d,l]),p=wn(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),d||!l.thread.getState().capabilities.attachments?e.dataTransfer.dropEffect=`none`:s||c(!0))},[d,s,l]),m=wn(e=>{if(d)return;e.preventDefault();let t=e.relatedTarget;t&&e.currentTarget.contains(t)||c(!1)},[d]),h=wn(function(){var e=O(function*(e){if(c(!1),!e.dataTransfer.types.includes(`Files`)||(e.preventDefault(),d))return;let t=Array.from(e.dataTransfer.files);l.thread.getState().capabilities.attachments&&t.length!==0&&(yield Promise.all(t.map(function(){var e=O(function*(e){try{yield l.composer.addAttachment(e)}catch(e){}});return function(t){return e.apply(this,arguments)}}())))});return function(t){return e.apply(this,arguments)}}(),[d,l]),g=A(A(A({},s&&!d?{"data-dragging":`true`}:null),o),{},{onDragEnterCapture:Bb(o.onDragEnterCapture,f),onDragOverCapture:Bb(o.onDragOverCapture,p),onDragLeaveCapture:Bb(o.onDragLeaveCapture,m),onDropCapture:Bb(o.onDropCapture,h),ref:t});if(i&&Ln(i))return RO(i,a,g);let _=r?Uy:`div`;return(0,X.jsx)(_,A(A({},g),{},{children:a}))});Wj.displayName=`ComposerPrimitive.AttachmentDropzone`;var Gj=tk(`ComposerPrimitive.Dictate`,()=>{let{disabled:e,startDictation:t}=Dv();return e?null:t}),Kj=tk(`ComposerPrimitive.StopDictation`,()=>{let e=J(2),t=Xa(),n=Y(qj),r;return e[0]===t.composer?r=e[1]:(r=()=>{t.composer.stopDictation()},e[0]=t.composer,e[1]=r),n?r:null});function qj(e){return e.composer.dictation!=null}j();var Jj=[`children`],Yj=Mn((e,t)=>{var n;let r=J(7),i,a;if(r[0]!==e){var o=e;({children:i}=o),a=G(o,Jj),r[0]=e,r[1]=i,r[2]=a}else i=r[1],a=r[2];let s=Y(Xj);if(!s)return null;let c=(n=i)==null?s:n,l;return r[3]!==t||r[4]!==a||r[5]!==c?(l=(0,X.jsx)(VO.span,A(A({},a),{},{ref:t,children:c})),r[3]=t,r[4]=a,r[5]=c,r[6]=l):l=r[6],l});Yj.displayName=`ComposerPrimitive.DictationTranscript`;function Xj(e){var t;return(t=e.composer.dictation)==null?void 0:t.transcript}j();var Zj=[`children`],Qj=[`onClick`],$j=Mn((e,t)=>{let n=J(3);if(!Y(nM))return null;let r;return n[0]!==t||n[1]!==e?(r=(0,X.jsx)(VO.div,A(A({},e),{},{ref:t})),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});$j.displayName=`ComposerPrimitive.Quote`;var eM=Mn((e,t)=>{var n;let r=J(7),i,a;if(r[0]!==e){var o=e;({children:i}=o),a=G(o,Zj),r[0]=e,r[1]=i,r[2]=a}else i=r[1],a=r[2];let s=Y(rM);if(!s)return null;let c=(n=i)==null?s:n,l;return r[3]!==t||r[4]!==a||r[5]!==c?(l=(0,X.jsx)(VO.span,A(A({},a),{},{ref:t,children:c})),r[3]=t,r[4]=a,r[5]=c,r[6]=l):l=r[6],l});eM.displayName=`ComposerPrimitive.QuoteText`;var tM=Mn((e,t)=>{let n=J(12),r,i;if(n[0]!==e){var a=e;({onClick:r}=a),i=G(a,Qj),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let o=Xa(),s;n[3]===o?s=n[4]:(s=()=>{o.composer.setQuote(void 0)},n[3]=o,n[4]=s);let c=s,l;n[5]!==c||n[6]!==r?(l=Bb(r,c),n[5]=c,n[6]=r,n[7]=l):l=n[7];let u;return n[8]!==t||n[9]!==i||n[10]!==l?(u=(0,X.jsx)(VO.button,A(A({type:`button`},i),{},{ref:t,onClick:l})),n[8]=t,n[9]=i,n[10]=l,n[11]=u):u=n[11],u});tM.displayName=`ComposerPrimitive.QuoteDismiss`;function nM(e){return e.composer.quote}function rM(e){var t;return(t=e.composer.quote)==null?void 0:t.text}j();var iM=[`children`,`aria-label`],aM=[`categoryId`,`onClick`,`onMouseMove`],oM=Mn((e,t)=>{var n;let r=J(12),i,a,o;if(r[0]!==e){var s=e;({children:a,"aria-label":i}=s),o=G(s,iM),r[0]=e,r[1]=i,r[2]=a,r[3]=o}else i=r[1],a=r[2],o=r[3];let{categories:c,activeCategoryId:l,isSearchMode:u,open:d}=FA();if(!d||l||u)return null;let f=(n=i)==null?`Categories`:n,p;r[4]!==c||r[5]!==a?(p=a(c),r[4]=c,r[5]=a,r[6]=p):p=r[6];let m;return r[7]!==t||r[8]!==o||r[9]!==f||r[10]!==p?(m=(0,X.jsx)(VO.div,A(A({role:`group`,"aria-label":f},o),{},{ref:t,children:p})),r[7]=t,r[8]=o,r[9]=f,r[10]=p,r[11]=m):m=r[11],m});oM.displayName=`ComposerPrimitive.TriggerPopoverCategories`;var sM=Mn((e,t)=>{let n=J(30),r,i,a,o;if(n[0]!==e){var s=e;({categoryId:r,onClick:i,onMouseMove:a}=s),o=G(s,aM),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o}else r=n[1],i=n[2],a=n[3],o=n[4];let{selectCategory:c,highlightIndex:l,categories:u,highlightedIndex:d,activeCategoryId:f,isSearchMode:p,popoverId:m}=FA(),h;n[5]!==r||n[6]!==c?(h=()=>{c(r)},n[5]=r,n[6]=c,n[7]=h):h=n[7];let g=h,_;if(n[8]!==u||n[9]!==r){let e;n[11]===r?e=n[12]:(e=e=>e.id===r,n[11]=r,n[12]=e),_=u.findIndex(e),n[8]=u,n[9]=r,n[10]=_}else _=n[10];let v=_,y=!f&&!p&&v===d,b;n[13]!==v||n[14]!==l?(b=()=>{l(v)},n[13]=v,n[14]=l,n[15]=b):b=n[15];let x=b,S=`${m}-option-${r}`,C=y?``:void 0,w;n[16]!==g||n[17]!==i?(w=Bb(i,g),n[16]=g,n[17]=i,n[18]=w):w=n[18];let T;n[19]!==x||n[20]!==a?(T=Bb(a,x),n[19]=x,n[20]=a,n[21]=T):T=n[21];let E;return n[22]!==t||n[23]!==y||n[24]!==o||n[25]!==S||n[26]!==C||n[27]!==w||n[28]!==T?(E=(0,X.jsx)(VO.button,A(A({type:`button`,role:`option`,id:S,"aria-selected":y,"data-highlighted":C},o),{},{ref:t,onClick:w,onMouseMove:T})),n[22]=t,n[23]=y,n[24]=o,n[25]=S,n[26]=C,n[27]=w,n[28]=T,n[29]=E):E=n[29],E});sM.displayName=`ComposerPrimitive.TriggerPopoverCategoryItem`,j();var cM=[`children`,`aria-label`],lM=[`item`,`index`,`onClick`,`onMouseMove`],uM=Mn((e,t)=>{var n;let r=J(12),i,a,o;if(r[0]!==e){var s=e;({children:a,"aria-label":i}=s),o=G(s,cM),r[0]=e,r[1]=i,r[2]=a,r[3]=o}else i=r[1],a=r[2],o=r[3];let{items:c,activeCategoryId:l,isSearchMode:u,open:d}=FA();if(!d||!l&&!u)return null;let f=(n=i)==null?`Items`:n,p;r[4]!==a||r[5]!==c?(p=a(c),r[4]=a,r[5]=c,r[6]=p):p=r[6];let m;return r[7]!==t||r[8]!==o||r[9]!==f||r[10]!==p?(m=(0,X.jsx)(VO.div,A(A({role:`group`,"aria-label":f},o),{},{ref:t,children:p})),r[7]=t,r[8]=o,r[9]=f,r[10]=p,r[11]=m):m=r[11],m});uM.displayName=`ComposerPrimitive.TriggerPopoverItems`;var dM=Mn((e,t)=>{let n=J(30),r,i,a,o,s;if(n[0]!==e){var c=e;({item:i,index:r,onClick:a,onMouseMove:o}=c),s=G(c,lM),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s}else r=n[1],i=n[2],a=n[3],o=n[4],s=n[5];let{selectItem:l,highlightIndex:u,items:d,highlightedIndex:f,activeCategoryId:p,isSearchMode:m,popoverId:h}=FA(),g;n[6]!==i||n[7]!==l?(g=()=>{l(i)},n[6]=i,n[7]=l,n[8]=g):g=n[8];let _=g,v;if(n[9]!==r||n[10]!==i.id||n[11]!==d){var y;v=(y=r)==null?d.findIndex(e=>e.id===i.id):y,n[9]=r,n[10]=i.id,n[11]=d,n[12]=v}else v=n[12];let b=v,x=(m||p!==null)&&b===f,S;n[13]!==u||n[14]!==b?(S=()=>{u(b)},n[13]=u,n[14]=b,n[15]=S):S=n[15];let C=S,w=`${h}-option-${i.id}`,T=x?``:void 0,E;n[16]!==_||n[17]!==a?(E=Bb(a,_),n[16]=_,n[17]=a,n[18]=E):E=n[18];let D;n[19]!==C||n[20]!==o?(D=Bb(o,C),n[19]=C,n[20]=o,n[21]=D):D=n[21];let O;return n[22]!==t||n[23]!==x||n[24]!==s||n[25]!==w||n[26]!==T||n[27]!==E||n[28]!==D?(O=(0,X.jsx)(VO.button,A(A({type:`button`,role:`option`,id:w,"aria-selected":x,"data-highlighted":T},s),{},{ref:t,onClick:E,onMouseMove:D})),n[22]=t,n[23]=x,n[24]=s,n[25]=w,n[26]=T,n[27]=E,n[28]=D,n[29]=O):O=n[29],O});dM.displayName=`ComposerPrimitive.TriggerPopoverItem`,j();var fM=[`onClick`],pM=Mn((e,t)=>{let n=J(10),r,i;if(n[0]!==e){var a=e;({onClick:r}=a),i=G(a,fM),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let{activeCategoryId:o,isSearchMode:s,goBack:c,open:l}=FA();if(!l||!o||s)return null;let u;n[3]!==c||n[4]!==r?(u=Bb(r,c),n[3]=c,n[4]=r,n[5]=u):u=n[5];let d;return n[6]!==t||n[7]!==i||n[8]!==u?(d=(0,X.jsx)(VO.button,A(A({type:`button`},i),{},{ref:t,onClick:u})),n[6]=t,n[7]=i,n[8]=u,n[9]=d):d=n[9],d});pM.displayName=`ComposerPrimitive.TriggerPopoverBack`,j();var mM=e=>{let t=J(8),{formatter:n,onExecute:r,removeOnExecute:i}=e,{register:a}=RA(),o=K(r),s,c;t[0]===r?(s=t[1],c=t[2]):(s=()=>{o.current=r},c=[r],t[0]=r,t[1]=s,t[2]=c),kn(s,c);let l,u;return t[3]!==n||t[4]!==a||t[5]!==i?(l=()=>{let e=A({kind:`action`,formatter:n==null?ee:n,onExecute:e=>o.current(e)},i===void 0?{}:{removeOnExecute:i});return a(e)},u=[a,n,i],t[3]=n,t[4]=a,t[5]=i,t[6]=l,t[7]=u):(l=t[6],u=t[7]),q(l,u),null};mM.displayName=`ComposerPrimitive.TriggerPopoverAction`;var hM=e=>{let t=J(7),{formatter:n,onInserted:r}=e,{register:i}=RA(),a=K(r),o,s;t[0]===r?(o=t[1],s=t[2]):(o=()=>{a.current=r},s=[r],t[0]=r,t[1]=o,t[2]=s),kn(o,s);let c,l;return t[3]!==n||t[4]!==i?(c=()=>i({kind:`directive`,formatter:n==null?ee:n,onInserted:e=>{var t;return(t=a.current)==null?void 0:t.call(a,e)}}),l=[i,n],t[3]=n,t[4]=i,t[5]=c,t[6]=l):(c=t[5],l=t[6]),q(c,l),null};hM.displayName=`ComposerPrimitive.TriggerPopoverDirective`;var gM=Object.assign(zA,{Directive:hM,Action:mM}),_M=pO({AddAttachment:()=>Hj,AttachmentByIndex:()=>H_,AttachmentDropzone:()=>Wj,Attachments:()=>W_,Cancel:()=>Vj,Dictate:()=>Gj,DictationTranscript:()=>Yj,If:()=>cv,Input:()=>zj,Queue:()=>K_,Quote:()=>$j,QuoteDismiss:()=>tM,QuoteText:()=>eM,Resume:()=>Bj,Root:()=>XA,Send:()=>HA,StopDictation:()=>Kj,TriggerPopover:()=>gM,TriggerPopoverBack:()=>pM,TriggerPopoverCategories:()=>oM,TriggerPopoverCategoryItem:()=>sM,TriggerPopoverItem:()=>dM,TriggerPopoverItems:()=>uM,TriggerPopoverRoot:()=>xA,Unstable_TriggerPopover:()=>gM,Unstable_TriggerPopoverBack:()=>pM,Unstable_TriggerPopoverCategories:()=>oM,Unstable_TriggerPopoverCategoryItem:()=>sM,Unstable_TriggerPopoverItem:()=>dM,Unstable_TriggerPopoverItems:()=>uM,Unstable_TriggerPopoverRoot:()=>xA,unstable_useTriggerPopoverRootContext:()=>lA,unstable_useTriggerPopoverRootContextOptional:()=>uA,unstable_useTriggerPopoverScopeContext:()=>FA,unstable_useTriggerPopoverScopeContextOptional:()=>IA,unstable_useTriggerPopoverTriggers:()=>fA,unstable_useTriggerPopoverTriggersOptional:()=>gA}),vM=Object.freeze({type:`complete`}),yM=Object.freeze({type:`text`,text:``,status:vM}),bM=()=>Y(xM);function xM(e){return e.part.type!==`text`&&e.part.type!==`reasoning`?yM:e.part}j();var SM=Hn(null),CM=e=>({useSmoothStatus:by(()=>e)}),wM=e=>{let t=J(6),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={optional:!0},t[0]=r):r=t[0];let i=EM(r),a=Xa(),o;t[1]===a.part?o=t[2]:(o=()=>CM(a.part.getState().status),t[1]=a.part,t[2]=o);let[s]=xn(o);if(i)return n;let c;return t[3]!==n||t[4]!==s?(c=(0,X.jsx)(SM.Provider,{value:s,children:n}),t[3]=n,t[4]=s,t[5]=c):c=t[5],c},TM=e=>{let t=Mn((t,n)=>{let r=J(3),i=t,a;return r[0]!==n||r[1]!==i?(a=(0,X.jsx)(wM,{children:(0,X.jsx)(e,A(A({},i),{},{ref:n}))}),r[0]=n,r[1]=i,r[2]=a):a=r[2],a});return t.displayName=e.displayName,t};function EM(e){let t=Wn(SM);if(!(e!=null&&e.optional)&&!t)throw Error(`This component must be used within a SmoothContextProvider.`);return t}var{useSmoothStatus:DM,useSmoothStatusStore:OM}=oy(EM,`useSmoothStatus`);E(),j();var kM=250,AM=5,jM=class{constructor(e,t){T(this,`animationFrameId`,null),T(this,`lastUpdateTime`,0),T(this,`lastCommitTime`,-1/0),T(this,`targetText`,``),T(this,`drainMs`,kM),T(this,`maxCharIntervalMs`,AM),T(this,`maxCharsPerFrame`,1/0),T(this,`minCommitMs`,0),T(this,`currentText`,void 0),T(this,`setText`,void 0),T(this,`animate`,()=>{let e=performance.now(),t=e-this.lastUpdateTime,n=this.targetText.length-this.currentText.length,r=Math.min(this.maxCharIntervalMs,this.drainMs/n),i=Math.min(n,this.maxCharsPerFrame),a=0;for(;t>=r&&a<i;)a++,t-=r;a===i&&i===this.maxCharsPerFrame&&(t=0),this.animationFrameId=a===n?null:requestAnimationFrame(this.animate),a!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+a),this.lastUpdateTime=e-t,(a===n||e-this.lastCommitTime>=this.minCommitMs)&&(this.lastCommitTime=e,this.setText(this.currentText)))}),this.currentText=e,this.setText=t}start(){this.animationFrameId===null&&(this.lastUpdateTime=performance.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}},MM=Object.freeze({type:`running`}),NM=(e,t)=>e!==void 0&&e>0?e:t,PM=(e,t=!1)=>{let{text:n}=e,r=rj(`(prefers-reduced-motion: reduce)`),i=typeof t==`object`&&t?t:void 0,a=t!==!1&&t!==null&&!r,o=NM(i==null?void 0:i.drainMs,kM),s=NM(i==null?void 0:i.maxCharIntervalMs,AM),c=NM(i==null?void 0:i.maxCharsPerFrame,1/0),l=NM(i==null?void 0:i.minCommitMs,0),[u,d]=xn(e.status.type===`running`?``:n),f=Xa(),p=Y(()=>f.part),[m,h]=xn(p);p===m&&n.startsWith(u)||(h(p),d(e.status.type===`running`?``:n));let g=OM({optional:!0}),_=Jb(t=>{if(d(t),g){let n=u!==t||e.status.type===`running`?MM:e.status;Ty(g).setState(n,!0)}});q(()=>{if(g){let t=a&&(u!==n||e.status.type===`running`)?MM:e.status;Ty(g).setState(t,!0)}},[g,a,n,u,e.status]);let[v]=xn(()=>new jM(u,_)),[y,b]=xn(a);a!==y&&(b(a),a&&p===m&&n.startsWith(v.currentText)&&d(v.currentText)),q(()=>{v.drainMs=o,v.maxCharIntervalMs=s,v.maxCharsPerFrame=c,v.minCommitMs=l},[v,o,s,c,l]);let x=K(p);return q(()=>{let t=x.current!==p;if(x.current=p,!a)v.stop(),v.currentText=n,v.targetText=n,v.lastCommitTime=-1/0;else if(t||!n.startsWith(v.targetText))e.status.type===`running`?(v.currentText=``,v.targetText=n,v.lastCommitTime=-1/0,v.start()):(v.currentText=n,v.targetText=n,v.stop(),_(n));else if(v.targetText=n,e.status.type!==`running`){if(v.currentText===``){v.currentText=n,v.stop(),_(n);return}v.start()}else v.start()},[v,a,n,e.status.type,p,_]),q(()=>()=>{v.stop()},[v]),Cn(()=>a?A(A({},e),{},{text:u,status:n===u?e.status:MM}):e,[a,u,e,n])},FM=Object.freeze({type:`complete`}),IM=Object.freeze({type:`image`,image:``,status:FM}),LM=()=>Y(RM);function RM(e){return e.part.type===`image`?e.part:IM}j();var zM=[`smooth`,`component`,`render`],BM=Mn((e,t)=>{let{smooth:n=!0,component:r=VO.span,render:i}=e,a=G(e,zM),{text:o,status:s}=PM(bM(),n),c=A(A({"data-status":s.type},a),{},{ref:t});return i&&Ln(i)?RO(i,o,c):(0,X.jsx)(r,A(A({},c),{},{children:o}))});BM.displayName=`MessagePartPrimitive.Text`,j();var VM=Mn((e,t)=>{let n=J(4),{image:r}=LM(),i;return n[0]!==t||n[1]!==r||n[2]!==e?(i=(0,X.jsx)(VO.img,A(A({src:r},e),{},{ref:t})),n[0]=t,n[1]=r,n[2]=e,n[3]=i):i=n[3],i});VM.displayName=`MessagePartPrimitive.Image`,j();var HM=Mn((e,t)=>{let n=J(3),r;return n[0]!==t||n[1]!==e?(r=(0,X.jsx)(VO.div,A(A({role:`alert`},e),{},{ref:t})),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});HM.displayName=`ErrorPrimitive.Root`,j();var UM=[`children`],WM=Mn((e,t)=>{var n;let r=J(7),i,a;if(r[0]!==e){var o=e;({children:i}=o),a=G(o,UM),r[0]=e,r[1]=i,r[2]=a}else i=r[1],a=r[2];let s=ny();if(s===void 0)return null;let c=(n=i)==null?String(s):n,l;return r[3]!==t||r[4]!==a||r[5]!==c?(l=(0,X.jsx)(VO.span,A(A({},a),{},{ref:t,children:c})),r[3]=t,r[4]=a,r[5]=c,r[6]=l):l=r[6],l});WM.displayName=`ErrorPrimitive.Message`;var GM=pO({Message:()=>WM,Root:()=>HM}),KM=e=>{let t=J(2),n=K(void 0),r;return t[0]===e?r=t[1]:(r=t=>{n.current&&(n.current(),n.current=void 0),t&&(n.current=e(t))},t[0]=e,t[1]=r),r},qM=(e,t)=>{let n=e.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!n)return 1/0;let r=Number(n[1]),i=n[2];return i===`px`?r:i===`em`?r*(parseFloat(getComputedStyle(t).fontSize)||16):i===`rem`?r*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):1/0},JM=e=>e.dataset.messageId,YM=()=>{let e=document.createElement(`div`);return e.dataset.auiTopAnchorReserve=``,e.style.height=`0px`,e.style.flexShrink=`0`,e.style.pointerEvents=`none`,e.setAttribute(`aria-hidden`,`true`),e},XM=(e,t)=>{let n=`${t}px`;return e.style.height!==n&&(e.style.height=n,!0)},ZM=e=>{let t=window.devicePixelRatio||1;return Math.round(e*t)/t};j();var QM=[`forwardedRef`],$M=[`forwardedRef`,`threadViewportStore`],eN=()=>{let e=J(4),t=Xa(),n;e[0]===t.message?n=e[1]:(n=()=>t.message,e[0]=t.message,e[1]=n);let r=Y(n),i;return e[2]===r?i=e[3]:(i=e=>{let t=!0,n=()=>{r.setIsHovering(!0)},i=()=>{r.setIsHovering(!1)};return e.addEventListener(`mouseenter`,n),e.addEventListener(`mouseleave`,i),e.matches(`:hover`)&&queueMicrotask(()=>{t&&r.setIsHovering(!0)}),()=>{t=!1,e.removeEventListener(`mouseenter`,n),e.removeEventListener(`mouseleave`,i),r.setIsHovering(!1)}},e[2]=r,e[3]=i),KM(i)},tN=()=>{let e=J(2),t=cy(cN),n;return e[0]===t?n=e[1]:(n=e=>{var n;return e.message.role===`user`&&e.message.index>0&&e.message.index===e.thread.messages.length-2&&((n=e.thread.messages.at(-1))==null?void 0:n.role)===`assistant`&&(e.message.id===t||e.thread.isRunning)},e[0]=t,e[1]=n),Y(n)},nN=()=>{let e=J(2),t=cy(lN),n;return e[0]===t?n=e[1]:(n=e=>{var n;return e.message.isLast&&e.message.role===`assistant`&&e.message.index>=1&&((n=e.thread.messages.at(e.message.index-1))==null?void 0:n.role)===`user`&&(e.message.id===t||e.thread.isRunning)},e[0]=t,e[1]=n),Y(n)},rN=(e,t)=>{let n=J(3),r;return n[0]!==e||n[1]!==t?(r=n=>{if(e)return t.getState().registerAnchorElement(n)},n[0]=e,n[1]=t,n[2]=r):r=n[2],KM(r)},iN=e=>{let t=J(3),{active:n,threadViewportStore:r}=e,i;return t[0]!==n||t[1]!==r?(i=e=>{if(!n)return;let t=r.getState(),i=t.topAnchorMessageClamp;return t.registerAnchorTargetElement(e,{tallerThan:qM(i.tallerThan,e),visibleHeight:qM(i.visibleHeight,e)})},t[0]=n,t[1]=r,t[2]=i):i=t[2],KM(i)},aN=e=>{let t=J(7),n,r;if(t[0]!==e){var i=e;({forwardedRef:n}=i),r=G(i,QM),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];let a=eN(),o=Ry(n,a),s=Y(uN),c;return t[3]!==s||t[4]!==r||t[5]!==o?(c=(0,X.jsx)(VO.div,A(A({},r),{},{ref:o,"data-message-id":s})),t[3]=s,t[4]=r,t[5]=o,t[6]=c):c=t[6],c},oN=e=>{let t=J(13),n,r,i;if(t[0]!==e){var a=e;({forwardedRef:n,threadViewportStore:i}=a),r=G(a,$M),t[0]=e,t[1]=n,t[2]=r,t[3]=i}else n=t[1],r=t[2],i=t[3];let o=eN(),s=tN(),c=nN(),l=rN(s,i),u;t[4]!==c||t[5]!==i?(u={active:c,threadViewportStore:i},t[4]=c,t[5]=i,t[6]=u):u=t[6];let d=iN(u),f=Ry(n,o,l,d),p=Y(dN),m=s?``:void 0,h=c?``:void 0,g;return t[7]!==p||t[8]!==r||t[9]!==f||t[10]!==m||t[11]!==h?(g=(0,X.jsx)(VO.div,A(A({},r),{},{ref:f,"data-message-id":p,"data-aui-top-anchor-user":m,"data-aui-top-anchor-target":h})),t[7]=p,t[8]=r,t[9]=f,t[10]=m,t[11]=h,t[12]=g):g=t[12],g},sN=Mn((e,t)=>{let n=J(7),r=ly();if(r.getState().turnAnchor===`top`){let i;return n[0]!==t||n[1]!==e||n[2]!==r?(i=(0,X.jsx)(oN,A(A({},e),{},{forwardedRef:t,threadViewportStore:r})),n[0]=t,n[1]=e,n[2]=r,n[3]=i):i=n[3],i}let i;return n[4]!==t||n[5]!==e?(i=(0,X.jsx)(aN,A(A({},e),{},{forwardedRef:t})),n[4]=t,n[5]=e,n[6]=i):i=n[6],i});sN.displayName=`MessagePrimitive.Root`;function cN(e){var t;return(t=e.topAnchorTurn)==null?void 0:t.anchorId}function lN(e){var t;return(t=e.topAnchorTurn)==null?void 0:t.targetId}function uN(e){return e.message.id}function dN(e){return e.message.id}j();var fN=[`components`],pN=A(A({},zg),{},{Text:()=>(0,X.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,X.jsx)(BM,{}),(0,X.jsx)(X_,{children:(0,X.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Image:()=>(0,X.jsx)(VM,{})}),mN=e=>{let t=J(10);if(`children`in e){let n;return t[0]===e.children?n=t[1]:(n=(0,X.jsx)(t_,{children:e.children}),t[0]=e.children,t[1]=n),n}let n,r;if(t[2]!==e){var i=e;({components:n}=i),r=G(i,fN),t[2]=e,t[3]=n,t[4]=r}else n=t[3],r=t[4];let a;if(t[5]!==n){var o,s;a=n?A(A({},n),{},{Text:(o=n.Text)==null?pN.Text:o,Image:(s=n.Image)==null?pN.Image:s}):pN,t[5]=n,t[6]=a}else a=t[6];let c=a,l;return t[7]!==r||t[8]!==c?(l=(0,X.jsx)(t_,A({components:c},r)),t[7]=r,t[8]=c,t[9]=l):l=t[9],l};mN.displayName=`MessagePrimitive.Parts`;var hN=[`children`],gN=e=>{let t=J(12),n;return t[0]!==e.assistant||t[1]!==e.copied||t[2]!==e.hasAttachments||t[3]!==e.hasBranches||t[4]!==e.hasContent||t[5]!==e.last||t[6]!==e.lastOrHover||t[7]!==e.speaking||t[8]!==e.submittedFeedback||t[9]!==e.system||t[10]!==e.user?(n=t=>{var n,r;let{role:i,attachments:a,parts:o,branchCount:s,isLast:c,speech:l,isCopied:u,isHovering:d}=t.message;return!(e.hasBranches===!0&&s<2||e.user===!0&&i!==`user`||e.user===!1&&i===`user`||e.assistant===!0&&i!==`assistant`||e.assistant===!1&&i===`assistant`||e.system===!0&&i!==`system`||e.system===!1&&i===`system`||e.lastOrHover===!0&&!d&&!c||e.last!==void 0&&e.last!==c||e.copied===!0&&!u||e.copied===!1&&u||e.speaking===!0&&l==null||e.speaking===!1&&l!=null||e.hasAttachments===!0&&(i!==`user`||!(a!=null&&a.length))||e.hasAttachments===!1&&i===`user`&&a!=null&&a.length||e.hasContent===!0&&o.length===0||e.hasContent===!1&&o.length>0||e.submittedFeedback!==void 0&&((n=(r=t.message.metadata.submittedFeedback)==null?void 0:r.type)==null?null:n)!==e.submittedFeedback)},t[0]=e.assistant,t[1]=e.copied,t[2]=e.hasAttachments,t[3]=e.hasBranches,t[4]=e.hasContent,t[5]=e.last,t[6]=e.lastOrHover,t[7]=e.speaking,t[8]=e.submittedFeedback,t[9]=e.system,t[10]=e.user,t[11]=n):n=t[11],Y(n)},_N=e=>{let t=J(3),n,r;if(t[0]!==e){var i=e;({children:n}=i),r=G(i,hN),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];return gN(r)?n:null};_N.displayName=`MessagePrimitive.If`;var vN=e=>{let{children:t}=e;return ny()===void 0?null:t};vN.displayName=`MessagePrimitive.Error`,j();var yN=[`components`],bN=e=>{let t=new Map;for(let a=0;a<e.length;a++){var n,r,i;let o=(n=(r=e[a])==null?void 0:r.parentId)==null?a:n,s=(i=t.get(o))==null?[]:i;s.push(a),t.set(o,s)}let a=[];for(let[e,n]of t){let t=typeof e==`string`?e:void 0;a.push({groupKey:t,indices:n})}return a},xN=e=>{let t=J(9),n=Y(kN),r;bb0:{if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],r=e;break bb0}let i;t[1]!==e||t[2]!==n?(i=e(n),t[1]=e,t[2]=n,t[3]=i):i=t[3],r=i}let i=r,a;t[4]===n?a=t[5]:(a=hu(n),t[4]=n,t[5]=a);let o;return t[6]!==i||t[7]!==a?(o={groups:i,partKeys:a},t[6]=i,t[7]=a,t[8]=o):o=t[8],o},SN={Text:()=>(0,X.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,X.jsx)(BM,{}),(0,X.jsx)(X_,{children:(0,X.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>(0,X.jsx)(VM,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:e})=>e},CN=Nn(e=>{let t=J(5),{partIndex:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,X.jsx)(Bg,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,X.jsx)(Zd,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>{var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_;return e.partIndex===t.partIndex&&((n=e.components)==null?void 0:n.Text)===((r=t.components)==null?void 0:r.Text)&&((i=e.components)==null?void 0:i.Reasoning)===((a=t.components)==null?void 0:a.Reasoning)&&((o=e.components)==null?void 0:o.Source)===((s=t.components)==null?void 0:s.Source)&&((c=e.components)==null?void 0:c.Image)===((l=t.components)==null?void 0:l.Image)&&((u=e.components)==null?void 0:u.File)===((d=t.components)==null?void 0:d.File)&&((f=e.components)==null?void 0:f.Unstable_Audio)===((p=t.components)==null?void 0:p.Unstable_Audio)&&((m=e.components)==null?void 0:m.tools)===((h=t.components)==null?void 0:h.tools)&&((g=e.components)==null?void 0:g.data)===((_=t.components)==null?void 0:_.data)}),wN=e=>{let t=J(6),{status:n,component:r}=e,i=n.type===`running`,a;t[0]!==r||t[1]!==n?(a=(0,X.jsx)(r,{type:`text`,text:``,status:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,X.jsx)($d,{text:``,isRunning:i,children:a}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o},TN=Object.freeze({type:`complete`}),EN=Nn(e=>{var t;let n=J(6),{components:r}=e,i=Y(AN);if(r!=null&&r.Empty){let e;return n[0]!==r.Empty||n[1]!==i?(e=(0,X.jsx)(r.Empty,{status:i}),n[0]=r.Empty,n[1]=i,n[2]=e):e=n[2],e}let a=(t=r==null?void 0:r.Text)==null?SN.Text:t,o;return n[3]!==i||n[4]!==a?(o=(0,X.jsx)(wN,{status:i,component:a}),n[3]=i,n[4]=a,n[5]=o):o=n[5],o},(e,t)=>{var n,r,i,a;return((n=e.components)==null?void 0:n.Empty)===((r=t.components)==null?void 0:r.Empty)&&((i=e.components)==null?void 0:i.Text)===((a=t.components)==null?void 0:a.Text)}),DN=e=>{let t=J(21),{groupingFunction:n,components:r}=e,i=Y(jN),{groups:a,partKeys:o}=xN(n),s;bb0:{var c,l,u,d,f,p;if(i===0){let e;t[0]===r?e=t[1]:(e=(0,X.jsx)(EN,{components:r}),t[0]=r,t[1]=e),s=e;break bb0}let e=(c=r==null?void 0:r.Text)==null?SN.Text:c,n=(l=r==null?void 0:r.Reasoning)==null?SN.Reasoning:l,m=(u=r==null?void 0:r.Image)==null?SN.Image:u,h=(d=r==null?void 0:r.Source)==null?SN.Source:d,g=(f=r==null?void 0:r.File)==null?SN.File:f,_=(p=r==null?void 0:r.Unstable_Audio)==null?SN.Unstable_Audio:p,v;t[2]!==r||t[3]!==e||t[4]!==n||t[5]!==m||t[6]!==h||t[7]!==g||t[8]!==_?(v=A(A({},r),{},{Text:e,Reasoning:n,Image:m,Source:h,File:g,Unstable_Audio:_}),t[2]=r,t[3]=e,t[4]=n,t[5]=m,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let y=v,b;if(t[10]!==(r==null?void 0:r.Group)||t[11]!==y||t[12]!==a||t[13]!==o){let e;t[15]!==(r==null?void 0:r.Group)||t[16]!==y||t[17]!==o?(e=(e,t)=>{var n,i;let a=(n=r==null?void 0:r.Group)==null?SN.Group:n,s=o[e.indices[0]];return(0,X.jsx)(a,{groupKey:e.groupKey,indices:e.indices,children:e.indices.map(e=>(0,X.jsx)(CN,{partIndex:e,components:y},o[e]))},JSON.stringify([`group`,(i=e.groupKey)==null?null:i,s!=null&&s.includes(`:`)?`id:${s}`:t]))},t[15]=r==null?void 0:r.Group,t[16]=y,t[17]=o,t[18]=e):e=t[18],b=a.map(e),t[10]=r==null?void 0:r.Group,t[11]=y,t[12]=a,t[13]=o,t[14]=b}else b=t[14];s=b}let m=s,h;return t[19]===m?h=t[20]:(h=(0,X.jsx)(X.Fragment,{children:m}),t[19]=m,t[20]=h),h};DN.displayName=`MessagePrimitive.Unstable_PartsGrouped`;var ON=e=>{let t=J(6),n,r;if(t[0]!==e){var i=e;({components:n}=i),r=G(i,yN),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];let a;return t[3]!==n||t[4]!==r?(a=(0,X.jsx)(DN,A(A({},r),{},{components:n,groupingFunction:bN})),t[3]=n,t[4]=r,t[5]=a):a=t[5],a};ON.displayName=`MessagePrimitive.Unstable_PartsGroupedByParentId`;function kN(e){return e.message.parts}function AN(e){var t;return(t=e.message.status)==null?TN:t}function jN(e){return e.message.parts.length}var MN=pO({AttachmentByIndex:()=>I_,Attachments:()=>R_,Content:()=>mN,Error:()=>vN,GenerativeUI:()=>Og,GroupedParts:()=>w_,If:()=>_N,PartByIndex:()=>Vg,Parts:()=>mN,Quote:()=>N_,Root:()=>sN,Unstable_PartsGrouped:()=>DN,Unstable_PartsGroupedByParentId:()=>ON}),NN=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:r=!0})=>{let i=Xa(),a=K(null),o=Y(e=>e.thread.messages.length>0),s=Y(e=>{var t;return(t=e.thread.messages[0])==null?void 0:t.id}),c=Y(e=>{var t;return(t=e.optional.threadListItem)==null?void 0:t.id}),l=Y(e=>e.thread.isRunning),u=ly(),d=Cy(u),{controller:f}=d;kn(()=>{d.getOptions=()=>{let i=u.getState();return{autoScroll:e==null?i.turnAnchor!==`top`:e,holdFollow:l&&i.turnAnchor===`top`&&i.element.viewport===a.current&&i.element.anchor!==null,scrollToBottomOnInitialize:n,scrollToBottomOnRunStart:t&&i.turnAnchor!==`top`,scrollToBottomOnThreadSwitch:r}}});let p=K({threadId:c,firstMessageId:s});return Ay(()=>{let e=p.current;if(p.current={threadId:c,firstMessageId:s},e.threadId!==c)return;let t=e.firstMessageId;t!==void 0&&t!==s&&i.thread.getState().messages.some((e,n)=>n>0&&e.id===t)&&f.messagesPrepended(t)},[i,f,s,c]),Ay(()=>{f.setHasMessages(o)},[f,o,n]),$A(({behavior:e})=>f.scrollToBottom(e)),Id(`thread.runStart`,()=>f.runStarted()),q(()=>{if(i.optional.threads)return i.on(`threads.selectionChanged`,()=>f.threadSwitched())},[i,f]),KM(wn(e=>{a.current=e;let t=f.attach(e);return()=>{t(),a.current=null}},[f]))};j();var PN=new WeakMap,FN=Mn((e,t)=>{let n=J(9),r=Xa(),i=K(null),a=Ry(t,i),o;n[0]===e?o=n[1]:(o=t=>{var n;t.key===`Escape`&&i.current&&PN.set(t.nativeEvent,i.current),(n=e.onKeyDown)==null||n.call(e,t)},n[0]=e,n[1]=o);let s=o,c,l;n[2]===r?(c=n[3],l=n[4]):(c=()=>{let e=e=>{var t;if(e.key!==`Escape`||ij(e)||e.defaultPrevented||r.thread.source===null)return;let n=(t=PN.get(e))==null?e.composedPath().find(IN):t;if(!(n&&n!==i.current)&&r.thread.getState().speech!=null){e.preventDefault();try{r.thread.stopSpeaking()}catch(e){let t=e;if(!(t instanceof Error)||t.message!==`No message is being spoken`)throw t}}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},l=[r],n[2]=r,n[3]=c,n[4]=l),q(c,l);let u;return n[5]!==a||n[6]!==s||n[7]!==e?(u=(0,X.jsx)(aj.Provider,{value:i,children:(0,X.jsx)(VO.div,A(A({},e),{},{"data-aui-thread-root":``,ref:a,onKeyDown:s}))}),n[5]=a,n[6]=s,n[7]=e,n[8]=u):u=n[8],u});FN.displayName=`ThreadPrimitive.Root`;function IN(e){return e instanceof Element&&e.hasAttribute(`data-aui-thread-root`)}var LN=e=>{let{children:t}=e;return Y(RN)?t:null};LN.displayName=`ThreadPrimitive.Empty`;function RN(e){return e.thread.isEmpty}var zN=[`children`],BN=e=>{let t=J(4),n;return t[0]!==e.disabled||t[1]!==e.empty||t[2]!==e.running?(n=t=>!(e.empty===!0&&!t.thread.isEmpty||e.empty===!1&&t.thread.isEmpty||e.running===!0&&!t.thread.isRunning||e.running===!1&&t.thread.isRunning||e.disabled===!0&&!t.thread.isDisabled||e.disabled===!1&&t.thread.isDisabled),t[0]=e.disabled,t[1]=e.empty,t[2]=e.running,t[3]=n):n=t[3],Y(n)},VN=e=>{let t=J(3),n,r;if(t[0]!==e){var i=e;({children:n}=i),r=G(i,zN),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];return BN(r)?n:null};VN.displayName=`ThreadPrimitive.If`;var HN=(e,t)=>{let n=J(3),r;return n[0]!==t||n[1]!==e?(r=n=>{if(!e)return;let r=e(),i=()=>{let e=t?t(n):n.offsetHeight;r.setHeight(e)},a=new ResizeObserver(i);return a.observe(n),i(),()=>{a.disconnect(),r.unregister()}},n[0]=t,n[1]=e,n[2]=r):r=n[2],KM(r)};j();var UN=[`scrollHeight`],WN=[`viewport`,`reserve`],GN=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},KN=(e,t)=>{let n=0,r=e;for(;r&&r!==t;)n+=r.offsetTop,r=r.offsetParent;return r===t?n:GN(e)-GN(t)},qN=({viewport:e,anchor:t,tallerThan:n,visibleHeight:r})=>{let i=KN(t,e),a=t.offsetHeight;return i+Math.max(0,a-(a<=n?a:r))},JN=e=>{let{scrollHeight:t}=e,n=G(e,UN),{viewport:r}=n,i=qN(n)+r.clientHeight;return Math.max(0,i-t)},YN=e=>{let{viewport:t,reserve:n}=e,r=G(e,WN);return JN(A(A({viewport:t},r),{},{scrollHeight:t.scrollHeight-n.offsetHeight}))},XN=e=>{let t=new ResizeObserver(e),n=new MutationObserver(e),r=null,i=null,a=null,o=()=>{t.disconnect(),n.disconnect(),r=null,i=null,a=null};return{target:(e,s,c)=>{(r!==e||i!==s||a!==c)&&(o(),t.observe(e),t.observe(s),t.observe(c),n.observe(c,{childList:!0,subtree:!0,characterData:!0}),r=e,i=s,a=c)},disconnect:o}};j();var ZN=e=>{let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},cancel:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}},QN=e=>{let t=null,n,r=null,i=0,a=null,o=!1,s=null,c=()=>{a=null,s=null},l=()=>s!==null&&Math.abs(i-s)<=1,u=()=>{let e=r;if(!e)return;let t=e.scrollTop,n=Math.max(0,e.scrollHeight-e.clientHeight);t<i&&i>n+1&&Math.abs(t-n)<=1&&l()&&!o&&(a!=null||(a=i),p.schedule()),i=t},d=e=>{r!==e&&(r&&r.removeEventListener(`scroll`,u),r=e,o=!1,c(),e&&(e.addEventListener(`scroll`,u,{passive:!0}),i=e.scrollTop))};function f(){let r=e.getState(),{viewport:i,anchor:l,target:u}=r.element,f=r.targetConfig;if(d(r.turnAnchor===`top`?i:null),r.turnAnchor!==`top`||!i){m.disconnect(),c(),t&&(XM(t,0),t.remove());return}if(!l&&!u&&!f&&r.topAnchorTurn){m.disconnect(),c(),t!=null&&t.parentElement&&t.parentElement.lastElementChild!==t&&t.parentElement.append(t);return}if(!l||!u||!f){m.disconnect(),c(),t&&(XM(t,0),t.remove());return}if(t!=null||(t=YM()),(t.parentElement!==u.parentElement||t.previousElementSibling!==u)&&u.after(t),m.target(i,l,u),XM(t,YN(A({viewport:i,anchor:l,reserve:t},f)))){p.schedule();return}let h=JM(l),g=ZM(qN(A({viewport:i,anchor:l},f)));if(h===void 0||h!==n)a=null,o=!1,Math.abs(i.scrollTop-g)>1&&i.scrollTo({top:g,behavior:`smooth`}),h!==void 0&&(n=h);else if(a!==null&&s!==null){let e=ZM(a+(g-s));a=null,o=!0,Math.abs(i.scrollTop-e)>1&&i.scrollTo({top:e,behavior:`instant`})}s=g}let p=ZN(f),m=XN(p.schedule);p.schedule();let h=e.subscribe(p.schedule);return()=>{p.cancel(),h(),m.disconnect(),d(null),t==null||t.remove()}},$N=e=>{let t=J(4),n=ly(),r,i;t[0]!==e||t[1]!==n?(r=()=>{if(e)return QN(n)},i=[e,n],t[0]=e,t[1]=n,t[2]=r,t[3]=i):(r=t[2],i=t[3]),Ay(r,i)},eP=(e,t)=>{var n;if(!e)return!1;let r=t.findIndex(t=>t.id===e.targetId);return r<1?!1:((n=t[r-1])==null?void 0:n.id)===e.anchorId&&t.slice(r+1).every(e=>e.role===`user`)},tP=({isRunning:e,messages:t})=>{if(!e)return null;let n=t.at(-1),r=t.at(-2);return(r==null?void 0:r.role)!==`user`||(n==null?void 0:n.role)!==`assistant`?null:{anchorId:r.id,targetId:n.id}},nP=e=>{var t;return(t=tP(e))==null?void 0:t.anchorId},rP=e=>{var t;return(t=tP(e))==null?void 0:t.targetId};j();var iP=[`autoScroll`,`scrollToBottomOnRunStart`,`scrollToBottomOnInitialize`,`scrollToBottomOnThreadSwitch`,`children`],aP=[`turnAnchor`,`topAnchorMessageClamp`],oP=()=>HN(cy(dP),fP),sP=()=>KM(cy(pP)),cP=e=>{let t=J(19),n=ly(),r;t[0]===e?r=t[1]:(r=t=>{if(e)return nP(t.thread)},t[0]=e,t[1]=r);let i=Y(r),a;t[2]===e?a=t[3]:(a=t=>{if(e)return rP(t.thread)},t[2]=e,t[3]=a);let o=Y(a),s=cy(mP),c;bb0:{if(!i||!o){c=null;break bb0}let e;t[4]!==i||t[5]!==o?(e={anchorId:i,targetId:o},t[4]=i,t[5]=o,t[6]=e):e=t[6],c=e}let l=c,u;t[7]!==e||t[8]!==s?(u=t=>e&&!!s&&eP(s,t.thread.messages),t[7]=e,t[8]=s,t[9]=u):u=t[9];let d=Y(u),f,p;t[10]!==n||t[11]!==s||t[12]!==d?(f=()=>{s&&!d&&n.getState().setTopAnchorTurn(null)},p=[n,s,d],t[10]=n,t[11]=s,t[12]=d,t[13]=f,t[14]=p):(f=t[13],p=t[14]),Ay(f,p);let m,h;t[15]!==l||t[16]!==n?(m=()=>{if(!l)return;let e=n.getState(),t=e.topAnchorTurn;((t==null?void 0:t.anchorId)!==l.anchorId||t.targetId!==l.targetId)&&e.setTopAnchorTurn(l)},h=[l,n],t[15]=l,t[16]=n,t[17]=m,t[18]=h):(m=t[17],h=t[18]),Ay(m,h)},lP=Mn((e,t)=>{let n=J(18),r,i,a,o,s,c;if(n[0]!==e){var l=e;({autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c,children:i}=l),a=G(l,iP),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c}else r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6];let u;n[7]!==r||n[8]!==o||n[9]!==s||n[10]!==c?(u={autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c},n[7]=r,n[8]=o,n[9]=s,n[10]=c,n[11]=u):u=n[11];let d=NN(u),f=oP(),p=sP(),m=ly(),h;n[12]===m?h=n[13]:(h=m.getState(),n[12]=m,n[13]=h);let g=h.turnAnchor===`top`;cP(g),$N(g);let _=Ry(t,d,f,p),v;return n[14]!==i||n[15]!==_||n[16]!==a?(v=(0,X.jsx)(VO.div,A(A({},a),{},{ref:_,children:i})),n[14]=i,n[15]=_,n[16]=a,n[17]=v):v=n[17],v});lP.displayName=`ThreadPrimitive.ViewportScrollable`;var uP=Mn((e,t)=>{let n=J(13),r,i,a;if(n[0]!==e){var o=e;({turnAnchor:a,topAnchorMessageClamp:i}=o),r=G(o,aP),n[0]=e,n[1]=r,n[2]=i,n[3]=a}else r=n[1],i=n[2],a=n[3];let s;n[4]!==i||n[5]!==a?(s={turnAnchor:a,topAnchorMessageClamp:i},n[4]=i,n[5]=a,n[6]=s):s=n[6];let c;n[7]!==r||n[8]!==t?(c=(0,X.jsx)(lP,A(A({},r),{},{ref:t})),n[7]=r,n[8]=t,n[9]=c):c=n[9];let l;return n[10]!==s||n[11]!==c?(l=(0,X.jsx)(Dy,{options:s,children:c}),n[10]=s,n[11]=c,n[12]=l):l=n[12],l});uP.displayName=`ThreadPrimitive.Viewport`;function dP(e){return e.registerViewport}function fP(e){return e.clientHeight}function pP(e){return e.registerViewportElement}function mP(e){return e.topAnchorTurn}j();var hP=Mn((e,t)=>{let n=J(3),r=Ry(t,HN(cy(gP),_P)),i;return n[0]!==e||n[1]!==r?(i=(0,X.jsx)(VO.div,A(A({},e),{},{ref:r})),n[0]=e,n[1]=r,n[2]=i):i=n[2],i});hP.displayName=`ThreadPrimitive.ViewportFooter`;function gP(e){return e.registerContentInset}function _P(e){let t=parseFloat(getComputedStyle(e).marginTop)||0;return e.offsetHeight+t}var vP=tk(`ThreadPrimitive.ScrollToBottom`,e=>{let t=J(5),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{behavior:r}=n,i=cy(yP),a=ly(),o;return t[2]!==r||t[3]!==a?(o=()=>{a.getState().scrollToBottom({behavior:r})},t[2]=r,t[3]=a,t[4]=o):o=t[4],i?null:o},[`behavior`]);function yP(e){return e.isAtBottom}var bP=tk(`ThreadPrimitive.LoadEarlier`,()=>{let e=J(2),t=Xa(),n=Y(xP),r;return e[0]===t.thread?r=e[1]:(r=()=>{t.thread.loadEarlier()},e[0]=t.thread,e[1]=r),n?r:null});function xP(e){return e.thread.hasEarlier}var SP=tk(`ThreadPrimitive.Suggestion`,e=>{var t;let n=J(4),{prompt:r,send:i,clearComposer:a,autoSend:o}=e,s=(t=i==null?o:i)!=null&&t,c;n[0]!==a||n[1]!==r||n[2]!==s?(c={prompt:r,send:s,clearComposer:a},n[0]=a,n[1]=r,n[2]=s,n[3]=c):c=n[3];let{disabled:l,trigger:u}=Jv(c);return l?null:u},[`prompt`,`send`,`clearComposer`,`autoSend`,`method`]),CP=pO({Empty:()=>LN,If:()=>VN,LoadEarlier:()=>bP,MessageByIndex:()=>pg,Messages:()=>_g,Root:()=>FN,Row:()=>j_,ScrollToBottom:()=>vP,Suggestion:()=>SP,SuggestionByIndex:()=>nv,Suggestions:()=>av,Unstable_MessageById:()=>mg,Viewport:()=>uP,ViewportFooter:()=>hP,ViewportProvider:()=>Dy});j();var wP=Mn((e,t)=>{var n;let r=J(4),i=Y(TP),a=(n=e.children)==null?i:n,o;return r[0]!==e||r[1]!==t||r[2]!==a?(o=(0,X.jsx)(VO.span,A(A({},e),{},{ref:t,children:a})),r[0]=e,r[1]=t,r[2]=a,r[3]=o):o=r[3],o});wP.displayName=`SuggestionPrimitive.Title`;function TP(e){return e.suggestion.title}j();var EP=Mn((e,t)=>{var n;let r=J(4),i=Y(DP),a=(n=e.children)==null?i:n,o;return r[0]!==e||r[1]!==t||r[2]!==a?(o=(0,X.jsx)(VO.span,A(A({},e),{},{ref:t,children:a})),r[0]=e,r[1]=t,r[2]=a,r[3]=o):o=r[3],o});EP.displayName=`SuggestionPrimitive.Description`;function DP(e){return e.suggestion.label}var OP=tk(`SuggestionPrimitive.Trigger`,e=>{let t=J(4),{send:n,clearComposer:r}=e,i=Y(kP),a;t[0]!==r||t[1]!==i||t[2]!==n?(a={prompt:i,send:n,clearComposer:r},t[0]=r,t[1]=i,t[2]=n,t[3]=a):a=t[3];let{trigger:o,disabled:s}=Jv(a);return s?null:o},[`send`,`clearComposer`]);function kP(e){return e.suggestion.prompt}var AP=pO({Description:()=>EP,Title:()=>wP,Trigger:()=>OP});j();var jP=[`onClick`,`disabled`],MP=Mn((e,t)=>{let n=J(15),r,i,a;if(n[0]!==e){var o=e;({onClick:i,disabled:r}=o),a=G(o,jP),n[0]=e,n[1]=r,n[2]=i,n[3]=a}else r=n[1],i=n[2],a=n[3];let s=Y(NP),{switchToNewThread:c}=ey(),l;n[4]===s?l=n[5]:(l=s?{"data-active":`true`,"aria-current":`true`}:null,n[4]=s,n[5]=l);let u;n[6]!==i||n[7]!==c?(u=Bb(i,c),n[6]=i,n[7]=c,n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==t||n[11]!==a||n[12]!==l||n[13]!==u?(d=(0,X.jsx)(VO.button,A(A(A({type:`button`},l),a),{},{ref:t,disabled:r,onClick:u})),n[9]=r,n[10]=t,n[11]=a,n[12]=l,n[13]=u,n[14]=d):d=n[14],d});MP.displayName=`ThreadListPrimitive.New`;function NP(e){return e.threads.newThreadId===e.threads.mainThreadId}var PP=tk(`ThreadListPrimitive.LoadMore`,()=>{let{loadMore:e,disabled:t}=ty();return t?null:e}),[FP,IP]=Tb(`ThreadList`),LP=FP,RP=Hn(null),zP=RP.Provider,BP=()=>Wn(RP);j();var VP=Mn((e,t)=>{let n=J(3),r;return n[0]!==e||n[1]!==t?(r=(0,X.jsx)(LP.Provider,{scope:void 0,children:(0,X.jsx)(LP.Slot,{scope:void 0,children:(0,X.jsx)(VO.div,A(A({},e),{},{ref:t}))})}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});VP.displayName=`ThreadListPrimitive.Root`;var HP=pO({ItemByIndex:()=>q_,Items:()=>Y_,LoadMore:()=>PP,New:()=>MP,Root:()=>VP});j();var UP=Mn((e,t)=>{let n=Y(e=>e.threads.mainThreadId===e.threadListItem.id),r=K(null),i=K(null),a=Cn(()=>({triggerRef:r,moreRef:i}),[]),o=IP(void 0),s=Ux();return(0,X.jsx)(zP,{value:a,children:(0,X.jsx)(VO.div,A(A(A({},n?{"data-active":`true`,"aria-current":`true`}:null),e),{},{onKeyDown:Bb(e.onKeyDown,e=>{if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=s===`rtl`?`ArrowLeft`:`ArrowRight`,n=s===`rtl`?`ArrowRight`:`ArrowLeft`,a=r.current,c=i.current;if(a&&e.target===a){if(e.key===`ArrowDown`||e.key===`ArrowUp`){let t=o().map(e=>e.ref.current).filter(e=>e!==null&&!e.disabled),n=t[t.indexOf(a)+(e.key===`ArrowDown`?1:-1)];n&&(n.focus(),e.preventDefault())}else e.key===t&&c&&(c.focus(),e.preventDefault())}else c&&e.target===c&&e.key===n&&(a==null||a.focus(),e.preventDefault())}),ref:t}))})});UP.displayName=`ThreadListItemPrimitive.Root`;var WP=tk(`ThreadListItemPrimitive.Archive`,()=>{let{archive:e}=Xv();return e}),GP=tk(`ThreadListItemPrimitive.Unarchive`,()=>{let{unarchive:e,disabled:t}=Qv();return t?null:e}),KP=tk(`ThreadListItemPrimitive.Delete`,()=>{let{delete:e}=Zv();return e});j();var qP=tk(`ThreadListItemPrimitive.Trigger`,()=>{let{switchTo:e}=$v();return e}),JP=Mn((e,t)=>{let n=J(3),r=BP(),i=Ry(t,r==null?void 0:r.triggerRef),a;return n[0]!==e||n[1]!==i?(a=(0,X.jsx)(LP.ItemSlot,{scope:void 0,children:(0,X.jsx)(qP,A(A({},e),{},{ref:i}))}),n[0]=e,n[1]=i,n[2]=a):a=n[2],a});JP.displayName=`ThreadListItemPrimitive.Trigger`;var YP=pO({Archive:()=>WP,Delete:()=>KP,Root:()=>UP,Title:()=>Q_,Trigger:()=>JP,Unarchive:()=>GP}),XP=e=>{let t=e;for(;t;){let{overflowY:e}=getComputedStyle(t);if(e===`scroll`||e===`auto`)return t;t=t.parentElement}return null},ZP=new WeakMap,QP=e=>{var t,n;let r=ZP.get(e);if(r)return r.count++,r;let i=e.scrollTop,a=e.style.scrollbarWidth,o=getComputedStyle(e),s=o.direction===`rtl`?`paddingLeft`:`paddingRight`,c=e.style[s],l=e.offsetWidth-e.clientWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.borderRightWidth),u=e.ownerDocument,d=(e===u.documentElement||e===u.body)&&l<=0?((t=(n=u.defaultView)==null?void 0:n.innerWidth)==null?0:t)-u.documentElement.clientWidth:l;e.style.scrollbarWidth=`none`,d>0&&(e.style[s]=`${parseFloat(o[s])+d}px`);let f=()=>{e.style.scrollbarWidth=a,e.style[s]=c},p=()=>e.scrollTop=i;e.addEventListener(`scroll`,p);let m={count:1,restore:()=>{e.removeEventListener(`scroll`,p),f()}};return ZP.set(e,m),m},$P=(e,t)=>{let n=J(5),r=K(null),i,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>()=>{var e;(e=r.current)==null||e.call(r)},a=[],n[0]=i,n[1]=a):(i=n[0],a=n[1]),q(i,a);let o;return n[2]!==e||n[3]!==t?(o=()=>{var n;(n=r.current)==null||n.call(r);let i=XP(e.current);if(!i){r.current=null;return}let a=QP(i),o=setTimeout(()=>{var e;return(e=r.current)==null?void 0:e.call(r)},t);r.current=()=>{clearTimeout(o),--a.count===0&&(a.restore(),ZP.delete(i)),r.current=null}},n[2]=e,n[3]=t,n[4]=o):o=n[4],o},eF=pO({AssistantRuntimeImpl:()=>op,BaseAssistantRuntimeCore:()=>sp,CompositeContextProvider:()=>Vo,DefaultThreadComposerRuntimeCore:()=>Op,MessageRepository:()=>kl,ThreadRuntimeImpl:()=>Bf,getAutoStatus:()=>Sl,splitLocalRuntimeOptions:()=>iy,useComposerInputPluginRegistryOptional:()=>rA,useSmooth:()=>PM,useSmoothStatus:()=>DM,withSmoothContextProvider:()=>TM});j();var tF=`http://localhost:3000/api/agent/chat`;function nF(e){let t=e.split(/\r?\n/);for(let e of t){if(!e.startsWith(`data:`))continue;let t=e.startsWith(`data: `)?e.slice(6):e.slice(5);if(t)try{return JSON.parse(t)}catch(e){return null}}return null}function rF(e){return iF.apply(this,arguments)}function iF(){return iF=ig(function*(e){let t=new TextDecoder,n=``;for(;;){let{done:r,value:i}=yield rg(e.read());if(r)break;n+=t.decode(i,{stream:!0});let a;for(;(a=n.search(/\r?\n\r?\n/))!==-1;){let e=n.match(/\r?\n\r?\n/);if(!e)break;let t=n.slice(0,a);n=n.slice(a+e[0].length);let r=nF(t);r&&(yield r)}}if(n+=t.decode(),n){let e=nF(n);e&&(yield e)}}),iF.apply(this,arguments)}function aF(e){return oF.apply(this,arguments)}function oF(){return oF=ig(function*({userMessage:e,abortSignal:t,token:n,getConversationId:r,onConversationCreated:i,onCustomEvent:a,onEvent:o}){let s={id:e.id,role:`user`,parts:e.content.filter(e=>e.type===`text`).map(e=>{var t;return{type:`text`,text:(t=e.text)==null?``:t}}),metadata:{files:[],sentAt:new Date().toISOString()}},c=r(),l=yield rg(fetch(tF,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`,Token:n},credentials:`include`,signal:t,body:JSON.stringify({message:s,conversationId:c||``})}));if(!l.ok){let e=yield rg(l.text());throw Error(`请求失败 (${l.status}): ${e}`)}if(!l.body)throw Error(`服务端没有返回数据流`);let u=l.body.getReader(),d=[],f=new Map,p=new Map,m=new Map,h=()=>[...d];try{var g=!1,_=!1,v;try{for(var y=ne(rF(u)),b;g=!(b=yield rg(y.next())).done;g=!1){let e=b.value;{if(t.aborted)return;let n=e.payload;switch(e.type){case`data-conversation-created`:{var x;let t=(x=e.data)==null?void 0:x.id;t&&i(t);break}case`text-delta`:{var S;let e=(S=n==null?void 0:n.id)==null?`default`:S,t=n==null?void 0:n.text;if(!t)break;let r=f.get(e);r===void 0&&(r=d.length,f.set(e,r),d.push({type:`text`,text:``}));let i=d[r];i.type===`text`&&(d[r]=A(A({},i),{},{text:i.text+t})),yield h();break}case`reasoning-start`:{var C;let e=(C=n==null?void 0:n.id)==null?`default`:C,t=Date.now(),r=d.length;p.set(e,r),m.set(e,t),d.push({type:`reasoning`,text:``,timing:{startedAt:t}}),yield h();break}case`reasoning-delta`:{var w;let e=(w=n==null?void 0:n.id)==null?`default`:w;if(!p.has(e)){let t=Date.now(),n=d.length;p.set(e,n),m.set(e,t),d.push({type:`reasoning`,text:``,timing:{startedAt:t}}),yield h()}break}case`reasoning-end`:{var T,E,D,O;let e=(T=n==null?void 0:n.id)==null?`default`:T,t=p.get(e);if(t===void 0)break;let r=d[t];if(r.type!==`reasoning`)break;let i=(E=(D=m.get(e))==null?(O=r.timing)==null?void 0:O.startedAt:D)==null?Date.now():E;d[t]=A(A({},r),{},{timing:{startedAt:i,completedAt:Date.now()}}),p.delete(e),m.delete(e),yield h();break}case`tool-call`:case`tool-result`:case`tool-error`:break;case`error`:var k;throw Error((k=n==null?void 0:n.error)==null?`AI 服务执行失败`:k);default:e.type.startsWith(`data-`)?a==null||a(e):o==null||o(e)}}}}catch(e){_=!0,v=e}finally{try{g&&y.return!=null&&(yield rg(y.return()))}finally{if(_)throw v}}}finally{try{yield rg(u.cancel())}catch(e){}finally{u.releaseLock()}}}),oF.apply(this,arguments)}j();var sF=`http://localhost:3000/api/conversations`,cF=new Map,lF=new Set,uF=`currentConversationId`;function dF(){return localStorage.getItem(uF)}function fF(e=``){localStorage.setItem(uF,e)}function pF(){localStorage.removeItem(uF)}function mF(e,t){cF.set(e,t)}var hF=``;function gF(e){hF=e}function _F(e){return vF.apply(this,arguments)}function vF(){return vF=O(function*(e,t={}){let n=yield fetch(`${sF}${e}`,A(A({},t),{},{credentials:`include`,headers:A({"Content-Type":`application/json`,Token:hF},t.headers)})),r=yield n.json();if(!n.ok||r.success===!1)throw Error(r.message||`请求失败`);return r}),vF.apply(this,arguments)}function yF(e){return{remoteId:e.id,status:`regular`,title:e.title||`新会话`}}function bF(e){let t={id:e.id,content:[{type:`text`,text:e.content}],createdAt:new Date(e.createdAt)};return e.role===`user`?A(A({},t),{},{role:`user`,attachments:[],metadata:{custom:{}}}):A(A({},t),{},{role:`assistant`,status:{type:`complete`,reason:`stop`},metadata:{unstable_state:{},unstable_annotations:[],unstable_data:[],steps:[],custom:{}}})}function xF(e){var t;let n=(t=e.custom)==null?void 0:t.conversationId;if(typeof n==`string`&&n)return n;let r=cF.get(e.id);if(r)return r;if(!lF.has(e.id))return e.remoteId||void 0}function SF(e){return lF.has(e)}function CF(e,t){return wF.apply(this,arguments)}function wF(){return wF=O(function*(e,t,n=20){return _F(`/${encodeURIComponent(e)}/messages?page=${t}&perPage=${n}`)}),wF.apply(this,arguments)}var TF={list(){return O(function*(){return{threads:(yield _F(`/`)).data.map(yF)}})()},initialize(e){return O(function*(){return lF.add(e),{remoteId:e}})()},fetch(e){return O(function*(){return yF((yield _F(`/${encodeURIComponent(e)}`)).data)})()},delete(e){return O(function*(){var t;let n=(t=cF.get(e))==null?lF.has(e)?void 0:e:t;n?(yield _F(`/${encodeURIComponent(n)}`,{method:`DELETE`}),cF.delete(e),lF.delete(e)):(lF.delete(e),cF.delete(e))})()},rename(){return O(function*(){})()},archive(){return O(function*(){})()},updateCustom(){return O(function*(){})()},generateTitle(e,t){return O(function*(){return cc(function(){var e=O(function*(e){let n=t.find(e=>e.role===`user`),r=(n==null?void 0:n.content.filter(e=>e.type===`text`).map(e=>e.text).join(``).slice(0,30))||`新会话`;e.appendText(r)});return function(t){return e.apply(this,arguments)}}())})()}};j();var EF=20;function DF(e,t,n){var r;let i=Xa(),a=Y(e=>e.threadListItem),[o,s]=(0,h.useState)([]),c=(0,h.useCallback)(e=>{s([...e])},[]),[l,u]=(0,h.useState)(!1),[d,f]=(0,h.useState)(!0),[p,m]=(0,h.useState)(!1),[g,_]=(0,h.useState)(0),v=(r=xF(a))==null?``:r,y=(0,h.useRef)(null),b=(0,h.useRef)(!1);(0,h.useEffect)(()=>{let e=!1;function t(){return n.apply(this,arguments)}function n(){return n=O(function*(){if(s([]),_(0),m(!1),f(!0),!v)f(!1);else try{let t=yield CF(v,0,EF);if(e)return;s([...t.messages].reverse().map(bF)),_(0),m(t.pagination.hasMore)}catch(t){e||console.error(`加载会话历史失败:`,t)}finally{e||f(!1)}}),n.apply(this,arguments)}return t(),()=>{e=!0}},[a.id]);let x=(0,h.useCallback)(function(){var r=O(function*(r,a=!1){var o;let c=crypto.randomUUID(),l=crypto.randomUUID(),d=new AbortController;y.current=d;let f=r.content.flatMap(e=>e.type===`text`?[{type:`text`,text:e.text}]:[]),p={id:c,role:`user`,content:f,attachments:(o=r.attachments)==null?[]:o,createdAt:new Date,metadata:{custom:{}}},h={id:l,role:`assistant`,content:[],createdAt:new Date,status:{type:`running`},metadata:{unstable_state:{},unstable_annotations:[],unstable_data:[],steps:[],custom:{}}};s(e=>{let t=e;if(a){let n=e.findIndex(e=>e.id===r.parentId);t=n===-1?[]:e.slice(0,n+1)}return[...t,p,h]}),u(!0);try{var g=!1,v=!1,b;try{for(var x=ne(aF({token:e.current||``,userMessage:{id:c,content:f},abortSignal:d.signal,getConversationId:()=>{var e;return(e=xF(i.threadListItem.getState()))==null?``:e},onConversationCreated:e=>{var t;let r=i.threadListItem.getState();mF(r.id,e),i.threadListItem.updateCustom(A(A({},r.custom),{},{conversationId:e})),(t=n.current)==null||t.call(n,e),_(0),m(!1)},onCustomEvent:e=>{var n;(n=t.current)==null||n.call(t,e)}})),S;g=!(S=yield x.next()).done;g=!1){let e=S.value;s(t=>t.map(t=>t.id!==l||t.role!==`assistant`?t:A(A({},t),{},{content:e})))}}catch(e){v=!0,b=e}finally{try{g&&x.return!=null&&(yield x.return())}finally{if(v)throw b}}if(d.signal.aborted){s(e=>e.filter(e=>e.id!==l));return}s(e=>e.map(e=>e.id!==l||e.role!==`assistant`?e:A(A({},e),{},{status:{type:`complete`,reason:`stop`}})))}catch(e){if(s(e=>e.filter(e=>e.id!==l)),!d.signal.aborted)throw e}finally{y.current===d&&(y.current=null),u(!1)}});return function(e){return r.apply(this,arguments)}}(),[i]);return em({messages:o,setMessages:c,isRunning:l,isLoading:d,onNew:(0,h.useCallback)(e=>x(e),[x]),onEdit:(0,h.useCallback)(e=>x(e,!0),[x]),onCancel:(0,h.useCallback)(O(function*(){var e;(e=y.current)==null||e.abort()}),[]),hasEarlier:p,onLoadEarlier:(0,h.useCallback)(O(function*(){if(v&&p&&!b.current){b.current=!0;try{let e=g+1,t=yield CF(v,e,EF),n=[...t.messages].reverse().map(bF);s(e=>{let t=new Set(e.map(e=>e.id));return[...n.filter(e=>!t.has(e.id)),...e]}),_(e),m(t.pagination.hasMore)}finally{b.current=!1}}}),[v,g,p])})}function OF({children:e,token:t,onCustomEvent:n}){let[r,i]=(0,h.useState)(),a=(0,h.useRef)(!1),o=(0,h.useRef)(t),s=(0,h.useRef)(n);(0,h.useEffect)(()=>{s.current=n},[n]),gF(t),(0,h.useEffect)(()=>{o.current=t},[t]);let c=(0,h.useRef)(()=>{}),l=(0,h.useCallback)(e=>{a.current&&(i(e),!e||SF(e)?pF():fF(e))},[]),u=(0,h.useCallback)(function(){return DF(o,s,c)},[]);(0,h.useEffect)(()=>{let e=!1;function t(){return n.apply(this,arguments)}function n(){return n=O(function*(){let t=dF();if(t)try{let n=yield TF.fetch(t);if(e)return;i(n.remoteId)}catch(t){if(e)return;pF(),i(void 0)}finally{e||(a.current=!0)}else{if(e)return;i(void 0),a.current=!0}}),n.apply(this,arguments)}return t(),c.current=e=>{fF(e)},()=>{e=!0}},[]);let d=tg({runtimeHook:u,adapter:TF,threadId:r,onThreadIdChange:l});return(0,X.jsx)(ky,{runtime:d,children:e})}var kF=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();j();function AF(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return A({name:kF(e),size:24,node:t},n.length>0?{aliases:n}:{})}var jF=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},MF=e=>{let t=jF(e);return t.charAt(0).toUpperCase()+t.slice(1)},NF=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),PF={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};j();function FF(e){return e!=null}function IF(e,t={}){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;let _=(n=t.attributeNames)==null?{}:n,v=e=>{var t;return(t=_[e])==null?e:t},y=(r=(i=e.size)==null?e.width:i)==null?PF.width:r,b=(a=(o=e.size)==null?e.height:o)==null?PF.height:a,x=(s=(c=e.aliases)==null?void 0:c.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`))==null?[]:s,S=[...e.name?[`lucide-${e.name}`]:[],...x],C=(l=(u=t.className)==null?void 0:u.split(` `).filter(Boolean))==null?[]:l,w=t.includeDefaultClasses===!1?NF(...C):NF(`lucide`,...S,...C),T=t.absoluteStrokeWidth?Number((d=t.strokeWidth)==null?PF[`stroke-width`]:d)*Number((f=(p=e.size)==null?e.width:p)==null?PF.width:f)/Number((m=(h=t.size)==null?t.width:h)==null?PF.width:m):(g=t.strokeWidth)==null?PF[`stroke-width`]:g;return[`svg`,A(A(A(A(A(A(A(A({},Object.entries(PF).reduce((e,[t,n])=>(e[v(t)]=n,e),{})),`color`in t&&t.color&&{[v(`stroke`)]:t.color}),`size`in t&&FF(t.size)&&{[v(`width`)]:t.size,[v(`height`)]:t.size}),`width`in t&&FF(t.width)&&{[v(`width`)]:t.width}),`height`in t&&FF(t.height)&&{[v(`height`)]:t.height}),{},{[v(`stroke-width`)]:T},w&&{[v(`class`)]:w}),{},{[v(`viewBox`)]:`0 0 ${y} ${b}`},t.hasA11yProp===!1?{[v(`aria-hidden`)]:`true`}:{}),`attributes`in t&&t.attributes),e.node.map(e=>{let[n,r,i]=e,a=t.nonScalingStroke?A({[v(`vector-effect`)]:`non-scaling-stroke`},r):r;return i?[n,a,i]:[n,a]})]}j();function LF(e,t={}){return IF(e,A(A({},t),{},{attributeNames:A(A({},t.attributeNames),{},{class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`})}))}var RF=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},zF=(0,h.createContext)({}),BF=()=>(0,h.useContext)(zF);j();var VF=[`color`,`size`,`width`,`height`,`strokeWidth`,`absoluteStrokeWidth`,`nonScalingStroke`,`className`,`children`,`iconNode`,`icon`],HF=(0,h.forwardRef)((e,t)=>{var n,r,i;let{color:a,size:o,width:s,height:c,strokeWidth:l,absoluteStrokeWidth:u,nonScalingStroke:d,className:f=``,children:p,iconNode:m=[],icon:g={node:m,aliases:[],size:24}}=e,_=G(e,VF),{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=(n=BF())==null?{}:n,w=!!p||RF(_),[T,E,D=[]]=LF(g,{color:a==null?S:a,width:(r=s==null?o:s)==null?v:r,height:(i=c==null?o:c)==null?v:i,strokeWidth:l==null?y:l,absoluteStrokeWidth:u==null?b:u,nonScalingStroke:d==null?x:d,className:NF(C,f),hasA11yProp:w,attributes:_});return(0,h.createElement)(T,A({ref:t},E),[...D.map(([e,t])=>(0,h.createElement)(e,t)),...Array.isArray(p)?p:[p]])});j();var UF=[`className`];function WF(e,t=[],n=[]){let r=typeof e==`string`?AF(e,t,n):e,i=(0,h.forwardRef)((e,t)=>{let{className:n}=e,i=G(e,UF);return(0,h.createElement)(HF,A({ref:t,icon:r,className:n},i))});return r.name&&(i.displayName=MF(r.name)),i}var GF={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};GF.node;var KF=WF(GF),qF={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};qF.node;var JF=WF(qF),YF={name:`audio-lines`,size:24,node:[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]};YF.node;var XF=WF(YF),ZF={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};ZF.node;var QF=WF(ZF),$F={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};$F.node;var eI=WF($F),tI={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};tI.node;var nI=WF(tI),rI={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};rI.node;var iI=WF(rI),aI={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};aI.node;var oI=WF(aI),sI={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};sI.node;var cI=WF(sI),lI={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};lI.node;var uI=WF(lI),dI={name:`circle-minus`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-circle`]};dI.node;var fI=WF(dI),pI={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};pI.node;var mI=WF(pI),hI={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};hI.node;var gI=WF(hI),_I={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};_I.node;var vI=WF(_I),yI={name:`eighth-notes`,size:24,node:[[`path`,{d:`M21 16V3a1 1 0 0 0-1.28-.96l-10 2.917a1 1 0 0 0-.72.96V19`,key:`uy6ho8`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}],[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}]],aliases:[`music`]};yI.node;var bI=WF(yI),xI={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};xI.node;var SI=WF(xI),CI={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};CI.node;var wI=WF(CI),TI={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};TI.node;var EI=WF(TI),DI={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};DI.node;var OI=WF(DI),kI={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};kI.node;var AI=WF(kI),jI={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};jI.node;var MI=WF(jI),NI={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};NI.node;var PI=WF(NI),FI={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};FI.node;var II=WF(FI),LI={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};LI.node;var RI=WF(LI),zI={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};zI.node;var BI=WF(zI),VI={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};VI.node;var HI=WF(VI),UI={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};UI.node;var WI=WF(UI),GI={name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};GI.node;var KI=WF(GI),qI={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};qI.node;var JI=WF(qI),YI={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};YI.node;var XI=WF(YI),ZI={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ZI.node;var QI=WF(ZI),$I={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};$I.node;var eL=WF($I),tL={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};tL.node;var nL=WF(tL),rL={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};rL.node;var iL=WF(rL),aL={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};aL.node;var oL=WF(aL),sL={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};sL.node;var cL=WF(sL),lL={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};lL.node;var uL=WF(lL),dL={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};dL.node;var fL=WF(dL),pL={};function mL(e,t){let n=h.useRef(pL);return n.current===pL&&(n.current=e(t)),n}var hL=[],gL=void 0;function _L(){return gL}function vL(e){hL.push(e)}function yL(e){let t=(t,n)=>{let r=mL(xL).current,i;try{gL=r;for(let e of hL)e.before(r);i=e(t,n);for(let e of hL)e.after(r);r.didInitialize=!0}finally{gL=void 0}return i};return t.displayName=e.displayName||e.name,t}function bL(e){return h.forwardRef(yL(e))}function xL(){return{didInitialize:!1}}function SL(){}var CL=Object.freeze([]),wL=Object.freeze({}),TL=typeof document<`u`?h.useLayoutEffect:()=>{};function EL(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var DL=EL(`https://base-ui.com/production-error`,`Base UI`),OL=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(OL.displayName=`TooltipRootContext`);function kL(e){let t=h.useContext(OL);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?DL(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return t}function AL(e){h.useEffect(e,CL)}E();var jL=0,ML=class e{constructor(){T(this,`currentId`,jL),T(this,`clear`,()=>{this.currentId!==jL&&(clearTimeout(this.currentId),this.currentId=jL)}),T(this,`disposeEffect`,()=>this.clear)}static create(){return new e}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=jL,t()},e)}isStarted(){return this.currentId!==jL}};function NL(){let e=mL(ML.create).current;return AL(e.disposeEffect),e}function PL(){var e,t;if(typeof navigator>`u`)return{userAgent:``,platform:``,maxTouchPoints:0};if(process.env.NODE_ENV!==`production`){let e=navigator.userAgentData;if(e&&Array.isArray(e.brands)){var n,r,i;return{userAgent:e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `),platform:(n=(r=e.platform)==null?navigator.platform:r)==null?``:n,maxTouchPoints:(i=navigator.maxTouchPoints)==null?0:i}}}return{userAgent:navigator.userAgent,platform:(e=navigator.platform)==null?``:e,maxTouchPoints:(t=navigator.maxTouchPoints)==null?0:t}}var{userAgent:FL,platform:IL,maxTouchPoints:LL}=PL(),RL=FL.toLowerCase(),zL=IL.toLowerCase(),BL=/^i(os$|p)/.test(zL)||zL===`macintel`&&LL>1,VL=`android`,HL=zL===VL||RL.includes(VL),UL=!BL&&zL.startsWith(`mac`);zL.startsWith(`win`),!HL&&/^(linux|chrome os)/.test(zL);var WL=UL||BL,GL,KL,qL=typeof CSS<`u`&&!!((GL=(KL=CSS).supports)!=null&&GL.call(KL,`-webkit-backdrop-filter:none`));!qL&&RL.includes(`firefox`),!qL&&RL.includes(`chrom`);var JL=WL,YL=/jsdom|happydom/.test(RL);function XL(e){e.preventDefault(),e.stopPropagation()}function ZL(e){return`nativeEvent`in e}function QL(e){return e.pointerType===``&&e.isTrusted?!0:HL&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function $L(e){return YL?!1:!HL&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(HL||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function eR(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function tR(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function nR(e){var t;let n=e.activeElement;for(;(n==null||(t=n.shadowRoot)==null?void 0:t.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function rR(e,t){var n;if(!e||!t)return!1;let r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&ZS(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function iR(e,t){let n=e;for(;n;){var r,i;if(YS(n)&&n.matches(t))return n;n=(r=(i=n.assignedSlot)==null?n.parentNode:i)==null?ZS(n)?n.host:null:r}return null}function aR(e){if(`composedPath`in e){var t;return(t=e.composedPath()[0])==null?e.target:t}return e.target}var oR=`data-base-ui-focusable`,sR=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,cR=`data-starting-style`,lR=`data-ending-style`,uR={[cR]:``},dR={[lR]:``},fR={transitionStatus(e){return e===`starting`?uR:e===`ending`?dR:null}},pR=`data-open`,mR=`data-closed`,hR=`data-anchor-hidden`,gR=`data-popup-open`;j();var _R={[gR]:``},vR={[pR]:``},yR={[mR]:``},bR={[hR]:``},xR={open(e){return e?_R:null}},SR={open(e){return e?vR:yR},anchorHidden(e){return e?bR:null}},CR=A(A({},SR),fR),wR=`data-trigger-disabled`;function TR(e,t){if(!YS(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(wR);for(let[,e]of t.entries())if(rR(e,n))return!e.hasAttribute(wR);return!1}function ER(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function DR(e){return e.matches(`html,body`)}function OR(e){return XS(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function kR(e){return iR(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${sR}`)!=null}function AR(e){return e?e.getAttribute(`role`)===`combobox`&&OR(e):!1}function jR(e){if(!e||YL)return!0;try{return e.matches(`:focus-visible`)}catch(e){return!0}}function MR(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function NR(e,t){return t!=null&&!eR(t)?0:typeof e==`function`?e():e}function PR(e,t,n){let r=NR(e,n);return typeof r==`number`?r:r==null?void 0:r[t]}function FR(e){return typeof e==`function`?e():e}function IR(e,t){return t||e===`click`||e===`mousedown`}function LR(e){return(e==null?void 0:e.includes(`mouse`))&&e!==`mousedown`}j();function RR(e,t,n,r){let i=!1,a=!1,o=r==null?wL:r;return A({reason:e,event:t==null?new Event(`base-ui`):t,cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n},o)}var zR=`none`,BR=`trigger-press`,VR=`trigger-hover`,HR=`trigger-focus`,UR=`outside-press`,WR=`close-press`,GR=`focus-out`,KR=`escape-key`,qR=`disabled`,JR=`imperative-action`,YR=h.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ML,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(YR.displayName=`FloatingDelayGroupContext`);function XR(e,t){e.current=t.current}function ZR(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=h.useRef(n),a=h.useRef(n),o=h.useRef(null),s=h.useRef(null),c=NL();return TL(()=>{a.current=n,o.current?i.current={open:PR(i.current,`open`),close:PR(n,`close`)}:i.current=n},[n,o,i,a]),(0,X.jsx)(YR.Provider,{value:h.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function QR(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=h.useContext(YR),[d,f]=h.useState(!1),p=h.useRef(n);return TL(()=>{p.current=n},[n]),TL(()=>{function t(){var e;(e=c.current)==null||e.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),TL(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:PR(s.current,`close`)},o!==null&&o!==r?(f(!0),t==null||t.setIsInstantPhase(!0),t==null||t.onOpenChange(!1,RR(`none`))):(f(!1),t==null||t.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),TL(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,XR(a,s),u.clear()}},[c,i,a,r,s,u]),h.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function $R(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ez(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function tz(e,t,n,r){let i=mL(rz).current;return iz(i,e,t,n,r)&&oz(i,[e,t,n,r]),i.callback}function nz(e){let t=mL(rz).current;return az(t,e)&&oz(t,e),t.callback}function rz(){return{callback:null,cleanup:null,refs:[]}}function iz(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function az(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function oz(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function sz(e){let t=mL(cz,e).current;return t.next=e,TL(t.effect),t}function cz(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}j();var lz=A({},h),uz=lz.useInsertionEffect,dz=uz&&uz!==lz.useLayoutEffect?uz:e=>e();function fz(e){let t=mL(pz).current;return t.next=e,dz(t.effect),t.trampoline}function pz(){let e={next:void 0,callback:mz,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function mz(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}E();var hz=null,gz=globalThis.requestAnimationFrame,_z=new class{constructor(){T(this,`callbacks`,[]),T(this,`callbacksCount`,0),T(this,`nextId`,1),T(this,`startId`,1),T(this,`isScheduled`,!1),T(this,`tick`,e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1){var r;(r=t[n])==null||r.call(t,e)}})}request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=process.env.NODE_ENV!==`production`&&gz!==requestAnimationFrame&&(gz=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},vz=class e{constructor(){T(this,`currentId`,hz),T(this,`cancel`,()=>{this.currentId!==hz&&(_z.cancel(this.currentId),this.currentId=hz)}),T(this,`disposeEffect`,()=>this.cancel)}static create(){return new e}static request(e){return _z.request(e)}static cancel(e){return _z.cancel(e)}request(e){this.cancel(),this.currentId=_z.request(()=>{this.currentId=hz,e()})}};function yz(){let e=mL(vz.create).current;return AL(e.disposeEffect),e}function bz(e){return(e==null?void 0:e.ownerDocument)||document}j();var xz={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Sz=A(A({},xz),{},{position:`fixed`,margin:0,top:0,left:0});A(A({},xz),{},{position:`absolute`}),j();var Cz=h.forwardRef(function(e,t){let[n,r]=h.useState();TL(()=>{JL&&qL&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,A(A(A({},e),{},{ref:t,style:Sz,"aria-hidden":!n||void 0},i),{},{"data-base-ui-focus-guard":``}))});process.env.NODE_ENV!==`production`&&(Cz.displayName=`FocusGuard`);function wz(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Tz(e,t=e?lC(e):null){return!e||!e.isConnected||!t||wz(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Ez=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Dz(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ZS(n)?n.host:null}function Oz(e){for(let t of Array.from(e.children))if(GS(t)===`summary`)return t;return null}function kz(e,t){let n=Oz(t);return!!n&&(e===n||rR(n,e))}function Az(e){let t=e?GS(e):``;return e!=null&&e.matches(Ez)&&(t!==`summary`||e.parentElement!=null&&GS(e.parentElement)===`details`&&Oz(e.parentElement)===e)&&(t!==`details`||Oz(e)==null)&&(t!==`input`||e.type!==`hidden`)}function jz(e){if(!Az(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Dz(t)){let n=t!==e,r=GS(t)===`slot`;if(t.hasAttribute(`inert`)||n&&GS(t)===`details`&&!t.open&&!kz(e,t)||t.hasAttribute(`hidden`)||!r&&!Mz(t,n))return!1}return!0}function Mz(e,t){let n=lC(e);return t?n.display!==`none`:Tz(e,n)}function Nz(e){let t=e.tabIndex;if(t<0){let t=GS(e);if(t===`details`||t===`audio`||t===`video`||XS(e)&&e.isContentEditable)return 0}return t}function Pz(e){if(GS(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Fz(e,t){let n=Pz(e);if(!n)return!0;let r=t.find(e=>{let t=Pz(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Pz(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form})===n}function Iz(e){if(XS(e)&&GS(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return XS(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Lz(e,t){Iz(e).forEach(e=>{Az(e)&&t.push(e),Lz(e,t)})}function Rz(e,t,n){Iz(e).forEach(e=>{XS(e)&&e.matches(t)&&n.push(e),Rz(e,t,n)})}function zz(e){return jz(e)&&Nz(e)>=0}function Bz(e){let t=[];return Lz(e,t),t.filter(jz)}function Vz(e){let t=Bz(e);return t.filter(e=>Nz(e)>=0&&Fz(e,t))}function Hz(e,t){let n=Vz(e),r=n.length;if(r===0)return;let i=nR(bz(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Uz(e){return Hz(bz(e).body,1)||e}function Wz(e){return Hz(bz(e).body,-1)||e}function Gz(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!rR(n,r)}function Kz(e){Vz(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function qz(e){let t=[];Rz(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Jz(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>{var r;return[...!n||(r=t.context)!=null&&r.open?[t]:[],...Jz(e,t.id,n)]})}function Yz(e,t){var n;let r=[],i=(n=e.find(e=>e.id===t))==null?void 0:n.parentId;for(;i;){let t=e.find(e=>e.id===i);i=t==null?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Xz(e){return`data-base-ui-${e}`}var Zz=0;function Qz(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Zz);function a(){i&&!i()||e==null||e.focus({preventScroll:n})}if(r)return a(),SL;let o=requestAnimationFrame(a);return Zz=o,()=>{Zz===o&&(cancelAnimationFrame(o),Zz=0)}}var $z=`data-base-ui-inert`,eB=new WeakMap,tB=new WeakSet,nB=new WeakMap,rB=0;function iB(e){return e?ZS(e)?e.host:iB(e.parentNode):null}var aB=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=iB(t);return e.contains(n)?n:null}).filter(e=>e!=null),oB=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},sB=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{GS(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function cB(e,t,n,{mark:r=!0}){let i=aB(t,e),a=r?sB(t,oB(i),new Set(i)):[],o=[],s=[];if(n){let e=aB(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);sB(t,oB(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(eB.get(e)||0)+1;eB.set(e,r),o.push(e),r===1&&n&&tB.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(nB.get(e)||0)+1;nB.set(e,t),s.push(e),t===1&&e.setAttribute($z,``)}),rB+=1,()=>{o.forEach(e=>{let t=(eB.get(e)||0)-1;eB.set(e,t),t||(tB.has(e)||e.removeAttribute(`aria-hidden`),tB.delete(e))}),r&&s.forEach(e=>{let t=(nB.get(e)||0)-1;nB.set(e,t),t||e.removeAttribute($z)}),--rB,rB||(eB=new WeakMap,tB=new WeakSet,nB=new WeakMap)}}function lB(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=bz(e[0]).body;return cB(e,i,n,{mark:r})}function uB(){let[,e]=h.useState({});return h.useCallback(()=>{e({})},[])}var dB=0;function fB(e,t=`mui`){let n=h.useRef(void 0),r=uB(),i=e==null?n.current:e;return h.useEffect(()=>{n.current==null&&(dB+=1,n.current=`${t}-${dB}`,e==null&&r())},[e,t,r]),i}var pB=lz.useId;function mB(e,t){if(pB!==void 0){let n=pB();return e==null?t?`${t}-${n}`:n:e}return fB(e,t)}var hB=parseInt(h.version,10);function gB(e){return hB>=e}function _B(e){var t;if(!h.isValidElement(e))return null;let n=e,r=n.props;return(t=gB(19)?r==null?void 0:r.ref:n.ref)==null?null:t}j();function vB(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return A(A({},e),t)}var yB;process.env.NODE_ENV!==`production`&&(yB=new Set);function bB(e,t){return function(...n){if(process.env.NODE_ENV!==`production`){let r=n.join(` `),i=t?`${t}: ${r}`:r,a=`${e}:${i}`;yB.has(a)||(yB.add(a),e===`warn`?console.warn(i):console.error(i))}}}var xB=bB(`warn`,`Base UI`);function SB(e,t){let n={};for(let r in e){let i=e[r];if(t!=null&&t.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function CB(e,t){return typeof e==`function`?e(t):e}function wB(e,t){return typeof e==`function`?e(t):e}j();var TB={};function EB(e,t,n,r,i){if(!n&&!r&&!i&&!e)return OB(t);let a=OB(e);return t&&(a=kB(a,t)),n&&(a=kB(a,n)),r&&(a=kB(a,r)),i&&(a=kB(a,i)),a}function DB(e){if(e.length===0)return TB;if(e.length===1)return OB(e[0]);let t=OB(e[0]);for(let n=1;n<e.length;n+=1)t=kB(t,e[n]);return t}function OB(e){return NB(e)?A({},e(TB)):AB(e)}function kB(e,t){return NB(t)?t(e):jB(e,t)}function AB(e){let t=A({},e);for(let e in t){let n=t[e];MB(e,n)&&(t[e]=FB(n))}return t}function jB(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=vB(e.style,r);break;case`className`:e[n]=LB(e.className,r);break;default:e[n]=MB(n,r)?PB(e[n],r):r}}return e}function MB(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function NB(e){return typeof e==`function`}function PB(e,t){return t?e?(...n)=>{let r=n[0];if(RB(r)){let i=r;IB(i);let a=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),a}let i=t(...n);return e==null||e(...n),i}:FB(t):e}function FB(e){return e&&((...t)=>{let n=t[0];return RB(n)&&IB(n),e(...t)})}function IB(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function LB(e,t){return t?e?t+` `+e:t:e}function RB(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}j();function zB(e,t,n={}){var r;let i=t.render;n.enabled!==!1&&(i=GB(i));let a=BB(t,n,i);if(n.enabled===!1)return null;let o=(r=n.state)==null?wL:r;return KB(e,i,a,o)}function BB(e,t,n){var r;let{className:i,style:a}=e,{state:o=wL,ref:s,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?CB(i,o):void 0,f=u?wB(a,o):void 0,p=u?SB(o,l):wL,m=u&&c?VB(c):void 0,h=u?(r=vB(p,m))==null?{}:r:wL;return typeof document<`u`&&(u?h.ref=Array.isArray(s)?nz([h.ref,_B(n),...s]):tz(h.ref,_B(n),s):tz(null,null)),u?(d!==void 0&&(h.className=LB(h.className,d)),f!==void 0&&(h.style=vB(h.style,f)),h):wL}function VB(e){return Array.isArray(e)?DB(e):EB(void 0,e)}var HB=Symbol.for(`react.lazy`),UB=/^[A-Z][A-Za-z0-9$]*$/,WB=/[a-z]/;function GB(e){if((e==null?void 0:e.$$typeof)!==HB)return e;let t=h.Children.toArray(e)[0];return h.isValidElement(t)?t:e}function KB(e,t,n,r){if(t){if(typeof t==`function`)return process.env.NODE_ENV!==`production`&&qB(t),t(n,r);let e=EB(n,t.props);if(e.ref=n.ref,process.env.NODE_ENV!==`production`&&!h.isValidElement(t))throw Error("Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.\nA valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.\nhttps://base-ui.com/r/invalid-render-prop");return h.cloneElement(t,e)}return JB(e,n)}function qB(e){let t=e.name;t.length!==0&&UB.test(t)&&WB.test(t)&&xB(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.",`If this is an intentional render callback, rename it to start with a lowercase letter.`,"Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.",`https://base-ui.com/r/invalid-render-prop`)}function JB(e,t){return e===`button`?(0,h.createElement)(`button`,A(A({type:`button`},t),{},{key:t.key})):e===`img`?(0,h.createElement)(`img`,A(A({alt:``},t),{},{key:t.key})):h.createElement(e,t)}var YB={style:{transition:`none`}},XB=`data-base-ui-click-trigger`,ZB={fallbackAxisSide:`end`},QB={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},$B=[`render`,`className`,`style`,`children`,`container`,`portalOwnerRole`],eV=h.createContext(null);process.env.NODE_ENV!==`production`&&(eV.displayName=`PortalContext`);var tV=()=>h.useContext(eV),nV=Xz(`portal`);function rV(e={}){let{ref:t,container:r,componentProps:i=wL,elementProps:a}=e,o=mB(),s=tV(),c=s==null?void 0:s.portalNode,[l,u]=h.useState(null),[d,f]=h.useState(null),p=fz(e=>{e!==null&&f(e)}),m=h.useRef(null);TL(()=>{var e,t;if(r===null){m.current&&(m.current=null,f(null),u(null));return}let n=(e=(t=r&&(JS(r)?r:r.current))==null?c:t)==null?document.body:e;n==null?m.current&&(m.current=null,f(null),u(null)):m.current!==n&&(m.current=n,f(null),u(n))},[r,c]);let g=zB(`div`,i,{ref:[t,p],props:[{id:o,[nV]:``},a]}),_=l&&g?n.createPortal(g,l):null;return{node:d,nodeId:h.isValidElement(g)?g.props.id:void 0,subtree:_}}var iV=h.forwardRef(function(e,t){let{render:r,className:i,style:a,children:o,container:s,portalOwnerRole:c}=e,{node:l,nodeId:u,subtree:d}=rV({container:s,ref:t,componentProps:e,elementProps:G(e,$B)}),f=h.useRef(null),p=h.useRef(null),m=h.useRef(null),g=h.useRef(null),[_,v]=h.useState(null),y=h.useRef(!1),b=_==null?void 0:_.modal,x=_==null?void 0:_.open,S=!!_&&!_.modal&&_.open&&!!l;h.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&Gz(e)&&(e.type===`focusin`?y.current&&(qz(l),y.current=!1):(Kz(l),y.current=!0))}return ez($R(l,`focusin`,e,!0),$R(l,`focusout`,e,!0))},[l,b]),TL(()=>{l&&x===!0&&y.current&&(qz(l),y.current=!1)},[x,l]);let C=h.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return(0,X.jsxs)(h.Fragment,{children:[d,(0,X.jsxs)(eV.Provider,{value:C,children:[S&&l&&(0,X.jsx)(Cz,{"data-type":`outside`,ref:f,onFocus:e=>{if(Gz(e,l)){var t;(t=m.current)==null||t.focus()}else{let e=Wz(_?_.domReference:null);e==null||e.focus()}}}),S&&l&&(0,X.jsx)(`span`,{role:c,"aria-owns":u,style:QB}),l&&n.createPortal(o,l),S&&l&&(0,X.jsx)(Cz,{"data-type":`outside`,ref:p,onFocus:e=>{if(Gz(e,l)){var t;(t=g.current)==null||t.focus()}else{let t=Uz(_?_.domReference:null);t==null||t.focus(),_!=null&&_.closeOnFocusOut&&(_==null||_.onOpenChange(!1,RR(`focus-out`,e.nativeEvent)))}}})]})]})});process.env.NODE_ENV!==`production`&&(iV.displayName=`FloatingPortal`);function aV(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var oV=h.createContext(null);process.env.NODE_ENV!==`production`&&(oV.displayName=`FloatingNodeContext`);var sV=h.createContext(null);process.env.NODE_ENV!==`production`&&(sV.displayName=`FloatingTreeContext`);var cV=()=>{var e;return((e=h.useContext(oV))==null?void 0:e.id)||null},lV=e=>{let t=h.useContext(sV);return e==null?t:e};function uV(e){return e==null?e:`current`in e?e.current:e}function dV(e,t){let n=KS(aR(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(QL(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var fV=20,pV=[];function mV(){pV=pV.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function hV(e){mV(),e&&GS(e)!==`body`&&(pV.push(new WeakRef(e)),pV.length>fV&&(pV=pV.slice(-20)))}function gV(){var e;return mV(),(e=pV[pV.length-1])==null?void 0:e.deref()}function _V(e){return e?zz(e)?e:Vz(e)[0]||e:null}function vV(e){var t;if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!((t=e.getAttribute(`role`))!=null&&t.includes(`dialog`)))return;let n=Bz(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return zz(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);n.length===0?r!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function yV(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=fz(()=>{var e;return(e=x.current.floatingContext)==null?void 0:e.nodeId}),C=i===!1,w=AR(v)&&C,T=sz(i),E=sz(a),D=sz(o),O=sz(u),k=sz(_),A=lV(m),j=tV(),M=h.useRef(!1),N=h.useRef(!1),P=h.useRef(!1),F=h.useRef(null),I=h.useRef(``),L=h.useRef(``),R=h.useRef(null),z=h.useRef(null),B=tz(R,p,j==null?void 0:j.beforeInsideRef),ee=tz(z,j==null?void 0:j.afterInsideRef),V=NL(),te=NL(),ne=yz(),H=j!=null,U=MR(y),re=fz((e=U)=>e?Vz(e):[]),ie=fz(()=>{var e;return(e=g==null?void 0:g().filter(e=>e!=null))==null?[]:e});h.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&rR(U,nR(bz(U)))&&re().length===0&&!w&&XL(e)}return $R(bz(U),`keydown`,e)},[r,U,c,w,re]),h.useEffect(()=>{if(r||!_)return;let e=bz(U);function t(){P.current=!1}function n(e){let t=aR(e),n=ie(),r=rR(y,t)||rR(v,t)||rR(j==null?void 0:j.portalNode,t)||n.some(e=>e===t||rR(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,iR(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,te.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return ez($R(e,`pointerdown`,n,!0),$R(e,`pointerup`,t,!0),$R(e,`pointercancel`,t,!0),$R(e,`keydown`,i,!0),t)},[r,y,v,U,_,j,te,ie]),h.useEffect(()=>{if(r||!l)return;let e=bz(U);function n(){N.current=!0,te.start(0,()=>{N.current=!1})}function i(e){let t=aR(e);zz(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=aR(n);c&&r==null&&a!=null&&rR(y,a)&&hV(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=ie(),p=(r==null?void 0:r.hasAttribute(Xz(`focus-guard`)))&&[R.current,z.current,j==null?void 0:j.beforeInsideRef.current,j==null?void 0:j.afterInsideRef.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,uV(f),uV(d)].includes(r),m=!(rR(v,r)||rR(y,r)||rR(r,y)||rR(j==null?void 0:j.portalNode,r)||u.some(e=>e===r||rR(e,r))||l.hasMatchingElement(e=>rR(e,r))||p||A&&(Jz(A.nodesRef.current,o).find(e=>{var t,n;return rR((t=e.context)==null?void 0:t.elements.floating,r)||rR((n=e.context)==null?void 0:n.elements.domReference,r)})||Yz(A.nodesRef.current,o).find(e=>{var t,n,i;return[(t=e.context)==null?void 0:t.elements.floating,MR((n=e.context)==null?void 0:n.elements.floating)].includes(r)||((i=e.context)==null?void 0:i.elements.domReference)===r})));if(i===v&&U&&vV(U),s&&i!==v&&!Tz(a)&&nR(e)===e.body){if(XS(U)&&(U.focus(),s===`popup`)){ne.request(()=>{U.focus()});return}let e=re(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;XS(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&m&&!N.current&&(w||r!==gV())&&(M.current=!0,t.setOpen(!1,RR(GR,n)))})}function o(){P.current||(x.current.insideReactTree=!0,V.start(0,()=>{x.current.insideReactTree=!1}))}let u=XS(v)?v:null;if(y||u)return ez(u&&$R(u,`focusout`,a),u&&$R(u,`pointerdown`,n),y&&$R(y,`focusin`,i),y&&$R(y,`focusout`,a),y&&j&&$R(y,`focusout`,o,!0))},[r,v,y,U,c,A,j,t,l,s,re,w,S,x,V,te,ne,d,f,ie]),h.useEffect(()=>{var e,t;if(r||!y||!_)return;let n=Array.from((j==null||(e=j.portalNode)==null?void 0:e.querySelectorAll(`[${Xz(`portal`)}]`))||[]),i=(t=(A?Yz(A.nodesRef.current,S()):[]).find(e=>{var t;return AR(((t=e.context)==null?void 0:t.elements.domReference)||null)}))==null||(t=t.context)==null?void 0:t.elements.domReference,a=lB([y,...n,R.current,z.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,...ie(),i,uV(f),uV(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),o=lB([y,...n].filter(e=>e!=null));return()=>{o(),a()}},[_,r,v,y,c,j,w,A,S,d,f,ie]),TL(()=>{if(!_||r||!XS(U))return;I.current=``,L.current=``;let e=bz(U),t=nR(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||rR(U,t))return;let i=null,a=()=>(i==null&&(i=re(U)),i[0]||U),o;o=r===!0||r===null?a():uV(r),o=o||a();let s=rR(U,nR(e)),c=x.current.openEvent,l=(c==null?void 0:c.type)===`mousedown`&&QL(c);Qz(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=nR(e);return!(t!==o&&rR(U,t))}})})},[r,_,U,re,T,O,k,x]);let W=h.useRef(null);TL(()=>{if(r||!U){W.current=null;return}W.current&&(W.current.cancelled=!0,W.current=null);let e=bz(U),t=nR(e),n=O.current==null;hV(t);function i(e){var t;if(e.open||(I.current=dV(e.nativeEvent,L.current)),(e.reason===`focus-out`&&(t=e.triggerElement)!=null&&t.hasAttribute(Xz(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(QL(e.nativeEvent)||$L(e.nativeEvent))M.current=!1;else{let e=!1;bz(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v!=null&&v.isConnected?v:null,o=t!=null&&t.isConnected&&GS(t)!==`body`?t:null,s=n?o||a:a||o;return s||(s=gV()||null),typeof i==`boolean`?s:uV(i)||s||null}return()=>{b.off(`openchange`,i);let t=nR(e),n=ie(),r=rR(y,t)||n.some(e=>e===t||rR(e,t))||A&&Jz(A.nodesRef.current,S(),!1).some(e=>{var n;return rR((n=e.context)==null?void 0:n.elements.floating,t)}),o=E.current,s=I.current,c=a(s),l={cancelled:!1};W.current=l,queueMicrotask(()=>{var n;W.current===l&&(W.current=null);let i=_V(c),a=(n=D.current)==null?typeof o!=`boolean`:n;if(!l.cancelled&&o&&!M.current&&XS(i)&&(a||i===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),i.focus(e)}M.current=!1})}},[r,y,U,E,D,O,b,A,v,S,ie]),TL(()=>{if(!qL||_||!y)return;let e=nR(bz(y));XS(e)&&OR(e)&&rR(y,e)&&e.blur()},[_,y]),TL(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,l,v]),TL(()=>{if(!r&&U)return vV(U),()=>{queueMicrotask(mV)}},[r,U]);let ae=!r&&(!c||!w)&&(H||c);return(0,X.jsxs)(h.Fragment,{children:[ae&&(0,X.jsx)(Cz,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=re();Qz(e[e.length-1])}else if(j!=null&&j.portalNode){if(M.current=!1,Gz(e,j.portalNode)){let e=Uz(v);e==null||e.focus()}else{var t;(t=uV(f==null?j.beforeOutsideRef:f))==null||t.focus()}}}}),n,ae&&(0,X.jsx)(Cz,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c)Qz(re()[0]);else if(j!=null&&j.portalNode){if(l&&(M.current=!0),Gz(e,j.portalNode)){let e=Wz(v);e==null||e.focus()}else{var t;(t=uV(d==null?j.afterOutsideRef:d))==null||t.focus()}}}})]})}function bV(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=BR}=t,l=e.context.dataRef,u=h.useRef(void 0),d=yz(),f=NL(),p=h.useMemo(()=>{function t(t,n,r,i){let a=RR(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=eR(e.pointerType,!0)&&$L(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||eR(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=aR(s),p=OR(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:eR(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return h.useMemo(()=>n?{reference:p}:wL,[n,p])}function xV(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){var a;let o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},s=t.axis===`x`||t.axis===`both`,c=t.axis===`y`||t.axis===`both`,l=[`mouseenter`,`mousemove`].includes(((a=t.dataRef.current.openEvent)==null?void 0:a.type)||``)&&t.pointerType!==`touch`,u=t.axis===`y`?o.width:0,d=t.axis===`x`?o.height:0,f=o.x,p=o.y;return n==null&&t.x&&s&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),f-=n||0,p-=r||0,(!i||l)&&(f=s&&t.x!=null?t.x:f,p=c&&t.y!=null?t.y:p),i=!0,{width:u,height:d,x:f,y:p,top:p,right:f+u,bottom:p+d,left:f}}}}function SV(e){return e!=null&&e.clientX!=null}function CV(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=h.useRef(!1),l=h.useRef(null),[u,d]=h.useState(),[f,p]=h.useState([]),m=fz(t=>{e.set(`positionReference`,t)}),g=fz((t,n,i)=>{c.current||(!s.current.openEvent||SV(s.current.openEvent))&&e.set(`positionReference`,xV(i==null?o:i,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),_=fz(e=>{i?l.current||(g(e.clientX,e.clientY,e.currentTarget),p([])):g(e.clientX,e.clientY,e.currentTarget)}),v=eR(u)?a:i;h.useEffect(()=>{if(!n){m(o);return}if(!v)return;function e(){var e;(e=l.current)==null||e.call(l),l.current=null}let t=KS(a);function r(t){let n=aR(t);rR(a,n)?e():g(t.clientX,t.clientY)}return!s.current.openEvent||SV(s.current.openEvent)?l.current=$R(t,`mousemove`,r):m(o),e},[v,n,a,s,o,e,g,m,f]),h.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),h.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),h.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=h.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return h.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function wV(){return!1}function TV(e){var t,n;return{escapeKey:typeof e==`boolean`?e:(t=e==null?void 0:e.escapeKey)!=null&&t,outsidePress:typeof e==`boolean`?e:(n=e==null?void 0:e.outsidePress)==null||n}}function EV(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=wV,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=lV(c),m=fz(typeof i==`function`?i:()=>!1),g=typeof i==`function`?m:i,_=g!==!1,v=fz(()=>a),{escapeKey:y,outsidePress:b}=TV(s),x=h.useRef(!1),S=h.useRef(!1),C=h.useRef(!1),w=h.useRef(!1),T=h.useRef(!1),E=h.useRef(``),D=h.useRef(null),O=NL(),k=NL(),A=NL(),j=fz(()=>{k.clear(),d.current.insideReactTree=!1}),M=fz(e=>{var t;let n=(t=d.current.floatingContext)==null?void 0:t.nodeId;return(p?Jz(p.nodesRef.current,n):[]).some(t=>{var n;return((n=t.context)==null?void 0:n.open)&&!t.context.dataRef.current[e]})}),N=fz(t=>ER(t,e.select(`floatingElement`))||ER(t,e.select(`domReferenceElement`))),P=fz(t=>{o()&&e.setOpen(!1,RR(BR,t.nativeEvent))}),F=fz(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ZL(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=RR(KR,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=fz(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=fz(t=>{if(!l||!n||t.button!==0)return;let r=aR(t.nativeEvent);rR(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=fz(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});h.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),h.useEffect(()=>j,[j]),h.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new ML,i=bz(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(qL?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){var t;let n=(t=d.current.floatingContext)==null?void 0:t.nodeId,r=p&&Jz(p.nodesRef.current,n).some(t=>{var n;return ER(e,(n=t.context)==null?void 0:n.elements.floating)});return N(e)||r}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=aR(n),i=`[${Xz(`inert`)}]`,a=YS(r)?r.getRootNode():null,o=Array.from((ZS(a)?a:bz(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>rR(e,r))))return;let c=YS(r)?r:null;for(;c&&!cC(c);){let e=dC(c);if(cC(e)||!YS(e))break;c=e}if(!(o.length&&YS(r)&&!DR(r)&&!rR(r,e.select(`floatingElement`))&&o.every(e=>!rR(c,e)))){if(XS(r)&&!(`touches`in n)){let e=cC(r),t=lC(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(f()===`intentional`){if(n.detail!==0&&!QL(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,RR(UR,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=aR(e);if(!n)return;let r=$R(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function ee(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function V(e){L(e,ee)}function te(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}let H=ez(r&&ez($R(i,`keydown`,F),$R(i,`compositionstart`,a),$R(i,`compositionend`,o)),_&&ez($R(i,`click`,z,!0),$R(i,`pointerdown`,z,!0),$R(i,`pointerup`,B,!0),$R(i,`pointercancel`,B,!0),$R(i,`mousedown`,z,!0),$R(i,`mouseup`,B,!0),$R(i,`touchstart`,R,{capture:!0,passive:!0}),$R(i,`touchmove`,V,{capture:!0,passive:!0}),$R(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),t.clear(),c(),C.current=!1}},[d,u,r,_,g,l,n,y,b,F,j,v,M,N,p,e,O,A]);let z=h.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=h.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return h.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function DV(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),TL(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};YS(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function OV(e,t=!1,n=!1,r=!1){let[i,a]=h.useState(e&&t?`idle`:void 0),[o,s]=h.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),TL(()=>{if(!e&&o&&i!==`ending`&&n){let e=vz.request(()=>{a(`ending`)});return()=>{vz.cancel(e)}}},[e,o,i,n]),TL(()=>{if(!e||t||i===void 0)return;let n=vz.request(()=>{a(void 0)});return()=>{vz.cancel(n)}},[t,e,i]),TL(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=vz.request(()=>{a(`idle`)});return()=>{vz.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function kV(e,t){return e.getAnimations(t).filter(e=>{var t;let n=(t=e.effect)==null?void 0:t.getTiming();return(n==null?void 0:n.duration)!==1/0&&(n==null?void 0:n.iterations)!==1/0})}var AV=null;function jV(e){if(!AV){let e=[];AV=e,queueMicrotask(()=>{AV=null,n.flushSync(()=>{for(let t of e)t()})})}AV.push(e)}function MV(e,t=!1,r=!1){let i=yz();return fz((a,o=null)=>{i.cancel();let s=uV(e);if(s==null)return;let c=s,l=()=>{r?jV(()=>{o!=null&&o.aborted||a()}):n.flushSync(a)};if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){a();return}function u(){Promise.all(kV(c).map(e=>e.finished.then(SL))).then(()=>{o!=null&&o.aborted||l()},()=>{o!=null&&o.aborted||(kV(c).some(e=>e.pending||e.playState!==`finished`)?u():l())})}if(t){let e=cR;if(!c.hasAttribute(e)){i.request(u);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),u())});t.observe(c,{attributes:!0,attributeFilter:[e]}),o==null||o.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else i.request(u)})}function NV(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=fz(a),s=MV(r,n,i);h.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function PV(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=fz(i),{mounted:c,setMounted:l,transitionStatus:u}=OV(t,!1,!1,o),d=!t&&r;TL(()=>{t&&s(!1)},[t,s]);let f=h.useRef(c),p=h.useRef(!1),m=uB(),g=()=>{f.current=!1,l(!1),a()};TL(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&g())});let _=fz(()=>{f.current&&(t?(p.current=!0,m()):g())});return NV({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}j();var FV={tabIndex:-1,[oR]:``};function IV(e){return t=>t!==`touch`||e.current}function LV(e,t=!1){let n=mB(),r=cV()!=null,i=mL(()=>e(n,r)).current;return DV({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function RV({handle:e,store:t}){return TL(()=>e.attachStore(t),[e,t]),null}function zV(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function BV(e,t){let n=h.useRef(null);return fz(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),zV(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),zV(t))})}function VV(e,t,n,r=!1){var i;let a=e.preventUnmountingOnClose;t?a=!1:r&&(a=!0);let o=(i=n==null?void 0:n.id)==null?null:i,s=e.activeTriggerId,c=e.activeTriggerElement;return(o||t)&&(s=o,c=n==null?null:n),{open:t,preventUnmountingOnClose:a,activeTriggerId:s,activeTriggerElement:c,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function HV(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function UV(e,t,r,i={}){var a,o,s;let c=r.reason,l=c===VR,u=t&&c===`trigger-focus`,d=!t&&(c===`trigger-press`||c===`escape-key`),f=HV(r);if((a=(o=e.context).onOpenChange)==null||a.call(o,t,r),r.isCanceled)return;(s=i.onBeforeDispatch)==null||s.call(i),e.state.floatingRootContext.dispatchOpenChange(t,r);let p=()=>{let n=VV(e.state,t,r.trigger,f()),a=A(A({},i.extraState),n);u?a.instantType=`focus`:d?a.instantType=`dismiss`:l&&(a.instantType=void 0),e.update(a)};l?n.flushSync(p):p()}function WV(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=BV(e,n),o=fz(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e=A({activeTriggerElement:t},i?r:null);n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i=A({activeTriggerId:e==null?null:e,activeTriggerElement:t},r);n.update(i)}}),s=fz(e=>{a(e),e&&o(e)});return TL(()=>(s(t.current),()=>s(null)),[s,t,n,e]),TL(()=>{if(i){let e=A({activeTriggerElement:t.current},r);n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function GV(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=h.useRef(null),i=e.useState(`open`);TL(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=RR(zR);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function KV(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=PV({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){var e,r;t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(e=(r=t.context).onOpenChangeComplete)==null||e.call(r,!1)}});return mL(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function qV(e,t){e.useSyncedValues(t),TL(()=>()=>{e.update({activeTriggerProps:wL,inactiveTriggerProps:wL,popupProps:wL})},[e])}function JV(e,t){TL(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),TL(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}E();var YV;function XV(e){YV!=null||(YV=new WeakMap);let t=YV.get(e);return t||(t=new WeakMap,YV.set(e,t)),t}var ZV=class{constructor(){T(this,`idMap`,new Map)}add(e,t){if(process.env.NODE_ENV!==`production`){let n=XV(this),r=n.get(t);if(r!==void 0&&r!==e)throw Error(`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`);let i=this.idMap.get(e);i!==void 0&&i!==t&&n.delete(i),n.set(t,e)}this.idMap.set(e,t)}delete(e){if(process.env.NODE_ENV!==`production`){let n=this.idMap.get(e);if(n!==void 0){var t;YV==null||(t=YV.get(this))==null||t.delete(n)}}this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},QV=u((e=>{var t=Ed();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),$V=u((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=Ed(),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),eH=u(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?QV():$V()})),tH=u((e=>{var t=Ed(),n=eH();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),nH=u((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=Ed(),r=eH(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),rH=u(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?tH():nH()})),iH=eH(),aH=rH(),oH=gB(19)?lH:uH;function sH(e,t,n,r,i){return oH(e,t,n,r,i)}function cH(e,t,n,r,i){let a=h.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,iH.useSyncExternalStore)(e.subscribe,a,a)}vL({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,iH.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function lH(e,t,n,r,i){let a=_L();if(!a)return cH(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function uH(e,t,n,r,i){return(0,aH.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}E(),j();var dH=class{static create(e){return new this(e)}constructor(e){T(this,`subscribe`,e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),T(this,`getSnapshot`,()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState(A(A({},this.state),e));return}}set(e,t){Object.is(this.state[e],t)||this.setState(A(A({},this.state),{},{[e]:t}))}notifyAll(){let e=A({},this.state);this.setState(e)}use(e,t,n,r){return sH(this,e,t,n,r)}};j();var fH=class extends dH{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){h.useDebugValue(e);let n=this;TL(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;TL(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;if(process.env.NODE_ENV!==`production`){h.useDebugValue(e,e=>Object.keys(e));let t=h.useRef(Object.keys(e)).current,n=Object.keys(e);(t.length!==n.length||t.some((e,t)=>e!==n[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}TL(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){h.useDebugValue(e);let n=this,r=t!==void 0;if(TL(()=>{r&&!Object.is(n.state[e],t)&&n.setState(A(A({},n.state),{},{[e]:t}))},[n,e,t,r]),process.env.NODE_ENV!==`production`){var i;let t=(i=this.controlledValues)==null?this.controlledValues=new Map:i;t.has(e)||t.set(e,r);let n=t.get(e);n!==void 0&&n!==r&&console.error(`A component is changing the ${n?``:`un`}controlled state of ${e.toString()} to be ${n?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return h.useDebugValue(e),sH(this,this.selectors[e],t,n,r)}useContextCallback(e,t){h.useDebugValue(e);let n=fz(t==null?SL:t);this.context[e]=n}useStateSetter(e){let t=h.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};E(),j();var pH=[`syncOnly`,`nested`,`onOpenChange`,`triggerElements`],mH={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>{var t;return(t=e.positionReference)==null?e.referenceElement:t},floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},hH=class extends fH{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i}=e,a=G(e,pH);super(A(A({},a),{},{positionReference:a.referenceElement,domReferenceElement:a.referenceElement}),{onOpenChange:r,dataRef:{current:{}},events:aV(),nested:n,triggerElements:i},mH),T(this,`syncOpenEvent`,(e,t)=>{(!e||!this.state.open||t!=null&&tR(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),T(this,`dispatchOpenChange`,(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}),T(this,`setOpen`,(e,t)=>{var n,r;if(this.syncOnly){var i,a;(i=(a=this.context).onOpenChange)==null||i.call(a,e,t)}else this.dispatchOpenChange(e,t),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t)}),this.syncOnly=t}};function gH(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new hH({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:wL,inactiveTriggerProps:wL,popupProps:wL}}var _H=e=>{var t;return(t=e.triggerIdProp)==null?e.activeTriggerId:t},vH=e=>{var t;return(t=e.openProp)==null?e.open:t},yH=e=>{var t,n;return((t=(n=e.popupElement)==null?void 0:n.id)==null?e.floatingId:t)||void 0};function bH(e,t){return t!==void 0&&vH(e)&&_H(e)===t}function xH(e,t){return bH(e,t)?!0:t!==void 0&&vH(e)&&_H(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var SH={open:vH,mounted:e=>e.mounted,transitionStatus:e=>vH(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:_H,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:yH,isTriggerActive:(e,t)=>t!==void 0&&_H(e)===t,isOpenedByTrigger:(e,t)=>bH(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&_H(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>xH(e,t)?yH(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function CH(e){let t=h.useCallback(t=>e===void 0?SL:e.subscribeStore(t),[e]),n=h.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,iH.useSyncExternalStore)(t,n,()=>e==null?void 0:e.serverStore)}var wH=UL&&qL;function TH(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=h.useRef(!1),s=h.useRef(null),c=h.useRef(!0),l=NL();h.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=KS(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&XS(t)&&t===nR(bz(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return ez($R(r,`blur`,i),wH&&$R(r,`keydown`,a,!0),wH&&$R(r,`pointerdown`,l,!0))},[e,n]),h.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);YS(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=h.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=aR(n.nativeEvent);if(YS(a)){if(wH&&!n.relatedTarget){if(!c.current&&!OR(a))return}else if(!jR(a))return}let u=TR(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,RR(HR,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,RR(HR,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=YS(r)&&r.hasAttribute(Xz(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{var t;let n=e.select(`domReferenceElement`),s=nR(bz(n));!r&&s===n||rR((t=a.current.floatingContext)==null?void 0:t.refs.floating.current,s)||rR(n,s)||o||TR(r==null?s:r,e.context.triggerElements)||e.setOpen(!1,RR(HR,i))})}}},[a,r,e,l]);return h.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}E();var EH=class e{constructor(){T(this,`pointerType`,void 0),T(this,`interactedInside`,!1),T(this,`handler`,void 0),T(this,`blockMouseMove`,!0),T(this,`performedPointerEventsMutation`,!1),T(this,`pointerEventsScopeElement`,null),T(this,`pointerEventsReferenceElement`,null),T(this,`pointerEventsFloatingElement`,null),T(this,`restTimeoutPending`,!1),T(this,`openChangeTimeout`,new ML),T(this,`restTimeout`,new ML),T(this,`handleCloseOptions`,void 0),T(this,`dispose`,()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),T(this,`disposeEffect`,()=>this.dispose)}static create(){return new e}},DH=new WeakMap;function OH(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&DH.get(t)===e){var n,r,i;(n=e.pointerEventsScopeElement)==null||n.style.removeProperty(`pointer-events`),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty(`pointer-events`),(i=e.pointerEventsFloatingElement)==null||i.style.removeProperty(`pointer-events`),DH.delete(t)}e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kH(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=DH.get(n);a&&a!==e&&OH(a),OH(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,DH.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function AH(e){let t=e.context.dataRef.current,n=mL(()=>{var e;return(e=t.hoverInteractionState)==null?EH.create():e}).current;return t.hoverInteractionState||(t.hoverInteractionState=n),AL(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function jH(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=lV(),u=cV(),d=AH(e),f=NL(),p=fz(()=>{var e;return IR((e=c.current.openEvent)==null?void 0:e.type,d.interactedInside)}),m=fz(()=>{var e;return LR((e=c.current.openEvent)==null?void 0:e.type)}),g=fz(()=>{OH(d)});TL(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),h.useEffect(()=>g,[g]),TL(()=>{var e;if(n&&a&&(e=d.handleCloseOptions)!=null&&e.blockPointerEvents&&m()&&YS(s)&&o){var t,r,i,c,f,p,h;let e=s,n=o,a=bz(o),m=l==null||(t=l.nodesRef.current.find(e=>e.id===u))==null||(t=t.context)==null?void 0:t.elements.floating;m&&(m.style.pointerEvents=``);let _=d.pointerEventsScopeElement===n?null:d.pointerEventsScopeElement,v=m===n?null:m,y=(r=(i=(c=(f=(p=d.handleCloseOptions)==null||(h=p.getScope)==null?void 0:h.call(p))==null?_:f)==null?v:c)==null?iR(e,`[data-rootownerid]`):i)==null?a.body:r;return kH(d,{scopeElement:y,referenceElement:e,floatingElement:n}),()=>{g()}}},[n,a,s,o,d,m,l,u,g]),h.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Jz(l.nodesRef.current,u).length>0)}function a(t){let n=PR(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,RR(VR,t)),l==null||l.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=aR(e);kR(t)?d.interactedInside=iR(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function h(){d.openChangeTimeout.clear(),f.clear(),l==null||l.events.off(`floating.closed`,v),g()}function _(n){var r,o;if(t()&&l){l.events.on(`floating.closed`,v);return}if(TR(n.relatedTarget,e.context.triggerElements))return;let s=(r=(o=c.current.floatingContext)==null?void 0:o.nodeId)==null?i:r,u=n.relatedTarget;l&&s&&YS(u)&&Jz(l.nodesRef.current,s,!1).some(e=>{var t;return rR((t=e.context)==null?void 0:t.elements.floating,u)})||(d.handler?d.handler(n):(g(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,RR(VR,n)),l.events.emit(`floating.closed`,n)})}let y=o;return ez(y&&$R(y,`mouseenter`,h),y&&$R(y,`mouseleave`,_),y&&$R(y,`pointerdown`,s,!0),()=>{l==null||l.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,g,d,l,u,f])}j();var MH={current:null};function NH(e,t={}){let{enabled:r=!0,delay:i=0,handleClose:a=null,mouseOnly:o=!1,restMs:s=0,move:c=!0,triggerElementRef:l=MH,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:p,shouldOpen:m,guardStaleOpen:g=!1}=t,{dataRef:_,events:v}=e.context,y=lV(u),b=AH(e),x=h.useRef(!1),S=sz(a),C=sz(i),w=sz(s),T=sz(r),E=sz(m),D=sz(p),O=fz(()=>{var e;return IR((e=_.current.openEvent)==null?void 0:e.type,b.interactedInside)}),k=fz(()=>{var e;return((e=E.current)==null?void 0:e.call(E))!==!1}),j=fz((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!rR(t,n);if(!YS(r))return!1;let a=r;return i.hasMatchingElement(e=>rR(e,a))&&(!t||!rR(t,a))}),M=fz(()=>{b.handler&&(bz(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),b.handler=void 0)}),N=fz(()=>{OH(b)});return d&&(b.handleCloseOptions=a==null?void 0:a.__options),h.useEffect(()=>M,[M]),h.useEffect(()=>{if(!r)return;function e(e){e.open?x.current=!1:(x.current=e.reason===VR,M(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[r,v,b,M]),h.useEffect(()=>{var t;if(!r)return;function n(t,n=!0){let r=PR(C.current,`close`,b.pointerType);r?b.openChangeTimeout.start(r,()=>{e.setOpen(!1,RR(VR,t)),y==null||y.events.emit(`floating.closed`,t)}):n&&(b.openChangeTimeout.clear(),e.setOpen(!1,RR(VR,t)),y==null||y.events.emit(`floating.closed`,t))}let i=(t=l.current)==null?d?e.select(`domReferenceElement`):null:t;if(!YS(i))return;function a(t){var n,r,i;if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,o&&!eR(b.pointerType))return;let a=FR(w.current),s=PR(C.current,`open`,b.pointerType),c=aR(t),l=(n=t.currentTarget)==null?null:n,u=e.select(`domReferenceElement`),d=l;if(YS(c)&&!e.context.triggerElements.hasElement(c)){for(let t of e.context.triggerElements.elements())if(rR(t,c)){d=t;break}}YS(l)&&YS(u)&&!e.context.triggerElements.hasElement(l)&&rR(l,u)&&(d=u);let f=d!=null&&j(u,d,c),p=e.select(`open`),m=(r=(i=D.current)==null?void 0:i.call(D))==null?e.select(`transitionStatus`)===`ending`:r,h=!p&&m&&x.current,g=!f&&YS(d)&&YS(u)&&rR(u,d)&&h,_=a>0&&!s,v=f&&(p||h)||g,y=!p||f;v?k()&&e.setOpen(!0,RR(VR,t,d)):_||(s?b.openChangeTimeout.start(s,()=>{y&&k()&&e.setOpen(!0,RR(VR,t,d))}):y&&k()&&e.setOpen(!0,RR(VR,t,d)))}function s(t){var r;if(O()){N();return}M();let i=bz(e.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let a=(r=_.current.floatingContext)==null?f==null?void 0:f():r;if(!TR(t.relatedTarget,e.context.triggerElements)){if(S.current&&a){e.select(`open`)||b.openChangeTimeout.clear();let r=l.current;b.handler=S.current(A(A({},a),{},{tree:y,x:t.clientX,y:t.clientY,onClose(){N(),M(),T.current&&!O()&&r===e.select(`domReferenceElement`)&&n(t,!0)}})),i.addEventListener(`mousemove`,b.handler),b.handler(t)}else b.pointerType===`touch`&&rR(e.select(`floatingElement`),t.relatedTarget)||n(t)}}function u(e){rR(i,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let p=g?$R(i,`mouseout`,u):void 0;return c?ez($R(i,`mousemove`,a,{once:!0}),$R(i,`mouseenter`,a),$R(i,`mouseleave`,s),p):ez($R(i,`mouseenter`,a),$R(i,`mouseleave`,s),p)},[M,N,_,C,e,r,S,b,d,j,O,o,c,w,l,y,T,f,D,k,g]),h.useMemo(()=>{if(!r)return;function t(e){b.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){var r;let{nativeEvent:i}=t,a=t.currentTarget,s=e.select(`domReferenceElement`),c=e.select(`open`),l=j(s,a,t.target);if(o&&!eR(b.pointerType))return;if(c&&l&&(r=b.handleCloseOptions)!=null&&r.blockPointerEvents){let t=e.select(`floatingElement`);if(t){var u,d,f;let e=(u=(d=b.handleCloseOptions)==null||(f=d.getScope)==null?void 0:f.call(d))==null?a.ownerDocument.body:u;kH(b,{scopeElement:e,referenceElement:a,floatingElement:t})}}let p=FR(w.current);if(c&&!l||p===0||!l&&b.restTimeoutPending&&Math.pow(t.movementX,2)+Math.pow(t.movementY,2)<2)return;b.restTimeout.clear();function m(){if(b.restTimeoutPending=!1,O())return;let t=e.select(`open`);!b.blockMouseMove&&(!t||l)&&k()&&e.setOpen(!0,RR(VR,i,a))}b.pointerType===`touch`?n.flushSync(()=>{m()}):l&&c?m():(b.restTimeoutPending=!0,b.restTimeout.start(p,m))}}},[r,b,O,j,o,e,w,k])}j();var PH=.1,FH=PH*PH,IH=.5;function LH(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function RH(e,t,n,r,i,a,o,s,c,l){let u=!1;return LH(e,t,n,r,i,a)&&(u=!u),LH(e,t,i,a,o,s)&&(u=!u),LH(e,t,o,s,c,l)&&(u=!u),LH(e,t,c,l,n,r)&&(u=!u),u}function zH(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function BH(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function VH(e={}){let{blockPointerEvents:t=!1}=e,n=new ML,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r==null?void 0:r.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*FH;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=aR(r),g=r.type===`mouseleave`,_=rR(u,h),v=rR(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&YS(r.relatedTarget)&&rR(u,r.relatedTarget))return;function y(){return!!(s&&Jz(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=BH(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=BH(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=BH(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=BH(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zH(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?IH/2:IH*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+IH+1,o=C||T?S.bottom-IH:S.top,s=C?T?S.bottom-IH:S.top:S.bottom-IH;M=RH(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?IH/2:IH*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-IH,o=C||T?S.top+IH:S.bottom,s=C?T?S.top+IH:S.bottom:S.top+IH;M=RH(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?IH/2:IH*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+IH+1,o=w||E?S.right-IH:S.left,s=w?E?S.right-IH:S.left:S.right-IH;M=RH(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?IH/2:IH*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-IH,o=w||E?S.left+IH:S.right,s=w?E?S.left+IH:S.right:S.left+IH;M=RH(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options=A(A({},e),{},{blockPointerEvents:t}),r}j(),E();var HH=A(A({},SH),{},{disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin}),UH=class extends fH{constructor(e,t,n){let r=new ZV;super(WH(e,r,t,n),GH(r),HH),T(this,`setOpen`,(e,t)=>{UV(this,e,t,{extraState:{openChangeReason:t.reason}})})}cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,RR(BR,e))}};function WH(e,t,n,r=!1){return A(A({},gH(t,n,r)),{},{disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0},e)}function GH(e){return{popupRef:h.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var KH=yL(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=LV((e,t)=>new UH({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),g=!t&&m,_=p.useState(`activeTriggerId`),v=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),GV(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=KV(g,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=h.useRef(null);TL(()=>{m&&t&&p.setOpen(!1,RR(qR))},[m,t,p]),TL(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),TL(()=>{g&&_==null&&p.set(`payload`,void 0)},[p,_,g]),h.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,RR(JR))}),[b,p]);let E=g||v||!t&&a!==`none`;return(0,X.jsxs)(OL.Provider,{value:p,children:[l&&(0,X.jsx)(RV,{handle:l,store:p}),E&&(0,X.jsx)(qH,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});process.env.NODE_ENV!==`production`&&(KH.displayName=`TooltipRoot`);function qH({store:e,disabled:t,trackCursorAxis:n}){var r;let i=e.useState(`floatingRootContext`),a=EV(i,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),o=CV(i,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),s=h.useMemo(()=>EB(o.reference,a.reference),[o.reference,a.reference]);return qV(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:(r=a.floating)==null?wL:r}),null}function JH(e){return mB(e,`base-ui`)}var YH=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(YH.displayName=`TooltipProviderContext`);function XH(){return h.useContext(YH)}var ZH=[`render`,`className`,`style`,`handle`,`payload`,`disabled`,`delay`,`closeOnClick`,`closeDelay`,`id`],QH=`data-base-ui-tooltip-trigger`;function $H(e){let t=aR(e);return YS(t)?t:null}var eU=bL(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d}=e,f=G(e,ZH),p=kL(!0),m=CH(a),g=m==null?p:m;if(!g)throw Error(process.env.NODE_ENV===`production`?DL(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let _=JH(d),v=g.useState(`isTriggerActive`,_),y=g.useState(`isOpenedByTrigger`,_),b=g.useState(`floatingRootContext`),x=h.useRef(null),S=u==null?0:u,{registerTrigger:C,isMountedByThisTrigger:w}=WV(_,x,g,{payload:o,closeOnClick:l,closeDelay:S}),T=XH(),{activeIdRef:E,delayRef:D,isInstantPhase:O,hasProvider:k}=QR(b,{open:y}),A=AH(b);g.useSyncedValue(`isInstantPhase`,O);let j=g.useState(`disabled`),M=s==null?j:s,N=sz(M),P=g.useState(`trackCursorAxis`),F=g.useState(`disableHoverablePopup`),I=h.useRef(!1),L=NL(),R=h.useRef(void 0);function z(){var e;return k&&E.current!=null?0:(e=c==null?T:c)==null?600:e}function B(e){let t=x.current;if(!t||!e)return!1;let n=iR(e,`[${QH}]`);return n!==null&&n!==t&&rR(t,n)}function ee(e){let t=B(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let V=NH(b,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!F&&P!==`both`?VH():null,restMs:z,delay(){return u==null&&k?{close:PR(D.current,`close`)}:{close:S}},triggerElementRef:x,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),te=TH(b,{enabled:!M}).reference,ne=e=>{let t=I.current,n=$H(e),r=ee(n),i=x.current,a=i&&n&&rR(i,n);if(r&&g.select(`open`)&&g.select(`lastOpenChangeReason`)===`trigger-hover`)g.setOpen(!1,RR(VR,e));else if(t&&!r&&a&&!N.current&&!g.select(`open`)&&i&&eR(R.current)){let t=()=>{I.current||N.current||g.select(`open`)||g.setOpen(!0,RR(VR,e,i))},n=z();n===0?(L.clear(),t()):L.start(n,t)}},H=g.useState(`appliedTriggerProps`,w||P!==`none`);return zB(`button`,e,{state:{open:y},ref:[t,C,x],props:[V,te,H,{onMouseOver(e){ne(e.nativeEvent)},onFocus(e){B($H(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,g.set(`closeOnClick`,l),l&&!g.select(`open`)&&g.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!g.select(`open`)&&g.cancelPendingOpen(e.nativeEvent)},id:_,[wR]:M?``:void 0,[QH]:M?void 0:``},f],stateAttributesMapping:xR})});process.env.NODE_ENV!==`production`&&(eU.displayName=`TooltipTrigger`);var tU=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(tU.displayName=`TooltipPortalContext`);function nU(){let e=h.useContext(tU);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?DL(70):`Base UI: <Tooltip.Portal> is missing.`);return e}var rU=[`children`,`container`,`className`,`render`,`style`],iU=h.forwardRef(function(e,t){let{children:r,container:i,className:a,render:o,style:s}=e,{node:c,subtree:l}=rV({container:i,ref:t,componentProps:e,elementProps:G(e,rU)});return!l&&!c?null:(0,X.jsxs)(h.Fragment,{children:[l,c&&n.createPortal(r,c)]})});process.env.NODE_ENV!==`production`&&(iU.displayName=`FloatingPortalLite`),j();var aU=[`keepMounted`],oU=h.forwardRef(function(e,t){let{keepMounted:n=!1}=e,r=G(e,aU);return kL().useState(`mounted`)||n?(0,X.jsx)(tU.Provider,{value:n,children:(0,X.jsx)(iU,A({ref:t},r))}):null});process.env.NODE_ENV!==`production`&&(oU.displayName=`TooltipPortal`);var sU=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(sU.displayName=`TooltipPositionerContext`);function cU(){let e=h.useContext(sU);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?DL(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}j();function lU(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=h.useState(null),d=h.useRef(null),f=lV(n),p=h.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=rw(A(A({},e),{},{elements:A(A({},p),l&&{reference:l})})),g=h.useCallback(e=>{let t=YS(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),_=h.useMemo(()=>A(A({},m.refs),{},{setPositionReference:g,domReference:d}),[m.refs,g]),v=h.useMemo(()=>A(A({},m.elements),{},{domReference:o}),[m.elements,o]),y=h.useMemo(()=>A(A({},m),{},{dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[m,_,v,t,r,s,c]);return TL(()=>{o&&(d.current=o)},[o]),TL(()=>{r.context.dataRef.current.floatingContext=y;let e=f==null?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),h.useMemo(()=>A(A({},m),{},{context:y,refs:_,elements:v,rootStore:r}),[m,_,v,y,r])}var uU=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(uU.displayName=`DirectionContext`);function dU(){var e;let t=h.useContext(uU);return(e=t==null?void 0:t.direction)==null?`ltr`:e}j();var fU=e=>({name:`arrow`,options:e,fn(t){return O(function*(){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=rS(e,t)||{};if(l==null)return{};let d=xS(u),f={x:n,y:r},p=lS(i),m=sS(p),h=yield o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,j=nS(D,k,O),M=!c.arrow&&aS(i)!=null&&k!==j&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,N=M?k<D?k-D:k-O:0;return{[p]:f[p]+N,data:A({[p]:j,centerOffset:k-j-N},M&&{alignmentOffset:N}),reset:M}})()}}),pU=(e,t)=>{let{name:n,fn:r}=fU(e);return{name:n,fn:r,options:[e,t]}},mU={name:`hide`,fn(e){return O(function*(){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=yield e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}})()}},hU={sideX:`left`,sideY:`top`},gU=`--available-width`,_U=`--available-height`,vU=`--anchor-width`,yU=`--anchor-height`,bU=`--transform-origin`;j();var xU=gU,SU=_U;function CU(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function wU(e,t,n){let{rects:r,placement:i}=e;return{side:CU(t,iS(i),n),align:aS(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function TU(e){return EU(e,lU)}function EU(e,t){var n,r,i;let{anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,sideOffset:c=0,align:l=`center`,alignOffset:u=0,collisionBoundary:d,collisionPadding:f=5,sticky:p=!1,arrowPadding:m=5,disableAnchorTracking:g=!1,inline:_,keepMounted:v=!1,floatingRootContext:y,mounted:b,collisionAvoidance:x,shift:S,nodeId:C,adaptiveOrigin:w,lazyFlip:T=!1,externalTree:E}=e,D=x.side||`flip`,O=x.align||`flip`,k=x.fallbackAxisSide||`end`,j=(n=S==null?void 0:S.crossAxis)!=null&&n,M=S==null?void 0:S.rootBoundary,N=typeof a==`function`?a:void 0,P=fz(N),F=N?P:a,I=sz(a),L=sz(b),R=dU()===`rtl`,[z,B]=h.useState(null);!b&&z!==null&&B(null);let ee=T===`placement`,V=z?iS(z):null,te=z&&ee?aS(z)||`center`:null,ne=V||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":R?`left`:`right`,"inline-start":R?`right`:`left`}[s],H=te||l,U=H===`center`?ne:`${ne}-${H}`,re=f;typeof re==`number`?re={top:re,right:re,bottom:re,left:re}:re&&(re={top:re.top||0,right:re.right||0,bottom:re.bottom||0,left:re.left||0});let ie=+(s===`bottom`),W=+(s===`top`),ae=+(s===`right`),G=+(s===`left`),oe={boundary:d===`clipping-ancestors`?`clippingAncestors`:d,padding:re},se=h.useRef(null),ce=sz(c),le=sz(u),ue=typeof c==`function`?0:c,de=typeof u==`function`?0:u,fe=[];_&&fe.push(_),fe.push(aw(e=>{let t=wU(e,s,R),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof le.current==`function`?le.current(t):le.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ue,de,R,s]));let pe=O===`none`&&D!==`shift`,me=!pe&&(p||j||D===`shift`),he=D===`none`?null:cw(A(A({},oe),{},{padding:{top:re.top+1+ie,right:re.right+1+G,bottom:re.bottom+1+W,left:re.left+1+ae},mainAxis:!j&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k})),ge=pe?null:ow(A(A({},oe),{},{rootBoundary:M,mainAxis:O!==`none`,crossAxis:me,limiter:p||j?void 0:sw(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=cS(iS(e.placement)),i=r===`y`?t:n,a=r===`y`?re.left+re.right:re.top+re.bottom;return{offset:i/2+a/2}})}),[oe,p,j,M,re,O]);D===`shift`||O===`shift`||H===`center`?fe.push(ge,he):fe.push(he,ge),fe.push(lw(A(A({},oe),{},{apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!L.current)return;let i=e.style;i.setProperty(xU,`${t}px`),i.setProperty(SU,`${n}px`);let a=KS(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(vU,`${u}px`),i.setProperty(yU,`${d}px`)}})),pU(e=>({element:se.current||bz(e.elements.floating).createElement(`div`),padding:se.current?m:0}),[m]),{name:`transformOrigin`,fn(e){var t,n,r;let{elements:{floating:i},middlewareData:a,placement:o,platform:l,rects:u,y:d}=e,f=iS(o),p=aS(o),m=cS(f)===`y`,h=se.current,g=typeof c==`function`?c(wU(e,s,R)):c,_;if(!h&&p&&Math.abs(m?((t=a.shift)==null?void 0:t.x)||0:((n=a.shift)==null?void 0:n.y)||0)<=1){var v;_=p===`start`===(m&&((v=l.isRTL)==null?void 0:v.call(l,i))===!0)?`100%`:`0%`}else{var y,b;_=`${(m?((y=a.arrow)==null?void 0:y.x)||0:((b=a.arrow)==null?void 0:b.y)||0)+(m?(h==null?void 0:h.clientWidth)||0:(h==null?void 0:h.clientHeight)||0)/2}px`}let x=f===`top`||f===`left`?`calc(100% + ${g}px)`:`${-g}px`;return me&&m&&Math.abs(((r=a.shift)==null?void 0:r.y)||0)>g&&(x=`${u.reference.y+u.reference.height/2-d}px`),i.style.setProperty(bU,m?`${_} ${x}`:`${x} ${_}`),{}}},mU,w),TL(()=>{!b&&y&&y.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,y]);let _e=h.useMemo(()=>({ancestorScroll:!g,elementResize:!g&&typeof ResizeObserver<`u`,layoutShift:!g&&typeof IntersectionObserver<`u`}),[g]),{refs:ve,elements:ye,x:be,y:xe,middlewareData:Se,update:Ce,placement:we,context:Te,isPositioned:Ee,floatingStyles:De}=t({rootContext:y,open:v?b:void 0,placement:U,middleware:fe,strategy:o,whileElementsMounted:v?void 0:(...e)=>UC(...e,_e),nodeId:C,externalTree:E}),{sideX:Oe,sideY:ke}=Se.adaptiveOrigin||hU,Ae=Ee?o:`fixed`,je=h.useMemo(()=>{let e;return e=Ee?w?{position:Ae,[Oe]:be,[ke]:xe}:A(A({},De),{},{position:Ae}):{position:Ae,top:0,left:0},e[xU]=`100vw`,e[SU]=`100vh`,Ee||(e.opacity=0),e},[w,Ae,Oe,be,ke,xe,De,Ee]),Me=h.useRef(null);TL(()=>{if(!b)return;let e=I.current,t=typeof e==`function`?e():e,n=(DU(t)?t.current:t)||null;n!==Me.current&&(ve.setPositionReference(n),Me.current=n)},[b,ve,F,I]),h.useEffect(()=>{if(!b)return;let e=I.current;typeof e!=`function`&&DU(e)&&e.current!==Me.current&&(ve.setPositionReference(e.current),Me.current=e.current)},[b,ve,F,I]),h.useEffect(()=>{if(v&&b&&ye.reference&&ye.floating)return UC(ye.reference,ye.floating,Ce,_e)},[v,b,ye,Ce,_e]);let Ne=iS(we),Pe=CU(s,Ne,R),Fe=aS(we)||`center`,Ie=!!((r=Se.hide)!=null&&r.referenceHidden);TL(()=>{T&&b&&Ee&&(Ne!==ne||ee&&Fe!==H)&&B(we)},[T,ee,b,Ee,we,Ne,Fe,ne,H]);let Le=h.useMemo(()=>{var e,t;return{position:`absolute`,top:(e=Se.arrow)==null?void 0:e.y,left:(t=Se.arrow)==null?void 0:t.x}},[Se.arrow]),Re=((i=Se.arrow)==null?void 0:i.centerOffset)!==0;return h.useMemo(()=>({positionerStyles:je,arrowStyles:Le,arrowRef:se,arrowUncentered:Re,side:Pe,align:Fe,physicalSide:Ne,anchorHidden:Ie,refs:ve,context:Te,isPositioned:Ee,update:Ce}),[je,Le,se,Re,Pe,Fe,Ne,Ie,ve,Te,Ee,Ce])}function DU(e){return e!=null&&`current`in e}function OU(e){return e===`starting`?YB:wL}j();function kU(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c=A({},n);return s&&(c.pointerEvents=`none`),zB(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},OU(r),i],stateAttributesMapping:SR})}var AU=[`render`,`className`,`anchor`,`positionMethod`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`,`style`],jU=h.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:g=ZB,style:_}=e,v=G(e,AU),y=kL(),b=nU(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=TU({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=kU(e,h.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,X.jsx)(sU.Provider,{value:O,children:k})});process.env.NODE_ENV!==`production`&&(jU.displayName=`TooltipPositioner`);var MU=[`render`,`className`,`style`],NU=h.forwardRef(function(e,t){let{render:n,className:r,style:i}=e,a=G(e,MU),o=kL(),{side:s,align:c}=cU(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);NV({open:l,ref:o.context.popupRef,onComplete(){if(l){var e,t;(e=(t=o.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),jH(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return zB(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[FV,f,OU(d),a],stateAttributesMapping:CR})});process.env.NODE_ENV!==`production`&&(NU.displayName=`TooltipPopup`);var PU=[`render`,`className`,`style`],FU=h.forwardRef(function(e,t){let{render:n,className:r,style:i}=e,a=G(e,PU),o=kL(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=cU();return zB(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:SR})});process.env.NODE_ENV!==`production`&&(FU.displayName=`TooltipArrow`);var IU=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=h.useMemo(()=>({open:t,close:n}),[t,n]);return(0,X.jsx)(YH.Provider,{value:t,children:(0,X.jsx)(ZR,{delay:i,timeoutMs:r,children:e.children})})};process.env.NODE_ENV!==`production`&&(IU.displayName=`TooltipProvider`);function LU(e){return gB(19)?e:e?`true`:void 0}var RU=48,zU=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-RU-t;return n},BU=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},VU=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-RU;n+=i>>>1^-(i&1),t[r]=n}return t},HU=384,UU=[],WU=BU(zU(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),GU=BU(zU(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),KU=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,qU=(()=>{let e=WU.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=WU[n];i<WU[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(WU[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=WU[i];a<WU[i+1];a++)n[r++]=e,e+=t[e]}return n})(),JU=zU(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),YU=BU(zU(`123333359346463635126536711576`)),XU=zU(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),ZU=zU(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),QU=VU(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),$U=(()=>{let e=new Int32Array(319).fill(-1),t=VU(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=VU(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),eW=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),tW=VU(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),nW=VU(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),rW=VU(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±`),iW=new Int32Array(987),aW=new Int32Array(987),oW=new Int32Array(987),sW=``,cW=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<tW.length;r++)for(let i of eW[rW[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),cW[a*2]=sW.length,cW[a*2+1]=i.length,sW+=i),iW[n]=tW[r],aW[n]=nW[r],oW[n]=a,n++}}var lW=VU(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),uW=BU(zU(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),dW=VU(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),fW=zU(`ij`),pW=zU(`—`),mW=zU(`1`),hW={GROUP_COUNT:HU,customValidatorNames:UU,edgeStart:WU,labelStart:GU,labelText:KU,edgeTarget:qU,nodeGroup:JU,nodeVlist:$U,vlistPat:YU,vlistOps:XU,vlistRef:ZU,vlistGroup:QU,litAnchor:iW,litGroup:aW,litPool:oW,poolOffsets:cW,poolText:sW,adjGid:lW,adjStart:uW,adjTgt:dW,patGid:fW,patTgt:pW,postfixLookupGroups:mW,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},gW=`line`in Error(),_W=-1,vW=-1,yW=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},bW=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},xW=(e,t,n={})=>{var r,i,a;let{GROUP_COUNT:o,edgeStart:s,labelStart:c,labelText:l,edgeTarget:u,nodeGroup:d,nodeVlist:f,vlistPat:p,vlistOps:m,vlistRef:h,vlistGroup:g,litAnchor:_,litGroup:v,litPool:y,poolOffsets:b,poolText:x,adjGid:S,adjStart:C,adjTgt:w,patGid:T,patTgt:E,postfixLookupGroups:D,customValidatorNames:O,orderSensitiveModifiers:k}=e,A=new Int32Array(o).fill(-1);for(let e=0;e<S.length;e++)A[S[e]]=e;let j=0;for(let e=0;e+1<C.length;e++){let t=C[e+1]-C[e];t>j&&(j=t)}let M=32;for(;M<2*(1+j+T.length);)M<<=1;let N=new Int32Array(h.length+1);for(let e=0;e<h.length;e++)N[e+1]=N[e]+p[h[e]+1]-p[h[e]];let P=new Uint8Array(o);for(let e=0;e<D.length;e++)P[D[e]]=1;let F=s.length-1,I=new Uint8Array(F),L=0,R=!0;for(let e=0;e<_.length;e++){I[_[e]]=1;let t=b[y[e]*2+1];t>L&&(L=t);let n=x.charCodeAt(b[y[e]*2]);(n===91||n===40)&&(R=!1)}let z=1;for(;z<_.length*2;)z<<=1;let B=new Int32Array(z).fill(-1);for(let e=0;e<_.length;e++){let t=b[y[e]*2],n=(yW(x,t,t+b[y[e]*2+1])^Math.imul(_[e],2654435761)|0)&z-1;for(;B[n]!==-1;)n=n+1&z-1;B[n]=e}let ee=(e,t,n,r)=>{let i=(yW(t,n,r)^Math.imul(e,2654435761)|0)&z-1,a=r-n;for(;;){let r=B[i];if(r===-1)return-1;if(_[r]===e&&b[y[r]*2+1]===a){let e=b[y[r]*2],i=!0;for(let r=0;r<a;r++)if(x.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return v[r]}i=i+1&z-1}},V=(r=n.cacheSize)==null?8192:r,te=(i=(a=n.prefix)==null?e.prefix:a)==null?``:i,ne=te===``?``:te+`:`,H=ne.length,U=(O==null?[]:O).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),re=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,W=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=0,oe=-1,se=-1,ce=-1,le=-1,ue=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,de=e=>/\s/.test(String.fromCharCode(e)),fe=(e,t,n)=>{if(G=0,oe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)G=1;else if(r===40&&i===41)G=2;else return;ce=t+1,le=n-1;let a=t+1;if(ue(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ue(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,se=a,ce=a+1)}},pe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},me=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,he=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ge=e=>!!e&&!Number.isNaN(Number(e)),_e=(e,t,n)=>{if(n-t<11||!pe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&pe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&pe(e,t+10,t+18,`-normal/`)},ve=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ye=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),be=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],xe=(e,t,n,r)=>{if(e>=10){if(e>=25)return U[e-25](t.slice(n,r));let i=e-10;if(G!==ve[i])return!1;if(oe>=0){for(let e of ye[i])if(pe(t,oe,se,e))return!0;return!1}switch(be[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ce,le);return re.test(e)&&!ie.test(e)}case 3:return ge(t.slice(ce,le));case 4:return ae.test(t.slice(ce,le));default:return W.test(t.slice(ce,le))}}switch(e){case 0:return!0;case 1:return G===0;case 2:return G===1;case 3:return G===2;case 4:return me.test(t.slice(n,r));case 5:return ge(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&ge(t.slice(n,r-1));case 8:return he.test(t.slice(n,r));default:return _e(t,n,r)}},Se=new Set(typeof k==`string`?k.split(` `):k),Ce=(e,t,n,r,i,a)=>{let o=yW(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},we=new Map,Te=new Map,Ee=2,De=4096,Oe=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||Se.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Te.get(s);return c===void 0&&Te.set(s,c=Ee++),c},ke=new Map,Ae=o,je=o+4096,Me=()=>Ae++,Ne=2097152,Pe=8192,Fe=new Int32Array(Pe),Ie=Array(Pe).fill(null),Le=new Int32Array(Pe),Re=new Int32Array(Pe),ze=new Uint8Array(Pe),Be=0,Ve=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ie[e]!==null){if(Ie[e|1]===null)c=e|1;else if(!(Be++&3))c=e|Be>>2&1;else return}Ie[c]=t.slice(n,r),Fe[c]=i,Le[c]=a,Re[c]=o,ze[c]=s},He=()=>Ie.fill(null),Ue=256,We=[new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue)],[Ge,Ke,qe,Je]=We,Ye=new Uint8Array(Ue),Xe=new Uint8Array(Ue),Ze=()=>{Ue*=2,We=We.map(e=>{let t=new Int32Array(Ue);return t.set(e),t}),[Ge,Ke,qe,Je]=We;let e=new Uint8Array(Ue);e.set(Ye),Ye=e,Xe=new Uint8Array(Ue)},Qe=64,$e=new Int32Array(Qe),et=new Int32Array(Qe),tt=new Int32Array(o),nt=2048,rt=21,it=new Float64Array(nt),at=new Int32Array(nt),ot=0,st=(e,t)=>{if(e===0&&t<o)return tt[t]===ot?1:(tt[t]=ot,0);let n=e*2097152+t+1,r=Math.imul(n,2654435761)>>>rt;for(;at[r]===ot;){if(it[r]===n)return 1;r=r+1&nt-1}return it[r]=n,at[r]=ot,0},ct=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?_W:Ce(ke,e,t+1,r,0,Me)}if(r>=0&&d[r]>=0)return d[r];for(let t=i-1;t>=0;t--){let r=et[t];if(r>n)continue;let i=$e[t],a=n-r;if(I[i]===1&&a>0&&a<=L){let t=e.charCodeAt(r);if(R===!1||t!==91&&t!==40){let t=ee(i,e,r,n);if(t>=0)return t}}let o=f[i];if(o<0)continue;let s=h[o],c=p[s],l=p[s+1];if(c===l)continue;fe(e,r,n);let u=N[o]-c;for(let t=c;t<l;t++)if(xe(m[t],e,r,n))return g[u+t]}return _W},lt=e=>{let t=e.length,n=0,r=0,i=!1;(Ee>De||we.size>De)&&(we=new Map,Te=new Map,Ee=2,He()),Ae>je&&(ke=new Map,Ae=o,He());let a=0;for(;a<t;){let d=e.charCodeAt(a);if(d===32||d>=9&&d<=13||d>=160&&de(d)){d!==32&&(i=!0),a++;continue}let p=a,m=0;for(;a<t;){if(d=e.charCodeAt(a),d<=32){if(d===32)break;if(d>=9&&d<=13){i=!0;break}}else if(d>=160&&de(d)){i=!0;break}m=Math.imul(m^d,16777619),a++}let h=a,g=h-p;n===Ue&&Ze();let _=n++;Ge[_]=p,Ke[_]=h,r+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Fe[y]===v&&Ie[y]!==null&&Ie[y].length===g?t=y:Fe[y|1]===v&&Ie[y|1]!==null&&Ie[y|1].length===g&&(t=y|1),t>=0){let n=Ie[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){qe[_]=Le[t],Je[_]=Re[t],Ye[_]=ze[t];continue}}}let b=p;if(H!==0){if(h-p<=H||!e.startsWith(ne,p)){qe[_]=_W,Ve(y,e,p,h,v,_W,0,0);continue}b=p+H}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let j=E;D-E>1&&e.charCodeAt(E)===45&&(j=E+1);let M=0,N=0,F=0,L=-1,R=0;(f[0]>=0||I[0]===1)&&($e[0]=0,et[0]=j,R=1);let z=vW,B=0;for(let t=j;t<D;t++)if(t===A&&(z=N<F?vW:M,B=R),M!==vW){let n=e.charCodeAt(t),r=-1;if(N<F)l.charCodeAt(N)===n?(N++,N===F&&(r=M=L)):M=vW;else{let e=s[M],t=s[M+1],i=vW;for(let a=e;a<t;a++){let e=c[a];if(l.charCodeAt(e)===n){c[a+1]-e===1?r=i=u[a]:(N=e+1,F=c[a+1],L=u[a],i=M);break}}M=i}if(r>=0&&(f[r]>=0||I[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Qe){Qe*=2;let e=new Int32Array(Qe);e.set($e),$e=e;let t=new Int32Array(Qe);t.set(et),et=t}$e[R]=r,et[R]=t+2,R++}}A===D&&(z=N<F?vW:M,B=R);let ee=N<F?vW:M,V,te=!1;if(A>=0){if(te=!0,V=ct(e,E,A,z,B),V!==_W&&V<o&&P[V]){let t=ct(e,E,D,ee,R);t!==_W&&t!==V&&(V=t,te=!1)}else V===_W&&(V=ct(e,E,D,ee,R),te=!1)}else V=ct(e,E,D,ee,R);let U=0,re=0;V===_W?qe[_]=_W:(re=+!!te,U=b>=C?+!!O:Ce(we,e,b,C,+!!O,e=>Oe(e,O)),qe[_]=V,Ye[_]=re,Je[_]=U),Ve(y,e,p,h,v,V,U,re)}if(n===0)return``;if(n===1)return Ge[0]===0&&Ke[0]===t?e:e.slice(Ge[0],Ke[0]);if(n*M>nt){for(;n*M>nt;)nt<<=1,rt--;it=new Float64Array(nt),at=new Int32Array(nt)}if(Ee>=Ne||Ae>=Ne)throw Error(`cn: too many distinct classes in one merge`);ot=ot+1|0,ot===0&&(tt.fill(0),at.fill(0),ot=1);let d=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===_W){Xe[e]=1;continue}let n=Je[e];if(st(n,t)===1)Xe[e]=0,d=!0;else if(Xe[e]=1,t<o){let r=A[t];if(r>=0)for(let e=C[r];e<C[r+1];e++)st(n,w[e]);if(Ye[e]&1)for(let e=0;e<T.length;e++)T[e]===t&&st(n,E[e])}}if(!d&&!i&&t===r+n-1)return e;let p=``,m=0;for(;m<n;){if(!Xe[m]){m++;continue}let t=Ge[m],r=Ke[m],i=m+1;for(;i<n&&Xe[i]&&Ge[i]===r+1&&e.charCodeAt(r)===32;)r=Ke[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ut=16384,dt=new Int32Array(ut*2),ft=0,pt=1,mt=Object.create(null),ht=Object.create(null),gt=new Map,_t=new Map,vt=0,yt=0,bt=()=>{ft^=ut,pt=pt+1|0,yt=0},xt=e=>{let t=mt[e];if(t!==void 0)return t;let n=bW(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=ht[e],t!==void 0)?(mt[e]=t,t):(t=lt(e),i?(mt[e]=t,++vt>V&&(vt=0,ht=mt,mt=Object.create(null),bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},St=e=>{let t=gt.get(e);if(t!==void 0)return t;let n=bW(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=_t.get(e),t!==void 0)?(gt.set(e,t),t):(t=lt(e),i?(gt.set(e,t),++vt>V&&(vt=0,_t=gt,gt=new Map,bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},Ct=e=>{let t=bW(e,0,e.length),n=(t&16383)+ft;return dt[n]===(t^pt)||dt[n^ut]===(t^pt-1)||(dt[n]=t^pt,++yt>ut&&bt(),!1)},wt=V===0?lt:gW?e=>{let t=gt.get(e);return t===void 0?St(e):t}:xt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?wt(arguments[0]):wt(wW.apply(null,arguments))},mergeString:wt,seenBefore:V===0?()=>!1:Ct,mergeUncached:lt}},SW=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:SW(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},CW=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:SW(i,t);a&&(n&&(n+=` `),n+=a)}return n},wW=function(){return CW(arguments,!1)},TW=256,EW=16,DW=1024,OW=4096,kW=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(OW).fill(``),l=Array(OW).fill(``),u=Array(OW).fill(``));let i=bW(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=SW(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){var y;let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:(y=c[2])==null?``:y,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>EW&&(_.miss=EW,_.skip=DW,_.e.length=0,_.at=0);let u=_.e;u.length<TW?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(SW(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},AW=xW(hW),Q=kW(AW.mergeString,AW);AW.merge;function jW(e){if(e==null)throw TypeError(`Cannot destructure `+e)}function MW(){return MW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MW.apply(null,arguments)}j();var NW=[`delay`],PW=[`className`,`side`,`sideOffset`,`align`,`alignOffset`,`children`];function FW(e){let{delay:t=0}=e,n=G(e,NW);return(0,X.jsx)(IU,A({"data-slot":`tooltip-provider`,delay:t},n))}function IW(e){let t=MW({},(jW(e),e));return(0,X.jsx)(KH,A({"data-slot":`tooltip`},t))}function LW(e){let t=MW({},(jW(e),e));return(0,X.jsx)(eU,A({"data-slot":`tooltip-trigger`},t))}function RW(e){let{className:t,side:n=`top`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,children:o}=e,s=G(e,PW);return(0,X.jsx)(oU,{children:(0,X.jsx)(jU,{align:i,alignOffset:a,side:n,sideOffset:r,className:`isolate z-50`,children:(0,X.jsxs)(NU,A(A({"data-slot":`tooltip-content`,className:Q(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t)},s),{},{children:[o,(0,X.jsx)(FU,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]}))})})}var zW=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(zW.displayName=`DialogRootContext`);function BW(e){let t=h.useContext(zW);if(!e&&t===void 0)throw Error(process.env.NODE_ENV===`production`?DL(27):`Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.`);return t}var VW=[`render`,`className`,`style`,`forceRender`],HW=h.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1}=e,o=G(e,VW),s=BW(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return zB(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:CR,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});process.env.NODE_ENV!==`production`&&(HW.displayName=`DialogBackdrop`);var UW=bB(`error`,`Base UI`),WW=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(WW.displayName=`CompositeRootContext`);function GW(e=!1){let t=h.useContext(WW);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?DL(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return t}function KW(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:h.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function qW(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(KS(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}var JW=[`onClick`,`onMouseDown`,`onKeyUp`,`onKeyDown`,`onPointerDown`];function YW(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=h.useRef(null),s=GW(!0),c=a==null?s!==void 0:a,{props:l}=KW({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i});process.env.NODE_ENV!==`production`&&h.useEffect(()=>{if(!o.current)return;let e=XW(o.current);if(i){if(!e){var t;UW(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${((t=lz.captureOwnerStack)==null?void 0:t.call(lz))||``}`)}}else if(e){var n;UW(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${((n=lz.captureOwnerStack)==null?void 0:n.call(lz))||``}`)}},[i]);let u=h.useCallback(()=>{let e=o.current;XW(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return TL(u,[u]),{getButtonProps:h.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s}=e,u=G(e,JW);return EB({onClick(e){t?e.preventDefault():n==null||n(e)},onMouseDown(e){t||r==null||r(e)},onKeyDown(e){if(t||(IB(e),o==null||o(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=XW(r),s=!i&&ZW(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=(f==null?void 0:f.startsWith(`menuitem`))||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),qW(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),qW(r,e)))},onKeyUp(e){t||(IB(e),a==null||a(e),e.target===e.currentTarget&&i&&c&&XW(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),qW(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s==null||s(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:fz(e=>{o.current=e,u()})}}function XW(e){return XS(e)&&e.tagName===`BUTTON`}function ZW(e){return XS(e)&&e.tagName===`A`&&!!e.href}var QW=[`render`,`className`,`style`,`disabled`,`nativeButton`],$W=h.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0}=e,s=G(e,QW),c=BW(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=YW({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,RR(WR,e.nativeEvent))}return zB(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})});process.env.NODE_ENV!==`production`&&($W.displayName=`DialogClose`);var eG=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(eG.displayName=`DialogPortalContext`);function tG(){let e=h.useContext(eG);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?DL(26):`Base UI: <Dialog.Portal> is missing.`);return e}var nG=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),rG=`--nested-dialogs`,iG=`data-nested-dialog-open`;j();var aG=A(A(A({},SR),fR),{},{nestedDialogOpen(e){return e?{[iG]:``}:null}});j();var oG=[`render`,`className`,`style`,`finalFocus`,`initialFocus`],sG=h.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o}=e,s=G(e,oG),c=BW(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);tG(),NV({open:_,ref:c.context.popupRef,onComplete(){if(_){var e,t;(e=(t=c.context).onOpenChangeComplete)==null||e.call(t,!0)}}});let C=o===void 0?IV(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=zB(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,A(A({id:S,"aria-labelledby":y,"aria-describedby":l,role:x},FV),{},{hidden:!m,onKeyDown(e){nG.has(e.key)&&e.stopPropagation()},style:{[rG]:g}}),s],ref:[t,c.context.popupRef,T],stateAttributesMapping:aG});return(0,X.jsx)(yV,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});process.env.NODE_ENV!==`production`&&(sG.displayName=`DialogPopup`),j();var cG=[`cutout`],lG=h.forwardRef(function(e,t){let{cutout:n}=e,r=G(e,cG),i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,A(A({ref:t,role:`presentation`,"data-base-ui-inert":``},r),{},{style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}}))});process.env.NODE_ENV!==`production`&&(lG.displayName=`InternalBackdrop`),j();var uG=[`keepMounted`],dG=h.forwardRef(function(e,t){let{keepMounted:n=!1}=e,r=G(e,uG),i=BW(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,X.jsx)(eG.Provider,{value:n,children:(0,X.jsxs)(iV,A(A({ref:t},r),{},{children:[a&&o===!0&&(0,X.jsx)(lG,{ref:i.context.internalBackdropRef,inert:LU(!s)}),e.children]}))}):null});process.env.NODE_ENV!==`production`&&(dG.displayName=`DialogPortal`),E();var fG={},pG={},mG=``;function hG(e,t){return QS(e)?e:t}function gG(e,t,n){return/hidden|clip/.test(e.getComputedStyle(hG(t,n)).overflowY)}function _G(e){if(typeof document>`u`)return!1;let t=bz(e);return KS(t).innerWidth-t.documentElement.clientWidth>0}function vG(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=bz(e),n=t.documentElement,r=t.body,i=hG(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function yG(e){let t=bz(e),n=t.documentElement,r=t.body,i=hG(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function bG(e){var t,n;let r=bz(e),i=r.documentElement,a=r.body,o=KS(i),s=0,c=0,l=!1,u=vz.create();if(qL&&((t=(n=o.visualViewport)==null?void 0:n.scale)==null?1:t)!==1)return()=>{};function d(){let t=o.getComputedStyle(i),n=o.getComputedStyle(a),r=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;s=i.scrollTop,c=i.scrollLeft,fG={scrollbarGutter:i.style.scrollbarGutter,overflowY:i.style.overflowY,overflowX:i.style.overflowX},mG=i.style.scrollBehavior,pG={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};let u=i.scrollHeight>i.clientHeight,d=i.scrollWidth>i.clientWidth,f=t.overflowY===`scroll`||n.overflowY===`scroll`,p=t.overflowX===`scroll`||n.overflowX===`scroll`,m=Math.max(0,o.innerWidth-a.clientWidth),h=Math.max(0,o.innerHeight-a.clientHeight),g=parseFloat(n.marginTop)+parseFloat(n.marginBottom),_=parseFloat(n.marginLeft)+parseFloat(n.marginRight),v=hG(i,a);l=vG(e),l?(i.style.scrollbarGutter=r,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(i.style,{scrollbarGutter:r,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(i.style.overflowY=`scroll`),(d||p)&&(i.style.overflowX=`scroll`),Object.assign(a.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),a.scrollTop=s,a.scrollLeft=c,i.setAttribute(`data-base-ui-scroll-locked`,``),i.style.scrollBehavior=`unset`)}function f(){Object.assign(i.style,fG),Object.assign(a.style,pG),l||(i.scrollTop=s,i.scrollLeft=c,i.removeAttribute(`data-base-ui-scroll-locked`),i.style.scrollBehavior=mG)}function p(){f(),u.request(d)}d();let m=$R(o,`resize`,p);return()=>{u.cancel(),f(),typeof o.removeEventListener==`function`&&m()}}var xG=new class{constructor(){T(this,`lockCount`,0),T(this,`restore`,null),T(this,`timeoutLock`,ML.create()),T(this,`timeoutUnlock`,ML.create()),T(this,`release`,()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),T(this,`unlock`,()=>{if(this.lockCount===0&&this.restore){var e;(e=this.restore)==null||e.call(this),this.restore=null}})}acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(this.lockCount===0||this.restore!==null)return;let t=bz(e),n=t.documentElement,r=t.body,i=KS(n);if(gG(i,n,r)){let t=new i.MutationObserver(()=>{gG(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=BL||!_G(e);this.restore=a?yG(e):bG(e)}};function SG(e=!0,t=null){TL(()=>{if(e)return xG.acquire(t)},[e,t])}function CG({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=h.useState(0),[d,f]=h.useState(0),p=l===0,m=EV(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=aR(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||rR(n,s)&&!(n!=null&&n.hasAttribute(`data-base-ui-portal`)):!0}return!0}return!1},escapeKey:p});return SG(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),TL(()=>{!r&&!i&&(u(0),f(0))},[r,i]),TL(()=>(t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),qV(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}j(),E();var wG=A(A({},SH),{},{modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role}),TG=class extends fH{constructor(e,t,n){let r=new ZV,i=EG(e,r,t,n);super(i,DG(r),wG),T(this,`setOpen`,(e,t)=>{var n,r;if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null){var i;t.trigger=(i=this.state.activeTriggerElement)==null?void 0:i}(n=(r=this.context).onOpenChange)==null||n.call(r,e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(VV(this.state,e,t.trigger)))})}};function EG(e,t,n,r=!1){return A(A({},gH(t,n,r)),{},{modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`},e)}function DG(e){return{popupRef:h.createRef(),backdropRef:h.createRef(),internalBackdropRef:h.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}j();function OG(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,g=m?!0:c,_=m||s,v=m?`alertdialog`:`dialog`,y=BW(!0),b={modal:g,disablePointerDismissal:_,nested:y!=null,role:v},x=LV((e,t)=>new TG(A({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d},b),e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);JV(x,S),GV(x);let{forceUnmount:T}=KV(S,x);h.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,RR(JR))}),[T,x]);let E=S||C||u!=null;return(0,X.jsxs)(zW.Provider,{value:x,children:[u&&(0,X.jsx)(RV,{handle:u,store:x}),E&&(0,X.jsx)(CG,{store:x,parentContext:y==null?void 0:y.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var kG=yL(function(e){return OG(`dialog`,e)});process.env.NODE_ENV!==`production`&&(kG.displayName=`DialogRoot`);var AG=[`render`,`className`,`style`,`id`],jG=h.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a}=e,o=G(e,AG),s=BW(),c=JH(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),zB(`h2`,e,{ref:t,props:[{id:c},o]})});process.env.NODE_ENV!==`production`&&(jG.displayName=`DialogTitle`);function MG(e){let t=h.useRef(``),n=h.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:h.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function NG(e,t){let{onClick:n,onPointerDown:r}=MG(fz((n,r)=>{(typeof e==`function`?e():e)||t(r||(BL?`touch`:``))}));return h.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var PG=[`render`,`className`,`style`,`disabled`,`nativeButton`,`id`,`payload`,`handle`],FG=bL(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l}=e,u=G(e,PG),d=BW(!0),f=CH(l),p=f==null?d:f;if(!p)throw Error(process.env.NODE_ENV===`production`?DL(79):`Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.`);let m=JH(s),g=p.useState(`floatingRootContext`),_=p.useState(`isOpenedByTrigger`,m),v=p.useState(`triggerPopupId`,m),y=h.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=WV(m,y,p,{payload:c}),{getButtonProps:S,buttonRef:C}=YW({disabled:a,native:o}),w=bV(g),T=NG(()=>p.select(`open`),e=>{p.set(`openMethod`,e)}),E={disabled:a,open:_},D=p.useState(`triggerProps`,x);return zB(`button`,e,{state:E,ref:[C,t,b,y],props:[w.reference,D,T,{[XB]:``,id:m,"aria-haspopup":`dialog`,"aria-expanded":_,"aria-controls":v},u,S],stateAttributesMapping:xR})});process.env.NODE_ENV!==`production`&&(FG.displayName=`DialogTrigger`);var IG=[`render`,`className`,`disabled`,`focusableWhenDisabled`,`nativeButton`,`style`],LG=h.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s}=e,c=G(e,IG),{getButtonProps:l,buttonRef:u}=YW({disabled:i,focusableWhenDisabled:a,native:o});return zB(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});process.env.NODE_ENV!==`production`&&(LG.displayName=`Button`);function RG(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=RG(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function zG(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=RG(e))&&(r&&(r+=` `),r+=t);return r}j();var BG=[`class`,`className`],VG=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,HG=zG,UG=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return HG(e,n==null?void 0:n.class,n==null?void 0:n.className);let{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(e=>{let t=n==null?void 0:n[e],r=a==null?void 0:a[e];if(t===null)return null;let o=VG(t)||VG(r);return i[e][o]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return HG(e,o,t==null||(r=t.compoundVariants)==null?void 0:r.reduce((e,t)=>{let{class:n,className:r}=t,i=G(t,BG);return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes(A(A({},a),s)[t]):A(A({},a),s)[t]===n})?[...e,n,r]:e},[]),n==null?void 0:n.class,n==null?void 0:n.className)};j();var WG=[`className`,`variant`,`size`],GG=UG(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[12.8px] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}}),KG=h.forwardRef((e,t)=>{let{className:n,variant:r=`default`,size:i=`default`}=e,a=G(e,WG);return(0,X.jsx)(LG,A({ref:t,"data-slot":`button`,className:Q(GG({variant:r,size:i,className:n}))},a))});KG.displayName=`Button`,j();var qG=[`className`],JG=[`className`,`children`,`showCloseButton`],YG=[`className`];function XG(e){let t=MW({},(jW(e),e));return(0,X.jsx)(kG,A({"data-slot":`dialog`},t))}function ZG(e){let t=MW({},(jW(e),e));return(0,X.jsx)(FG,A({"data-slot":`dialog-trigger`},t))}function QG(e){let t=MW({},(jW(e),e));return(0,X.jsx)(dG,A({"data-slot":`dialog-portal`},t))}function $G(e){let{className:t}=e,n=G(e,qG);return(0,X.jsx)(HW,A({"data-slot":`dialog-overlay`,className:Q(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,t)},n))}function eK(e){let{className:t,children:n,showCloseButton:r=!0}=e,i=G(e,JG);return(0,X.jsxs)(QG,{children:[(0,X.jsx)($G,{}),(0,X.jsxs)(sG,A(A({"data-slot":`dialog-content`,className:Q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-32px)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t)},i),{},{children:[n,r&&(0,X.jsxs)($W,{"data-slot":`dialog-close`,render:(0,X.jsx)(KG,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,X.jsx)(fL,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]}))]})}function tK(e){let{className:t}=e,n=G(e,YG);return(0,X.jsx)(jG,A({"data-slot":`dialog-title`,className:Q(`font-heading text-base leading-none font-medium`,t)},n))}var nK=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(nK.displayName=`AvatarRootContext`);function rK(){let e=h.useContext(nK);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?DL(13):`Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.`);return e}var iK={imageLoadingStatus:()=>null},aK=[`className`,`render`,`style`],oK=h.forwardRef(function(e,t){let{className:n,render:r,style:i}=e,a=G(e,aK),[o,s]=h.useState(`idle`),c={imageLoadingStatus:o},l=h.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=zB(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:iK});return(0,X.jsx)(nK.Provider,{value:l,children:u})});process.env.NODE_ENV!==`production`&&(oK.displayName=`AvatarRoot`);function sK(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=h.useState(`idle`),s=o[1];return TL(()=>{if(!a)return SL;if(!e&&!i)return s(`error`),SL;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n==null?null:n,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}j();var cK=[`className`,`render`,`onLoadingStatusChange`,`keepMounted`,`style`,`sizes`,`srcSet`,`src`],lK=A(A({},iK),fR),uK=h.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l}=e,u=G(e,cK),{setImageLoadingStatus:d}=rK(),[f,p]=sK(l,e,!a),m=f===`loaded`,{mounted:g,transitionStatus:_,setMounted:v}=OV(m),y=h.useRef(null),b=h.useRef(!0);TL(()=>{if(!a)return;let e=b.current;b.current=!1;let t=y.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&v(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,v]);let x=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,S=fz(e=>{i==null||i(e),d(e)});TL(()=>{f!==`idle`&&S(f)},[f,S]),TL(()=>()=>d(`idle`),[d]),NV({enabled:!m,open:m,ref:y,onComplete(){m||v(!1)}});let C={imageLoadingStatus:f,transitionStatus:a&&_===`ending`?void 0:_},w=a||g,T={};s!==void 0&&(T.sizes=s),c!==void 0&&(T.srcSet=c),l!==void 0&&(T.src=l);let E=zB(`img`,e,{state:C,ref:[t,y],props:[x,u,T],stateAttributesMapping:lK,enabled:w});return w?E:null});process.env.NODE_ENV!==`production`&&(uK.displayName=`AvatarImage`);var dK=[`className`,`render`,`delay`,`style`],fK=h.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a}=e,o=G(e,dK),{imageLoadingStatus:s}=rK(),[c,l]=h.useState(i===0),u=NL();return h.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),zB(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:iK,enabled:s!==`loaded`&&(i===0||c)})});process.env.NODE_ENV!==`production`&&(fK.displayName=`AvatarFallback`),j();var pK=[`className`,`size`],mK=[`className`],hK=[`className`];function gK(e){let{className:t,size:n=`default`}=e,r=G(e,pK);return(0,X.jsx)(oK,A({"data-slot":`avatar`,"data-size":n,className:Q(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,t)},r))}function _K(e){let{className:t}=e,n=G(e,mK);return(0,X.jsx)(uK,A({"data-slot":`avatar-image`,className:Q(`aspect-square size-full rounded-full object-cover`,t)},n))}function vK(e){let{className:t}=e,n=G(e,hK);return(0,X.jsx)(fK,A({"data-slot":`avatar-fallback`,className:Q(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,t)},n))}j();var yK=[`children`,`tooltip`,`side`,`className`],bK=(0,h.forwardRef)((e,t)=>{let{children:n,tooltip:r,side:i=`bottom`,className:a}=e,o=G(e,yK);return(0,X.jsx)(FW,{children:(0,X.jsxs)(IW,{children:[(0,X.jsxs)(LW,{render:(0,X.jsx)(KG,A(A({variant:`ghost`,size:`icon`},o),{},{className:Q(`aui-button-icon size-6 p-1 active:scale-90`,a),ref:t})),children:[n,(0,X.jsx)(`span`,{className:`aui-sr-only sr-only`,children:r})]}),(0,X.jsx)(RW,{side:i,children:r})]})})});bK.displayName=`TooltipIconButton`;var xK=e=>Symbol.iterator in e,SK=e=>`entries`in e,CK=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},wK=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function TK(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:xK(e)&&xK(t)?SK(e)&&SK(t)?CK(e,t):wK(e,t):CK({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function EK(e){let t=h.default.useRef(void 0);return n=>{let r=e(n);return TK(t.current,r)?t.current:t.current=r}}var DK=e=>{let[t,n]=(0,h.useState)(void 0);return(0,h.useEffect)(()=>{if(!e){n(void 0);return}let t=URL.createObjectURL(e);return n({file:e,url:t}),()=>{URL.revokeObjectURL(t)}},[e]),t!==void 0&&t.file===e?t.url:void 0},OK=()=>{var e;let{file:t,src:n}=Y(EK(e=>{var t;if(e.attachment.type!==`image`)return{};if(e.attachment.file)return{file:e.attachment.file};let n=(t=e.attachment.content)==null||(t=t.filter(e=>e.type===`image`)[0])==null?void 0:t.image;return n?{src:n}:{}}));return(e=DK(t))==null?n:e};function kK(){let e=Xa().attachment.source!==`message`,t=OK(),n=Y(e=>e.attachment.type===`image`),r=Y(e=>e.attachment.name),i=Y(e=>{let t=e.attachment.type;switch(t){case`image`:return`Image`;case`document`:return`Document`;case`file`:return`File`;default:return t}}),a=Y(e=>{var t;return e.attachment.status.type===`incomplete`&&e.attachment.status.reason===`error`?`error`:e.attachment.status.type===`running`||((t=e.optional.message)==null?void 0:t.submission)!==void 0&&e.attachment.status.type!==`complete`?`uploading`:void 0});return{isComposer:e,src:t,isImage:n,name:r,typeLabel:i,isUploading:a===`uploading`,isError:a===`error`,errorMessage:Y(e=>{var t;return e.attachment.status.type===`incomplete`&&e.attachment.status.reason===`error`?(t=e.attachment.status.message)==null?`Upload failed`:t:void 0})}}var AK=({src:e,name:t})=>{let[n,r]=(0,h.useState)(!1);return(0,X.jsx)(`img`,{src:e,alt:`Preview of ${t}`,className:Q(`block h-auto max-h-[80vh] w-auto max-w-full rounded-sm object-contain transition-opacity duration-300 motion-reduce:transition-none`,n?`aui-attachment-preview-image-loaded opacity-100`:`aui-attachment-preview-image-loading opacity-0`),onLoad:()=>r(!0)})},jK=({children:e,src:t,name:n})=>t?(0,X.jsxs)(XG,{children:[(0,X.jsx)(ZG,{nativeButton:!1,className:`aui-attachment-preview-trigger cursor-zoom-in`,render:(0,h.isValidElement)(e)?e:(0,X.jsx)(`button`,{type:`button`,children:e})}),(0,X.jsxs)(eK,{className:`aui-attachment-preview-dialog-content [&>button]:bg-foreground/60 [&>button]:hover:bg-foreground/80 [&_svg]:text-background p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0!`,children:[(0,X.jsxs)(tK,{className:`aui-sr-only sr-only`,children:[`Preview `,n]}),(0,X.jsx)(`div`,{className:`aui-attachment-preview bg-background relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden rounded-sm`,children:(0,X.jsx)(AK,{src:t,name:n})})]})]}):e,MK=({src:e})=>(0,X.jsxs)(gK,{className:`aui-attachment-tile-avatar h-full w-full rounded-none after:hidden`,children:[(0,X.jsx)(_K,{src:e,alt:``,className:`aui-attachment-tile-image rounded-none object-cover`}),(0,X.jsx)(vK,{children:(0,X.jsx)(wI,{className:`aui-attachment-tile-fallback-icon text-muted-foreground/80 size-6 stroke-[1.5]`})})]}),NK=()=>{let{isComposer:e,src:t,isImage:n,name:r,typeLabel:i,isUploading:a,isError:o,errorMessage:s}=kK();return(0,X.jsx)(FW,{children:(0,X.jsxs)(IW,{children:[(0,X.jsxs)(Wk.Root,{className:Q(`aui-attachment-root relative`,e&&`animate-in fade-in-0 zoom-in-95 duration-200 motion-reduce:animate-none`,n&&!e&&`aui-attachment-root-message only:*:first:size-24`),children:[(0,X.jsx)(jK,{src:t,name:r,children:(0,X.jsxs)(LW,{render:(0,X.jsx)(`div`,{className:Q(`aui-attachment-tile bg-muted hover:after:bg-foreground/10 focus-visible:ring-ring/50 relative size-14 overflow-hidden rounded-[calc(var(--composer-radius,16px)-var(--composer-padding,8px))] transition-transform outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-black/10 after:transition-colors after:ring-inset focus-visible:ring-1 motion-reduce:transition-none dark:after:ring-white/10`,t?`cursor-zoom-in active:scale-[0.96]`:`cursor-default`,o&&`after:ring-destructive/60 dark:after:ring-destructive/60`),role:t?`button`:`group`,tabIndex:0,"aria-label":`${t?`Preview ${r}`:`${i} attachment ${r}`}${o?`, upload failed`:a?`, uploading`:``}`}),children:[(0,X.jsx)(MK,{src:t}),a&&(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`aui-attachment-tile-uploading bg-background/60 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none`,children:(0,X.jsx)(MI,{className:`text-muted-foreground size-4 animate-spin`})}),o&&(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`aui-attachment-tile-error bg-background/70 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none`,children:(0,X.jsx)(uI,{className:`text-destructive size-4`})})]})}),e&&(0,X.jsx)(PK,{name:r})]}),(0,X.jsxs)(RW,{side:`top`,children:[(0,X.jsx)(Wk.Name,{}),s&&(0,X.jsx)(`p`,{className:`aui-attachment-error-message`,children:s})]})]})})},PK=({name:e})=>(0,X.jsx)(Wk.Remove,{render:(0,X.jsx)(bK,{tooltip:`Remove ${e}`,className:`aui-attachment-tile-remove absolute end-1 top-1 size-5 rounded-full bg-black/50! text-white after:absolute after:-inset-1.5 hover:bg-black/70! hover:text-white! active:scale-[0.96] motion-reduce:transition-none`,side:`top`}),children:(0,X.jsx)(fL,{className:`aui-attachment-remove-icon size-3 stroke-[2.5]`})}),FK=()=>(0,X.jsx)(`div`,{className:`aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2 empty:hidden`,children:(0,X.jsx)(MN.Attachments,{children:()=>(0,X.jsx)(NK,{})})}),IK=()=>(0,X.jsx)(`div`,{className:`aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden`,children:(0,X.jsx)(_M.Attachments,{children:()=>(0,X.jsx)(NK,{})})}),LK=()=>(0,X.jsx)(_M.AddAttachment,{render:(0,X.jsx)(bK,{tooltip:`Add Attachment`,side:`bottom`,variant:`ghost`,size:`icon`,className:`aui-composer-add-attachment text-muted-foreground hover:text-foreground hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30 size-7 rounded-full active:scale-[0.96] motion-reduce:transition-none`,"aria-label":`Add Attachment`}),children:(0,X.jsx)(XI,{className:`aui-attachment-add-icon size-4`})}),RK=globalThis.window===void 0?h.useEffect:h.useLayoutEffect,zK=`bg-background border border-border/60 dark:bg-popover`,BK=`bg-foreground/[0.04] forced-colors:border dark:bg-foreground/[0.06]`,VK=`bg-foreground text-background transition-[opacity,scale] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] hover:opacity-90 active:scale-[0.96] motion-reduce:transition-none forced-colors:border`,HK=`font-mono text-[11px] tracking-tight`;j();var UK=[`src`,`title`,`artwork`,`durationMs`,`className`],WK=[`src`,`poster`,`title`,`ratio`,`durationMs`,`className`];function GK(e){let t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function KK(e,t,n){var r;let[i,a]=(0,h.useState)({src:t});(0,h.useEffect)(()=>{let n=e.current;!n||n.readyState<HTMLMediaElement.HAVE_METADATA||Number.isFinite(n.duration)&&n.duration>=0&&a({src:t,duration:n.duration})},[e,t]);let o=n!==void 0&&Number.isFinite(n)?Math.max(0,n/1e3):void 0;return{duration:i.src===t?(r=i.duration)==null?o:r:o,setDurationFromMetadata:e=>{Number.isFinite(e)&&e>=0&&a({src:t,duration:e})}}}function qK(e){let{src:t,title:n,artwork:r,durationMs:i,className:a}=e,o=G(e,UK),s=(0,h.useRef)(null),[c,l]=(0,h.useState)({src:t,currentTime:0,playing:!1,hasError:!1}),{duration:u,setDurationFromMetadata:d}=KK(s,t,i),{currentTime:f,playing:p,hasError:m}=c.src===t?c:{src:t,currentTime:0,playing:!1,hasError:!1},g=e=>l(n=>A(A({},n.src===t?n:{src:t,currentTime:0,playing:!1,hasError:!1}),e)),_=n==null?`Audio`:n,v=n?` ${n}`:` audio`,y=u===void 0?`--:--`:GK(u);return(0,h.useEffect)(()=>{var e;(e=s.current)!=null&&e.error&&l({src:t,currentTime:0,playing:!1,hasError:!0})},[t]),(0,X.jsxs)(`div`,A(A({"data-slot":`audio-player`,className:Q(zK,`flex w-full max-w-md items-center gap-3 rounded-2xl p-3`,a)},o),{},{children:[r?(0,X.jsx)(`img`,{src:r,alt:``,className:`size-10 shrink-0 rounded-lg object-cover`}):null,(0,X.jsx)(`button`,{type:`button`,"aria-label":`${p?`Pause`:`Play`}${v}`,disabled:m,onClick:()=>{let e=s.current;e&&!m&&(p?(e.pause(),g({playing:!1})):e.play().then(()=>g({playing:!0}),()=>g(e.error?{hasError:!0,playing:!1}:{playing:!1})))},className:Q(VK,`flex size-9 shrink-0 items-center justify-center rounded-full disabled:cursor-default disabled:opacity-40`),children:p?(0,X.jsx)(HI,{"aria-hidden":!0,className:`size-4`}):(0,X.jsx)(JI,{"aria-hidden":!0,className:`ml-0.5 size-4`})}),(0,X.jsxs)(`div`,{className:`flex min-w-0 grow basis-16 flex-col gap-1.5`,children:[(0,X.jsx)(`span`,{className:`truncate text-[13.5px] font-medium`,children:_}),(0,X.jsx)(`input`,{type:`range`,min:0,max:u==null?0:u,step:.1,value:Math.min(f,u==null?0:u),"aria-label":`Seek`,"aria-valuetext":`${GK(f)} of ${y}`,disabled:m,onChange:e=>{let t=Number(e.currentTarget.value);if(!Number.isFinite(t))return;let n=Math.min(t,u==null?t:u);s.current&&(s.current.currentTime=n),g({currentTime:n})},className:`accent-foreground w-full`})]}),(0,X.jsxs)(`span`,{className:Q(HK,`text-muted-foreground tabular-nums`),children:[GK(f),`\xA0/ `,y]}),(0,X.jsx)(`audio`,{ref:s,src:t,preload:`metadata`,className:`hidden`,onLoadedMetadata:e=>{d(e.currentTarget.duration)},onTimeUpdate:e=>g({currentTime:e.currentTarget.currentTime}),onPlay:()=>g({playing:!0}),onPause:()=>g({playing:!1}),onError:()=>g({hasError:!0,playing:!1})}),m?(0,X.jsx)(`span`,{role:`alert`,className:`text-muted-foreground text-xs`,children:`Can't play this audio`}):null]}))}function JK(e){let{src:t,poster:n,title:r,ratio:i=`16:9`,durationMs:a,className:o}=e,s=G(e,WK),c=(0,h.useRef)(null),{duration:l,setDurationFromMetadata:u}=KK(c,t,a),d=i===`1:1`?`aspect-square`:i===`4:3`?`aspect-[4/3]`:i===`16:9`?`aspect-video`:i===`9:16`?`aspect-[9/16]`:void 0;return(0,X.jsxs)(`div`,A(A({"data-slot":`video-player`,className:Q(`flex w-full max-w-xl flex-col gap-2`,o)},s),{},{children:[(0,X.jsx)(`div`,{className:Q(BK,`overflow-hidden rounded-xl`,d),children:(0,X.jsx)(`video`,{ref:c,src:t,poster:n,controls:!0,playsInline:!0,preload:`metadata`,"aria-label":r==null?`Video`:r,className:Q(`block max-w-full`,i!==`auto`&&`h-full w-full object-contain`),onLoadedMetadata:e=>{u(e.currentTarget.duration)}})}),(r||l!==void 0)&&(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 px-1`,children:[r?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13.5px] font-medium`,children:r}):null,l===void 0?null:(0,X.jsx)(`span`,{className:Q(`font-mono text-[11px] tracking-tight`,`text-muted-foreground shrink-0 tabular-nums`),children:GK(l)})]})]}))}j();var YK=[`className`,`variant`,`size`,`children`],XK=[`mimeType`,`className`,`children`],ZK=[`className`,`children`],QK=[`bytes`,`className`],$K=[`data`,`mimeType`,`filename`,`sourceType`,`className`,`children`],eq=[`data`,`mimeType`,`filename`,`sourceType`,`className`],tq=UG(`aui-file-root inline-flex items-center gap-3 rounded-lg transition-colors`,{variants:{variant:{outline:`border-border hover:bg-muted/50 border`,ghost:`hover:bg-muted/50`,muted:`bg-muted/50 hover:bg-muted/70`},size:{sm:`px-2.5 py-1.5 text-xs`,default:`px-3 py-2 text-sm`,lg:`px-4 py-3 text-base`}},defaultVariants:{variant:`outline`,size:`default`}});function nq(e){let t=e.toLowerCase();return t.startsWith(`image/`)?AI:t===`application/pdf`?wI:t===`application/json`?QF:t.startsWith(`text/`)?wI:t.startsWith(`audio/`)?bI:t.startsWith(`video/`)?uL:EI}function rq(e,t){return t===`url`&&/^data:/i.test(e)?`data-uri`:t||(/^data:/i.test(e)?`data-uri`:/^(https?:\/\/|blob:)/i.test(e)?`url`:`base64`)}function iq(e){return/^[a-z][a-z\d+.-]*:/i.test(e)&&!/^(data:|https?:\/\/|blob:)/i.test(e)}function aq(e,t,n){if(iq(e))return null;let r=rq(e,n);return r===`id`?null:r===`data-uri`?/^data:[^,]*,/i.test(e)?e:null:r===`url`?/^(https?:\/\/|blob:)/i.test(e)?e:null:`data:${t};base64,${e}`}function oq(e){let t=e.endsWith(`==`)?2:+!!e.endsWith(`=`),n=e.search(/[^A-Za-z\d+/]/);return n!==-1&&n!==e.length-t||e.length%4==1||t>0&&e.length%4!=0?0:Math.floor(e.length*3/4)-t}function sq(e){return oq(/[\t\n\f\r ]/.test(e)?e.replace(/[\t\n\f\r ]/g,``):e)}function cq(e){let t=e.indexOf(`#`),n=t<0?e.length:t,r=e.indexOf(`,`);if(r<0||r>=n)return 0;let i=e.slice(r+1,n);return/;base64$/i.test(e.slice(0,r))?(/[%\t\n\f\r ]/.test(i)&&(i=i.replace(/%([\da-f]{2})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))).replace(/[\t\n\f\r ]/g,``)),oq(i)):new TextEncoder().encode(i.replace(/%[\da-f]{2}/gi,`_`)).byteLength}function lq(e){var t;let n=(t=/^[^/;]+\/(?:x-)?(?:[^;+]*\.)?([^;+.\s]+)/.exec(e.toLowerCase()))==null?void 0:t[1];return!n||n===`octet-stream`?`文件`:n===`plain`?`文本文件`:`${n.toUpperCase()} 文件`}function uq(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function dq(e){let{className:t,variant:n,size:r,children:i}=e,a=G(e,YK);return(0,X.jsx)(`div`,A(A({"data-slot":`file-root`,"data-variant":n,"data-size":r,className:Q(tq({variant:n,size:r,className:t}))},a),{},{children:i}))}function fq(e){let{mimeType:t,className:n,children:r}=e,i=G(e,XK),a=t?nq(t):EI;return(0,X.jsx)(`span`,A(A({"data-slot":`file-icon`,className:Q(`text-muted-foreground shrink-0`,n)},i),{},{children:r==null?(0,X.jsx)(a,{className:`size-5`}):r}))}function pq(e){let{className:t,children:n}=e,r=G(e,ZK);return(0,X.jsx)(`span`,A(A({"data-slot":`file-name`,className:Q(`min-w-0 flex-1 truncate font-medium`,t)},r),{},{children:n||`未命名文件`}))}function mq(e){let{bytes:t,className:n}=e,r=G(e,QK);return(0,X.jsx)(`span`,A(A({"data-slot":`file-size`,className:Q(`text-muted-foreground shrink-0`,n)},r),{},{children:uq(t)}))}function hq(e){let{data:t,mimeType:n,filename:r,sourceType:i,className:a,children:o}=e,s=G(e,$K);if(typeof t!=`string`)return null;let c=rq(t,i),l=aq(t,n,i);return l?(0,X.jsx)(`a`,A(A(A({"data-slot":`file-download`,href:l,download:r||`download`},c===`url`&&{target:`_blank`,rel:`noopener noreferrer`}),{},{className:Q(`text-muted-foreground hover:bg-accent hover:text-accent-foreground shrink-0 rounded-md p-1 transition-colors`,a),"aria-label":o?void 0:`下载 ${r||`文件`}`},s),{},{children:o||(0,X.jsx)(vI,{className:`size-4`})})):null}function gq(e){let{data:t,mimeType:n,filename:r,sourceType:i,className:a}=e,o=G(e,eq),s=aq(t,n,i),c=n.toLowerCase();return!s||!c.startsWith(`audio/`)&&!c.startsWith(`video/`)?null:(0,X.jsx)(`div`,A(A({"data-slot":`file-player`,className:Q(`w-full`,a)},o),{},{children:c.startsWith(`audio/`)?(0,X.jsx)(qK,{src:s,title:r}):(0,X.jsx)(JK,{src:s,title:r})}))}var _q=(0,h.memo)(({filename:e,data:t,mimeType:n,sourceType:r})=>{let i=rq(t,r),a=typeof t==`string`&&(i===`base64`||i===`data-uri`),o=aq(t,n,r),s=n.toLowerCase().startsWith(`audio/`)||n.toLowerCase().startsWith(`video/`);return o&&s?(0,X.jsxs)(`div`,{className:`flex w-full max-w-xl flex-col gap-2`,children:[(0,X.jsx)(gq,A(A({data:t,mimeType:n},e!==void 0&&{filename:e}),r!==void 0&&{sourceType:r})),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-2 px-1`,children:[a&&(0,X.jsx)(mq,{bytes:i===`data-uri`?cq(t):sq(t),className:`text-muted-foreground text-[11px]`}),(0,X.jsx)(hq,A(A({data:t,mimeType:n},e!==void 0&&{filename:e}),r!==void 0&&{sourceType:r}))]})]}):(0,X.jsxs)(dq,{children:[(0,X.jsx)(fq,{mimeType:n}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,X.jsx)(pq,{children:e||lq(n)}),a&&(0,X.jsx)(mq,{bytes:i===`data-uri`?cq(t):sq(t),className:`text-xs`})]}),(0,X.jsx)(hq,A(A({data:t,mimeType:n},e!==void 0&&{filename:e}),r!==void 0&&{sourceType:r}))]})});_q.displayName=`File`,_q.Root=dq,_q.Icon=fq,_q.Name=pq,_q.Size=mq,_q.Download=hq,_q.Player=gq;var vq=()=>{let e=Y(e=>e.thread.suggestions),t=(0,h.useRef)(null),n=(0,h.useRef)(null),[r,i]=(0,h.useState)({left:!1,right:!1}),a=(0,h.useCallback)(()=>{var e;let r=t.current;if(!r)return;let a=r.scrollWidth-r.clientWidth,o=Math.abs(r.scrollLeft),[s,c]=((e=n.current)==null?n.current=getComputedStyle(r).direction===`rtl`:e)?[a-o,o]:[o,a-o];i(e=>{let t={left:s>1,right:c>1};return e.left===t.left&&e.right===t.right?e:t})},[]);(0,h.useEffect)(()=>{a();let e=t.current;if(!(e!=null&&e.firstElementChild))return;let n=new ResizeObserver(a);return n.observe(e),n.observe(e.firstElementChild),()=>n.disconnect()},[a]);let o=`linear-gradient(to right, ${r.left?`transparent, black 32px`:`black`}, ${r.right?`black calc(100% - 32px), transparent`:`black`})`;return(0,X.jsx)(`div`,{ref:t,onScroll:a,role:`group`,"aria-label":`后续问题建议`,className:`aui-thread-followup-suggestions -my-1 w-full [scrollbar-width:none] overflow-x-auto py-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,style:{maskImage:o,WebkitMaskImage:o},children:(0,X.jsx)(`div`,{className:`mx-auto flex min-h-8 w-max items-center gap-2 px-0.5`,children:e.map((e,t)=>{var n;return(0,X.jsxs)(CP.Suggestion,{className:`aui-thread-followup-suggestion border-foreground/10 hover:bg-foreground/[0.03] hover:border-foreground/25 rounded-md border px-2.5 py-1 text-sm whitespace-nowrap transition-colors ease-in motion-reduce:transition-none`,prompt:e.prompt,send:!0,children:[(n=e.title)==null?e.prompt:n,e.label&&(0,X.jsx)(`span`,{className:`aui-thread-followup-suggestion-label text-muted-foreground ms-1`,children:e.label})]},t)})})})},yq=()=>(0,X.jsx)(Td,{condition:e=>!e.thread.isEmpty&&!e.thread.isRunning&&e.thread.suggestions.length>0,children:(0,X.jsx)(vq,{})}),bq=/^(?:[/?#]|\.{1,2}\/)/,xq=new Set([`http:`,`https:`,`mailto:`]),Sq=e=>{try{return new URL(e)}catch(e){return}};function Cq(e){if(typeof e!=`string`)return;let t=e.trim();if(t===``)return;let n=Sq(t);return n?xq.has(n.protocol)?t:void 0:bq.test(t)?t:void 0}function wq(e){var t,n;let r=Cq(e);return(r===void 0||(t=(n=Sq(r))==null?void 0:n.hostname)==null?``:t).replace(/^www\./,``)||void 0}j();var Tq=[`className`,`variant`,`size`,`children`],Eq=[`className`,`containerClassName`,`ratio`,`fit`,`onLoad`,`onError`,`alt`,`src`],Dq=[`className`,`label`,`url`,`iconUrl`],Oq=[`className`,`children`],kq=e=>{switch(e){case`image/png`:return`png`;case`image/jpeg`:case`image/jpg`:return`jpg`;case`image/webp`:return`webp`;case`image/gif`:return`gif`;case`image/svg+xml`:return`svg`;default:return`png`}},Aq=e=>{var t,n;let r=e.indexOf(`,`),i=r>=0?e.slice(0,r):e,a=r>=0?e.slice(r+1):``,o=(t=(n=i.match(/data:([^;]+)/i))==null||(n=n[1])==null?void 0:n.toLowerCase())==null?`application/octet-stream`:t;if(!/;base64/i.test(i)){let e=[],t=0;for(let n of a.matchAll(/(?:%[\da-f]{2})+/gi)){n.index>t&&e.push(a.slice(t,n.index));let r=n[0],i=new Uint8Array(r.length/3);for(let e=0;e<i.length;e++)i[e]=Number.parseInt(r.slice(e*3+1,e*3+3),16);e.push(i),t=n.index+r.length}return e.push(a.slice(t)),new Blob(e,{type:o})}let s;try{let e=a.replace(/%([\da-f]{2})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16)));s=atob(e)}catch(e){return null}let c=new Uint8Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);return new Blob([c],{type:o})},jq=e=>{var t;return(t=e.match(/^data:([^;,]+)/i))==null||(t=t[1])==null?void 0:t.toLowerCase()},Mq=e=>{let t=jq(e);if(t)return`image.${kq(t)}`;try{var n;let t=(n=new URL(e,document.baseURI).pathname.split(`/`).pop())==null?``:n,r=t;try{r=decodeURIComponent(t)}catch(e){}if(/\.(png|jpe?g|webp|gif|svg)$/i.test(r))return r}catch(e){}return`image.png`},Nq=e=>{try{let t=new URL(e,document.baseURI);return t.protocol===`http:`||t.protocol===`https:`||t.protocol===`blob:`?e:null}catch(e){return null}},Pq=e=>{var t;if(typeof document>`u`)return;let n=(t=e.filename)==null?Mq(e.image):t,r=/^data:/i.test(e.image),i=r?Aq(e.image):null;if(r&&!i)return;let a=i?URL.createObjectURL(i):null,o=a==null?Nq(e.image):a;if(!o)return;let s=document.createElement(`a`);s.href=o,s.download=n,s.rel=`noopener`,document.body.appendChild(s),s.click(),document.body.removeChild(s),a&&setTimeout(()=>URL.revokeObjectURL(a),4e4)},Fq=function(){var e=O(function*(e){var t,n;if(typeof navigator>`u`||!navigator.clipboard||typeof ClipboardItem>`u`)throw Error(`Clipboard API is not available in this environment.`);let r=/^data:/i.test(e.image)?Aq(e.image):yield fetch(e.image).then(e=>e.blob());if(!r)return;let i=(t=(n=jq(e.image))==null?r.type:n)==null?`image/png`:t;yield navigator.clipboard.write([new ClipboardItem({[i]:r})])});return function(t){return e.apply(this,arguments)}}(),Iq=UG(`aui-image-root relative overflow-hidden rounded-lg`,{variants:{variant:{outline:`border-border border`,ghost:``,muted:`bg-muted/50`},size:{sm:`max-w-64`,default:`max-w-96`,lg:`max-w-[512px]`,full:`w-full`}},defaultVariants:{variant:`outline`,size:`default`}});function Lq(e){let{className:t,variant:n,size:r,children:i}=e,a=G(e,Tq);return(0,X.jsx)(`div`,A(A({"data-slot":`image-root`,"data-variant":n,"data-size":r,className:Q(Iq({variant:n,size:r,className:t}))},a),{},{children:i}))}function Rq(e){let{className:t,containerClassName:n,ratio:r=`auto`,fit:i=`contain`,onLoad:a,onError:o,alt:s=`Image content`,src:c}=e,l=G(e,Eq),u=(0,h.useRef)(null),[d,f]=(0,h.useState)(void 0),[p,m]=(0,h.useState)(void 0),g=d===c,_=p===c,v=r!==`auto`,y=r===`1:1`?`aspect-square`:r===`4:3`?`aspect-[4/3]`:r===`16:9`?`aspect-video`:r===`9:16`?`aspect-[9/16]`:void 0;return(0,h.useEffect)(()=>{let e=u.current;typeof c==`string`&&e!=null&&e.complete&&(e.naturalWidth>0?f(c):m(c))},[c]),(0,X.jsxs)(`div`,{"data-slot":`image-preview`,className:Q(`relative`,v?y:`min-h-32`,n),children:[!g&&!_&&(0,X.jsx)(`div`,{"data-slot":`image-preview-loading`,className:`bg-muted/50 absolute inset-0 flex items-center justify-center`,children:(0,X.jsx)(AI,{className:`text-muted-foreground size-8 animate-pulse`})}),_?(0,X.jsx)(`div`,{"data-slot":`image-preview-error`,className:Q(`bg-muted/50 flex min-h-32 items-center justify-center p-4`,v&&`absolute inset-0`),children:(0,X.jsx)(OI,{className:`text-muted-foreground size-8`})}):(0,X.jsx)(`img`,A({ref:u,src:c,alt:s,className:Q(v?Q(`block h-full w-full`,{"object-cover":i===`cover`,"object-contain":i===`contain`}):`block h-auto w-full object-contain`,!g&&`invisible`,t),onLoad:e=>{typeof c==`string`&&f(c),a==null||a(e)},onError:e=>{typeof c==`string`&&m(c),o==null||o(e)}},l))]})}function zq(e){let{className:t,label:n,url:r,iconUrl:i}=e,a=G(e,Dq),o=Cq(r),s=wq(r),c=n||s,[l,u]=(0,h.useState)();if(!c)return null;let d=i!==void 0&&l!==i;return(0,X.jsxs)(`div`,A(A({"data-slot":`image-source`,className:Q(`text-muted-foreground flex items-center gap-2 border-t px-2 py-1.5 text-xs`,t)},a),{},{children:[d?(0,X.jsx)(`img`,{"data-slot":`image-source-icon`,src:i,alt:``,className:`size-4 shrink-0 rounded-sm`,onError:()=>u(i)}):(0,X.jsx)(`span`,{"data-slot":`image-source-icon-fallback`,"aria-hidden":`true`,className:`bg-muted flex size-4 shrink-0 items-center justify-center rounded-sm text-[10px] font-medium`,children:c.charAt(0).toUpperCase()}),o?(0,X.jsxs)(`a`,{"data-slot":`image-source-label`,href:o,target:`_blank`,rel:`noopener noreferrer`,className:`hover:text-foreground truncate`,children:[c,(0,X.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]}):(0,X.jsx)(`span`,{"data-slot":`image-source-label`,className:`truncate`,children:c})]}))}function Bq(e){let{className:t,children:n}=e,r=G(e,Oq);return n?(0,X.jsx)(`span`,A(A({"data-slot":`image-filename`,className:Q(`text-muted-foreground block truncate px-2 py-1.5 text-xs`,t)},r),{},{children:n})):null}function Vq({src:e,alt:t=`Image preview`,children:r}){let[i,a]=(0,h.useState)(!1),o=(0,h.useRef)(null),s=(0,h.useRef)(null),c=(0,h.useRef)(null),l=(0,h.useCallback)(()=>a(!0),[]),u=(0,h.useCallback)(()=>{var e;a(!1),(e=o.current)==null||e.focus()},[]);return(0,h.useEffect)(()=>{if(!i)return;let e=e=>{var t;if(e.key===`Escape`){u();return}if(e.key!==`Tab`)return;let n=(t=c.current)==null?void 0:t.querySelectorAll(`a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n==null?void 0:n[0],i=n==null?void 0:n[n.length-1];r&&i&&(e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus()))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i,u]),(0,h.useEffect)(()=>{if(!i)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i]),(0,h.useEffect)(()=>{var e;i&&((e=s.current)==null||e.focus())},[i]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{ref:o,onClick:l,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.click()):e.key===` `&&e.preventDefault()},onKeyUp:e=>{e.key===` `&&e.currentTarget.click()},role:`button`,tabIndex:0,className:`aui-image-zoom-trigger cursor-zoom-in`,"aria-label":`Click to zoom image`,children:r}),i&&(0,n.createPortal)((0,X.jsxs)(`div`,{ref:c,"data-slot":`image-zoom-overlay`,role:`dialog`,"aria-modal":`true`,className:`aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-black/80 duration-200`,onClick:u,"aria-label":`Zoomed image`,children:[(0,X.jsx)(`img`,{"data-slot":`image-zoom-content`,src:e,alt:t,className:`aui-image-zoom-content fade-in zoom-in-95 animate-in max-h-[90%] max-w-[90%] cursor-zoom-out object-contain duration-200`,onClick:e=>{e.stopPropagation(),u()}}),(0,X.jsx)(`button`,{ref:s,type:`button`,"aria-label":`Close zoomed image`,onClick:e=>{e.stopPropagation(),u()},className:`text-muted-foreground hover:text-foreground bg-background/80 absolute end-4 top-4 rounded-md p-2`,children:(0,X.jsx)(fL,{className:`size-5`})})]}),document.body)]})}function Hq({className:e}){return(0,X.jsxs)(`div`,{"data-slot":`image-generating`,className:Q(`bg-muted/50 flex min-h-32 items-center justify-center p-4`,e),children:[(0,X.jsx)(MI,{className:`text-muted-foreground size-8 animate-spin`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Generating image…`})]})}function Uq({className:e,reason:t}){return(0,X.jsxs)(`div`,{"data-slot":`image-content-filter-error`,className:Q(`bg-muted/50 flex min-h-32 flex-col items-center justify-center gap-2 p-4 text-center`,e),children:[(0,X.jsx)(eL,{className:`text-muted-foreground size-8`}),(0,X.jsx)(`p`,{className:`text-sm font-medium`,children:`Image could not be generated`}),t&&(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:t})]})}function Wq({onRegenerate:e}){let[t,n]=(0,h.useState)(!1);return(0,X.jsx)(`button`,{type:`button`,onClick:function(){var t=O(function*(){n(!0);try{yield e()}catch(e){}finally{n(!1)}});return function(){return t.apply(this,arguments)}}(),disabled:t,"data-slot":`image-regenerate`,"aria-label":`Regenerate image`,className:`hover:bg-muted inline-flex size-7 items-center justify-center rounded disabled:opacity-50`,children:(0,X.jsx)(QI,{className:Q(`size-4`,t&&`animate-spin`)})})}function Gq({part:e,onRegenerate:t,className:n}){return(0,X.jsxs)(`div`,{"data-slot":`image-actions`,className:Q(`flex items-center gap-1 p-1`,n),children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>Pq(e),"data-slot":`image-download`,"aria-label":`Download image`,className:`hover:bg-muted inline-flex size-7 items-center justify-center rounded`,children:(0,X.jsx)(vI,{className:`size-4`})}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>{Fq(e).catch(()=>{})},"data-slot":`image-copy`,"aria-label":`Copy image`,className:`hover:bg-muted inline-flex size-7 items-center justify-center rounded`,children:(0,X.jsx)(gI,{className:`size-4`})}),t&&(0,X.jsx)(Wq,{onRegenerate:t})]})}var Kq=(0,h.memo)(e=>{let{image:t,filename:n,status:r}=e;return(r==null?void 0:r.type)===`running`?(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Hq,{}),(0,X.jsx)(Bq,{children:n})]}):(r==null?void 0:r.type)===`incomplete`&&r.reason===`content-filter`?(0,X.jsx)(Lq,{children:(0,X.jsx)(Uq,{reason:`The provider blocked this image.`})}):(0,X.jsxs)(Lq,{children:[(0,X.jsx)(Vq,{src:t,alt:n||`Image content`,children:(0,X.jsx)(Rq,{src:t,alt:n||`Image content`})}),(0,X.jsx)(Bq,{children:n})]})});Kq.displayName=`Image`,Kq.Root=Lq,Kq.Preview=Rq,Kq.Source=zq,Kq.Filename=Bq,Kq.Zoom=Vq,Kq.Actions=Gq,Kq.Generating=Hq,Kq.ContentFilterError=Uq,j();var qq=[`node`],Jq=(e,t,n=0,r=!1)=>{if(Object.is(e,t))return!0;if(n>=100||typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Jq(e[r],t[r],n+1))return!1;return!0}if(Array.isArray(t))return!1;let i=Object.getPrototypeOf(e),a=Object.getPrototypeOf(t);if(i!==Object.prototype&&i!==null||a!==Object.prototype&&a!==null)return!1;let o=e,s=t,c=0;for(let e in o)if(Object.hasOwn(o,e)&&(!r||e!==`position`&&e!==`data`)){if(!Object.prototype.propertyIsEnumerable.call(s,e)||!Jq(o[e],s[e],n+1))return!1;c++}let l=0;for(let e in s)Object.hasOwn(s,e)&&(!r||e!==`position`&&e!==`data`)&&l++;return c===l},Yq=(e,t)=>!e||!t?!1:e===t||Jq(e.properties,t.properties,0,!0)&&Jq(e.children,t.children),Xq=(e,t)=>Yq(e.node,t.node),Zq=(e={})=>Object.fromEntries(Object.entries(e==null?{}:e).map(([e,t])=>{if(!t)return[e,t];let n=t;return[e,(0,h.memo)(e=>{let{node:t}=e,r=G(e,qq);return(0,X.jsx)(n,A({},r))},Xq)]}));j();var Qq=[`children`,`fallbackPre`],$q=(0,h.createContext)(null),eJ=()=>(0,h.useContext)($q)!==null,tJ=(0,h.memo)(e=>{var t,n;let{children:r,fallbackPre:i}=e,a=G(e,Qq);return(t=(n=a.node)==null?void 0:n.children.some(e=>e.type===`element`&&e.tagName===`code`))==null||t?(0,X.jsx)($q.Provider,{value:a,children:r}):(0,X.jsx)(i,A(A({},a),{},{children:r}))},(e,t)=>e.fallbackPre===t.fallbackPre&&Xq(e,t));j();var nJ=[`node`],rJ=[`node`],iJ=e=>{let{node:t}=e,n=G(e,nJ);return(0,X.jsx)(`pre`,A({},n))},aJ=e=>{let{node:t}=e,n=G(e,rJ);return(0,X.jsx)(`code`,A({},n))},oJ=({node:e,components:{Pre:t,Code:n},code:r})=>(0,X.jsx)(t,{children:(0,X.jsx)(n,{node:e,children:r})}),sJ=()=>null,cJ=e=>{var t,n;return(t=(n=/language-([^\s]+)/.exec(e==null?``:e))==null?void 0:n[1])==null?``:t},lJ=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},language:a,code:o})=>{let s=(0,h.useMemo)(()=>({Pre:t,Code:n}),[t,n]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(i,{node:e,language:a,code:o}),(0,X.jsx)(r,{node:e,components:s,language:a,code:o})]})},uJ=m(u(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1);j();var dJ=[`className`],fJ=[`className`],pJ=e=>{let{className:t}=e,n=G(e,dJ);return e=>{let{className:r}=e,i=G(e,fJ);return A(A({className:(0,uJ.default)(t,r)},n),i)}};j();var mJ=[`node`,`components`,`componentsByLanguage`,`children`],hJ=[`node`,`components`,`componentsByLanguage`],gJ=(0,h.createContext)(null);function _J(e){let{Pre:t,preProps:n}=(0,h.useContext)(gJ);return(0,X.jsx)(t,A({},pJ(n)(e)))}function vJ(e){let{Code:t,codeProps:n}=(0,h.useContext)(gJ);return(0,X.jsx)(t,A({},pJ(n)(e)))}function yJ(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=``;for(let n of e)t+=yJ(n);return t}return(0,h.isValidElement)(e)?yJ(e.props.children):``}var bJ=e=>{var t,n,r,i;let{node:a,components:{Pre:o,Code:s,SyntaxHighlighter:c,CodeHeader:l},componentsByLanguage:u={},children:d}=e,f=G(e,mJ),p={Pre:o,Code:s,preProps:(0,h.useContext)($q),codeProps:f},m=cJ(f.className),g=(t=(n=u[m])==null?void 0:n.SyntaxHighlighter)==null?c:t,_=(r=(i=u[m])==null?void 0:i.CodeHeader)==null?l:r;return d!=null&&typeof d!=`string`?(0,X.jsxs)(gJ.Provider,{value:p,children:[(0,X.jsx)(_,{node:a,language:m,code:yJ(d)}),(0,X.jsx)(oJ,{node:a,components:{Pre:_J,Code:vJ},code:d})]}):(0,X.jsx)(gJ.Provider,{value:p,children:(0,X.jsx)(lJ,{node:a,components:{Pre:_J,Code:vJ,SyntaxHighlighter:g,CodeHeader:_},language:m,code:d==null?``:d})})},xJ=e=>{let{node:t,components:n,componentsByLanguage:r}=e,i=G(e,hJ);return eJ()?(0,X.jsx)(bJ,A({node:t,components:n,componentsByLanguage:r},i)):(0,X.jsx)(n.Code,A({},i))},SJ=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n){if(!Object.hasOwn(t,r))return!1;let n=e[r],i=t[r];if(n!==i&&(!n||!i||n.SyntaxHighlighter!==i.SyntaxHighlighter||n.CodeHeader!==i.CodeHeader))return!1}return!0},CJ=(0,h.memo)(xJ,(e,t)=>e.components===t.components&&SJ(e.componentsByLanguage,t.componentsByLanguage)&&Xq(e,t));function wJ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}RegExp(`[$_\\p{ID_Start}]`,`u`),RegExp(`[$_\\u{200C}\\u{200D}\\p{ID_Continue}]`,`u`),RegExp(`[-$_\\u{200C}\\u{200D}\\p{ID_Continue}]`,`u`);var TJ=RegExp(`^[$_\\p{ID_Start}][$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$`,`u`),EJ=RegExp(`^[$_\\p{ID_Start}][-$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$`,`u`),DJ={};function OJ(e,t){return((t||DJ).jsx?EJ:TJ).test(e)}var kJ=/[ \t\n\f\r]/g;function AJ(e){return typeof e==`object`?e.type===`text`&&jJ(e.value):jJ(e)}function jJ(e){return e.replace(kJ,``)===``}var MJ=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};MJ.prototype.normal={},MJ.prototype.property={},MJ.prototype.space=void 0;function NJ(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new MJ(n,r,t)}function PJ(e){return e.toLowerCase()}var FJ=class{constructor(e,t){this.attribute=t,this.property=e}};FJ.prototype.attribute=``,FJ.prototype.booleanish=!1,FJ.prototype.boolean=!1,FJ.prototype.commaOrSpaceSeparated=!1,FJ.prototype.commaSeparated=!1,FJ.prototype.defined=!1,FJ.prototype.mustUseProperty=!1,FJ.prototype.number=!1,FJ.prototype.overloadedBoolean=!1,FJ.prototype.property=``,FJ.prototype.spaceSeparated=!1,FJ.prototype.space=void 0;var IJ=d({boolean:()=>RJ,booleanish:()=>zJ,commaOrSpaceSeparated:()=>UJ,commaSeparated:()=>HJ,number:()=>$,overloadedBoolean:()=>BJ,spaceSeparated:()=>VJ}),LJ=0,RJ=WJ(),zJ=WJ(),BJ=WJ(),$=WJ(),VJ=WJ(),HJ=WJ(),UJ=WJ();function WJ(){return Math.pow(2,++LJ)}var GJ=Object.keys(IJ),KJ=class extends FJ{constructor(e,t,n,r){let i=-1;if(super(e,t),qJ(this,`space`,r),typeof n==`number`)for(;++i<GJ.length;){let e=GJ[i];qJ(this,GJ[i],(n&IJ[e])===IJ[e])}}};KJ.prototype.defined=!0;function qJ(e,t,n){n&&(e[t]=n)}function JJ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new KJ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[PJ(r)]=r,n[PJ(a.attribute)]=r}return new MJ(t,n,e.space)}var YJ=JJ({properties:{ariaActiveDescendant:null,ariaAtomic:zJ,ariaAutoComplete:null,ariaBusy:zJ,ariaChecked:zJ,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:VJ,ariaCurrent:null,ariaDescribedBy:VJ,ariaDetails:null,ariaDisabled:zJ,ariaDropEffect:VJ,ariaErrorMessage:null,ariaExpanded:zJ,ariaFlowTo:VJ,ariaGrabbed:zJ,ariaHasPopup:null,ariaHidden:zJ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:VJ,ariaLevel:$,ariaLive:null,ariaModal:zJ,ariaMultiLine:zJ,ariaMultiSelectable:zJ,ariaOrientation:null,ariaOwns:VJ,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:zJ,ariaReadOnly:zJ,ariaRelevant:null,ariaRequired:zJ,ariaRoleDescription:VJ,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:zJ,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function XJ(e,t){return t in e?e[t]:t}function ZJ(e,t){return XJ(e,t.toLowerCase())}var QJ=JJ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:HJ,acceptCharset:VJ,accessKey:VJ,action:null,allow:null,allowFullScreen:RJ,allowPaymentRequest:RJ,allowUserMedia:RJ,alpha:RJ,alt:null,as:null,async:RJ,autoCapitalize:null,autoComplete:VJ,autoFocus:RJ,autoPlay:RJ,blocking:VJ,capture:null,charSet:null,checked:RJ,cite:null,className:VJ,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:zJ,controls:RJ,controlsList:VJ,coords:$|HJ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:RJ,defer:RJ,dir:null,dirName:null,disabled:RJ,download:BJ,draggable:zJ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:RJ,formTarget:null,headers:VJ,height:$,hidden:BJ,high:$,href:null,hrefLang:null,htmlFor:VJ,httpEquiv:VJ,id:null,imageSizes:null,imageSrcSet:null,inert:RJ,inputMode:null,integrity:null,is:null,isMap:RJ,itemId:null,itemProp:VJ,itemRef:VJ,itemScope:RJ,itemType:VJ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:RJ,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:RJ,muted:RJ,name:null,nonce:null,noModule:RJ,noValidate:RJ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:RJ,optimum:$,pattern:null,ping:VJ,placeholder:null,playsInline:RJ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:RJ,referrerPolicy:null,rel:VJ,required:RJ,reversed:RJ,rows:$,rowSpan:$,sandbox:VJ,scope:null,scoped:RJ,seamless:RJ,selected:RJ,shadowRootClonable:RJ,shadowRootCustomElementRegistry:RJ,shadowRootDelegatesFocus:RJ,shadowRootMode:null,shadowRootSerializable:RJ,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:zJ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:RJ,useMap:null,value:zJ,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:VJ,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:RJ,declare:RJ,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:RJ,noHref:RJ,noShade:RJ,noWrap:RJ,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:zJ,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:RJ,disablePictureInPicture:RJ,disableRemotePlayback:RJ,exportParts:HJ,part:VJ,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:ZJ}),$J=JJ({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:UJ,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:VJ,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:RJ,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:HJ,g2:HJ,glyphName:HJ,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:UJ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:VJ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:UJ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:UJ,rev:UJ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:UJ,requiredFeatures:UJ,requiredFonts:UJ,requiredFormats:UJ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:UJ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:UJ,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:UJ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:XJ}),eY=JJ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),tY=JJ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ZJ}),nY=JJ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),rY={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},iY=/[A-Z]/g,aY=/-[a-z]/g,oY=/^data[-\w.:]+$/i;function sY(e,t){let n=PJ(t),r=t,i=FJ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&oY.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(aY,lY);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!aY.test(e)){let n=e.replace(iY,cY);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=KJ}return new i(r,t)}function cY(e){return`-`+e.toLowerCase()}function lY(e){return e.charAt(1).toUpperCase()}var uY=NJ([YJ,QJ,eY,tY,nY],`html`),dY=NJ([YJ,$J,eY,tY,nY],`svg`);function fY(e){return e.join(` `).trim()}var pY=/\/\*(?:[^*]|\*(?!\/))*\*\//g,mY=/\n/g,hY=/^\s*/,gY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,_Y=/^:\s*/,vY=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,yY=/^[;\s]*/,bY=`
61
- `,xY=`/`,SY=`*`,CY=``,wY=`comment`,TY=`declaration`;function EY(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t=t||{};var n=1,r=1;function i(e){var t=e.match(mY);t&&(n+=t.length);var i=e.lastIndexOf(bY);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(hY)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(xY==e.charAt(0)&&SY==e.charAt(1)){for(var n=2;CY!=e.charAt(n)&&(SY!=e.charAt(n)||xY!=e.charAt(n+1));)++n;if(n+=2,CY===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:wY,comment:o})}}function f(){var e=a(),t=c(gY);if(t){if(d(),!c(_Y))return s(`property missing ':'`);var n=c(vY),r=e({type:TY,property:t[0].replace(pY,CY).trim(),value:n?n[0].replace(pY,CY).trim():CY});return c(yY),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function DY(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=EY(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;if(i)t(r,a,e);else if(a){var o;n=(o=n)==null?{}:o,n[r]=a}}),n}var OY=AY(`end`),kY=AY(`start`);function AY(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function jY(e){let t=kY(e),n=OY(e);if(t&&n)return{start:t,end:n}}function MY(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?PY(e.position):`start`in e||`end`in e?PY(e):`line`in e||`column`in e?NY(e):``}function NY(e){return FY(e&&e.line)+`:`+FY(e&&e.column)}function PY(e){return NY(e&&e.start)+`-`+NY(e&&e.end)}function FY(e){return e&&typeof e==`number`?e:1}j();var IY=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:A({},t)),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=MY(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};IY.prototype.file=``,IY.prototype.name=``,IY.prototype.reason=``,IY.prototype.message=``,IY.prototype.stack=``,IY.prototype.column=void 0,IY.prototype.line=void 0,IY.prototype.ancestors=void 0,IY.prototype.cause=void 0,IY.prototype.fatal=void 0,IY.prototype.place=void 0,IY.prototype.ruleId=void 0,IY.prototype.source=void 0;var LY={}.hasOwnProperty,RY=new Map,zY=/[A-Z]/g,BY=/-([a-z])/g,VY=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),HY=new Set([`td`,`th`]),UY=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function WY(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=tX(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=eX(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?dY:uY,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=GY(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function GY(e,t,n){if(t.type===`element`)return KY(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qY(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return YY(e,t,n);if(t.type===`mdxjsEsm`)return JY(e,t);if(t.type===`root`)return XY(e,t,n);if(t.type===`text`)return ZY(e,t)}function KY(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=dY,e.schema=i),e.ancestors.push(t);let a=sX(e,t.tagName,!1),o=nX(e,t),s=iX(e,t);return VY.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!AJ(e)})),QY(e,o,a,t),$Y(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qY(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}cX(e,t.position)}function JY(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cX(e,t.position)}function YY(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=dY,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:sX(e,t.name,!0),o=rX(e,t),s=iX(e,t);return QY(e,o,a,t),$Y(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function XY(e,t,n){let r={};return $Y(r,iX(e,t)),e.create(t,e.Fragment,r,n)}function ZY(e,t){return t.value}function QY(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $Y(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eX(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function tX(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=kY(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function nX(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&LY.call(t.properties,i)){let a=aX(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&HY.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||(n.style={});t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function rX(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cX(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else cX(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function iX(e,t){let n=[],r=-1,i=e.passKeys?new Map:RY;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=GY(e,a,o);s!==void 0&&n.push(s)}return n}function aX(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=sY(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?wJ(n):fY(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:lX(n):oX(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?rY[r.property]||r.property:r.attribute,n]}function oX(e,t){let n={};try{DY(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(BY,fX))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new IY("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=UY+`#cannot-parse-style-attribute`,r}return n}function sX(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=OJ(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=OJ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return LY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);cX(e)}function cX(e,t){let n=new IY("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=UY+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function lX(e){let t={},n;for(n in e)LY.call(e,n)&&(t[uX(n)]=e[n]);return t}function uX(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(zY,dX);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function dX(e){return`-`+e.toLowerCase()}function fX(e,t){return t.toUpperCase()}var pX={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},mX={};function hX(e,t){let n=t||mX;return gX(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function gX(e,t,n){if(vX(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return _X(e.children,t,n)}return Array.isArray(e)?_X(e,t,n):``}function _X(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=gX(e[i],t,n);return r.join(``)}function vX(e){return!!(e&&typeof e==`object`)}var yX=document.createElement(`i`);function bX(e){let t=`&`+e+`;`;yX.innerHTML=t;let n=yX.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function xX(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function SX(e,t){return e.length>0?(xX(e,e.length,0,t),e):t}var CX={}.hasOwnProperty;function wX(e){let t={},n=-1;for(;++n<e.length;)TX(t,e[n]);return t}function TX(e,t){let n;for(n in t){let r=(CX.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){CX.call(r,a)||(r[a]=[]);let e=i[a];EX(r[a],Array.isArray(e)?e:e?[e]:[])}}}function EX(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);xX(e,0,0,r)}function DX(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function OX(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var kX=VX(/[A-Za-z]/),AX=VX(/[\dA-Za-z]/),jX=VX(/[#-'*+\--9=?A-Z^-~]/);function MX(e){return e!==null&&(e<32||e===127)}var NX=VX(/\d/),PX=VX(/[\dA-Fa-f]/),FX=VX(/[!-/:-@[-`{-~]/);function IX(e){return e!==null&&e<-2}function LX(e){return e!==null&&(e<0||e===32)}function RX(e){return e===-2||e===-1||e===32}var zX=VX(RegExp(`\\p{P}|\\p{S}`,`u`)),BX=VX(/\s/);function VX(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function HX(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&AX(e.charCodeAt(n+1))&&AX(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=``),i&&(n+=i,i=0)}return t.join(``)+e.slice(r)}function UX(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return RX(r)?(e.enter(n),s(r)):t(r)}function s(r){return RX(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function WX(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&RX(t)?(e.enter(r),c(t)):l(t)}function c(t){return RX(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var GX={tokenize:KX};function KX(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),UX(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return IX(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var qX=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){JX(this,e,t,n,!1)}addBefore(e,t,n){JX(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function JX(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}j();var YX={tokenize:ZX},XX={tokenize:QX};function ZX(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end=A({},o),s++;let c=new qX;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(XX,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(XX,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i=i||t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return IX(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end=A({},c),e++;let l=new qX;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function QX(e,t,n){return UX(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function $X(e){if(e===null||LX(e)||BX(e))return 1;if(zX(e))return 2}function eZ(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}j();var tZ={name:`attention`,resolveAll:nZ,tokenize:rZ};function nZ(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o=A({},e[i][1].end),s=A({},e[n][1].start);iZ(o,-a),iZ(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:A({},e[i][1].end)},l={type:a>1?`strongSequence`:`emphasisSequence`,start:A({},e[n][1].start),end:s},u={type:a>1?`strongText`:`emphasisText`,start:A({},e[i][1].end),end:A({},e[n][1].start)},d={type:a>1?`strong`:`emphasis`,start:A({},c.start),end:A({},l.end)};e[i][1].end=A({},c.start),e[n][1].start=A({},l.end),r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=SX(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=SX(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=SX(r,eZ(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=SX(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=SX(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),xX(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function rZ(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=$X(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=$X(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function iZ(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var aZ={name:`autolink`,tokenize:oZ};function oZ(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return kX(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||AX(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||AX(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||MX(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):jX(t)?(e.consume(t),l):n(t)}function u(e){return AX(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||AX(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var sZ={partial:!0,tokenize:cZ};function cZ(e,t,n){return r;function r(t){return RX(t)?UX(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||IX(e)?t(e):n(e)}}var lZ={continuation:{tokenize:dZ},exit:fZ,name:`blockQuote`,tokenize:uZ};function uZ(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||(e.enter(`blockQuote`,{_container:!0}),n.open=!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return RX(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function dZ(e,t,n){let r=this;return i;function i(t){return RX(t)?UX(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(lZ,t,n)(r)}}function fZ(e){e.exit(`blockQuote`)}var pZ={name:`characterEscape`,tokenize:mZ};function mZ(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return FX(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var hZ={name:`characterReference`,tokenize:gZ};function gZ(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=AX,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=PX,u):(e.enter(`characterReferenceValue`),a=7,o=NX,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===AX&&!bX(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var _Z={partial:!0,tokenize:vZ};function vZ(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var yZ={concrete:!0,name:`codeFenced`,tokenize:bZ};function bZ(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),RX(t)?UX(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||IX(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(_Z,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||IX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):RX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),UX(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||IX(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||IX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&RX(t)?UX(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||IX(t)?e.check(_Z,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||IX(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),RX(t)?UX(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),RX(t)?UX(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||IX(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var xZ={name:`codeIndented`,tokenize:CZ},SZ={partial:!0,tokenize:wZ};function CZ(e,t,n){return r;function r(t){return e.enter(`codeIndented`),WX(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):IX(t)?e.attempt(SZ,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||IX(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function wZ(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):IX(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):WX(e,t,a,`linePrefix`,4,4)(o)}function a(e){return IX(e)?i(e):n(e)}}var TZ={name:`codeText`,previous:DZ,resolve:EZ,tokenize:OZ};function EZ(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function DZ(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function OZ(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):IX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||IX(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var kZ=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t==null?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&AZ(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),AZ(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),AZ(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);AZ(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);AZ(this.left,t.reverse())}}}};function AZ(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}j();function jZ(e){let t={},n=-1,r,i,a,o,s,c,l,u=new kZ(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,MZ(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end=A({},u.get(i)[1].start),s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return xX(e,0,1/0,u.slice(0)),!l}function MZ(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var NZ={resolve:FZ,tokenize:IZ},PZ={partial:!0,tokenize:LZ};function FZ(e){return jZ(e),e}function IZ(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):IX(t)?e.check(PZ,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function LZ(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),UX(e,a,`linePrefix`)}function a(i){if(i===null||IX(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function RZ(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||MX(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||IX(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||LX(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||MX(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function zZ(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):IX(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||IX(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||(c=!RX(t)),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function BZ(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):IX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),UX(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||IX(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function VZ(e,t){let n;return r;function r(i){return IX(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):RX(i)?UX(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var HZ={name:`definition`,tokenize:WZ},UZ={partial:!0,tokenize:GZ};function WZ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return zZ.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=OX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return LX(t)?VZ(e,l)(t):l(t)}function l(t){return RZ(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(UZ,d,d)(t)}function d(t){return RX(t)?UX(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||IX(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function GZ(e,t,n){return r;function r(t){return LX(t)?VZ(e,i)(t):n(t)}function i(t){return BZ(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return RX(t)?UX(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||IX(e)?t(e):n(e)}}var KZ={name:`hardBreakEscape`,tokenize:qZ};function qZ(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return IX(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var JZ={name:`headingAtx`,resolve:YZ,tokenize:XZ};function YZ(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};xX(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function XZ(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||LX(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||IX(n)?(e.exit(`atxHeading`),t(n)):RX(n)?UX(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||LX(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var ZZ=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),QZ=[`pre`,`script`,`style`,`textarea`],$Z={concrete:!0,name:`htmlFlow`,resolveTo:tQ,tokenize:nQ},eQ={partial:!0,tokenize:rQ};function tQ(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function nQ(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):kX(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):kX(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return kX(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||LX(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&QZ.includes(l)?(i=1,r.interrupt?t(s):O(s)):ZZ.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||AX(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return RX(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||kX(t)?(e.consume(t),b):RX(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||AX(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):RX(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):RX(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||IX(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||LX(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||RX(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||IX(t)?O(t):RX(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):IX(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(eQ,R,k)(t)):t===null||IX(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(_Z,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||IX(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return QZ.includes(n)?(e.consume(t),L):O(t)}return kX(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||IX(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function rQ(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(sZ,t,n)}}var iQ={name:`htmlText`,tokenize:aQ};function aQ(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):kX(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):kX(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):IX(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):IX(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):IX(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):IX(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return kX(t)?(e.consume(t),S):n(t)}function S(t){return t===45||AX(t)?(e.consume(t),S):C(t)}function C(t){return IX(t)?(o=C,N(t)):RX(t)?(e.consume(t),C):M(t)}function w(t){return t===45||AX(t)?(e.consume(t),w):t===47||t===62||LX(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||kX(t)?(e.consume(t),E):IX(t)?(o=T,N(t)):RX(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||AX(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):IX(t)?(o=D,N(t)):RX(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):IX(t)?(o=O,N(t)):RX(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):IX(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||LX(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||LX(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return RX(t)?UX(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}j();var oQ={name:`labelEnd`,resolveAll:uQ,resolveTo:dQ,tokenize:fQ},sQ={tokenize:pQ},cQ={tokenize:mQ},lQ={tokenize:hQ};function uQ(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&xX(e,0,e.length,n),e}function dQ(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:A({},e[i][1].start),end:A({},e[e.length-1][1].end)},c={type:`label`,start:A({},e[i][1].start),end:A({},e[a][1].end)},l={type:`labelText`,start:A({},e[i+r+2][1].end),end:A({},e[a-2][1].start)};return o=[[`enter`,s,t],[`enter`,c,t]],o=SX(o,e.slice(i+1,i+r+3)),o=SX(o,[[`enter`,l,t]]),o=SX(o,eZ(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=SX(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=SX(o,e.slice(a+1)),o=SX(o,[[`exit`,s,t]]),xX(e,i,e.length,o),e}function fQ(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(OX(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(sQ,u,o?u:d)(t):t===91?e.attempt(cQ,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(lQ,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function pQ(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return LX(t)?VZ(e,a)(t):a(t)}function a(t){return t===41?u(t):RZ(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return LX(t)?VZ(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?BZ(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return LX(t)?VZ(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function mQ(e,t,n){let r=this;return i;function i(t){return zZ.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(OX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function hQ(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var gQ={name:`labelStartImage`,resolveAll:oQ.resolveAll,tokenize:_Q};function _Q(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var vQ={name:`labelStartLink`,resolveAll:oQ.resolveAll,tokenize:yQ};function yQ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var bQ={name:`lineEnding`,tokenize:xQ};function xQ(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),UX(e,t,`linePrefix`)}}var SQ={name:`thematicBreak`,tokenize:CQ};function CQ(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||IX(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),RX(t)?UX(e,s,`whitespace`)(t):s(t))}}var wQ={continuation:{tokenize:OQ},exit:AQ,name:`list`,tokenize:DQ},TQ={partial:!0,tokenize:jQ},EQ={partial:!0,tokenize:kQ};function DQ(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:NX(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(SQ,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return NX(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(sZ,r.interrupt?n:u,e.attempt(TQ,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return RX(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function OQ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(sZ,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,UX(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!RX(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(EQ,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,UX(e,e.attempt(wQ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function kQ(e,t,n){let r=this;return UX(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function AQ(e){e.exit(this.containerState.type)}function jQ(e,t,n){let r=this;return UX(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!RX(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}j();var MQ={name:`setextUnderline`,resolveTo:NQ,tokenize:PQ};function NQ(e,t){let n=new qX,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:A({},e[i][1].start),end:A({},e[e.length-1][1].end)};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end=A({},e[o][1].end)):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function PQ(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),RX(t)?UX(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||IX(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var FQ={tokenize:IQ};function IQ(e){let t=this,n=e.attempt(sZ,r,e.attempt(this.parser.constructs.flowInitial,i,UX(e,e.attempt(this.parser.constructs.flow,i,e.attempt(NZ,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}j();var LQ={resolveAll:VQ()},RQ=BQ(`string`),zQ=BQ(`text`);function BQ(e){return{resolveAll:VQ(e===`text`?HQ:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function VQ(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function HQ(e,t){let n=new qX,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:A({},i.end)};i.end=A({},a.start),i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var UQ=d({attentionMarkers:()=>ZQ,contentInitial:()=>GQ,disable:()=>QQ,document:()=>WQ,flow:()=>qQ,flowInitial:()=>KQ,insideSpan:()=>XQ,string:()=>JQ,text:()=>YQ}),WQ={42:wQ,43:wQ,45:wQ,48:wQ,49:wQ,50:wQ,51:wQ,52:wQ,53:wQ,54:wQ,55:wQ,56:wQ,57:wQ,62:lZ},GQ={91:HZ},KQ={[-2]:xZ,[-1]:xZ,32:xZ},qQ={35:JZ,42:SQ,45:[MQ,SQ],60:$Z,61:MQ,95:SQ,96:yZ,126:yZ},JQ={38:hZ,92:pZ},YQ={[-5]:bQ,[-4]:bQ,[-3]:bQ,33:gQ,38:hZ,42:tZ,60:[aZ,iQ],91:vQ,92:[KZ,pZ],93:oQ,95:tZ,96:TZ},XQ={null:[tZ,LQ]},ZQ={null:[42,95]},QQ={null:[]};function $Q(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=SX(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=eZ(a,l.events,l),l.events):[]}function f(e,t){return t$(p(e),t)}function p(e){return e$(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){IX(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&xX(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function e$(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function t$(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
60
+ `):!1,n[7]=r,n[8]=h);let g=Y(h)&&!d,_=YA&&typeof i==`boolean`?i?``:void 0:i,v;n[9]===l?v=n[10]:(v=e=>{e.preventDefault(),l&&l()},n[9]=l,n[10]=v);let y=v,b=QA,x=r?m:null,S=_,C=g?``:void 0,w;n[11]!==y||n[12]!==o?(w=Bb(o,y),n[11]=y,n[12]=o,n[13]=w):w=n[13];let T;n[14]===a?T=n[15]:(T=Bb(a,b),n[14]=a,n[15]=T);let E;n[16]!==u||n[17]!==t||n[18]!==s||n[19]!==S||n[20]!==C||n[21]!==w||n[22]!==T?(E=(0,X.jsx)(VO.form,A(A({},s),{},{inert:S,"data-aui-composer-type":u,"data-compact":C,ref:t,onSubmit:w,onMouseDown:T})),n[16]=u,n[17]=t,n[18]=s,n[19]=S,n[20]=C,n[21]=w,n[22]=T,n[23]=E):E=n[23];let D;return n[24]!==x||n[25]!==E?(D=(0,X.jsx)(UA.Provider,{value:x,children:E}),n[24]=x,n[25]=E,n[26]=D):D=n[26],D});XA.displayName=`ComposerPrimitive.Root`;function ZA(e){return e.composer.type}function QA(e){if(e.button!==0)return;let t=e.target;if(!(t instanceof Element)||!e.currentTarget.contains(t))return;let n=t.closest(JA);if(n&&e.currentTarget.contains(n))return;let r=e.currentTarget.querySelector(KA);r&&(e.preventDefault(),r.focus())}var $A=e=>{let t=J(4),n=Jb(e),r=cy(ej),i,a;t[0]!==n||t[1]!==r?(i=()=>r(n),a=[r,n],t[0]=n,t[1]=r,t[2]=i,t[3]=a):(i=t[2],a=t[3]),q(i,a)};function ej(e){return e.onScrollToBottom}var tj=()=>!1,nj=()=>{},rj=e=>{let t=J(4),n;t[0]===e?n=t[1]:(n=t=>{if(typeof window>`u`||e===null||!window.matchMedia)return nj;let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},t[0]=e,t[1]=n);let r=n,i;return t[2]===e?i=t[3]:(i=()=>typeof window>`u`||e===null||!window.matchMedia?!1:window.matchMedia(e).matches,t[2]=e,t[3]=i),Dn(r,i,tj)},ij=e=>e.isComposing||e.keyCode===229,aj=Hn(void 0),oj=()=>Wn(aj),sj=`[data-aui-composer-type]`,cj=`[data-aui-thread-root]`,lj=e=>{let t=J(4),n=Xa(),r=oj(),i;return t[0]!==n.composer||t[1]!==e||t[2]!==r?(i=t=>{let i=r==null?void 0:r.current,a=t==null?void 0:t.ownerDocument,o=a==null?void 0:a.activeElement,s=t==null?void 0:t.closest(sj),c=n.composer.getState().type===`edit`&&i&&o&&(s==null?void 0:s.getAttribute(`data-aui-composer-type`))===`edit`&&s.contains(o)&&s.closest(cj)===i,l=c?Array.from(i.querySelectorAll(KA)).filter(e=>{var t;return e.closest(cj)===i&&((t=e.closest(sj))==null?void 0:t.getAttribute(`data-aui-composer-type`))===`thread`}):[];if(e(),a&&o&&c&&(a.activeElement===o||a.activeElement===a.body)){for(let e of l)if(e.isConnected&&!e.closest(`[hidden], [inert]`)&&(e.focus({preventScroll:!0}),a.activeElement!==o&&a.activeElement!==a.body))break}},t[0]=n.composer,t[1]=e,t[2]=r,t[3]=i):i=t[3],i};function uj(){return Y(dj)}function dj(e){return e.composer.isEditing?e.composer.text:``}function fj(e){return!!Y(pj)||!!e}function pj(e){var t;return e.thread.isDisabled||((t=e.composer.dictation)==null?void 0:t.inputDisabled)}function mj(){let e=J(4),t=vA();if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={},e[0]=t):t=e[0],t}let n;return e[1]!==t.highlightedItemId||e[2]!==t.popoverId?(n={"aria-controls":t.popoverId,"aria-expanded":!0,"aria-haspopup":`listbox`,"aria-activedescendant":t.highlightedItemId},e[1]=t.highlightedItemId,e[2]=t.popoverId,e[3]=n):n=e[3],n}function hj(){return hj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hj.apply(null,arguments)}function gj(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _j=t.useLayoutEffect,vj=function(e){var n=t.default.useRef(e);return _j(function(){n.current=e}),n},yj=function(e,t){typeof e==`function`?e(t):e.current=t},bj=function(e,n){var r=t.default.useRef();return t.default.useCallback(function(t){e.current=t,r.current&&yj(r.current,null),r.current=n,n&&yj(n,t)},[n])},xj={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},Sj=function(e){Object.keys(xj).forEach(function(t){e.style.setProperty(t,xj[t],`important`)})},Cj=null,wj=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function Tj(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Cj||(Cj=document.createElement(`textarea`),Cj.setAttribute(`tabindex`,`-1`),Cj.setAttribute(`aria-hidden`,`true`),Sj(Cj)),Cj.parentNode===null&&document.body.appendChild(Cj);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;Cj.style[t]=o[t]}),Sj(Cj),Cj.value=t;var c=wj(Cj,e);Cj.value=t,c=wj(Cj,e),Cj.value=`x`;var l=Cj.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var Ej=function(){},Dj=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},Oj=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],kj=!!document.documentElement.currentStyle,Aj=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Dj(Oj,t),r=n.boxSizing;return r===``?null:(kj&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function jj(e,n,r){var i=vj(r);t.useLayoutEffect(function(){var t=function(e){return i.current(e)};if(e)return e.addEventListener(n,t),function(){return e.removeEventListener(n,t)}},[])}var Mj=function(e,t){jj(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},Nj=function(e){jj(window,`resize`,e)},Pj=function(e){jj(document.fonts,`loadingdone`,e)},Fj=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],Ij=t.forwardRef(function(e,n){var r=e.cacheMeasurements,i=e.maxRows,a=e.minRows,o=e.onChange,s=o===void 0?Ej:o,c=e.onHeightChange,l=c===void 0?Ej:c,u=gj(e,Fj),d=u.value!==void 0,f=t.useRef(null),p=bj(f,n),m=t.useRef(0),h=t.useRef(),g=function(){var e=f.current,t=r&&h.current?h.current:Aj(e);if(t){h.current=t;var n=Tj(t,e.value||e.placeholder||`x`,a,i),o=n[0],s=n[1];m.current!==o&&(m.current=o,e.style.setProperty(`height`,o+`px`,`important`),l(o,{rowHeight:s}))}};return t.useLayoutEffect(g),Mj(f,function(){if(!d){var e=f.current.value;requestAnimationFrame(function(){var t=f.current;t&&e!==t.value&&g()})}}),Nj(g),Pj(g),t.createElement(`textarea`,hj({},u,{onChange:function(e){d||g(),s(e)},ref:p}))});j();var Lj=[`autoFocus`,`asChild`,`render`,`disabled`,`onChange`,`onKeyDown`,`onPaste`,`onSelect`,`submitOnEnter`,`submitMode`,`cancelOnEscape`,`unstable_focusOnRunStart`,`unstable_focusOnScrollToBottom`,`unstable_focusOnThreadSwitched`,`unstable_insertNewlineOnTouchEnter`,`addAttachmentOnPaste`,`onHeightChange`],Rj=`(pointer: coarse) and (not (any-pointer: fine))`,zj=Mn((e,t)=>{let{autoFocus:n=!1,asChild:r,render:i,disabled:a,onChange:o,onKeyDown:s,onPaste:c,onSelect:l,submitOnEnter:u,submitMode:d,cancelOnEscape:f=!0,unstable_focusOnRunStart:p=!0,unstable_focusOnScrollToBottom:m=!0,unstable_focusOnThreadSwitched:h=!0,unstable_insertNewlineOnTouchEnter:g=!1,addAttachmentOnPaste:_=!0,onHeightChange:v}=e,y=G(e,Lj),b=Xa(),x=oj(),S=rA(),C=WA(),w=d==null?u===!1?`none`:`enter`:d,T=rj(g?Rj:null),E=g&&T&&w===`enter`?`none`:w,D=uj(),k=fj(a),j=K(null),M=lj(wn(()=>b.composer.cancel(),[b])),N=Ry(t,j),P=K(!1);uO(e=>{var t;if((t=j.current)!=null&&t.contains(e.target)&&!ij(e)){if(S){for(let t of S.getPlugins())if(t.handleKeyDown(e))return}f&&b.composer.getState().canCancel&&(M(j.current),e.preventDefault())}});let F=e=>{if(!k&&!ij(e.nativeEvent)){if(S){for(let t of S.getPlugins())if(t.handleKeyDown(e))return}if(e.key===`Enter`){let n=b.thread.getState(),r=n.capabilities.queue;if(e.shiftKey&&(e.ctrlKey||e.metaKey)&&r&&w!==`none`&&b.composer.getState().canSend){e.preventDefault(),b.composer.send({steer:!0});return}if(e.shiftKey||n.isRunning&&!r&&n.voice===void 0)return;let i=!1;if(E===`ctrlEnter`?i=e.ctrlKey||e.metaKey:E===`enter`&&(i=!0),i){var t;e.preventDefault(),(t=j.current)==null||(t=t.closest(`form`))==null||t.requestSubmit()}}}},I=function(){var e=O(function*(e){var t;if(!_)return;let n=b.thread.getState().capabilities,r=Array.from(((t=e.clipboardData)==null?void 0:t.files)||[]);n.attachments&&r.length>0&&(e.preventDefault(),yield Promise.all(r.map(function(){var e=O(function*(e){try{yield b.composer.addAttachment(e)}catch(e){}});return function(t){return e.apply(this,arguments)}}())))});return function(t){return e.apply(this,arguments)}}(),L=(e,t)=>{if(v==null||v(e,t),!C)return;let n=j.current;if(!n||n.value===``)return;let r=getComputedStyle(n),i=r.boxSizing===`border-box`?e-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderTopWidth)-parseFloat(r.borderBottomWidth):e;Math.round(i/t.rowHeight)>1&&C.setMultiline(!0)},R=n&&!k,z=wn(()=>{let e=j.current;e&&R&&(e.focus({preventScroll:!0}),e.setSelectionRange(e.value.length,e.value.length))},[R]),B=wn(()=>{let e=j.current;if(!e)return;let t=e.ownerDocument,n=t.activeElement;if(n===e)return;let r=x==null?void 0:x.current,i=e.closest(`[data-aui-composer-type]`);(!n||n===t.body||i!=null&&i.contains(n)||r!=null&&r.contains(n)&&n.closest(`[data-aui-thread-root]`)===r)&&z()},[z,x]);q(()=>z(),[z]),$A(()=>{b.composer.getState().type===`thread`&&m&&z()}),q(()=>{if(b.composer.getState().type===`thread`&&p)return b.on(`thread.runStart`,B)},[p,B,b]),q(()=>{if(b.composer.getState().type===`thread`&&h&&b.optional.threads)return b.on(`threads.selectionChanged`,z)},[h,z,b]),q(()=>{D===``&&(C==null||C.setMultiline(!1))},[D,C]);let ee=mj(),V=A(A(A({name:`input`,value:D},y),ee),{},{ref:N,disabled:k,onChange:Bb(o,e=>{var t;if(!b.composer.getState().isEditing)return;let n=e.nativeEvent.isComposing===!0;P.current&&!n&&(P.current=!1);let r=n||P.current;if(sr(()=>{b.composer.setText(e.target.value,{origin:`user`})}),r)return;let i=(t=e.target.selectionStart)==null?e.target.value.length:t;if(S)for(let e of S.getPlugins())e.setCursorPosition(i)}),onKeyDown:Bb(s,F),onCompositionStart:Bb(y.onCompositionStart,()=>{P.current=!0}),onCompositionEnd:Bb(y.onCompositionEnd,e=>{var t;if(P.current=!1,!b.composer.getState().isEditing)return;let n=e.target;sr(()=>{b.composer.setText(n.value,{origin:`user`})});let r=(t=n.selectionStart)==null?n.value.length:t;if(S)for(let e of S.getPlugins())e.setCursorPosition(r)}),onSelect:Bb(l,e=>{var t;if(P.current)return;let n=e.target,r=(t=n.selectionStart)==null?n.value.length:t;if(S)for(let e of S.getPlugins())e.setCursorPosition(r)}),onPaste:Bb(c,I)},C?{onHeightChange:L}:v===void 0?{}:{onHeightChange:v});if(i&&Ln(i))return RO(i,y.children,V);let te=r?Uy:Ij;return(0,X.jsx)(te,A({},V))});zj.displayName=`ComposerPrimitive.Input`;var Bj=tk(`ComposerPrimitive.Resume`,()=>{let e=J(2),{disabled:t,resume:n}=Tv(),r;return e[0]===n?r=e[1]:(r=()=>n(),e[0]=n,e[1]=r),t?null:r}),Vj=tk(`ComposerPrimitive.Cancel`,()=>{let e=J(2),{disabled:t,cancel:n}=Ev(),r=lj(n);if(t)return null;let i;return e[0]===r?i=e[1]:(i=e=>r(e.detail===0?e.currentTarget:null),e[0]=r,e[1]=i),i}),Hj=tk(`ComposerPrimitive.AddAttachment`,e=>{let t=J(10),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{multiple:r}=n,i=r===void 0||r,{disabled:a,addAttachment:o}=kv(),s=Xa(),c=K(0),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>()=>{c.current+=1},t[2]=l):l=t[2];let u;t[3]!==s.composer||t[4]!==s.optional.threadListItem?(u=[s.composer,s.optional.threadListItem],t[3]=s.composer,t[4]=s.optional.threadListItem,t[5]=u):u=t[5],kn(l,u);let d;return t[6]!==o||t[7]!==s.composer||t[8]!==i?(d=()=>{let e=c.current,t=document.createElement(`input`);t.type=`file`,t.multiple=i,t.hidden=!0;let n=s.composer.getState().attachmentAccept;n!==`*`&&(t.accept=n),document.body.appendChild(t),t.onchange=function(){var n=O(function*(n){let r=n.target.files;if(!r)return;let i=Array.from(r,function(){var t=O(function*(t){try{if(c.current!==e)return;yield o(t)}catch(e){}});return function(e){return t.apply(this,arguments)}}());document.body.removeChild(t),yield Promise.all(i)});return function(e){return n.apply(this,arguments)}}(),t.oncancel=()=>{t.files&&t.files.length!==0||document.body.removeChild(t)},t.click()},t[6]=o,t[7]=s.composer,t[8]=i,t[9]=d):d=t[9],a?null:d},[`multiple`]);j();var Uj=[`disabled`,`asChild`,`render`,`children`],Wj=Mn((e,t)=>{let{disabled:n,asChild:r=!1,render:i,children:a}=e,o=G(e,Uj),[s,c]=xn(!1),l=Xa(),u=Y(e=>e.thread.isDisabled),d=n||u;q(()=>{d&&c(!1)},[d]);let f=wn(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),d||!l.thread.getState().capabilities.attachments?e.dataTransfer.dropEffect=`none`:c(!0))},[d,l]),p=wn(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),d||!l.thread.getState().capabilities.attachments?e.dataTransfer.dropEffect=`none`:s||c(!0))},[d,s,l]),m=wn(e=>{if(d)return;e.preventDefault();let t=e.relatedTarget;t&&e.currentTarget.contains(t)||c(!1)},[d]),h=wn(function(){var e=O(function*(e){if(c(!1),!e.dataTransfer.types.includes(`Files`)||(e.preventDefault(),d))return;let t=Array.from(e.dataTransfer.files);l.thread.getState().capabilities.attachments&&t.length!==0&&(yield Promise.all(t.map(function(){var e=O(function*(e){try{yield l.composer.addAttachment(e)}catch(e){}});return function(t){return e.apply(this,arguments)}}())))});return function(t){return e.apply(this,arguments)}}(),[d,l]),g=A(A(A({},s&&!d?{"data-dragging":`true`}:null),o),{},{onDragEnterCapture:Bb(o.onDragEnterCapture,f),onDragOverCapture:Bb(o.onDragOverCapture,p),onDragLeaveCapture:Bb(o.onDragLeaveCapture,m),onDropCapture:Bb(o.onDropCapture,h),ref:t});if(i&&Ln(i))return RO(i,a,g);let _=r?Uy:`div`;return(0,X.jsx)(_,A(A({},g),{},{children:a}))});Wj.displayName=`ComposerPrimitive.AttachmentDropzone`;var Gj=tk(`ComposerPrimitive.Dictate`,()=>{let{disabled:e,startDictation:t}=Dv();return e?null:t}),Kj=tk(`ComposerPrimitive.StopDictation`,()=>{let e=J(2),t=Xa(),n=Y(qj),r;return e[0]===t.composer?r=e[1]:(r=()=>{t.composer.stopDictation()},e[0]=t.composer,e[1]=r),n?r:null});function qj(e){return e.composer.dictation!=null}j();var Jj=[`children`],Yj=Mn((e,t)=>{var n;let r=J(7),i,a;if(r[0]!==e){var o=e;({children:i}=o),a=G(o,Jj),r[0]=e,r[1]=i,r[2]=a}else i=r[1],a=r[2];let s=Y(Xj);if(!s)return null;let c=(n=i)==null?s:n,l;return r[3]!==t||r[4]!==a||r[5]!==c?(l=(0,X.jsx)(VO.span,A(A({},a),{},{ref:t,children:c})),r[3]=t,r[4]=a,r[5]=c,r[6]=l):l=r[6],l});Yj.displayName=`ComposerPrimitive.DictationTranscript`;function Xj(e){var t;return(t=e.composer.dictation)==null?void 0:t.transcript}j();var Zj=[`children`],Qj=[`onClick`],$j=Mn((e,t)=>{let n=J(3);if(!Y(nM))return null;let r;return n[0]!==t||n[1]!==e?(r=(0,X.jsx)(VO.div,A(A({},e),{},{ref:t})),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});$j.displayName=`ComposerPrimitive.Quote`;var eM=Mn((e,t)=>{var n;let r=J(7),i,a;if(r[0]!==e){var o=e;({children:i}=o),a=G(o,Zj),r[0]=e,r[1]=i,r[2]=a}else i=r[1],a=r[2];let s=Y(rM);if(!s)return null;let c=(n=i)==null?s:n,l;return r[3]!==t||r[4]!==a||r[5]!==c?(l=(0,X.jsx)(VO.span,A(A({},a),{},{ref:t,children:c})),r[3]=t,r[4]=a,r[5]=c,r[6]=l):l=r[6],l});eM.displayName=`ComposerPrimitive.QuoteText`;var tM=Mn((e,t)=>{let n=J(12),r,i;if(n[0]!==e){var a=e;({onClick:r}=a),i=G(a,Qj),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let o=Xa(),s;n[3]===o?s=n[4]:(s=()=>{o.composer.setQuote(void 0)},n[3]=o,n[4]=s);let c=s,l;n[5]!==c||n[6]!==r?(l=Bb(r,c),n[5]=c,n[6]=r,n[7]=l):l=n[7];let u;return n[8]!==t||n[9]!==i||n[10]!==l?(u=(0,X.jsx)(VO.button,A(A({type:`button`},i),{},{ref:t,onClick:l})),n[8]=t,n[9]=i,n[10]=l,n[11]=u):u=n[11],u});tM.displayName=`ComposerPrimitive.QuoteDismiss`;function nM(e){return e.composer.quote}function rM(e){var t;return(t=e.composer.quote)==null?void 0:t.text}j();var iM=[`children`,`aria-label`],aM=[`categoryId`,`onClick`,`onMouseMove`],oM=Mn((e,t)=>{var n;let r=J(12),i,a,o;if(r[0]!==e){var s=e;({children:a,"aria-label":i}=s),o=G(s,iM),r[0]=e,r[1]=i,r[2]=a,r[3]=o}else i=r[1],a=r[2],o=r[3];let{categories:c,activeCategoryId:l,isSearchMode:u,open:d}=FA();if(!d||l||u)return null;let f=(n=i)==null?`Categories`:n,p;r[4]!==c||r[5]!==a?(p=a(c),r[4]=c,r[5]=a,r[6]=p):p=r[6];let m;return r[7]!==t||r[8]!==o||r[9]!==f||r[10]!==p?(m=(0,X.jsx)(VO.div,A(A({role:`group`,"aria-label":f},o),{},{ref:t,children:p})),r[7]=t,r[8]=o,r[9]=f,r[10]=p,r[11]=m):m=r[11],m});oM.displayName=`ComposerPrimitive.TriggerPopoverCategories`;var sM=Mn((e,t)=>{let n=J(30),r,i,a,o;if(n[0]!==e){var s=e;({categoryId:r,onClick:i,onMouseMove:a}=s),o=G(s,aM),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o}else r=n[1],i=n[2],a=n[3],o=n[4];let{selectCategory:c,highlightIndex:l,categories:u,highlightedIndex:d,activeCategoryId:f,isSearchMode:p,popoverId:m}=FA(),h;n[5]!==r||n[6]!==c?(h=()=>{c(r)},n[5]=r,n[6]=c,n[7]=h):h=n[7];let g=h,_;if(n[8]!==u||n[9]!==r){let e;n[11]===r?e=n[12]:(e=e=>e.id===r,n[11]=r,n[12]=e),_=u.findIndex(e),n[8]=u,n[9]=r,n[10]=_}else _=n[10];let v=_,y=!f&&!p&&v===d,b;n[13]!==v||n[14]!==l?(b=()=>{l(v)},n[13]=v,n[14]=l,n[15]=b):b=n[15];let x=b,S=`${m}-option-${r}`,C=y?``:void 0,w;n[16]!==g||n[17]!==i?(w=Bb(i,g),n[16]=g,n[17]=i,n[18]=w):w=n[18];let T;n[19]!==x||n[20]!==a?(T=Bb(a,x),n[19]=x,n[20]=a,n[21]=T):T=n[21];let E;return n[22]!==t||n[23]!==y||n[24]!==o||n[25]!==S||n[26]!==C||n[27]!==w||n[28]!==T?(E=(0,X.jsx)(VO.button,A(A({type:`button`,role:`option`,id:S,"aria-selected":y,"data-highlighted":C},o),{},{ref:t,onClick:w,onMouseMove:T})),n[22]=t,n[23]=y,n[24]=o,n[25]=S,n[26]=C,n[27]=w,n[28]=T,n[29]=E):E=n[29],E});sM.displayName=`ComposerPrimitive.TriggerPopoverCategoryItem`,j();var cM=[`children`,`aria-label`],lM=[`item`,`index`,`onClick`,`onMouseMove`],uM=Mn((e,t)=>{var n;let r=J(12),i,a,o;if(r[0]!==e){var s=e;({children:a,"aria-label":i}=s),o=G(s,cM),r[0]=e,r[1]=i,r[2]=a,r[3]=o}else i=r[1],a=r[2],o=r[3];let{items:c,activeCategoryId:l,isSearchMode:u,open:d}=FA();if(!d||!l&&!u)return null;let f=(n=i)==null?`Items`:n,p;r[4]!==a||r[5]!==c?(p=a(c),r[4]=a,r[5]=c,r[6]=p):p=r[6];let m;return r[7]!==t||r[8]!==o||r[9]!==f||r[10]!==p?(m=(0,X.jsx)(VO.div,A(A({role:`group`,"aria-label":f},o),{},{ref:t,children:p})),r[7]=t,r[8]=o,r[9]=f,r[10]=p,r[11]=m):m=r[11],m});uM.displayName=`ComposerPrimitive.TriggerPopoverItems`;var dM=Mn((e,t)=>{let n=J(30),r,i,a,o,s;if(n[0]!==e){var c=e;({item:i,index:r,onClick:a,onMouseMove:o}=c),s=G(c,lM),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s}else r=n[1],i=n[2],a=n[3],o=n[4],s=n[5];let{selectItem:l,highlightIndex:u,items:d,highlightedIndex:f,activeCategoryId:p,isSearchMode:m,popoverId:h}=FA(),g;n[6]!==i||n[7]!==l?(g=()=>{l(i)},n[6]=i,n[7]=l,n[8]=g):g=n[8];let _=g,v;if(n[9]!==r||n[10]!==i.id||n[11]!==d){var y;v=(y=r)==null?d.findIndex(e=>e.id===i.id):y,n[9]=r,n[10]=i.id,n[11]=d,n[12]=v}else v=n[12];let b=v,x=(m||p!==null)&&b===f,S;n[13]!==u||n[14]!==b?(S=()=>{u(b)},n[13]=u,n[14]=b,n[15]=S):S=n[15];let C=S,w=`${h}-option-${i.id}`,T=x?``:void 0,E;n[16]!==_||n[17]!==a?(E=Bb(a,_),n[16]=_,n[17]=a,n[18]=E):E=n[18];let D;n[19]!==C||n[20]!==o?(D=Bb(o,C),n[19]=C,n[20]=o,n[21]=D):D=n[21];let O;return n[22]!==t||n[23]!==x||n[24]!==s||n[25]!==w||n[26]!==T||n[27]!==E||n[28]!==D?(O=(0,X.jsx)(VO.button,A(A({type:`button`,role:`option`,id:w,"aria-selected":x,"data-highlighted":T},s),{},{ref:t,onClick:E,onMouseMove:D})),n[22]=t,n[23]=x,n[24]=s,n[25]=w,n[26]=T,n[27]=E,n[28]=D,n[29]=O):O=n[29],O});dM.displayName=`ComposerPrimitive.TriggerPopoverItem`,j();var fM=[`onClick`],pM=Mn((e,t)=>{let n=J(10),r,i;if(n[0]!==e){var a=e;({onClick:r}=a),i=G(a,fM),n[0]=e,n[1]=r,n[2]=i}else r=n[1],i=n[2];let{activeCategoryId:o,isSearchMode:s,goBack:c,open:l}=FA();if(!l||!o||s)return null;let u;n[3]!==c||n[4]!==r?(u=Bb(r,c),n[3]=c,n[4]=r,n[5]=u):u=n[5];let d;return n[6]!==t||n[7]!==i||n[8]!==u?(d=(0,X.jsx)(VO.button,A(A({type:`button`},i),{},{ref:t,onClick:u})),n[6]=t,n[7]=i,n[8]=u,n[9]=d):d=n[9],d});pM.displayName=`ComposerPrimitive.TriggerPopoverBack`,j();var mM=e=>{let t=J(8),{formatter:n,onExecute:r,removeOnExecute:i}=e,{register:a}=RA(),o=K(r),s,c;t[0]===r?(s=t[1],c=t[2]):(s=()=>{o.current=r},c=[r],t[0]=r,t[1]=s,t[2]=c),kn(s,c);let l,u;return t[3]!==n||t[4]!==a||t[5]!==i?(l=()=>{let e=A({kind:`action`,formatter:n==null?ee:n,onExecute:e=>o.current(e)},i===void 0?{}:{removeOnExecute:i});return a(e)},u=[a,n,i],t[3]=n,t[4]=a,t[5]=i,t[6]=l,t[7]=u):(l=t[6],u=t[7]),q(l,u),null};mM.displayName=`ComposerPrimitive.TriggerPopoverAction`;var hM=e=>{let t=J(7),{formatter:n,onInserted:r}=e,{register:i}=RA(),a=K(r),o,s;t[0]===r?(o=t[1],s=t[2]):(o=()=>{a.current=r},s=[r],t[0]=r,t[1]=o,t[2]=s),kn(o,s);let c,l;return t[3]!==n||t[4]!==i?(c=()=>i({kind:`directive`,formatter:n==null?ee:n,onInserted:e=>{var t;return(t=a.current)==null?void 0:t.call(a,e)}}),l=[i,n],t[3]=n,t[4]=i,t[5]=c,t[6]=l):(c=t[5],l=t[6]),q(c,l),null};hM.displayName=`ComposerPrimitive.TriggerPopoverDirective`;var gM=Object.assign(zA,{Directive:hM,Action:mM}),_M=pO({AddAttachment:()=>Hj,AttachmentByIndex:()=>H_,AttachmentDropzone:()=>Wj,Attachments:()=>W_,Cancel:()=>Vj,Dictate:()=>Gj,DictationTranscript:()=>Yj,If:()=>cv,Input:()=>zj,Queue:()=>K_,Quote:()=>$j,QuoteDismiss:()=>tM,QuoteText:()=>eM,Resume:()=>Bj,Root:()=>XA,Send:()=>HA,StopDictation:()=>Kj,TriggerPopover:()=>gM,TriggerPopoverBack:()=>pM,TriggerPopoverCategories:()=>oM,TriggerPopoverCategoryItem:()=>sM,TriggerPopoverItem:()=>dM,TriggerPopoverItems:()=>uM,TriggerPopoverRoot:()=>xA,Unstable_TriggerPopover:()=>gM,Unstable_TriggerPopoverBack:()=>pM,Unstable_TriggerPopoverCategories:()=>oM,Unstable_TriggerPopoverCategoryItem:()=>sM,Unstable_TriggerPopoverItem:()=>dM,Unstable_TriggerPopoverItems:()=>uM,Unstable_TriggerPopoverRoot:()=>xA,unstable_useTriggerPopoverRootContext:()=>lA,unstable_useTriggerPopoverRootContextOptional:()=>uA,unstable_useTriggerPopoverScopeContext:()=>FA,unstable_useTriggerPopoverScopeContextOptional:()=>IA,unstable_useTriggerPopoverTriggers:()=>fA,unstable_useTriggerPopoverTriggersOptional:()=>gA}),vM=Object.freeze({type:`complete`}),yM=Object.freeze({type:`text`,text:``,status:vM}),bM=()=>Y(xM);function xM(e){return e.part.type!==`text`&&e.part.type!==`reasoning`?yM:e.part}j();var SM=Hn(null),CM=e=>({useSmoothStatus:by(()=>e)}),wM=e=>{let t=J(6),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={optional:!0},t[0]=r):r=t[0];let i=EM(r),a=Xa(),o;t[1]===a.part?o=t[2]:(o=()=>CM(a.part.getState().status),t[1]=a.part,t[2]=o);let[s]=xn(o);if(i)return n;let c;return t[3]!==n||t[4]!==s?(c=(0,X.jsx)(SM.Provider,{value:s,children:n}),t[3]=n,t[4]=s,t[5]=c):c=t[5],c},TM=e=>{let t=Mn((t,n)=>{let r=J(3),i=t,a;return r[0]!==n||r[1]!==i?(a=(0,X.jsx)(wM,{children:(0,X.jsx)(e,A(A({},i),{},{ref:n}))}),r[0]=n,r[1]=i,r[2]=a):a=r[2],a});return t.displayName=e.displayName,t};function EM(e){let t=Wn(SM);if(!(e!=null&&e.optional)&&!t)throw Error(`This component must be used within a SmoothContextProvider.`);return t}var{useSmoothStatus:DM,useSmoothStatusStore:OM}=oy(EM,`useSmoothStatus`);E(),j();var kM=250,AM=5,jM=class{constructor(e,t){T(this,`animationFrameId`,null),T(this,`lastUpdateTime`,0),T(this,`lastCommitTime`,-1/0),T(this,`targetText`,``),T(this,`drainMs`,kM),T(this,`maxCharIntervalMs`,AM),T(this,`maxCharsPerFrame`,1/0),T(this,`minCommitMs`,0),T(this,`currentText`,void 0),T(this,`setText`,void 0),T(this,`animate`,()=>{let e=performance.now(),t=e-this.lastUpdateTime,n=this.targetText.length-this.currentText.length,r=Math.min(this.maxCharIntervalMs,this.drainMs/n),i=Math.min(n,this.maxCharsPerFrame),a=0;for(;t>=r&&a<i;)a++,t-=r;a===i&&i===this.maxCharsPerFrame&&(t=0),this.animationFrameId=a===n?null:requestAnimationFrame(this.animate),a!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+a),this.lastUpdateTime=e-t,(a===n||e-this.lastCommitTime>=this.minCommitMs)&&(this.lastCommitTime=e,this.setText(this.currentText)))}),this.currentText=e,this.setText=t}start(){this.animationFrameId===null&&(this.lastUpdateTime=performance.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}},MM=Object.freeze({type:`running`}),NM=(e,t)=>e!==void 0&&e>0?e:t,PM=(e,t=!1)=>{let{text:n}=e,r=rj(`(prefers-reduced-motion: reduce)`),i=typeof t==`object`&&t?t:void 0,a=t!==!1&&t!==null&&!r,o=NM(i==null?void 0:i.drainMs,kM),s=NM(i==null?void 0:i.maxCharIntervalMs,AM),c=NM(i==null?void 0:i.maxCharsPerFrame,1/0),l=NM(i==null?void 0:i.minCommitMs,0),[u,d]=xn(e.status.type===`running`?``:n),f=Xa(),p=Y(()=>f.part),[m,h]=xn(p);p===m&&n.startsWith(u)||(h(p),d(e.status.type===`running`?``:n));let g=OM({optional:!0}),_=Jb(t=>{if(d(t),g){let n=u!==t||e.status.type===`running`?MM:e.status;Ty(g).setState(n,!0)}});q(()=>{if(g){let t=a&&(u!==n||e.status.type===`running`)?MM:e.status;Ty(g).setState(t,!0)}},[g,a,n,u,e.status]);let[v]=xn(()=>new jM(u,_)),[y,b]=xn(a);a!==y&&(b(a),a&&p===m&&n.startsWith(v.currentText)&&d(v.currentText)),q(()=>{v.drainMs=o,v.maxCharIntervalMs=s,v.maxCharsPerFrame=c,v.minCommitMs=l},[v,o,s,c,l]);let x=K(p);return q(()=>{let t=x.current!==p;if(x.current=p,!a)v.stop(),v.currentText=n,v.targetText=n,v.lastCommitTime=-1/0;else if(t||!n.startsWith(v.targetText))e.status.type===`running`?(v.currentText=``,v.targetText=n,v.lastCommitTime=-1/0,v.start()):(v.currentText=n,v.targetText=n,v.stop(),_(n));else if(v.targetText=n,e.status.type!==`running`){if(v.currentText===``){v.currentText=n,v.stop(),_(n);return}v.start()}else v.start()},[v,a,n,e.status.type,p,_]),q(()=>()=>{v.stop()},[v]),Cn(()=>a?A(A({},e),{},{text:u,status:n===u?e.status:MM}):e,[a,u,e,n])},FM=Object.freeze({type:`complete`}),IM=Object.freeze({type:`image`,image:``,status:FM}),LM=()=>Y(RM);function RM(e){return e.part.type===`image`?e.part:IM}j();var zM=[`smooth`,`component`,`render`],BM=Mn((e,t)=>{let{smooth:n=!0,component:r=VO.span,render:i}=e,a=G(e,zM),{text:o,status:s}=PM(bM(),n),c=A(A({"data-status":s.type},a),{},{ref:t});return i&&Ln(i)?RO(i,o,c):(0,X.jsx)(r,A(A({},c),{},{children:o}))});BM.displayName=`MessagePartPrimitive.Text`,j();var VM=Mn((e,t)=>{let n=J(4),{image:r}=LM(),i;return n[0]!==t||n[1]!==r||n[2]!==e?(i=(0,X.jsx)(VO.img,A(A({src:r},e),{},{ref:t})),n[0]=t,n[1]=r,n[2]=e,n[3]=i):i=n[3],i});VM.displayName=`MessagePartPrimitive.Image`,j();var HM=Mn((e,t)=>{let n=J(3),r;return n[0]!==t||n[1]!==e?(r=(0,X.jsx)(VO.div,A(A({role:`alert`},e),{},{ref:t})),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});HM.displayName=`ErrorPrimitive.Root`,j();var UM=[`children`],WM=Mn((e,t)=>{var n;let r=J(7),i,a;if(r[0]!==e){var o=e;({children:i}=o),a=G(o,UM),r[0]=e,r[1]=i,r[2]=a}else i=r[1],a=r[2];let s=ny();if(s===void 0)return null;let c=(n=i)==null?String(s):n,l;return r[3]!==t||r[4]!==a||r[5]!==c?(l=(0,X.jsx)(VO.span,A(A({},a),{},{ref:t,children:c})),r[3]=t,r[4]=a,r[5]=c,r[6]=l):l=r[6],l});WM.displayName=`ErrorPrimitive.Message`;var GM=pO({Message:()=>WM,Root:()=>HM}),KM=e=>{let t=J(2),n=K(void 0),r;return t[0]===e?r=t[1]:(r=t=>{n.current&&(n.current(),n.current=void 0),t&&(n.current=e(t))},t[0]=e,t[1]=r),r},qM=(e,t)=>{let n=e.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!n)return 1/0;let r=Number(n[1]),i=n[2];return i===`px`?r:i===`em`?r*(parseFloat(getComputedStyle(t).fontSize)||16):i===`rem`?r*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):1/0},JM=e=>e.dataset.messageId,YM=()=>{let e=document.createElement(`div`);return e.dataset.auiTopAnchorReserve=``,e.style.height=`0px`,e.style.flexShrink=`0`,e.style.pointerEvents=`none`,e.setAttribute(`aria-hidden`,`true`),e},XM=(e,t)=>{let n=`${t}px`;return e.style.height!==n&&(e.style.height=n,!0)},ZM=e=>{let t=window.devicePixelRatio||1;return Math.round(e*t)/t};j();var QM=[`forwardedRef`],$M=[`forwardedRef`,`threadViewportStore`],eN=()=>{let e=J(4),t=Xa(),n;e[0]===t.message?n=e[1]:(n=()=>t.message,e[0]=t.message,e[1]=n);let r=Y(n),i;return e[2]===r?i=e[3]:(i=e=>{let t=!0,n=()=>{r.setIsHovering(!0)},i=()=>{r.setIsHovering(!1)};return e.addEventListener(`mouseenter`,n),e.addEventListener(`mouseleave`,i),e.matches(`:hover`)&&queueMicrotask(()=>{t&&r.setIsHovering(!0)}),()=>{t=!1,e.removeEventListener(`mouseenter`,n),e.removeEventListener(`mouseleave`,i),r.setIsHovering(!1)}},e[2]=r,e[3]=i),KM(i)},tN=()=>{let e=J(2),t=cy(cN),n;return e[0]===t?n=e[1]:(n=e=>{var n;return e.message.role===`user`&&e.message.index>0&&e.message.index===e.thread.messages.length-2&&((n=e.thread.messages.at(-1))==null?void 0:n.role)===`assistant`&&(e.message.id===t||e.thread.isRunning)},e[0]=t,e[1]=n),Y(n)},nN=()=>{let e=J(2),t=cy(lN),n;return e[0]===t?n=e[1]:(n=e=>{var n;return e.message.isLast&&e.message.role===`assistant`&&e.message.index>=1&&((n=e.thread.messages.at(e.message.index-1))==null?void 0:n.role)===`user`&&(e.message.id===t||e.thread.isRunning)},e[0]=t,e[1]=n),Y(n)},rN=(e,t)=>{let n=J(3),r;return n[0]!==e||n[1]!==t?(r=n=>{if(e)return t.getState().registerAnchorElement(n)},n[0]=e,n[1]=t,n[2]=r):r=n[2],KM(r)},iN=e=>{let t=J(3),{active:n,threadViewportStore:r}=e,i;return t[0]!==n||t[1]!==r?(i=e=>{if(!n)return;let t=r.getState(),i=t.topAnchorMessageClamp;return t.registerAnchorTargetElement(e,{tallerThan:qM(i.tallerThan,e),visibleHeight:qM(i.visibleHeight,e)})},t[0]=n,t[1]=r,t[2]=i):i=t[2],KM(i)},aN=e=>{let t=J(7),n,r;if(t[0]!==e){var i=e;({forwardedRef:n}=i),r=G(i,QM),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];let a=eN(),o=Ry(n,a),s=Y(uN),c;return t[3]!==s||t[4]!==r||t[5]!==o?(c=(0,X.jsx)(VO.div,A(A({},r),{},{ref:o,"data-message-id":s})),t[3]=s,t[4]=r,t[5]=o,t[6]=c):c=t[6],c},oN=e=>{let t=J(13),n,r,i;if(t[0]!==e){var a=e;({forwardedRef:n,threadViewportStore:i}=a),r=G(a,$M),t[0]=e,t[1]=n,t[2]=r,t[3]=i}else n=t[1],r=t[2],i=t[3];let o=eN(),s=tN(),c=nN(),l=rN(s,i),u;t[4]!==c||t[5]!==i?(u={active:c,threadViewportStore:i},t[4]=c,t[5]=i,t[6]=u):u=t[6];let d=iN(u),f=Ry(n,o,l,d),p=Y(dN),m=s?``:void 0,h=c?``:void 0,g;return t[7]!==p||t[8]!==r||t[9]!==f||t[10]!==m||t[11]!==h?(g=(0,X.jsx)(VO.div,A(A({},r),{},{ref:f,"data-message-id":p,"data-aui-top-anchor-user":m,"data-aui-top-anchor-target":h})),t[7]=p,t[8]=r,t[9]=f,t[10]=m,t[11]=h,t[12]=g):g=t[12],g},sN=Mn((e,t)=>{let n=J(7),r=ly();if(r.getState().turnAnchor===`top`){let i;return n[0]!==t||n[1]!==e||n[2]!==r?(i=(0,X.jsx)(oN,A(A({},e),{},{forwardedRef:t,threadViewportStore:r})),n[0]=t,n[1]=e,n[2]=r,n[3]=i):i=n[3],i}let i;return n[4]!==t||n[5]!==e?(i=(0,X.jsx)(aN,A(A({},e),{},{forwardedRef:t})),n[4]=t,n[5]=e,n[6]=i):i=n[6],i});sN.displayName=`MessagePrimitive.Root`;function cN(e){var t;return(t=e.topAnchorTurn)==null?void 0:t.anchorId}function lN(e){var t;return(t=e.topAnchorTurn)==null?void 0:t.targetId}function uN(e){return e.message.id}function dN(e){return e.message.id}j();var fN=[`components`],pN=A(A({},zg),{},{Text:()=>(0,X.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,X.jsx)(BM,{}),(0,X.jsx)(X_,{children:(0,X.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Image:()=>(0,X.jsx)(VM,{})}),mN=e=>{let t=J(10);if(`children`in e){let n;return t[0]===e.children?n=t[1]:(n=(0,X.jsx)(t_,{children:e.children}),t[0]=e.children,t[1]=n),n}let n,r;if(t[2]!==e){var i=e;({components:n}=i),r=G(i,fN),t[2]=e,t[3]=n,t[4]=r}else n=t[3],r=t[4];let a;if(t[5]!==n){var o,s;a=n?A(A({},n),{},{Text:(o=n.Text)==null?pN.Text:o,Image:(s=n.Image)==null?pN.Image:s}):pN,t[5]=n,t[6]=a}else a=t[6];let c=a,l;return t[7]!==r||t[8]!==c?(l=(0,X.jsx)(t_,A({components:c},r)),t[7]=r,t[8]=c,t[9]=l):l=t[9],l};mN.displayName=`MessagePrimitive.Parts`;var hN=[`children`],gN=e=>{let t=J(12),n;return t[0]!==e.assistant||t[1]!==e.copied||t[2]!==e.hasAttachments||t[3]!==e.hasBranches||t[4]!==e.hasContent||t[5]!==e.last||t[6]!==e.lastOrHover||t[7]!==e.speaking||t[8]!==e.submittedFeedback||t[9]!==e.system||t[10]!==e.user?(n=t=>{var n,r;let{role:i,attachments:a,parts:o,branchCount:s,isLast:c,speech:l,isCopied:u,isHovering:d}=t.message;return!(e.hasBranches===!0&&s<2||e.user===!0&&i!==`user`||e.user===!1&&i===`user`||e.assistant===!0&&i!==`assistant`||e.assistant===!1&&i===`assistant`||e.system===!0&&i!==`system`||e.system===!1&&i===`system`||e.lastOrHover===!0&&!d&&!c||e.last!==void 0&&e.last!==c||e.copied===!0&&!u||e.copied===!1&&u||e.speaking===!0&&l==null||e.speaking===!1&&l!=null||e.hasAttachments===!0&&(i!==`user`||!(a!=null&&a.length))||e.hasAttachments===!1&&i===`user`&&a!=null&&a.length||e.hasContent===!0&&o.length===0||e.hasContent===!1&&o.length>0||e.submittedFeedback!==void 0&&((n=(r=t.message.metadata.submittedFeedback)==null?void 0:r.type)==null?null:n)!==e.submittedFeedback)},t[0]=e.assistant,t[1]=e.copied,t[2]=e.hasAttachments,t[3]=e.hasBranches,t[4]=e.hasContent,t[5]=e.last,t[6]=e.lastOrHover,t[7]=e.speaking,t[8]=e.submittedFeedback,t[9]=e.system,t[10]=e.user,t[11]=n):n=t[11],Y(n)},_N=e=>{let t=J(3),n,r;if(t[0]!==e){var i=e;({children:n}=i),r=G(i,hN),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];return gN(r)?n:null};_N.displayName=`MessagePrimitive.If`;var vN=e=>{let{children:t}=e;return ny()===void 0?null:t};vN.displayName=`MessagePrimitive.Error`,j();var yN=[`components`],bN=e=>{let t=new Map;for(let a=0;a<e.length;a++){var n,r,i;let o=(n=(r=e[a])==null?void 0:r.parentId)==null?a:n,s=(i=t.get(o))==null?[]:i;s.push(a),t.set(o,s)}let a=[];for(let[e,n]of t){let t=typeof e==`string`?e:void 0;a.push({groupKey:t,indices:n})}return a},xN=e=>{let t=J(9),n=Y(kN),r;bb0:{if(n.length===0){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],r=e;break bb0}let i;t[1]!==e||t[2]!==n?(i=e(n),t[1]=e,t[2]=n,t[3]=i):i=t[3],r=i}let i=r,a;t[4]===n?a=t[5]:(a=hu(n),t[4]=n,t[5]=a);let o;return t[6]!==i||t[7]!==a?(o={groups:i,partKeys:a},t[6]=i,t[7]=a,t[8]=o):o=t[8],o},SN={Text:()=>(0,X.jsxs)(`p`,{style:{whiteSpace:`pre-line`},children:[(0,X.jsx)(BM,{}),(0,X.jsx)(X_,{children:(0,X.jsx)(`span`,{style:{fontFamily:`revert`},children:` ●`})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>(0,X.jsx)(VM,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:e})=>e},CN=Nn(e=>{let t=J(5),{partIndex:n,components:r}=e,i;t[0]===r?i=t[1]:(i=(0,X.jsx)(Bg,{components:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,X.jsx)(Zd,{index:n,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},(e,t)=>{var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_;return e.partIndex===t.partIndex&&((n=e.components)==null?void 0:n.Text)===((r=t.components)==null?void 0:r.Text)&&((i=e.components)==null?void 0:i.Reasoning)===((a=t.components)==null?void 0:a.Reasoning)&&((o=e.components)==null?void 0:o.Source)===((s=t.components)==null?void 0:s.Source)&&((c=e.components)==null?void 0:c.Image)===((l=t.components)==null?void 0:l.Image)&&((u=e.components)==null?void 0:u.File)===((d=t.components)==null?void 0:d.File)&&((f=e.components)==null?void 0:f.Unstable_Audio)===((p=t.components)==null?void 0:p.Unstable_Audio)&&((m=e.components)==null?void 0:m.tools)===((h=t.components)==null?void 0:h.tools)&&((g=e.components)==null?void 0:g.data)===((_=t.components)==null?void 0:_.data)}),wN=e=>{let t=J(6),{status:n,component:r}=e,i=n.type===`running`,a;t[0]!==r||t[1]!==n?(a=(0,X.jsx)(r,{type:`text`,text:``,status:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,X.jsx)($d,{text:``,isRunning:i,children:a}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o},TN=Object.freeze({type:`complete`}),EN=Nn(e=>{var t;let n=J(6),{components:r}=e,i=Y(AN);if(r!=null&&r.Empty){let e;return n[0]!==r.Empty||n[1]!==i?(e=(0,X.jsx)(r.Empty,{status:i}),n[0]=r.Empty,n[1]=i,n[2]=e):e=n[2],e}let a=(t=r==null?void 0:r.Text)==null?SN.Text:t,o;return n[3]!==i||n[4]!==a?(o=(0,X.jsx)(wN,{status:i,component:a}),n[3]=i,n[4]=a,n[5]=o):o=n[5],o},(e,t)=>{var n,r,i,a;return((n=e.components)==null?void 0:n.Empty)===((r=t.components)==null?void 0:r.Empty)&&((i=e.components)==null?void 0:i.Text)===((a=t.components)==null?void 0:a.Text)}),DN=e=>{let t=J(21),{groupingFunction:n,components:r}=e,i=Y(jN),{groups:a,partKeys:o}=xN(n),s;bb0:{var c,l,u,d,f,p;if(i===0){let e;t[0]===r?e=t[1]:(e=(0,X.jsx)(EN,{components:r}),t[0]=r,t[1]=e),s=e;break bb0}let e=(c=r==null?void 0:r.Text)==null?SN.Text:c,n=(l=r==null?void 0:r.Reasoning)==null?SN.Reasoning:l,m=(u=r==null?void 0:r.Image)==null?SN.Image:u,h=(d=r==null?void 0:r.Source)==null?SN.Source:d,g=(f=r==null?void 0:r.File)==null?SN.File:f,_=(p=r==null?void 0:r.Unstable_Audio)==null?SN.Unstable_Audio:p,v;t[2]!==r||t[3]!==e||t[4]!==n||t[5]!==m||t[6]!==h||t[7]!==g||t[8]!==_?(v=A(A({},r),{},{Text:e,Reasoning:n,Image:m,Source:h,File:g,Unstable_Audio:_}),t[2]=r,t[3]=e,t[4]=n,t[5]=m,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let y=v,b;if(t[10]!==(r==null?void 0:r.Group)||t[11]!==y||t[12]!==a||t[13]!==o){let e;t[15]!==(r==null?void 0:r.Group)||t[16]!==y||t[17]!==o?(e=(e,t)=>{var n,i;let a=(n=r==null?void 0:r.Group)==null?SN.Group:n,s=o[e.indices[0]];return(0,X.jsx)(a,{groupKey:e.groupKey,indices:e.indices,children:e.indices.map(e=>(0,X.jsx)(CN,{partIndex:e,components:y},o[e]))},JSON.stringify([`group`,(i=e.groupKey)==null?null:i,s!=null&&s.includes(`:`)?`id:${s}`:t]))},t[15]=r==null?void 0:r.Group,t[16]=y,t[17]=o,t[18]=e):e=t[18],b=a.map(e),t[10]=r==null?void 0:r.Group,t[11]=y,t[12]=a,t[13]=o,t[14]=b}else b=t[14];s=b}let m=s,h;return t[19]===m?h=t[20]:(h=(0,X.jsx)(X.Fragment,{children:m}),t[19]=m,t[20]=h),h};DN.displayName=`MessagePrimitive.Unstable_PartsGrouped`;var ON=e=>{let t=J(6),n,r;if(t[0]!==e){var i=e;({components:n}=i),r=G(i,yN),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];let a;return t[3]!==n||t[4]!==r?(a=(0,X.jsx)(DN,A(A({},r),{},{components:n,groupingFunction:bN})),t[3]=n,t[4]=r,t[5]=a):a=t[5],a};ON.displayName=`MessagePrimitive.Unstable_PartsGroupedByParentId`;function kN(e){return e.message.parts}function AN(e){var t;return(t=e.message.status)==null?TN:t}function jN(e){return e.message.parts.length}var MN=pO({AttachmentByIndex:()=>I_,Attachments:()=>R_,Content:()=>mN,Error:()=>vN,GenerativeUI:()=>Og,GroupedParts:()=>w_,If:()=>_N,PartByIndex:()=>Vg,Parts:()=>mN,Quote:()=>N_,Root:()=>sN,Unstable_PartsGrouped:()=>DN,Unstable_PartsGroupedByParentId:()=>ON}),NN=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:r=!0})=>{let i=Xa(),a=K(null),o=Y(e=>e.thread.messages.length>0),s=Y(e=>{var t;return(t=e.thread.messages[0])==null?void 0:t.id}),c=Y(e=>{var t;return(t=e.optional.threadListItem)==null?void 0:t.id}),l=Y(e=>e.thread.isRunning),u=ly(),d=Cy(u),{controller:f}=d;kn(()=>{d.getOptions=()=>{let i=u.getState();return{autoScroll:e==null?i.turnAnchor!==`top`:e,holdFollow:l&&i.turnAnchor===`top`&&i.element.viewport===a.current&&i.element.anchor!==null,scrollToBottomOnInitialize:n,scrollToBottomOnRunStart:t&&i.turnAnchor!==`top`,scrollToBottomOnThreadSwitch:r}}});let p=K({threadId:c,firstMessageId:s});return Ay(()=>{let e=p.current;if(p.current={threadId:c,firstMessageId:s},e.threadId!==c)return;let t=e.firstMessageId;t!==void 0&&t!==s&&i.thread.getState().messages.some((e,n)=>n>0&&e.id===t)&&f.messagesPrepended(t)},[i,f,s,c]),Ay(()=>{f.setHasMessages(o)},[f,o,n]),$A(({behavior:e})=>f.scrollToBottom(e)),Id(`thread.runStart`,()=>f.runStarted()),q(()=>{if(i.optional.threads)return i.on(`threads.selectionChanged`,()=>f.threadSwitched())},[i,f]),KM(wn(e=>{a.current=e;let t=f.attach(e);return()=>{t(),a.current=null}},[f]))};j();var PN=new WeakMap,FN=Mn((e,t)=>{let n=J(9),r=Xa(),i=K(null),a=Ry(t,i),o;n[0]===e?o=n[1]:(o=t=>{var n;t.key===`Escape`&&i.current&&PN.set(t.nativeEvent,i.current),(n=e.onKeyDown)==null||n.call(e,t)},n[0]=e,n[1]=o);let s=o,c,l;n[2]===r?(c=n[3],l=n[4]):(c=()=>{let e=e=>{var t;if(e.key!==`Escape`||ij(e)||e.defaultPrevented||r.thread.source===null)return;let n=(t=PN.get(e))==null?e.composedPath().find(IN):t;if(!(n&&n!==i.current)&&r.thread.getState().speech!=null){e.preventDefault();try{r.thread.stopSpeaking()}catch(e){let t=e;if(!(t instanceof Error)||t.message!==`No message is being spoken`)throw t}}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},l=[r],n[2]=r,n[3]=c,n[4]=l),q(c,l);let u;return n[5]!==a||n[6]!==s||n[7]!==e?(u=(0,X.jsx)(aj.Provider,{value:i,children:(0,X.jsx)(VO.div,A(A({},e),{},{"data-aui-thread-root":``,ref:a,onKeyDown:s}))}),n[5]=a,n[6]=s,n[7]=e,n[8]=u):u=n[8],u});FN.displayName=`ThreadPrimitive.Root`;function IN(e){return e instanceof Element&&e.hasAttribute(`data-aui-thread-root`)}var LN=e=>{let{children:t}=e;return Y(RN)?t:null};LN.displayName=`ThreadPrimitive.Empty`;function RN(e){return e.thread.isEmpty}var zN=[`children`],BN=e=>{let t=J(4),n;return t[0]!==e.disabled||t[1]!==e.empty||t[2]!==e.running?(n=t=>!(e.empty===!0&&!t.thread.isEmpty||e.empty===!1&&t.thread.isEmpty||e.running===!0&&!t.thread.isRunning||e.running===!1&&t.thread.isRunning||e.disabled===!0&&!t.thread.isDisabled||e.disabled===!1&&t.thread.isDisabled),t[0]=e.disabled,t[1]=e.empty,t[2]=e.running,t[3]=n):n=t[3],Y(n)},VN=e=>{let t=J(3),n,r;if(t[0]!==e){var i=e;({children:n}=i),r=G(i,zN),t[0]=e,t[1]=n,t[2]=r}else n=t[1],r=t[2];return BN(r)?n:null};VN.displayName=`ThreadPrimitive.If`;var HN=(e,t)=>{let n=J(3),r;return n[0]!==t||n[1]!==e?(r=n=>{if(!e)return;let r=e(),i=()=>{let e=t?t(n):n.offsetHeight;r.setHeight(e)},a=new ResizeObserver(i);return a.observe(n),i(),()=>{a.disconnect(),r.unregister()}},n[0]=t,n[1]=e,n[2]=r):r=n[2],KM(r)};j();var UN=[`scrollHeight`],WN=[`viewport`,`reserve`],GN=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},KN=(e,t)=>{let n=0,r=e;for(;r&&r!==t;)n+=r.offsetTop,r=r.offsetParent;return r===t?n:GN(e)-GN(t)},qN=({viewport:e,anchor:t,tallerThan:n,visibleHeight:r})=>{let i=KN(t,e),a=t.offsetHeight;return i+Math.max(0,a-(a<=n?a:r))},JN=e=>{let{scrollHeight:t}=e,n=G(e,UN),{viewport:r}=n,i=qN(n)+r.clientHeight;return Math.max(0,i-t)},YN=e=>{let{viewport:t,reserve:n}=e,r=G(e,WN);return JN(A(A({viewport:t},r),{},{scrollHeight:t.scrollHeight-n.offsetHeight}))},XN=e=>{let t=new ResizeObserver(e),n=new MutationObserver(e),r=null,i=null,a=null,o=()=>{t.disconnect(),n.disconnect(),r=null,i=null,a=null};return{target:(e,s,c)=>{(r!==e||i!==s||a!==c)&&(o(),t.observe(e),t.observe(s),t.observe(c),n.observe(c,{childList:!0,subtree:!0,characterData:!0}),r=e,i=s,a=c)},disconnect:o}};j();var ZN=e=>{let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},cancel:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}},QN=e=>{let t=null,n,r=null,i=0,a=null,o=!1,s=null,c=()=>{a=null,s=null},l=()=>s!==null&&Math.abs(i-s)<=1,u=()=>{let e=r;if(!e)return;let t=e.scrollTop,n=Math.max(0,e.scrollHeight-e.clientHeight);t<i&&i>n+1&&Math.abs(t-n)<=1&&l()&&!o&&(a!=null||(a=i),p.schedule()),i=t},d=e=>{r!==e&&(r&&r.removeEventListener(`scroll`,u),r=e,o=!1,c(),e&&(e.addEventListener(`scroll`,u,{passive:!0}),i=e.scrollTop))};function f(){let r=e.getState(),{viewport:i,anchor:l,target:u}=r.element,f=r.targetConfig;if(d(r.turnAnchor===`top`?i:null),r.turnAnchor!==`top`||!i){m.disconnect(),c(),t&&(XM(t,0),t.remove());return}if(!l&&!u&&!f&&r.topAnchorTurn){m.disconnect(),c(),t!=null&&t.parentElement&&t.parentElement.lastElementChild!==t&&t.parentElement.append(t);return}if(!l||!u||!f){m.disconnect(),c(),t&&(XM(t,0),t.remove());return}if(t!=null||(t=YM()),(t.parentElement!==u.parentElement||t.previousElementSibling!==u)&&u.after(t),m.target(i,l,u),XM(t,YN(A({viewport:i,anchor:l,reserve:t},f)))){p.schedule();return}let h=JM(l),g=ZM(qN(A({viewport:i,anchor:l},f)));if(h===void 0||h!==n)a=null,o=!1,Math.abs(i.scrollTop-g)>1&&i.scrollTo({top:g,behavior:`smooth`}),h!==void 0&&(n=h);else if(a!==null&&s!==null){let e=ZM(a+(g-s));a=null,o=!0,Math.abs(i.scrollTop-e)>1&&i.scrollTo({top:e,behavior:`instant`})}s=g}let p=ZN(f),m=XN(p.schedule);p.schedule();let h=e.subscribe(p.schedule);return()=>{p.cancel(),h(),m.disconnect(),d(null),t==null||t.remove()}},$N=e=>{let t=J(4),n=ly(),r,i;t[0]!==e||t[1]!==n?(r=()=>{if(e)return QN(n)},i=[e,n],t[0]=e,t[1]=n,t[2]=r,t[3]=i):(r=t[2],i=t[3]),Ay(r,i)},eP=(e,t)=>{var n;if(!e)return!1;let r=t.findIndex(t=>t.id===e.targetId);return r<1?!1:((n=t[r-1])==null?void 0:n.id)===e.anchorId&&t.slice(r+1).every(e=>e.role===`user`)},tP=({isRunning:e,messages:t})=>{if(!e)return null;let n=t.at(-1),r=t.at(-2);return(r==null?void 0:r.role)!==`user`||(n==null?void 0:n.role)!==`assistant`?null:{anchorId:r.id,targetId:n.id}},nP=e=>{var t;return(t=tP(e))==null?void 0:t.anchorId},rP=e=>{var t;return(t=tP(e))==null?void 0:t.targetId};j();var iP=[`autoScroll`,`scrollToBottomOnRunStart`,`scrollToBottomOnInitialize`,`scrollToBottomOnThreadSwitch`,`children`],aP=[`turnAnchor`,`topAnchorMessageClamp`],oP=()=>HN(cy(dP),fP),sP=()=>KM(cy(pP)),cP=e=>{let t=J(19),n=ly(),r;t[0]===e?r=t[1]:(r=t=>{if(e)return nP(t.thread)},t[0]=e,t[1]=r);let i=Y(r),a;t[2]===e?a=t[3]:(a=t=>{if(e)return rP(t.thread)},t[2]=e,t[3]=a);let o=Y(a),s=cy(mP),c;bb0:{if(!i||!o){c=null;break bb0}let e;t[4]!==i||t[5]!==o?(e={anchorId:i,targetId:o},t[4]=i,t[5]=o,t[6]=e):e=t[6],c=e}let l=c,u;t[7]!==e||t[8]!==s?(u=t=>e&&!!s&&eP(s,t.thread.messages),t[7]=e,t[8]=s,t[9]=u):u=t[9];let d=Y(u),f,p;t[10]!==n||t[11]!==s||t[12]!==d?(f=()=>{s&&!d&&n.getState().setTopAnchorTurn(null)},p=[n,s,d],t[10]=n,t[11]=s,t[12]=d,t[13]=f,t[14]=p):(f=t[13],p=t[14]),Ay(f,p);let m,h;t[15]!==l||t[16]!==n?(m=()=>{if(!l)return;let e=n.getState(),t=e.topAnchorTurn;((t==null?void 0:t.anchorId)!==l.anchorId||t.targetId!==l.targetId)&&e.setTopAnchorTurn(l)},h=[l,n],t[15]=l,t[16]=n,t[17]=m,t[18]=h):(m=t[17],h=t[18]),Ay(m,h)},lP=Mn((e,t)=>{let n=J(18),r,i,a,o,s,c;if(n[0]!==e){var l=e;({autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c,children:i}=l),a=G(l,iP),n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c}else r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6];let u;n[7]!==r||n[8]!==o||n[9]!==s||n[10]!==c?(u={autoScroll:r,scrollToBottomOnRunStart:s,scrollToBottomOnInitialize:o,scrollToBottomOnThreadSwitch:c},n[7]=r,n[8]=o,n[9]=s,n[10]=c,n[11]=u):u=n[11];let d=NN(u),f=oP(),p=sP(),m=ly(),h;n[12]===m?h=n[13]:(h=m.getState(),n[12]=m,n[13]=h);let g=h.turnAnchor===`top`;cP(g),$N(g);let _=Ry(t,d,f,p),v;return n[14]!==i||n[15]!==_||n[16]!==a?(v=(0,X.jsx)(VO.div,A(A({},a),{},{ref:_,children:i})),n[14]=i,n[15]=_,n[16]=a,n[17]=v):v=n[17],v});lP.displayName=`ThreadPrimitive.ViewportScrollable`;var uP=Mn((e,t)=>{let n=J(13),r,i,a;if(n[0]!==e){var o=e;({turnAnchor:a,topAnchorMessageClamp:i}=o),r=G(o,aP),n[0]=e,n[1]=r,n[2]=i,n[3]=a}else r=n[1],i=n[2],a=n[3];let s;n[4]!==i||n[5]!==a?(s={turnAnchor:a,topAnchorMessageClamp:i},n[4]=i,n[5]=a,n[6]=s):s=n[6];let c;n[7]!==r||n[8]!==t?(c=(0,X.jsx)(lP,A(A({},r),{},{ref:t})),n[7]=r,n[8]=t,n[9]=c):c=n[9];let l;return n[10]!==s||n[11]!==c?(l=(0,X.jsx)(Dy,{options:s,children:c}),n[10]=s,n[11]=c,n[12]=l):l=n[12],l});uP.displayName=`ThreadPrimitive.Viewport`;function dP(e){return e.registerViewport}function fP(e){return e.clientHeight}function pP(e){return e.registerViewportElement}function mP(e){return e.topAnchorTurn}j();var hP=Mn((e,t)=>{let n=J(3),r=Ry(t,HN(cy(gP),_P)),i;return n[0]!==e||n[1]!==r?(i=(0,X.jsx)(VO.div,A(A({},e),{},{ref:r})),n[0]=e,n[1]=r,n[2]=i):i=n[2],i});hP.displayName=`ThreadPrimitive.ViewportFooter`;function gP(e){return e.registerContentInset}function _P(e){let t=parseFloat(getComputedStyle(e).marginTop)||0;return e.offsetHeight+t}var vP=tk(`ThreadPrimitive.ScrollToBottom`,e=>{let t=J(5),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{behavior:r}=n,i=cy(yP),a=ly(),o;return t[2]!==r||t[3]!==a?(o=()=>{a.getState().scrollToBottom({behavior:r})},t[2]=r,t[3]=a,t[4]=o):o=t[4],i?null:o},[`behavior`]);function yP(e){return e.isAtBottom}var bP=tk(`ThreadPrimitive.LoadEarlier`,()=>{let e=J(2),t=Xa(),n=Y(xP),r;return e[0]===t.thread?r=e[1]:(r=()=>{t.thread.loadEarlier()},e[0]=t.thread,e[1]=r),n?r:null});function xP(e){return e.thread.hasEarlier}var SP=tk(`ThreadPrimitive.Suggestion`,e=>{var t;let n=J(4),{prompt:r,send:i,clearComposer:a,autoSend:o}=e,s=(t=i==null?o:i)!=null&&t,c;n[0]!==a||n[1]!==r||n[2]!==s?(c={prompt:r,send:s,clearComposer:a},n[0]=a,n[1]=r,n[2]=s,n[3]=c):c=n[3];let{disabled:l,trigger:u}=Jv(c);return l?null:u},[`prompt`,`send`,`clearComposer`,`autoSend`,`method`]),CP=pO({Empty:()=>LN,If:()=>VN,LoadEarlier:()=>bP,MessageByIndex:()=>pg,Messages:()=>_g,Root:()=>FN,Row:()=>j_,ScrollToBottom:()=>vP,Suggestion:()=>SP,SuggestionByIndex:()=>nv,Suggestions:()=>av,Unstable_MessageById:()=>mg,Viewport:()=>uP,ViewportFooter:()=>hP,ViewportProvider:()=>Dy});j();var wP=Mn((e,t)=>{var n;let r=J(4),i=Y(TP),a=(n=e.children)==null?i:n,o;return r[0]!==e||r[1]!==t||r[2]!==a?(o=(0,X.jsx)(VO.span,A(A({},e),{},{ref:t,children:a})),r[0]=e,r[1]=t,r[2]=a,r[3]=o):o=r[3],o});wP.displayName=`SuggestionPrimitive.Title`;function TP(e){return e.suggestion.title}j();var EP=Mn((e,t)=>{var n;let r=J(4),i=Y(DP),a=(n=e.children)==null?i:n,o;return r[0]!==e||r[1]!==t||r[2]!==a?(o=(0,X.jsx)(VO.span,A(A({},e),{},{ref:t,children:a})),r[0]=e,r[1]=t,r[2]=a,r[3]=o):o=r[3],o});EP.displayName=`SuggestionPrimitive.Description`;function DP(e){return e.suggestion.label}var OP=tk(`SuggestionPrimitive.Trigger`,e=>{let t=J(4),{send:n,clearComposer:r}=e,i=Y(kP),a;t[0]!==r||t[1]!==i||t[2]!==n?(a={prompt:i,send:n,clearComposer:r},t[0]=r,t[1]=i,t[2]=n,t[3]=a):a=t[3];let{trigger:o,disabled:s}=Jv(a);return s?null:o},[`send`,`clearComposer`]);function kP(e){return e.suggestion.prompt}var AP=pO({Description:()=>EP,Title:()=>wP,Trigger:()=>OP});j();var jP=[`onClick`,`disabled`],MP=Mn((e,t)=>{let n=J(15),r,i,a;if(n[0]!==e){var o=e;({onClick:i,disabled:r}=o),a=G(o,jP),n[0]=e,n[1]=r,n[2]=i,n[3]=a}else r=n[1],i=n[2],a=n[3];let s=Y(NP),{switchToNewThread:c}=ey(),l;n[4]===s?l=n[5]:(l=s?{"data-active":`true`,"aria-current":`true`}:null,n[4]=s,n[5]=l);let u;n[6]!==i||n[7]!==c?(u=Bb(i,c),n[6]=i,n[7]=c,n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==t||n[11]!==a||n[12]!==l||n[13]!==u?(d=(0,X.jsx)(VO.button,A(A(A({type:`button`},l),a),{},{ref:t,disabled:r,onClick:u})),n[9]=r,n[10]=t,n[11]=a,n[12]=l,n[13]=u,n[14]=d):d=n[14],d});MP.displayName=`ThreadListPrimitive.New`;function NP(e){return e.threads.newThreadId===e.threads.mainThreadId}var PP=tk(`ThreadListPrimitive.LoadMore`,()=>{let{loadMore:e,disabled:t}=ty();return t?null:e}),[FP,IP]=Tb(`ThreadList`),LP=FP,RP=Hn(null),zP=RP.Provider,BP=()=>Wn(RP);j();var VP=Mn((e,t)=>{let n=J(3),r;return n[0]!==e||n[1]!==t?(r=(0,X.jsx)(LP.Provider,{scope:void 0,children:(0,X.jsx)(LP.Slot,{scope:void 0,children:(0,X.jsx)(VO.div,A(A({},e),{},{ref:t}))})}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});VP.displayName=`ThreadListPrimitive.Root`;var HP=pO({ItemByIndex:()=>q_,Items:()=>Y_,LoadMore:()=>PP,New:()=>MP,Root:()=>VP});j();var UP=Mn((e,t)=>{let n=Y(e=>e.threads.mainThreadId===e.threadListItem.id),r=K(null),i=K(null),a=Cn(()=>({triggerRef:r,moreRef:i}),[]),o=IP(void 0),s=Ux();return(0,X.jsx)(zP,{value:a,children:(0,X.jsx)(VO.div,A(A(A({},n?{"data-active":`true`,"aria-current":`true`}:null),e),{},{onKeyDown:Bb(e.onKeyDown,e=>{if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=s===`rtl`?`ArrowLeft`:`ArrowRight`,n=s===`rtl`?`ArrowRight`:`ArrowLeft`,a=r.current,c=i.current;if(a&&e.target===a){if(e.key===`ArrowDown`||e.key===`ArrowUp`){let t=o().map(e=>e.ref.current).filter(e=>e!==null&&!e.disabled),n=t[t.indexOf(a)+(e.key===`ArrowDown`?1:-1)];n&&(n.focus(),e.preventDefault())}else e.key===t&&c&&(c.focus(),e.preventDefault())}else c&&e.target===c&&e.key===n&&(a==null||a.focus(),e.preventDefault())}),ref:t}))})});UP.displayName=`ThreadListItemPrimitive.Root`;var WP=tk(`ThreadListItemPrimitive.Archive`,()=>{let{archive:e}=Xv();return e}),GP=tk(`ThreadListItemPrimitive.Unarchive`,()=>{let{unarchive:e,disabled:t}=Qv();return t?null:e}),KP=tk(`ThreadListItemPrimitive.Delete`,()=>{let{delete:e}=Zv();return e});j();var qP=tk(`ThreadListItemPrimitive.Trigger`,()=>{let{switchTo:e}=$v();return e}),JP=Mn((e,t)=>{let n=J(3),r=BP(),i=Ry(t,r==null?void 0:r.triggerRef),a;return n[0]!==e||n[1]!==i?(a=(0,X.jsx)(LP.ItemSlot,{scope:void 0,children:(0,X.jsx)(qP,A(A({},e),{},{ref:i}))}),n[0]=e,n[1]=i,n[2]=a):a=n[2],a});JP.displayName=`ThreadListItemPrimitive.Trigger`;var YP=pO({Archive:()=>WP,Delete:()=>KP,Root:()=>UP,Title:()=>Q_,Trigger:()=>JP,Unarchive:()=>GP}),XP=e=>{let t=e;for(;t;){let{overflowY:e}=getComputedStyle(t);if(e===`scroll`||e===`auto`)return t;t=t.parentElement}return null},ZP=new WeakMap,QP=e=>{var t,n;let r=ZP.get(e);if(r)return r.count++,r;let i=e.scrollTop,a=e.style.scrollbarWidth,o=getComputedStyle(e),s=o.direction===`rtl`?`paddingLeft`:`paddingRight`,c=e.style[s],l=e.offsetWidth-e.clientWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.borderRightWidth),u=e.ownerDocument,d=(e===u.documentElement||e===u.body)&&l<=0?((t=(n=u.defaultView)==null?void 0:n.innerWidth)==null?0:t)-u.documentElement.clientWidth:l;e.style.scrollbarWidth=`none`,d>0&&(e.style[s]=`${parseFloat(o[s])+d}px`);let f=()=>{e.style.scrollbarWidth=a,e.style[s]=c},p=()=>e.scrollTop=i;e.addEventListener(`scroll`,p);let m={count:1,restore:()=>{e.removeEventListener(`scroll`,p),f()}};return ZP.set(e,m),m},$P=(e,t)=>{let n=J(5),r=K(null),i,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>()=>{var e;(e=r.current)==null||e.call(r)},a=[],n[0]=i,n[1]=a):(i=n[0],a=n[1]),q(i,a);let o;return n[2]!==e||n[3]!==t?(o=()=>{var n;(n=r.current)==null||n.call(r);let i=XP(e.current);if(!i){r.current=null;return}let a=QP(i),o=setTimeout(()=>{var e;return(e=r.current)==null?void 0:e.call(r)},t);r.current=()=>{clearTimeout(o),--a.count===0&&(a.restore(),ZP.delete(i)),r.current=null}},n[2]=e,n[3]=t,n[4]=o):o=n[4],o},eF=pO({AssistantRuntimeImpl:()=>op,BaseAssistantRuntimeCore:()=>sp,CompositeContextProvider:()=>Vo,DefaultThreadComposerRuntimeCore:()=>Op,MessageRepository:()=>kl,ThreadRuntimeImpl:()=>Bf,getAutoStatus:()=>Sl,splitLocalRuntimeOptions:()=>iy,useComposerInputPluginRegistryOptional:()=>rA,useSmooth:()=>PM,useSmoothStatus:()=>DM,withSmoothContextProvider:()=>TM}),tF={searchMineCapabilitiesTool:`查询相关API文档`,scriptWriteTool:`编写脚本`,scriptCompile:`编译脚本`,addIndicator:`添加指标到图表`,modifyScriptTool:`修改脚本`,readScriptTool:`读取当前编辑器脚本`,readChartIndicatorsTool:`读取图表指标信息`},nF=`https://ai-test.tradingvue.com`;j();var rF=`${nF}/api/agent/chat`;function iF(e){let t=e.split(/\r?\n/);for(let e of t){if(!e.startsWith(`data:`))continue;let t=e.startsWith(`data: `)?e.slice(6):e.slice(5);if(t)try{return JSON.parse(t)}catch(e){return null}}return null}function aF(e){return oF.apply(this,arguments)}function oF(){return oF=ig(function*(e){let t=new TextDecoder,n=``;for(;;){let{done:r,value:i}=yield rg(e.read());if(r)break;n+=t.decode(i,{stream:!0});let a;for(;(a=n.search(/\r?\n\r?\n/))!==-1;){let e=n.match(/\r?\n\r?\n/);if(!e)break;let t=n.slice(0,a);n=n.slice(a+e[0].length);let r=iF(t);r&&(yield r)}}if(n+=t.decode(),n){let e=iF(n);e&&(yield e)}}),oF.apply(this,arguments)}function sF(e){return cF.apply(this,arguments)}function cF(){return cF=ig(function*({userMessage:e,abortSignal:t,token:n,getChartInfo:r,getConversationId:i,onConversationCreated:a,onCustomEvent:o,onEvent:s,onSuggestions:c}){let l={id:e.id,role:`user`,parts:e.content.filter(e=>e.type===`text`).map(e=>{var t;return{type:`text`,text:(t=e.text)==null?``:t}}),metadata:{files:[],sentAt:new Date().toISOString()}},u=i(),d=yield rg(fetch(rF,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`,Token:n},credentials:`include`,signal:t,body:JSON.stringify(A({message:l,conversationId:u||``},r()))}));if(!d.ok){let e=yield rg(d.text());throw Error(`请求失败 (${d.status}): ${e}`)}if(!d.body)throw Error(`服务端没有返回数据流`);let f=d.body.getReader(),p=[],m=new Map,h=new Map,g=new Map,_=new Map,v=()=>[...p];try{var y=!1,b=!1,x;try{for(var S=ne(aF(f)),C;y=!(C=yield rg(S.next())).done;y=!1){let e=C.value;{if(t.aborted)return;let n=e.payload;switch(e.type){case`data-conversation-created`:{var w;let t=(w=e.data)==null?void 0:w.id;t&&a(t);break}case`text-start`:{var T;let e=(T=n==null?void 0:n.id)==null?`default`:T,t=p.length;m.set(e,t),p.push({type:`text`,text:``}),yield v();break}case`text-delta`:{var E;let e=(E=n==null?void 0:n.id)==null?`default`:E,t=n==null?void 0:n.text;if(!t)break;let r=m.get(e);r===void 0&&(r=p.length,m.set(e,r),p.push({type:`text`,text:``}));let i=p[r];i.type===`text`&&(p[r]=A(A({},i),{},{text:i.text+t})),yield v();break}case`text-end`:{var D;let e=(D=n==null?void 0:n.id)==null?`default`:D;m.delete(e);break}case`reasoning-start`:{var O;let e=(O=n==null?void 0:n.id)==null?`default`:O,t=Date.now(),r=p.length;h.set(e,r),g.set(e,t),p.push({type:`reasoning`,text:``,timing:{startedAt:t}}),yield v();break}case`reasoning-delta`:{var k;let e=(k=n==null?void 0:n.id)==null?`default`:k;if(!(n!=null&&n.text))break;let t=h.get(e);if(t===void 0){let n=Date.now();t=p.length,h.set(e,t),g.set(e,n),p.push({type:`reasoning`,text:``,timing:{startedAt:n}})}let r=p[t];r.type===`reasoning`&&(p[t]=A({},r)),yield v();break}case`reasoning-end`:{var j,M,N,P;let e=(j=n==null?void 0:n.id)==null?`default`:j,t=h.get(e);if(t===void 0)break;let r=p[t];if(r.type!==`reasoning`)break;let i=(M=(N=g.get(e))==null?(P=r.timing)==null?void 0:P.startedAt:N)==null?Date.now():M;p[t]=A(A({},r),{},{timing:{startedAt:i,completedAt:Date.now()}}),h.delete(e),g.delete(e),yield v();break}case`tool-call`:{var F,I,L;let e=String((F=n==null?void 0:n.toolCallId)==null?``:F),t=String((I=n==null?void 0:n.toolName)==null?``:I);if(!e||!t)break;let r=(L=n==null?void 0:n.args)==null?{}:L,i=p.length;_.set(e,i),p.push({type:`tool-call`,toolCallId:e,toolName:t,args:typeof r==`object`&&r?r:{}}),yield v();break}case`tool-result`:{var R;let e=String((R=n==null?void 0:n.toolCallId)==null?``:R),t=_.get(e);if(t===void 0)break;let r=p[t];if(r.type!==`tool-call`)break;p[t]=A({},r),_.delete(e),yield v();break}case`tool-error`:{var z,B,ee,V;let e=String((z=(B=n==null?void 0:n.toolCallId)==null?n==null?void 0:n.id:B)==null?``:z),t=_.get(e);if(t===void 0)break;let r=p[t];if(r.type!==`tool-call`)break;p[t]=A(A({},r),{},{result:(ee=(V=n==null?void 0:n.error)==null?n==null?void 0:n.result:V)==null?`工具执行失败`:ee,isError:!0}),_.delete(e),yield v();break}case`error`:var te;throw Error((te=n==null?void 0:n.error)==null?`AI 服务执行失败`:te);case`data-suggestions`:{let t=e.data;Array.isArray(t)&&(c==null||c(t.map(e=>({prompt:e.prompt,label:e.label}))))}break;default:e.type.startsWith(`data-`)?o==null||o(e):s==null||s(e)}}}}catch(e){b=!0,x=e}finally{try{y&&S.return!=null&&(yield rg(S.return()))}finally{if(b)throw x}}}finally{try{yield rg(f.cancel())}catch(e){}finally{f.releaseLock()}}}),cF.apply(this,arguments)}j();var lF=`${nF}/api/conversations`,uF=new Map,dF=new Set,fF=`currentConversationId`;function pF(){return localStorage.getItem(fF)}function mF(e=``){localStorage.setItem(fF,e)}function hF(){localStorage.removeItem(fF)}function gF(e,t){uF.set(e,t)}var _F=``;function vF(e){_F=e}function yF(e){return bF.apply(this,arguments)}function bF(){return bF=O(function*(e,t={}){let n=yield fetch(`${lF}${e}`,A(A({},t),{},{credentials:`include`,headers:A({"Content-Type":`application/json`,Token:_F},t.headers)})),r=yield n.json();if(!n.ok||r.success===!1)throw Error(r.message||`请求失败`);return r}),bF.apply(this,arguments)}function xF(e){return{remoteId:e.id,status:`regular`,title:e.title||`新会话`}}function SF(e){let t={id:e.id,content:[{type:`text`,text:e.content}],createdAt:new Date(e.createdAt)};return e.role===`user`?A(A({},t),{},{role:`user`,attachments:[],metadata:{custom:{}}}):A(A({},t),{},{role:`assistant`,status:{type:`complete`,reason:`stop`},metadata:{unstable_state:{},unstable_annotations:[],unstable_data:[],steps:[],custom:{}}})}function CF(e){var t;let n=(t=e.custom)==null?void 0:t.conversationId;if(typeof n==`string`&&n)return n;let r=uF.get(e.id);if(r)return r;if(!dF.has(e.id))return e.remoteId||void 0}function wF(e){return dF.has(e)}function TF(e,t){return EF.apply(this,arguments)}function EF(){return EF=O(function*(e,t,n=20){return yF(`/${encodeURIComponent(e)}/messages?page=${t}&perPage=${n}`)}),EF.apply(this,arguments)}var DF={list(){return O(function*(){return{threads:(yield yF(`/`)).data.map(xF)}})()},initialize(e){return O(function*(){return dF.add(e),{remoteId:e}})()},fetch(e){return O(function*(){return xF((yield yF(`/${encodeURIComponent(e)}`)).data)})()},delete(e){return O(function*(){var t;let n=(t=uF.get(e))==null?dF.has(e)?void 0:e:t;n?(yield yF(`/${encodeURIComponent(n)}`,{method:`DELETE`}),uF.delete(e),dF.delete(e)):(dF.delete(e),uF.delete(e))})()},rename(){return O(function*(){})()},archive(){return O(function*(){})()},updateCustom(){return O(function*(){})()},generateTitle(e,t){return O(function*(){return cc(function(){var e=O(function*(e){let n=t.find(e=>e.role===`user`),r=(n==null?void 0:n.content.filter(e=>e.type===`text`).map(e=>e.text).join(``).slice(0,30))||`新会话`;e.appendText(r)});return function(t){return e.apply(this,arguments)}}())})()}};j();var OF=20;function kF(e,t,n,r){var i;let a=Xa(),o=Y(e=>e.threadListItem),[s,c]=(0,h.useState)([]),[l,u]=(0,h.useState)([]),d=(0,h.useCallback)(e=>{c([...e])},[]),[f,p]=(0,h.useState)(!1),[m,g]=(0,h.useState)(!0),[_,v]=(0,h.useState)(!1),[y,b]=(0,h.useState)(0),x=(i=CF(o))==null?``:i,S=(0,h.useRef)(null),C=(0,h.useRef)(!1);(0,h.useEffect)(()=>{let e=!1;function t(){return n.apply(this,arguments)}function n(){return n=O(function*(){if(c([]),b(0),v(!1),g(!0),!x)g(!1);else try{let t=yield TF(x,0,OF);if(e)return;c([...t.messages].reverse().map(SF)),b(0),v(t.pagination.hasMore)}catch(t){e||console.error(`加载会话历史失败:`,t)}finally{e||g(!1)}}),n.apply(this,arguments)}return t(),()=>{e=!0}},[o.id]);let w=(0,h.useCallback)(function(){var i=O(function*(i,o){let s=new AbortController;S.current=s,u([]),p(!0);try{var l=!1,d=!1,f;try{for(var m=ne(sF({token:t.current||``,userMessage:{id:i.id,content:i.content},abortSignal:s.signal,getChartInfo:e,getConversationId:()=>{var e;return(e=CF(a.threadListItem.getState()))==null?``:e},onConversationCreated:e=>{var t;let n=a.threadListItem.getState();gF(n.id,e),a.threadListItem.updateCustom(A(A({},n.custom),{},{conversationId:e})),(t=r.current)==null||t.call(r,e),b(0),v(!1)},onCustomEvent:e=>{var t;(t=n.current)==null||t.call(n,e)},onSuggestions:e=>{u(e)}})),h;l=!(h=yield m.next()).done;l=!1){let e=h.value;c(t=>t.map(t=>t.id!==o.id||t.role!==`assistant`?t:A(A({},t),{},{content:e})))}}catch(e){d=!0,f=e}finally{try{l&&m.return!=null&&(yield m.return())}finally{if(d)throw f}}if(s.signal.aborted){c(e=>e.map(e=>e.id===o.id?A(A({},e),{},{status:{type:`incomplete`,reason:`cancelled`}}):e));return}c(e=>e.map(e=>e.id===o.id?A(A({},e),{},{status:{type:`complete`,reason:`stop`}}):e))}catch(e){if(s.signal.aborted)c(e=>e.map(e=>e.id===o.id?A(A({},e),{},{status:{type:`incomplete`,reason:`cancelled`}}):e));else throw e}finally{S.current===s&&(S.current=null),p(!1)}});return function(e,t){return i.apply(this,arguments)}}(),[a.threadListItem,e]),T=(0,h.useCallback)(function(){var e=O(function*(e,t=`new`,n){var r,i,a;let o=e.content.flatMap(e=>e.type===`text`?[{type:`text`,text:e.text}]:[]),s={id:(r=n==null?void 0:n.userMessageId)==null?crypto.randomUUID():r,role:`user`,content:o,attachments:(i=e.attachments)==null?[]:i,createdAt:new Date,metadata:{custom:{}}},l={id:(a=n==null?void 0:n.assistantMessageId)==null?crypto.randomUUID():a,role:`assistant`,content:[],createdAt:new Date,status:{type:`running`},metadata:{unstable_state:{},unstable_annotations:[],unstable_data:[],steps:[],custom:{}}};c(n=>{if(t===`regenerate`)return n.map(e=>e.id===l.id?l:e);if(t===`edit`){let t=n.findIndex(t=>t.id===e.parentId);return[...t===-1?[]:n.slice(0,t+1),s,l]}return[...n,s,l]}),yield w(s,l)});return function(t){return e.apply(this,arguments)}}(),[w]),E=(0,h.useCallback)(e=>T(e,`new`),[T]),D=(0,h.useCallback)(e=>T(e,`edit`),[T]),k=(0,h.useCallback)(O(function*(){var e;(e=S.current)==null||e.abort()}),[]),j=(0,h.useCallback)(function(){var e=O(function*(e){if(!e)return;let t=s.findIndex(t=>t.id===e&&t.role===`assistant`);if(t===-1)return;let n=s.slice(0,t).findLast(e=>e.role===`user`);if(!n)return;let r=s[t];yield T({content:n.content,attachments:n.attachments,parentId:n.id},`regenerate`,{userMessageId:n.id,assistantMessageId:r.id})});return function(t){return e.apply(this,arguments)}}(),[s,T]);return em({messages:s,setMessages:d,isRunning:f,isLoading:m,onNew:E,onEdit:D,onCancel:k,hasEarlier:_,onLoadEarlier:(0,h.useCallback)(O(function*(){if(x&&_&&!C.current){C.current=!0;try{let e=y+1,t=yield TF(x,e,OF),n=[...t.messages].reverse().map(SF);c(e=>{let t=new Set(e.map(e=>e.id));return[...n.filter(e=>!t.has(e.id)),...e]}),b(e),v(t.pagination.hasMore)}finally{C.current=!1}}}),[x,y,_]),suggestions:l,onReload:j})}function AF({children:e,token:t,getChartInfo:n,onCustomEvent:r}){let[i,a]=(0,h.useState)(),o=(0,h.useRef)(!1),s=(0,h.useRef)(t),c=(0,h.useRef)(r);(0,h.useEffect)(()=>{c.current=r},[r]),vF(t),(0,h.useEffect)(()=>{s.current=t},[t]);let l=(0,h.useRef)(()=>{}),u=(0,h.useCallback)(e=>{o.current&&(a(e),!e||wF(e)?hF():mF(e))},[]),d=(0,h.useCallback)(function(){return kF(n,s,c,l)},[n]);(0,h.useEffect)(()=>{let e=!1;function t(){return n.apply(this,arguments)}function n(){return n=O(function*(){let t=pF();if(t)try{let n=yield DF.fetch(t);if(e)return;a(n.remoteId)}catch(t){if(e)return;hF(),a(void 0)}finally{e||(o.current=!0)}else{if(e)return;a(void 0),o.current=!0}}),n.apply(this,arguments)}return t(),l.current=e=>{mF(e)},()=>{e=!0}},[]);let f=tg({runtimeHook:d,adapter:DF,threadId:i,onThreadIdChange:u});return(0,X.jsx)(ky,{runtime:f,children:e})}var jF=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();j();function MF(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return A({name:jF(e),size:24,node:t},n.length>0?{aliases:n}:{})}var NF=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},PF=e=>{let t=NF(e);return t.charAt(0).toUpperCase()+t.slice(1)},FF=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),IF={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};j();function LF(e){return e!=null}function RF(e,t={}){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;let _=(n=t.attributeNames)==null?{}:n,v=e=>{var t;return(t=_[e])==null?e:t},y=(r=(i=e.size)==null?e.width:i)==null?IF.width:r,b=(a=(o=e.size)==null?e.height:o)==null?IF.height:a,x=(s=(c=e.aliases)==null?void 0:c.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`))==null?[]:s,S=[...e.name?[`lucide-${e.name}`]:[],...x],C=(l=(u=t.className)==null?void 0:u.split(` `).filter(Boolean))==null?[]:l,w=t.includeDefaultClasses===!1?FF(...C):FF(`lucide`,...S,...C),T=t.absoluteStrokeWidth?Number((d=t.strokeWidth)==null?IF[`stroke-width`]:d)*Number((f=(p=e.size)==null?e.width:p)==null?IF.width:f)/Number((m=(h=t.size)==null?t.width:h)==null?IF.width:m):(g=t.strokeWidth)==null?IF[`stroke-width`]:g;return[`svg`,A(A(A(A(A(A(A(A({},Object.entries(IF).reduce((e,[t,n])=>(e[v(t)]=n,e),{})),`color`in t&&t.color&&{[v(`stroke`)]:t.color}),`size`in t&&LF(t.size)&&{[v(`width`)]:t.size,[v(`height`)]:t.size}),`width`in t&&LF(t.width)&&{[v(`width`)]:t.width}),`height`in t&&LF(t.height)&&{[v(`height`)]:t.height}),{},{[v(`stroke-width`)]:T},w&&{[v(`class`)]:w}),{},{[v(`viewBox`)]:`0 0 ${y} ${b}`},t.hasA11yProp===!1?{[v(`aria-hidden`)]:`true`}:{}),`attributes`in t&&t.attributes),e.node.map(e=>{let[n,r,i]=e,a=t.nonScalingStroke?A({[v(`vector-effect`)]:`non-scaling-stroke`},r):r;return i?[n,a,i]:[n,a]})]}j();function zF(e,t={}){return RF(e,A(A({},t),{},{attributeNames:A(A({},t.attributeNames),{},{class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`})}))}var BF=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},VF=(0,h.createContext)({}),HF=()=>(0,h.useContext)(VF);j();var UF=[`color`,`size`,`width`,`height`,`strokeWidth`,`absoluteStrokeWidth`,`nonScalingStroke`,`className`,`children`,`iconNode`,`icon`],WF=(0,h.forwardRef)((e,t)=>{var n,r,i;let{color:a,size:o,width:s,height:c,strokeWidth:l,absoluteStrokeWidth:u,nonScalingStroke:d,className:f=``,children:p,iconNode:m=[],icon:g={node:m,aliases:[],size:24}}=e,_=G(e,UF),{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=(n=HF())==null?{}:n,w=!!p||BF(_),[T,E,D=[]]=zF(g,{color:a==null?S:a,width:(r=s==null?o:s)==null?v:r,height:(i=c==null?o:c)==null?v:i,strokeWidth:l==null?y:l,absoluteStrokeWidth:u==null?b:u,nonScalingStroke:d==null?x:d,className:FF(C,f),hasA11yProp:w,attributes:_});return(0,h.createElement)(T,A({ref:t},E),[...D.map(([e,t])=>(0,h.createElement)(e,t)),...Array.isArray(p)?p:[p]])});j();var GF=[`className`];function KF(e,t=[],n=[]){let r=typeof e==`string`?MF(e,t,n):e,i=(0,h.forwardRef)((e,t)=>{let{className:n}=e,i=G(e,GF);return(0,h.createElement)(WF,A({ref:t,icon:r,className:n},i))});return r.name&&(i.displayName=PF(r.name)),i}var qF={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};qF.node;var JF=KF(qF),YF={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};YF.node;var XF=KF(YF),ZF={name:`audio-lines`,size:24,node:[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]};ZF.node;var QF=KF(ZF),$F={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};$F.node;var eI=KF($F),tI={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};tI.node;var nI=KF(tI),rI={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};rI.node;var iI=KF(rI),aI={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};aI.node;var oI=KF(aI),sI={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};sI.node;var cI=KF(sI),lI={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};lI.node;var uI=KF(lI),dI={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};dI.node;var fI=KF(dI),pI={name:`circle-minus`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-circle`]};pI.node;var mI=KF(pI),hI={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};hI.node;var gI=KF(hI),_I={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};_I.node;var vI=KF(_I),yI={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};yI.node;var bI=KF(yI),xI={name:`eighth-notes`,size:24,node:[[`path`,{d:`M21 16V3a1 1 0 0 0-1.28-.96l-10 2.917a1 1 0 0 0-.72.96V19`,key:`uy6ho8`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}],[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}]],aliases:[`music`]};xI.node;var SI=KF(xI),CI={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};CI.node;var wI=KF(CI),TI={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};TI.node;var EI=KF(TI),DI={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};DI.node;var OI=KF(DI),kI={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};kI.node;var AI=KF(kI),jI={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};jI.node;var MI=KF(jI),NI={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};NI.node;var PI=KF(NI),FI={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};FI.node;var II=KF(FI),LI={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};LI.node;var RI=KF(LI),zI={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};zI.node;var BI=KF(zI),VI={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};VI.node;var HI=KF(VI),UI={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};UI.node;var WI=KF(UI),GI={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};GI.node;var KI=KF(GI),qI={name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};qI.node;var JI=KF(qI),YI={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};YI.node;var XI=KF(YI),ZI={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};ZI.node;var QI=KF(ZI),$I={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};$I.node;var eL=KF($I),tL={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};tL.node;var nL=KF(tL),rL={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};rL.node;var iL=KF(rL),aL={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};aL.node;var oL=KF(aL),sL={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};sL.node;var cL=KF(sL),lL={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};lL.node;var uL=KF(lL),dL={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};dL.node;var fL=KF(dL),pL={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};pL.node;var mL=KF(pL),hL={};function gL(e,t){let n=h.useRef(hL);return n.current===hL&&(n.current=e(t)),n}var _L=[],vL=void 0;function yL(){return vL}function bL(e){_L.push(e)}function xL(e){let t=(t,n)=>{let r=gL(CL).current,i;try{vL=r;for(let e of _L)e.before(r);i=e(t,n);for(let e of _L)e.after(r);r.didInitialize=!0}finally{vL=void 0}return i};return t.displayName=e.displayName||e.name,t}function SL(e){return h.forwardRef(xL(e))}function CL(){return{didInitialize:!1}}function wL(){}var TL=Object.freeze([]),EL=Object.freeze({}),DL=typeof document<`u`?h.useLayoutEffect:()=>{};function OL(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var kL=OL(`https://base-ui.com/production-error`,`Base UI`),AL=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(AL.displayName=`TooltipRootContext`);function jL(e){let t=h.useContext(AL);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?kL(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return t}function ML(e){h.useEffect(e,TL)}E();var NL=0,PL=class e{constructor(){T(this,`currentId`,NL),T(this,`clear`,()=>{this.currentId!==NL&&(clearTimeout(this.currentId),this.currentId=NL)}),T(this,`disposeEffect`,()=>this.clear)}static create(){return new e}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=NL,t()},e)}isStarted(){return this.currentId!==NL}};function FL(){let e=gL(PL.create).current;return ML(e.disposeEffect),e}function IL(){var e,t;if(typeof navigator>`u`)return{userAgent:``,platform:``,maxTouchPoints:0};if(process.env.NODE_ENV!==`production`){let e=navigator.userAgentData;if(e&&Array.isArray(e.brands)){var n,r,i;return{userAgent:e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `),platform:(n=(r=e.platform)==null?navigator.platform:r)==null?``:n,maxTouchPoints:(i=navigator.maxTouchPoints)==null?0:i}}}return{userAgent:navigator.userAgent,platform:(e=navigator.platform)==null?``:e,maxTouchPoints:(t=navigator.maxTouchPoints)==null?0:t}}var{userAgent:LL,platform:RL,maxTouchPoints:zL}=IL(),BL=LL.toLowerCase(),VL=RL.toLowerCase(),HL=/^i(os$|p)/.test(VL)||VL===`macintel`&&zL>1,UL=`android`,WL=VL===UL||BL.includes(UL),GL=!HL&&VL.startsWith(`mac`);VL.startsWith(`win`),!WL&&/^(linux|chrome os)/.test(VL);var KL=GL||HL,qL,JL,YL=typeof CSS<`u`&&!!((qL=(JL=CSS).supports)!=null&&qL.call(JL,`-webkit-backdrop-filter:none`));!YL&&BL.includes(`firefox`),!YL&&BL.includes(`chrom`);var XL=KL,ZL=/jsdom|happydom/.test(BL);function QL(e){e.preventDefault(),e.stopPropagation()}function $L(e){return`nativeEvent`in e}function eR(e){return e.pointerType===``&&e.isTrusted?!0:WL&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function tR(e){return ZL?!1:!WL&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(WL||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function nR(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function rR(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function iR(e){var t;let n=e.activeElement;for(;(n==null||(t=n.shadowRoot)==null?void 0:t.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function aR(e,t){var n;if(!e||!t)return!1;let r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&ZS(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function oR(e,t){let n=e;for(;n;){var r,i;if(YS(n)&&n.matches(t))return n;n=(r=(i=n.assignedSlot)==null?n.parentNode:i)==null?ZS(n)?n.host:null:r}return null}function sR(e){if(`composedPath`in e){var t;return(t=e.composedPath()[0])==null?e.target:t}return e.target}var cR=`data-base-ui-focusable`,lR=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,uR=`data-starting-style`,dR=`data-ending-style`,fR={[uR]:``},pR={[dR]:``},mR={transitionStatus(e){return e===`starting`?fR:e===`ending`?pR:null}},hR=`data-open`,gR=`data-closed`,_R=`data-anchor-hidden`,vR=`data-popup-open`;j();var yR={[vR]:``},bR={[hR]:``},xR={[gR]:``},SR={[_R]:``},CR={open(e){return e?yR:null}},wR={open(e){return e?bR:xR},anchorHidden(e){return e?SR:null}},TR=A(A({},wR),mR),ER=`data-trigger-disabled`;function DR(e,t){if(!YS(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(ER);for(let[,e]of t.entries())if(aR(e,n))return!e.hasAttribute(ER);return!1}function OR(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function kR(e){return e.matches(`html,body`)}function AR(e){return XS(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function jR(e){return oR(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${lR}`)!=null}function MR(e){return e?e.getAttribute(`role`)===`combobox`&&AR(e):!1}function NR(e){if(!e||ZL)return!0;try{return e.matches(`:focus-visible`)}catch(e){return!0}}function PR(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function FR(e,t){return t!=null&&!nR(t)?0:typeof e==`function`?e():e}function IR(e,t,n){let r=FR(e,n);return typeof r==`number`?r:r==null?void 0:r[t]}function LR(e){return typeof e==`function`?e():e}function RR(e,t){return t||e===`click`||e===`mousedown`}function zR(e){return(e==null?void 0:e.includes(`mouse`))&&e!==`mousedown`}j();function BR(e,t,n,r){let i=!1,a=!1,o=r==null?EL:r;return A({reason:e,event:t==null?new Event(`base-ui`):t,cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n},o)}var VR=`none`,HR=`trigger-press`,UR=`trigger-hover`,WR=`trigger-focus`,GR=`outside-press`,KR=`close-press`,qR=`focus-out`,JR=`escape-key`,YR=`disabled`,XR=`imperative-action`,ZR=h.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new PL,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(ZR.displayName=`FloatingDelayGroupContext`);function QR(e,t){e.current=t.current}function $R(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=h.useRef(n),a=h.useRef(n),o=h.useRef(null),s=h.useRef(null),c=FL();return DL(()=>{a.current=n,o.current?i.current={open:IR(i.current,`open`),close:IR(n,`close`)}:i.current=n},[n,o,i,a]),(0,X.jsx)(ZR.Provider,{value:h.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function ez(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=h.useContext(ZR),[d,f]=h.useState(!1),p=h.useRef(n);return DL(()=>{p.current=n},[n]),DL(()=>{function t(){var e;(e=c.current)==null||e.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),DL(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:IR(s.current,`close`)},o!==null&&o!==r?(f(!0),t==null||t.setIsInstantPhase(!0),t==null||t.onOpenChange(!1,BR(`none`))):(f(!1),t==null||t.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),DL(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,QR(a,s),u.clear()}},[c,i,a,r,s,u]),h.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function tz(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function nz(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function rz(e,t,n,r){let i=gL(az).current;return oz(i,e,t,n,r)&&cz(i,[e,t,n,r]),i.callback}function iz(e){let t=gL(az).current;return sz(t,e)&&cz(t,e),t.callback}function az(){return{callback:null,cleanup:null,refs:[]}}function oz(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function sz(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function cz(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function lz(e){let t=gL(uz,e).current;return t.next=e,DL(t.effect),t}function uz(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}j();var dz=A({},h),fz=dz.useInsertionEffect,pz=fz&&fz!==dz.useLayoutEffect?fz:e=>e();function mz(e){let t=gL(hz).current;return t.next=e,pz(t.effect),t.trampoline}function hz(){let e={next:void 0,callback:gz,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function gz(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}E();var _z=null,vz=globalThis.requestAnimationFrame,yz=new class{constructor(){T(this,`callbacks`,[]),T(this,`callbacksCount`,0),T(this,`nextId`,1),T(this,`startId`,1),T(this,`isScheduled`,!1),T(this,`tick`,e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1){var r;(r=t[n])==null||r.call(t,e)}})}request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=process.env.NODE_ENV!==`production`&&vz!==requestAnimationFrame&&(vz=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},bz=class e{constructor(){T(this,`currentId`,_z),T(this,`cancel`,()=>{this.currentId!==_z&&(yz.cancel(this.currentId),this.currentId=_z)}),T(this,`disposeEffect`,()=>this.cancel)}static create(){return new e}static request(e){return yz.request(e)}static cancel(e){return yz.cancel(e)}request(e){this.cancel(),this.currentId=yz.request(()=>{this.currentId=_z,e()})}};function xz(){let e=gL(bz.create).current;return ML(e.disposeEffect),e}function Sz(e){return(e==null?void 0:e.ownerDocument)||document}j();var Cz={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},wz=A(A({},Cz),{},{position:`fixed`,margin:0,top:0,left:0});A(A({},Cz),{},{position:`absolute`}),j();var Tz=h.forwardRef(function(e,t){let[n,r]=h.useState();DL(()=>{XL&&YL&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,A(A(A({},e),{},{ref:t,style:wz,"aria-hidden":!n||void 0},i),{},{"data-base-ui-focus-guard":``}))});process.env.NODE_ENV!==`production`&&(Tz.displayName=`FocusGuard`);function Ez(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Dz(e,t=e?lC(e):null){return!e||!e.isConnected||!t||Ez(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Oz=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function kz(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ZS(n)?n.host:null}function Az(e){for(let t of Array.from(e.children))if(GS(t)===`summary`)return t;return null}function jz(e,t){let n=Az(t);return!!n&&(e===n||aR(n,e))}function Mz(e){let t=e?GS(e):``;return e!=null&&e.matches(Oz)&&(t!==`summary`||e.parentElement!=null&&GS(e.parentElement)===`details`&&Az(e.parentElement)===e)&&(t!==`details`||Az(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Nz(e){if(!Mz(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=kz(t)){let n=t!==e,r=GS(t)===`slot`;if(t.hasAttribute(`inert`)||n&&GS(t)===`details`&&!t.open&&!jz(e,t)||t.hasAttribute(`hidden`)||!r&&!Pz(t,n))return!1}return!0}function Pz(e,t){let n=lC(e);return t?n.display!==`none`:Dz(e,n)}function Fz(e){let t=e.tabIndex;if(t<0){let t=GS(e);if(t===`details`||t===`audio`||t===`video`||XS(e)&&e.isContentEditable)return 0}return t}function Iz(e){if(GS(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Lz(e,t){let n=Iz(e);if(!n)return!0;let r=t.find(e=>{let t=Iz(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Iz(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form})===n}function Rz(e){if(XS(e)&&GS(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return XS(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function zz(e,t){Rz(e).forEach(e=>{Mz(e)&&t.push(e),zz(e,t)})}function Bz(e,t,n){Rz(e).forEach(e=>{XS(e)&&e.matches(t)&&n.push(e),Bz(e,t,n)})}function Vz(e){return Nz(e)&&Fz(e)>=0}function Hz(e){let t=[];return zz(e,t),t.filter(Nz)}function Uz(e){let t=Hz(e);return t.filter(e=>Fz(e)>=0&&Lz(e,t))}function Wz(e,t){let n=Uz(e),r=n.length;if(r===0)return;let i=iR(Sz(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Gz(e){return Wz(Sz(e).body,1)||e}function Kz(e){return Wz(Sz(e).body,-1)||e}function qz(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!aR(n,r)}function Jz(e){Uz(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Yz(e){let t=[];Bz(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Xz(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>{var r;return[...!n||(r=t.context)!=null&&r.open?[t]:[],...Xz(e,t.id,n)]})}function Zz(e,t){var n;let r=[],i=(n=e.find(e=>e.id===t))==null?void 0:n.parentId;for(;i;){let t=e.find(e=>e.id===i);i=t==null?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Qz(e){return`data-base-ui-${e}`}var $z=0;function eB(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame($z);function a(){i&&!i()||e==null||e.focus({preventScroll:n})}if(r)return a(),wL;let o=requestAnimationFrame(a);return $z=o,()=>{$z===o&&(cancelAnimationFrame(o),$z=0)}}var tB=`data-base-ui-inert`,nB=new WeakMap,rB=new WeakSet,iB=new WeakMap,aB=0;function oB(e){return e?ZS(e)?e.host:oB(e.parentNode):null}var sB=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=oB(t);return e.contains(n)?n:null}).filter(e=>e!=null),cB=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},lB=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{GS(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function uB(e,t,n,{mark:r=!0}){let i=sB(t,e),a=r?lB(t,cB(i),new Set(i)):[],o=[],s=[];if(n){let e=sB(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);lB(t,cB(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(nB.get(e)||0)+1;nB.set(e,r),o.push(e),r===1&&n&&rB.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(iB.get(e)||0)+1;iB.set(e,t),s.push(e),t===1&&e.setAttribute(tB,``)}),aB+=1,()=>{o.forEach(e=>{let t=(nB.get(e)||0)-1;nB.set(e,t),t||(rB.has(e)||e.removeAttribute(`aria-hidden`),rB.delete(e))}),r&&s.forEach(e=>{let t=(iB.get(e)||0)-1;iB.set(e,t),t||e.removeAttribute(tB)}),--aB,aB||(nB=new WeakMap,rB=new WeakSet,iB=new WeakMap)}}function dB(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Sz(e[0]).body;return uB(e,i,n,{mark:r})}function fB(){let[,e]=h.useState({});return h.useCallback(()=>{e({})},[])}var pB=0;function mB(e,t=`mui`){let n=h.useRef(void 0),r=fB(),i=e==null?n.current:e;return h.useEffect(()=>{n.current==null&&(pB+=1,n.current=`${t}-${pB}`,e==null&&r())},[e,t,r]),i}var hB=dz.useId;function gB(e,t){if(hB!==void 0){let n=hB();return e==null?t?`${t}-${n}`:n:e}return mB(e,t)}var _B=parseInt(h.version,10);function vB(e){return _B>=e}function yB(e){var t;if(!h.isValidElement(e))return null;let n=e,r=n.props;return(t=vB(19)?r==null?void 0:r.ref:n.ref)==null?null:t}j();function bB(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return A(A({},e),t)}var xB;process.env.NODE_ENV!==`production`&&(xB=new Set);function SB(e,t){return function(...n){if(process.env.NODE_ENV!==`production`){let r=n.join(` `),i=t?`${t}: ${r}`:r,a=`${e}:${i}`;xB.has(a)||(xB.add(a),e===`warn`?console.warn(i):console.error(i))}}}var CB=SB(`warn`,`Base UI`);function wB(e,t){let n={};for(let r in e){let i=e[r];if(t!=null&&t.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function TB(e,t){return typeof e==`function`?e(t):e}function EB(e,t){return typeof e==`function`?e(t):e}j();var DB={};function OB(e,t,n,r,i){if(!n&&!r&&!i&&!e)return AB(t);let a=AB(e);return t&&(a=jB(a,t)),n&&(a=jB(a,n)),r&&(a=jB(a,r)),i&&(a=jB(a,i)),a}function kB(e){if(e.length===0)return DB;if(e.length===1)return AB(e[0]);let t=AB(e[0]);for(let n=1;n<e.length;n+=1)t=jB(t,e[n]);return t}function AB(e){return FB(e)?A({},e(DB)):MB(e)}function jB(e,t){return FB(t)?t(e):NB(e,t)}function MB(e){let t=A({},e);for(let e in t){let n=t[e];PB(e,n)&&(t[e]=LB(n))}return t}function NB(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=bB(e.style,r);break;case`className`:e[n]=zB(e.className,r);break;default:e[n]=PB(n,r)?IB(e[n],r):r}}return e}function PB(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function FB(e){return typeof e==`function`}function IB(e,t){return t?e?(...n)=>{let r=n[0];if(BB(r)){let i=r;RB(i);let a=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),a}let i=t(...n);return e==null||e(...n),i}:LB(t):e}function LB(e){return e&&((...t)=>{let n=t[0];return BB(n)&&RB(n),e(...t)})}function RB(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function zB(e,t){return t?e?t+` `+e:t:e}function BB(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}j();function VB(e,t,n={}){var r;let i=t.render;n.enabled!==!1&&(i=qB(i));let a=HB(t,n,i);if(n.enabled===!1)return null;let o=(r=n.state)==null?EL:r;return JB(e,i,a,o)}function HB(e,t,n){var r;let{className:i,style:a}=e,{state:o=EL,ref:s,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?TB(i,o):void 0,f=u?EB(a,o):void 0,p=u?wB(o,l):EL,m=u&&c?UB(c):void 0,h=u?(r=bB(p,m))==null?{}:r:EL;return typeof document<`u`&&(u?h.ref=Array.isArray(s)?iz([h.ref,yB(n),...s]):rz(h.ref,yB(n),s):rz(null,null)),u?(d!==void 0&&(h.className=zB(h.className,d)),f!==void 0&&(h.style=bB(h.style,f)),h):EL}function UB(e){return Array.isArray(e)?kB(e):OB(void 0,e)}var WB=Symbol.for(`react.lazy`),GB=/^[A-Z][A-Za-z0-9$]*$/,KB=/[a-z]/;function qB(e){if((e==null?void 0:e.$$typeof)!==WB)return e;let t=h.Children.toArray(e)[0];return h.isValidElement(t)?t:e}function JB(e,t,n,r){if(t){if(typeof t==`function`)return process.env.NODE_ENV!==`production`&&YB(t),t(n,r);let e=OB(n,t.props);if(e.ref=n.ref,process.env.NODE_ENV!==`production`&&!h.isValidElement(t))throw Error("Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.\nA valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.\nhttps://base-ui.com/r/invalid-render-prop");return h.cloneElement(t,e)}return XB(e,n)}function YB(e){let t=e.name;t.length!==0&&GB.test(t)&&KB.test(t)&&CB(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.",`If this is an intentional render callback, rename it to start with a lowercase letter.`,"Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.",`https://base-ui.com/r/invalid-render-prop`)}function XB(e,t){return e===`button`?(0,h.createElement)(`button`,A(A({type:`button`},t),{},{key:t.key})):e===`img`?(0,h.createElement)(`img`,A(A({alt:``},t),{},{key:t.key})):h.createElement(e,t)}var ZB={style:{transition:`none`}},QB=`data-base-ui-click-trigger`,$B={fallbackAxisSide:`end`},eV={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},tV=[`render`,`className`,`style`,`children`,`container`,`portalOwnerRole`],nV=h.createContext(null);process.env.NODE_ENV!==`production`&&(nV.displayName=`PortalContext`);var rV=()=>h.useContext(nV),iV=Qz(`portal`);function aV(e={}){let{ref:t,container:r,componentProps:i=EL,elementProps:a}=e,o=gB(),s=rV(),c=s==null?void 0:s.portalNode,[l,u]=h.useState(null),[d,f]=h.useState(null),p=mz(e=>{e!==null&&f(e)}),m=h.useRef(null);DL(()=>{var e,t;if(r===null){m.current&&(m.current=null,f(null),u(null));return}let n=(e=(t=r&&(JS(r)?r:r.current))==null?c:t)==null?document.body:e;n==null?m.current&&(m.current=null,f(null),u(null)):m.current!==n&&(m.current=n,f(null),u(n))},[r,c]);let g=VB(`div`,i,{ref:[t,p],props:[{id:o,[iV]:``},a]}),_=l&&g?n.createPortal(g,l):null;return{node:d,nodeId:h.isValidElement(g)?g.props.id:void 0,subtree:_}}var oV=h.forwardRef(function(e,t){let{render:r,className:i,style:a,children:o,container:s,portalOwnerRole:c}=e,{node:l,nodeId:u,subtree:d}=aV({container:s,ref:t,componentProps:e,elementProps:G(e,tV)}),f=h.useRef(null),p=h.useRef(null),m=h.useRef(null),g=h.useRef(null),[_,v]=h.useState(null),y=h.useRef(!1),b=_==null?void 0:_.modal,x=_==null?void 0:_.open,S=!!_&&!_.modal&&_.open&&!!l;h.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&qz(e)&&(e.type===`focusin`?y.current&&(Yz(l),y.current=!1):(Jz(l),y.current=!0))}return nz(tz(l,`focusin`,e,!0),tz(l,`focusout`,e,!0))},[l,b]),DL(()=>{l&&x===!0&&y.current&&(Yz(l),y.current=!1)},[x,l]);let C=h.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return(0,X.jsxs)(h.Fragment,{children:[d,(0,X.jsxs)(nV.Provider,{value:C,children:[S&&l&&(0,X.jsx)(Tz,{"data-type":`outside`,ref:f,onFocus:e=>{if(qz(e,l)){var t;(t=m.current)==null||t.focus()}else{let e=Kz(_?_.domReference:null);e==null||e.focus()}}}),S&&l&&(0,X.jsx)(`span`,{role:c,"aria-owns":u,style:eV}),l&&n.createPortal(o,l),S&&l&&(0,X.jsx)(Tz,{"data-type":`outside`,ref:p,onFocus:e=>{if(qz(e,l)){var t;(t=g.current)==null||t.focus()}else{let t=Gz(_?_.domReference:null);t==null||t.focus(),_!=null&&_.closeOnFocusOut&&(_==null||_.onOpenChange(!1,BR(`focus-out`,e.nativeEvent)))}}})]})]})});process.env.NODE_ENV!==`production`&&(oV.displayName=`FloatingPortal`);function sV(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var cV=h.createContext(null);process.env.NODE_ENV!==`production`&&(cV.displayName=`FloatingNodeContext`);var lV=h.createContext(null);process.env.NODE_ENV!==`production`&&(lV.displayName=`FloatingTreeContext`);var uV=()=>{var e;return((e=h.useContext(cV))==null?void 0:e.id)||null},dV=e=>{let t=h.useContext(lV);return e==null?t:e};function fV(e){return e==null?e:`current`in e?e.current:e}function pV(e,t){let n=KS(sR(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(eR(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var mV=20,hV=[];function gV(){hV=hV.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function _V(e){gV(),e&&GS(e)!==`body`&&(hV.push(new WeakRef(e)),hV.length>mV&&(hV=hV.slice(-20)))}function vV(){var e;return gV(),(e=hV[hV.length-1])==null?void 0:e.deref()}function yV(e){return e?Vz(e)?e:Uz(e)[0]||e:null}function bV(e){var t;if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!((t=e.getAttribute(`role`))!=null&&t.includes(`dialog`)))return;let n=Hz(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Vz(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);n.length===0?r!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function xV(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=mz(()=>{var e;return(e=x.current.floatingContext)==null?void 0:e.nodeId}),C=i===!1,w=MR(v)&&C,T=lz(i),E=lz(a),D=lz(o),O=lz(u),k=lz(_),A=dV(m),j=rV(),M=h.useRef(!1),N=h.useRef(!1),P=h.useRef(!1),F=h.useRef(null),I=h.useRef(``),L=h.useRef(``),R=h.useRef(null),z=h.useRef(null),B=rz(R,p,j==null?void 0:j.beforeInsideRef),ee=rz(z,j==null?void 0:j.afterInsideRef),V=FL(),te=FL(),ne=xz(),H=j!=null,U=PR(y),re=mz((e=U)=>e?Uz(e):[]),ie=mz(()=>{var e;return(e=g==null?void 0:g().filter(e=>e!=null))==null?[]:e});h.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&aR(U,iR(Sz(U)))&&re().length===0&&!w&&QL(e)}return tz(Sz(U),`keydown`,e)},[r,U,c,w,re]),h.useEffect(()=>{if(r||!_)return;let e=Sz(U);function t(){P.current=!1}function n(e){let t=sR(e),n=ie(),r=aR(y,t)||aR(v,t)||aR(j==null?void 0:j.portalNode,t)||n.some(e=>e===t||aR(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,oR(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,te.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return nz(tz(e,`pointerdown`,n,!0),tz(e,`pointerup`,t,!0),tz(e,`pointercancel`,t,!0),tz(e,`keydown`,i,!0),t)},[r,y,v,U,_,j,te,ie]),h.useEffect(()=>{if(r||!l)return;let e=Sz(U);function n(){N.current=!0,te.start(0,()=>{N.current=!1})}function i(e){let t=sR(e);Vz(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=sR(n);c&&r==null&&a!=null&&aR(y,a)&&_V(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=ie(),p=(r==null?void 0:r.hasAttribute(Qz(`focus-guard`)))&&[R.current,z.current,j==null?void 0:j.beforeInsideRef.current,j==null?void 0:j.afterInsideRef.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,fV(f),fV(d)].includes(r),m=!(aR(v,r)||aR(y,r)||aR(r,y)||aR(j==null?void 0:j.portalNode,r)||u.some(e=>e===r||aR(e,r))||l.hasMatchingElement(e=>aR(e,r))||p||A&&(Xz(A.nodesRef.current,o).find(e=>{var t,n;return aR((t=e.context)==null?void 0:t.elements.floating,r)||aR((n=e.context)==null?void 0:n.elements.domReference,r)})||Zz(A.nodesRef.current,o).find(e=>{var t,n,i;return[(t=e.context)==null?void 0:t.elements.floating,PR((n=e.context)==null?void 0:n.elements.floating)].includes(r)||((i=e.context)==null?void 0:i.elements.domReference)===r})));if(i===v&&U&&bV(U),s&&i!==v&&!Dz(a)&&iR(e)===e.body){if(XS(U)&&(U.focus(),s===`popup`)){ne.request(()=>{U.focus()});return}let e=re(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;XS(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&m&&!N.current&&(w||r!==vV())&&(M.current=!0,t.setOpen(!1,BR(qR,n)))})}function o(){P.current||(x.current.insideReactTree=!0,V.start(0,()=>{x.current.insideReactTree=!1}))}let u=XS(v)?v:null;if(y||u)return nz(u&&tz(u,`focusout`,a),u&&tz(u,`pointerdown`,n),y&&tz(y,`focusin`,i),y&&tz(y,`focusout`,a),y&&j&&tz(y,`focusout`,o,!0))},[r,v,y,U,c,A,j,t,l,s,re,w,S,x,V,te,ne,d,f,ie]),h.useEffect(()=>{var e,t;if(r||!y||!_)return;let n=Array.from((j==null||(e=j.portalNode)==null?void 0:e.querySelectorAll(`[${Qz(`portal`)}]`))||[]),i=(t=(A?Zz(A.nodesRef.current,S()):[]).find(e=>{var t;return MR(((t=e.context)==null?void 0:t.elements.domReference)||null)}))==null||(t=t.context)==null?void 0:t.elements.domReference,a=dB([y,...n,R.current,z.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,...ie(),i,fV(f),fV(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),o=dB([y,...n].filter(e=>e!=null));return()=>{o(),a()}},[_,r,v,y,c,j,w,A,S,d,f,ie]),DL(()=>{if(!_||r||!XS(U))return;I.current=``,L.current=``;let e=Sz(U),t=iR(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||aR(U,t))return;let i=null,a=()=>(i==null&&(i=re(U)),i[0]||U),o;o=r===!0||r===null?a():fV(r),o=o||a();let s=aR(U,iR(e)),c=x.current.openEvent,l=(c==null?void 0:c.type)===`mousedown`&&eR(c);eB(o,{sync:l,preventScroll:o===U,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=iR(e);return!(t!==o&&aR(U,t))}})})},[r,_,U,re,T,O,k,x]);let W=h.useRef(null);DL(()=>{if(r||!U){W.current=null;return}W.current&&(W.current.cancelled=!0,W.current=null);let e=Sz(U),t=iR(e),n=O.current==null;_V(t);function i(e){var t;if(e.open||(I.current=pV(e.nativeEvent,L.current)),(e.reason===`focus-out`&&(t=e.triggerElement)!=null&&t.hasAttribute(Qz(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(eR(e.nativeEvent)||tR(e.nativeEvent))M.current=!1;else{let e=!1;Sz(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v!=null&&v.isConnected?v:null,o=t!=null&&t.isConnected&&GS(t)!==`body`?t:null,s=n?o||a:a||o;return s||(s=vV()||null),typeof i==`boolean`?s:fV(i)||s||null}return()=>{b.off(`openchange`,i);let t=iR(e),n=ie(),r=aR(y,t)||n.some(e=>e===t||aR(e,t))||A&&Xz(A.nodesRef.current,S(),!1).some(e=>{var n;return aR((n=e.context)==null?void 0:n.elements.floating,t)}),o=E.current,s=I.current,c=a(s),l={cancelled:!1};W.current=l,queueMicrotask(()=>{var n;W.current===l&&(W.current=null);let i=yV(c),a=(n=D.current)==null?typeof o!=`boolean`:n;if(!l.cancelled&&o&&!M.current&&XS(i)&&(a||i===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),i.focus(e)}M.current=!1})}},[r,y,U,E,D,O,b,A,v,S,ie]),DL(()=>{if(!YL||_||!y)return;let e=iR(Sz(y));XS(e)&&AR(e)&&aR(y,e)&&e.blur()},[_,y]),DL(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,l,v]),DL(()=>{if(!r&&U)return bV(U),()=>{queueMicrotask(gV)}},[r,U]);let ae=!r&&(!c||!w)&&(H||c);return(0,X.jsxs)(h.Fragment,{children:[ae&&(0,X.jsx)(Tz,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=re();eB(e[e.length-1])}else if(j!=null&&j.portalNode){if(M.current=!1,qz(e,j.portalNode)){let e=Gz(v);e==null||e.focus()}else{var t;(t=fV(f==null?j.beforeOutsideRef:f))==null||t.focus()}}}}),n,ae&&(0,X.jsx)(Tz,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c)eB(re()[0]);else if(j!=null&&j.portalNode){if(l&&(M.current=!0),qz(e,j.portalNode)){let e=Kz(v);e==null||e.focus()}else{var t;(t=fV(d==null?j.afterOutsideRef:d))==null||t.focus()}}}})]})}function SV(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=HR}=t,l=e.context.dataRef,u=h.useRef(void 0),d=xz(),f=FL(),p=h.useMemo(()=>{function t(t,n,r,i){let a=BR(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=nR(e.pointerType,!0)&&tR(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||nR(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=sR(s),p=AR(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:nR(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return h.useMemo(()=>n?{reference:p}:EL,[n,p])}function CV(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){var a;let o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},s=t.axis===`x`||t.axis===`both`,c=t.axis===`y`||t.axis===`both`,l=[`mouseenter`,`mousemove`].includes(((a=t.dataRef.current.openEvent)==null?void 0:a.type)||``)&&t.pointerType!==`touch`,u=t.axis===`y`?o.width:0,d=t.axis===`x`?o.height:0,f=o.x,p=o.y;return n==null&&t.x&&s&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),f-=n||0,p-=r||0,(!i||l)&&(f=s&&t.x!=null?t.x:f,p=c&&t.y!=null?t.y:p),i=!0,{width:u,height:d,x:f,y:p,top:p,right:f+u,bottom:p+d,left:f}}}}function wV(e){return e!=null&&e.clientX!=null}function TV(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=h.useRef(!1),l=h.useRef(null),[u,d]=h.useState(),[f,p]=h.useState([]),m=mz(t=>{e.set(`positionReference`,t)}),g=mz((t,n,i)=>{c.current||(!s.current.openEvent||wV(s.current.openEvent))&&e.set(`positionReference`,CV(i==null?o:i,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),_=mz(e=>{i?l.current||(g(e.clientX,e.clientY,e.currentTarget),p([])):g(e.clientX,e.clientY,e.currentTarget)}),v=nR(u)?a:i;h.useEffect(()=>{if(!n){m(o);return}if(!v)return;function e(){var e;(e=l.current)==null||e.call(l),l.current=null}let t=KS(a);function r(t){let n=sR(t);aR(a,n)?e():g(t.clientX,t.clientY)}return!s.current.openEvent||wV(s.current.openEvent)?l.current=tz(t,`mousemove`,r):m(o),e},[v,n,a,s,o,e,g,m,f]),h.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),h.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),h.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=h.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return h.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function EV(){return!1}function DV(e){var t,n;return{escapeKey:typeof e==`boolean`?e:(t=e==null?void 0:e.escapeKey)!=null&&t,outsidePress:typeof e==`boolean`?e:(n=e==null?void 0:e.outsidePress)==null||n}}function OV(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=EV,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=dV(c),m=mz(typeof i==`function`?i:()=>!1),g=typeof i==`function`?m:i,_=g!==!1,v=mz(()=>a),{escapeKey:y,outsidePress:b}=DV(s),x=h.useRef(!1),S=h.useRef(!1),C=h.useRef(!1),w=h.useRef(!1),T=h.useRef(!1),E=h.useRef(``),D=h.useRef(null),O=FL(),k=FL(),A=FL(),j=mz(()=>{k.clear(),d.current.insideReactTree=!1}),M=mz(e=>{var t;let n=(t=d.current.floatingContext)==null?void 0:t.nodeId;return(p?Xz(p.nodesRef.current,n):[]).some(t=>{var n;return((n=t.context)==null?void 0:n.open)&&!t.context.dataRef.current[e]})}),N=mz(t=>OR(t,e.select(`floatingElement`))||OR(t,e.select(`domReferenceElement`))),P=mz(t=>{o()&&e.setOpen(!1,BR(HR,t.nativeEvent))}),F=mz(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=$L(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=BR(JR,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=mz(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=mz(t=>{if(!l||!n||t.button!==0)return;let r=sR(t.nativeEvent);aR(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=mz(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});h.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),h.useEffect(()=>j,[j]),h.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new PL,i=Sz(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(YL?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){var t;let n=(t=d.current.floatingContext)==null?void 0:t.nodeId,r=p&&Xz(p.nodesRef.current,n).some(t=>{var n;return OR(e,(n=t.context)==null?void 0:n.elements.floating)});return N(e)||r}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=sR(n),i=`[${Qz(`inert`)}]`,a=YS(r)?r.getRootNode():null,o=Array.from((ZS(a)?a:Sz(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>aR(e,r))))return;let c=YS(r)?r:null;for(;c&&!cC(c);){let e=dC(c);if(cC(e)||!YS(e))break;c=e}if(!(o.length&&YS(r)&&!kR(r)&&!aR(r,e.select(`floatingElement`))&&o.every(e=>!aR(c,e)))){if(XS(r)&&!(`touches`in n)){let e=cC(r),t=lC(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(f()===`intentional`){if(n.detail!==0&&!eR(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,BR(GR,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=sR(e);if(!n)return;let r=tz(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function ee(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function V(e){L(e,ee)}function te(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}let H=nz(r&&nz(tz(i,`keydown`,F),tz(i,`compositionstart`,a),tz(i,`compositionend`,o)),_&&nz(tz(i,`click`,z,!0),tz(i,`pointerdown`,z,!0),tz(i,`pointerup`,B,!0),tz(i,`pointercancel`,B,!0),tz(i,`mousedown`,z,!0),tz(i,`mouseup`,B,!0),tz(i,`touchstart`,R,{capture:!0,passive:!0}),tz(i,`touchmove`,V,{capture:!0,passive:!0}),tz(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),t.clear(),c(),C.current=!1}},[d,u,r,_,g,l,n,y,b,F,j,v,M,N,p,e,O,A]);let z=h.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=h.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return h.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function kV(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),DL(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};YS(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function AV(e,t=!1,n=!1,r=!1){let[i,a]=h.useState(e&&t?`idle`:void 0),[o,s]=h.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),DL(()=>{if(!e&&o&&i!==`ending`&&n){let e=bz.request(()=>{a(`ending`)});return()=>{bz.cancel(e)}}},[e,o,i,n]),DL(()=>{if(!e||t||i===void 0)return;let n=bz.request(()=>{a(void 0)});return()=>{bz.cancel(n)}},[t,e,i]),DL(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=bz.request(()=>{a(`idle`)});return()=>{bz.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function jV(e,t){return e.getAnimations(t).filter(e=>{var t;let n=(t=e.effect)==null?void 0:t.getTiming();return(n==null?void 0:n.duration)!==1/0&&(n==null?void 0:n.iterations)!==1/0})}var MV=null;function NV(e){if(!MV){let e=[];MV=e,queueMicrotask(()=>{MV=null,n.flushSync(()=>{for(let t of e)t()})})}MV.push(e)}function PV(e,t=!1,r=!1){let i=xz();return mz((a,o=null)=>{i.cancel();let s=fV(e);if(s==null)return;let c=s,l=()=>{r?NV(()=>{o!=null&&o.aborted||a()}):n.flushSync(a)};if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){a();return}function u(){Promise.all(jV(c).map(e=>e.finished.then(wL))).then(()=>{o!=null&&o.aborted||l()},()=>{o!=null&&o.aborted||(jV(c).some(e=>e.pending||e.playState!==`finished`)?u():l())})}if(t){let e=uR;if(!c.hasAttribute(e)){i.request(u);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),u())});t.observe(c,{attributes:!0,attributeFilter:[e]}),o==null||o.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else i.request(u)})}function FV(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=mz(a),s=PV(r,n,i);h.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function IV(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=mz(i),{mounted:c,setMounted:l,transitionStatus:u}=AV(t,!1,!1,o),d=!t&&r;DL(()=>{t&&s(!1)},[t,s]);let f=h.useRef(c),p=h.useRef(!1),m=fB(),g=()=>{f.current=!1,l(!1),a()};DL(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&g())});let _=mz(()=>{f.current&&(t?(p.current=!0,m()):g())});return FV({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}j();var LV={tabIndex:-1,[cR]:``};function RV(e){return t=>t!==`touch`||e.current}function zV(e,t=!1){let n=gB(),r=uV()!=null,i=gL(()=>e(n,r)).current;return kV({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function BV({handle:e,store:t}){return DL(()=>e.attachStore(t),[e,t]),null}function VV(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function HV(e,t){let n=h.useRef(null);return mz(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),VV(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),VV(t))})}function UV(e,t,n,r=!1){var i;let a=e.preventUnmountingOnClose;t?a=!1:r&&(a=!0);let o=(i=n==null?void 0:n.id)==null?null:i,s=e.activeTriggerId,c=e.activeTriggerElement;return(o||t)&&(s=o,c=n==null?null:n),{open:t,preventUnmountingOnClose:a,activeTriggerId:s,activeTriggerElement:c,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function WV(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function GV(e,t,r,i={}){var a,o,s;let c=r.reason,l=c===UR,u=t&&c===`trigger-focus`,d=!t&&(c===`trigger-press`||c===`escape-key`),f=WV(r);if((a=(o=e.context).onOpenChange)==null||a.call(o,t,r),r.isCanceled)return;(s=i.onBeforeDispatch)==null||s.call(i),e.state.floatingRootContext.dispatchOpenChange(t,r);let p=()=>{let n=UV(e.state,t,r.trigger,f()),a=A(A({},i.extraState),n);u?a.instantType=`focus`:d?a.instantType=`dismiss`:l&&(a.instantType=void 0),e.update(a)};l?n.flushSync(p):p()}function KV(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=HV(e,n),o=mz(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e=A({activeTriggerElement:t},i?r:null);n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i=A({activeTriggerId:e==null?null:e,activeTriggerElement:t},r);n.update(i)}}),s=mz(e=>{a(e),e&&o(e)});return DL(()=>(s(t.current),()=>s(null)),[s,t,n,e]),DL(()=>{if(i){let e=A({activeTriggerElement:t.current},r);n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function qV(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=h.useRef(null),i=e.useState(`open`);DL(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=BR(VR);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function JV(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=IV({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){var e,r;t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(e=(r=t.context).onOpenChangeComplete)==null||e.call(r,!1)}});return gL(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function YV(e,t){e.useSyncedValues(t),DL(()=>()=>{e.update({activeTriggerProps:EL,inactiveTriggerProps:EL,popupProps:EL})},[e])}function XV(e,t){DL(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),DL(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}E();var ZV;function QV(e){ZV!=null||(ZV=new WeakMap);let t=ZV.get(e);return t||(t=new WeakMap,ZV.set(e,t)),t}var $V=class{constructor(){T(this,`idMap`,new Map)}add(e,t){if(process.env.NODE_ENV!==`production`){let n=QV(this),r=n.get(t);if(r!==void 0&&r!==e)throw Error(`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`);let i=this.idMap.get(e);i!==void 0&&i!==t&&n.delete(i),n.set(t,e)}this.idMap.set(e,t)}delete(e){if(process.env.NODE_ENV!==`production`){let n=this.idMap.get(e);if(n!==void 0){var t;ZV==null||(t=ZV.get(this))==null||t.delete(n)}}this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},eH=u((e=>{var t=Ed();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),tH=u((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=Ed(),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),nH=u(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?eH():tH()})),rH=u((e=>{var t=Ed(),n=nH();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),iH=u((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=Ed(),r=nH(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),aH=u(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?rH():iH()})),oH=nH(),sH=aH(),cH=vB(19)?dH:fH;function lH(e,t,n,r,i){return cH(e,t,n,r,i)}function uH(e,t,n,r,i){let a=h.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,oH.useSyncExternalStore)(e.subscribe,a,a)}bL({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,oH.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function dH(e,t,n,r,i){let a=yL();if(!a)return uH(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function fH(e,t,n,r,i){return(0,sH.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}E(),j();var pH=class{static create(e){return new this(e)}constructor(e){T(this,`subscribe`,e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),T(this,`getSnapshot`,()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState(A(A({},this.state),e));return}}set(e,t){Object.is(this.state[e],t)||this.setState(A(A({},this.state),{},{[e]:t}))}notifyAll(){let e=A({},this.state);this.setState(e)}use(e,t,n,r){return lH(this,e,t,n,r)}};j();var mH=class extends pH{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){h.useDebugValue(e);let n=this;DL(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;DL(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;if(process.env.NODE_ENV!==`production`){h.useDebugValue(e,e=>Object.keys(e));let t=h.useRef(Object.keys(e)).current,n=Object.keys(e);(t.length!==n.length||t.some((e,t)=>e!==n[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}DL(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){h.useDebugValue(e);let n=this,r=t!==void 0;if(DL(()=>{r&&!Object.is(n.state[e],t)&&n.setState(A(A({},n.state),{},{[e]:t}))},[n,e,t,r]),process.env.NODE_ENV!==`production`){var i;let t=(i=this.controlledValues)==null?this.controlledValues=new Map:i;t.has(e)||t.set(e,r);let n=t.get(e);n!==void 0&&n!==r&&console.error(`A component is changing the ${n?``:`un`}controlled state of ${e.toString()} to be ${n?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return h.useDebugValue(e),lH(this,this.selectors[e],t,n,r)}useContextCallback(e,t){h.useDebugValue(e);let n=mz(t==null?wL:t);this.context[e]=n}useStateSetter(e){let t=h.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};E(),j();var hH=[`syncOnly`,`nested`,`onOpenChange`,`triggerElements`],gH={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>{var t;return(t=e.positionReference)==null?e.referenceElement:t},floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},_H=class extends mH{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i}=e,a=G(e,hH);super(A(A({},a),{},{positionReference:a.referenceElement,domReferenceElement:a.referenceElement}),{onOpenChange:r,dataRef:{current:{}},events:sV(),nested:n,triggerElements:i},gH),T(this,`syncOpenEvent`,(e,t)=>{(!e||!this.state.open||t!=null&&rR(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),T(this,`dispatchOpenChange`,(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}),T(this,`setOpen`,(e,t)=>{var n,r;if(this.syncOnly){var i,a;(i=(a=this.context).onOpenChange)==null||i.call(a,e,t)}else this.dispatchOpenChange(e,t),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t)}),this.syncOnly=t}};function vH(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new _H({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:EL,inactiveTriggerProps:EL,popupProps:EL}}var yH=e=>{var t;return(t=e.triggerIdProp)==null?e.activeTriggerId:t},bH=e=>{var t;return(t=e.openProp)==null?e.open:t},xH=e=>{var t,n;return((t=(n=e.popupElement)==null?void 0:n.id)==null?e.floatingId:t)||void 0};function SH(e,t){return t!==void 0&&bH(e)&&yH(e)===t}function CH(e,t){return SH(e,t)?!0:t!==void 0&&bH(e)&&yH(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var wH={open:bH,mounted:e=>e.mounted,transitionStatus:e=>bH(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:yH,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:xH,isTriggerActive:(e,t)=>t!==void 0&&yH(e)===t,isOpenedByTrigger:(e,t)=>SH(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&yH(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>CH(e,t)?xH(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function TH(e){let t=h.useCallback(t=>e===void 0?wL:e.subscribeStore(t),[e]),n=h.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,oH.useSyncExternalStore)(t,n,()=>e==null?void 0:e.serverStore)}var EH=GL&&YL;function DH(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=h.useRef(!1),s=h.useRef(null),c=h.useRef(!0),l=FL();h.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=KS(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&XS(t)&&t===iR(Sz(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return nz(tz(r,`blur`,i),EH&&tz(r,`keydown`,a,!0),EH&&tz(r,`pointerdown`,l,!0))},[e,n]),h.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);YS(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=h.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=sR(n.nativeEvent);if(YS(a)){if(EH&&!n.relatedTarget){if(!c.current&&!AR(a))return}else if(!NR(a))return}let u=DR(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,BR(WR,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,BR(WR,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=YS(r)&&r.hasAttribute(Qz(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{var t;let n=e.select(`domReferenceElement`),s=iR(Sz(n));!r&&s===n||aR((t=a.current.floatingContext)==null?void 0:t.refs.floating.current,s)||aR(n,s)||o||DR(r==null?s:r,e.context.triggerElements)||e.setOpen(!1,BR(WR,i))})}}},[a,r,e,l]);return h.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}E();var OH=class e{constructor(){T(this,`pointerType`,void 0),T(this,`interactedInside`,!1),T(this,`handler`,void 0),T(this,`blockMouseMove`,!0),T(this,`performedPointerEventsMutation`,!1),T(this,`pointerEventsScopeElement`,null),T(this,`pointerEventsReferenceElement`,null),T(this,`pointerEventsFloatingElement`,null),T(this,`restTimeoutPending`,!1),T(this,`openChangeTimeout`,new PL),T(this,`restTimeout`,new PL),T(this,`handleCloseOptions`,void 0),T(this,`dispose`,()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),T(this,`disposeEffect`,()=>this.dispose)}static create(){return new e}},kH=new WeakMap;function AH(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&kH.get(t)===e){var n,r,i;(n=e.pointerEventsScopeElement)==null||n.style.removeProperty(`pointer-events`),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty(`pointer-events`),(i=e.pointerEventsFloatingElement)==null||i.style.removeProperty(`pointer-events`),kH.delete(t)}e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function jH(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=kH.get(n);a&&a!==e&&AH(a),AH(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,kH.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function MH(e){let t=e.context.dataRef.current,n=gL(()=>{var e;return(e=t.hoverInteractionState)==null?OH.create():e}).current;return t.hoverInteractionState||(t.hoverInteractionState=n),ML(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function NH(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=dV(),u=uV(),d=MH(e),f=FL(),p=mz(()=>{var e;return RR((e=c.current.openEvent)==null?void 0:e.type,d.interactedInside)}),m=mz(()=>{var e;return zR((e=c.current.openEvent)==null?void 0:e.type)}),g=mz(()=>{AH(d)});DL(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),h.useEffect(()=>g,[g]),DL(()=>{var e;if(n&&a&&(e=d.handleCloseOptions)!=null&&e.blockPointerEvents&&m()&&YS(s)&&o){var t,r,i,c,f,p,h;let e=s,n=o,a=Sz(o),m=l==null||(t=l.nodesRef.current.find(e=>e.id===u))==null||(t=t.context)==null?void 0:t.elements.floating;m&&(m.style.pointerEvents=``);let _=d.pointerEventsScopeElement===n?null:d.pointerEventsScopeElement,v=m===n?null:m,y=(r=(i=(c=(f=(p=d.handleCloseOptions)==null||(h=p.getScope)==null?void 0:h.call(p))==null?_:f)==null?v:c)==null?oR(e,`[data-rootownerid]`):i)==null?a.body:r;return jH(d,{scopeElement:y,referenceElement:e,floatingElement:n}),()=>{g()}}},[n,a,s,o,d,m,l,u,g]),h.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Xz(l.nodesRef.current,u).length>0)}function a(t){let n=IR(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,BR(UR,t)),l==null||l.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=sR(e);jR(t)?d.interactedInside=oR(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function h(){d.openChangeTimeout.clear(),f.clear(),l==null||l.events.off(`floating.closed`,v),g()}function _(n){var r,o;if(t()&&l){l.events.on(`floating.closed`,v);return}if(DR(n.relatedTarget,e.context.triggerElements))return;let s=(r=(o=c.current.floatingContext)==null?void 0:o.nodeId)==null?i:r,u=n.relatedTarget;l&&s&&YS(u)&&Xz(l.nodesRef.current,s,!1).some(e=>{var t;return aR((t=e.context)==null?void 0:t.elements.floating,u)})||(d.handler?d.handler(n):(g(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,BR(UR,n)),l.events.emit(`floating.closed`,n)})}let y=o;return nz(y&&tz(y,`mouseenter`,h),y&&tz(y,`mouseleave`,_),y&&tz(y,`pointerdown`,s,!0),()=>{l==null||l.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,g,d,l,u,f])}j();var PH={current:null};function FH(e,t={}){let{enabled:r=!0,delay:i=0,handleClose:a=null,mouseOnly:o=!1,restMs:s=0,move:c=!0,triggerElementRef:l=PH,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:p,shouldOpen:m,guardStaleOpen:g=!1}=t,{dataRef:_,events:v}=e.context,y=dV(u),b=MH(e),x=h.useRef(!1),S=lz(a),C=lz(i),w=lz(s),T=lz(r),E=lz(m),D=lz(p),O=mz(()=>{var e;return RR((e=_.current.openEvent)==null?void 0:e.type,b.interactedInside)}),k=mz(()=>{var e;return((e=E.current)==null?void 0:e.call(E))!==!1}),j=mz((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!aR(t,n);if(!YS(r))return!1;let a=r;return i.hasMatchingElement(e=>aR(e,a))&&(!t||!aR(t,a))}),M=mz(()=>{b.handler&&(Sz(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),b.handler=void 0)}),N=mz(()=>{AH(b)});return d&&(b.handleCloseOptions=a==null?void 0:a.__options),h.useEffect(()=>M,[M]),h.useEffect(()=>{if(!r)return;function e(e){e.open?x.current=!1:(x.current=e.reason===UR,M(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[r,v,b,M]),h.useEffect(()=>{var t;if(!r)return;function n(t,n=!0){let r=IR(C.current,`close`,b.pointerType);r?b.openChangeTimeout.start(r,()=>{e.setOpen(!1,BR(UR,t)),y==null||y.events.emit(`floating.closed`,t)}):n&&(b.openChangeTimeout.clear(),e.setOpen(!1,BR(UR,t)),y==null||y.events.emit(`floating.closed`,t))}let i=(t=l.current)==null?d?e.select(`domReferenceElement`):null:t;if(!YS(i))return;function a(t){var n,r,i;if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,o&&!nR(b.pointerType))return;let a=LR(w.current),s=IR(C.current,`open`,b.pointerType),c=sR(t),l=(n=t.currentTarget)==null?null:n,u=e.select(`domReferenceElement`),d=l;if(YS(c)&&!e.context.triggerElements.hasElement(c)){for(let t of e.context.triggerElements.elements())if(aR(t,c)){d=t;break}}YS(l)&&YS(u)&&!e.context.triggerElements.hasElement(l)&&aR(l,u)&&(d=u);let f=d!=null&&j(u,d,c),p=e.select(`open`),m=(r=(i=D.current)==null?void 0:i.call(D))==null?e.select(`transitionStatus`)===`ending`:r,h=!p&&m&&x.current,g=!f&&YS(d)&&YS(u)&&aR(u,d)&&h,_=a>0&&!s,v=f&&(p||h)||g,y=!p||f;v?k()&&e.setOpen(!0,BR(UR,t,d)):_||(s?b.openChangeTimeout.start(s,()=>{y&&k()&&e.setOpen(!0,BR(UR,t,d))}):y&&k()&&e.setOpen(!0,BR(UR,t,d)))}function s(t){var r;if(O()){N();return}M();let i=Sz(e.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let a=(r=_.current.floatingContext)==null?f==null?void 0:f():r;if(!DR(t.relatedTarget,e.context.triggerElements)){if(S.current&&a){e.select(`open`)||b.openChangeTimeout.clear();let r=l.current;b.handler=S.current(A(A({},a),{},{tree:y,x:t.clientX,y:t.clientY,onClose(){N(),M(),T.current&&!O()&&r===e.select(`domReferenceElement`)&&n(t,!0)}})),i.addEventListener(`mousemove`,b.handler),b.handler(t)}else b.pointerType===`touch`&&aR(e.select(`floatingElement`),t.relatedTarget)||n(t)}}function u(e){aR(i,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let p=g?tz(i,`mouseout`,u):void 0;return c?nz(tz(i,`mousemove`,a,{once:!0}),tz(i,`mouseenter`,a),tz(i,`mouseleave`,s),p):nz(tz(i,`mouseenter`,a),tz(i,`mouseleave`,s),p)},[M,N,_,C,e,r,S,b,d,j,O,o,c,w,l,y,T,f,D,k,g]),h.useMemo(()=>{if(!r)return;function t(e){b.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){var r;let{nativeEvent:i}=t,a=t.currentTarget,s=e.select(`domReferenceElement`),c=e.select(`open`),l=j(s,a,t.target);if(o&&!nR(b.pointerType))return;if(c&&l&&(r=b.handleCloseOptions)!=null&&r.blockPointerEvents){let t=e.select(`floatingElement`);if(t){var u,d,f;let e=(u=(d=b.handleCloseOptions)==null||(f=d.getScope)==null?void 0:f.call(d))==null?a.ownerDocument.body:u;jH(b,{scopeElement:e,referenceElement:a,floatingElement:t})}}let p=LR(w.current);if(c&&!l||p===0||!l&&b.restTimeoutPending&&Math.pow(t.movementX,2)+Math.pow(t.movementY,2)<2)return;b.restTimeout.clear();function m(){if(b.restTimeoutPending=!1,O())return;let t=e.select(`open`);!b.blockMouseMove&&(!t||l)&&k()&&e.setOpen(!0,BR(UR,i,a))}b.pointerType===`touch`?n.flushSync(()=>{m()}):l&&c?m():(b.restTimeoutPending=!0,b.restTimeout.start(p,m))}}},[r,b,O,j,o,e,w,k])}j();var IH=.1,LH=IH*IH,RH=.5;function zH(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function BH(e,t,n,r,i,a,o,s,c,l){let u=!1;return zH(e,t,n,r,i,a)&&(u=!u),zH(e,t,i,a,o,s)&&(u=!u),zH(e,t,o,s,c,l)&&(u=!u),zH(e,t,c,l,n,r)&&(u=!u),u}function VH(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function HH(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function UH(e={}){let{blockPointerEvents:t=!1}=e,n=new PL,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r==null?void 0:r.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*LH;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=sR(r),g=r.type===`mouseleave`,_=aR(u,h),v=aR(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&YS(r.relatedTarget)&&aR(u,r.relatedTarget))return;function y(){return!!(s&&Xz(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=HH(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=HH(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=HH(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=HH(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!VH(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?RH/2:RH*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+RH+1,o=C||T?S.bottom-RH:S.top,s=C?T?S.bottom-RH:S.top:S.bottom-RH;M=BH(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?RH/2:RH*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-RH,o=C||T?S.top+RH:S.bottom,s=C?T?S.top+RH:S.bottom:S.top+RH;M=BH(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?RH/2:RH*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+RH+1,o=w||E?S.right-RH:S.left,s=w?E?S.right-RH:S.left:S.right-RH;M=BH(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?RH/2:RH*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-RH,o=w||E?S.left+RH:S.right,s=w?E?S.left+RH:S.right:S.left+RH;M=BH(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options=A(A({},e),{},{blockPointerEvents:t}),r}j(),E();var WH=A(A({},wH),{},{disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin}),GH=class extends mH{constructor(e,t,n){let r=new $V;super(KH(e,r,t,n),qH(r),WH),T(this,`setOpen`,(e,t)=>{GV(this,e,t,{extraState:{openChangeReason:t.reason}})})}cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,BR(HR,e))}};function KH(e,t,n,r=!1){return A(A({},vH(t,n,r)),{},{disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0},e)}function qH(e){return{popupRef:h.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var JH=xL(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=zV((e,t)=>new GH({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),g=!t&&m,_=p.useState(`activeTriggerId`),v=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),qV(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=JV(g,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=h.useRef(null);DL(()=>{m&&t&&p.setOpen(!1,BR(YR))},[m,t,p]),DL(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),DL(()=>{g&&_==null&&p.set(`payload`,void 0)},[p,_,g]),h.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,BR(XR))}),[b,p]);let E=g||v||!t&&a!==`none`;return(0,X.jsxs)(AL.Provider,{value:p,children:[l&&(0,X.jsx)(BV,{handle:l,store:p}),E&&(0,X.jsx)(YH,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});process.env.NODE_ENV!==`production`&&(JH.displayName=`TooltipRoot`);function YH({store:e,disabled:t,trackCursorAxis:n}){var r;let i=e.useState(`floatingRootContext`),a=OV(i,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),o=TV(i,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),s=h.useMemo(()=>OB(o.reference,a.reference),[o.reference,a.reference]);return YV(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:(r=a.floating)==null?EL:r}),null}function XH(e){return gB(e,`base-ui`)}var ZH=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(ZH.displayName=`TooltipProviderContext`);function QH(){return h.useContext(ZH)}var $H=[`render`,`className`,`style`,`handle`,`payload`,`disabled`,`delay`,`closeOnClick`,`closeDelay`,`id`],eU=`data-base-ui-tooltip-trigger`;function tU(e){let t=sR(e);return YS(t)?t:null}var nU=SL(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d}=e,f=G(e,$H),p=jL(!0),m=TH(a),g=m==null?p:m;if(!g)throw Error(process.env.NODE_ENV===`production`?kL(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let _=XH(d),v=g.useState(`isTriggerActive`,_),y=g.useState(`isOpenedByTrigger`,_),b=g.useState(`floatingRootContext`),x=h.useRef(null),S=u==null?0:u,{registerTrigger:C,isMountedByThisTrigger:w}=KV(_,x,g,{payload:o,closeOnClick:l,closeDelay:S}),T=QH(),{activeIdRef:E,delayRef:D,isInstantPhase:O,hasProvider:k}=ez(b,{open:y}),A=MH(b);g.useSyncedValue(`isInstantPhase`,O);let j=g.useState(`disabled`),M=s==null?j:s,N=lz(M),P=g.useState(`trackCursorAxis`),F=g.useState(`disableHoverablePopup`),I=h.useRef(!1),L=FL(),R=h.useRef(void 0);function z(){var e;return k&&E.current!=null?0:(e=c==null?T:c)==null?600:e}function B(e){let t=x.current;if(!t||!e)return!1;let n=oR(e,`[${eU}]`);return n!==null&&n!==t&&aR(t,n)}function ee(e){let t=B(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let V=FH(b,{enabled:!M,mouseOnly:!0,move:!1,handleClose:!F&&P!==`both`?UH():null,restMs:z,delay(){return u==null&&k?{close:IR(D.current,`close`)}:{close:S}},triggerElementRef:x,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),te=DH(b,{enabled:!M}).reference,ne=e=>{let t=I.current,n=tU(e),r=ee(n),i=x.current,a=i&&n&&aR(i,n);if(r&&g.select(`open`)&&g.select(`lastOpenChangeReason`)===`trigger-hover`)g.setOpen(!1,BR(UR,e));else if(t&&!r&&a&&!N.current&&!g.select(`open`)&&i&&nR(R.current)){let t=()=>{I.current||N.current||g.select(`open`)||g.setOpen(!0,BR(UR,e,i))},n=z();n===0?(L.clear(),t()):L.start(n,t)}},H=g.useState(`appliedTriggerProps`,w||P!==`none`);return VB(`button`,e,{state:{open:y},ref:[t,C,x],props:[V,te,H,{onMouseOver(e){ne(e.nativeEvent)},onFocus(e){B(tU(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,g.set(`closeOnClick`,l),l&&!g.select(`open`)&&g.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!g.select(`open`)&&g.cancelPendingOpen(e.nativeEvent)},id:_,[ER]:M?``:void 0,[eU]:M?void 0:``},f],stateAttributesMapping:CR})});process.env.NODE_ENV!==`production`&&(nU.displayName=`TooltipTrigger`);var rU=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(rU.displayName=`TooltipPortalContext`);function iU(){let e=h.useContext(rU);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?kL(70):`Base UI: <Tooltip.Portal> is missing.`);return e}var aU=[`children`,`container`,`className`,`render`,`style`],oU=h.forwardRef(function(e,t){let{children:r,container:i,className:a,render:o,style:s}=e,{node:c,subtree:l}=aV({container:i,ref:t,componentProps:e,elementProps:G(e,aU)});return!l&&!c?null:(0,X.jsxs)(h.Fragment,{children:[l,c&&n.createPortal(r,c)]})});process.env.NODE_ENV!==`production`&&(oU.displayName=`FloatingPortalLite`),j();var sU=[`keepMounted`],cU=h.forwardRef(function(e,t){let{keepMounted:n=!1}=e,r=G(e,sU);return jL().useState(`mounted`)||n?(0,X.jsx)(rU.Provider,{value:n,children:(0,X.jsx)(oU,A({ref:t},r))}):null});process.env.NODE_ENV!==`production`&&(cU.displayName=`TooltipPortal`);var lU=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(lU.displayName=`TooltipPositionerContext`);function uU(){let e=h.useContext(lU);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?kL(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}j();function dU(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=h.useState(null),d=h.useRef(null),f=dV(n),p=h.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=rw(A(A({},e),{},{elements:A(A({},p),l&&{reference:l})})),g=h.useCallback(e=>{let t=YS(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),_=h.useMemo(()=>A(A({},m.refs),{},{setPositionReference:g,domReference:d}),[m.refs,g]),v=h.useMemo(()=>A(A({},m.elements),{},{domReference:o}),[m.elements,o]),y=h.useMemo(()=>A(A({},m),{},{dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[m,_,v,t,r,s,c]);return DL(()=>{o&&(d.current=o)},[o]),DL(()=>{r.context.dataRef.current.floatingContext=y;let e=f==null?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),h.useMemo(()=>A(A({},m),{},{context:y,refs:_,elements:v,rootStore:r}),[m,_,v,y,r])}var fU=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(fU.displayName=`DirectionContext`);function pU(){var e;let t=h.useContext(fU);return(e=t==null?void 0:t.direction)==null?`ltr`:e}j();var mU=e=>({name:`arrow`,options:e,fn(t){return O(function*(){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=rS(e,t)||{};if(l==null)return{};let d=xS(u),f={x:n,y:r},p=lS(i),m=sS(p),h=yield o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,j=nS(D,k,O),M=!c.arrow&&aS(i)!=null&&k!==j&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,N=M?k<D?k-D:k-O:0;return{[p]:f[p]+N,data:A({[p]:j,centerOffset:k-j-N},M&&{alignmentOffset:N}),reset:M}})()}}),hU=(e,t)=>{let{name:n,fn:r}=mU(e);return{name:n,fn:r,options:[e,t]}},gU={name:`hide`,fn(e){return O(function*(){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=yield e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}})()}},_U={sideX:`left`,sideY:`top`},vU=`--available-width`,yU=`--available-height`,bU=`--anchor-width`,xU=`--anchor-height`,SU=`--transform-origin`;j();var CU=vU,wU=yU;function TU(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function EU(e,t,n){let{rects:r,placement:i}=e;return{side:TU(t,iS(i),n),align:aS(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function DU(e){return OU(e,dU)}function OU(e,t){var n,r,i;let{anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,sideOffset:c=0,align:l=`center`,alignOffset:u=0,collisionBoundary:d,collisionPadding:f=5,sticky:p=!1,arrowPadding:m=5,disableAnchorTracking:g=!1,inline:_,keepMounted:v=!1,floatingRootContext:y,mounted:b,collisionAvoidance:x,shift:S,nodeId:C,adaptiveOrigin:w,lazyFlip:T=!1,externalTree:E}=e,D=x.side||`flip`,O=x.align||`flip`,k=x.fallbackAxisSide||`end`,j=(n=S==null?void 0:S.crossAxis)!=null&&n,M=S==null?void 0:S.rootBoundary,N=typeof a==`function`?a:void 0,P=mz(N),F=N?P:a,I=lz(a),L=lz(b),R=pU()===`rtl`,[z,B]=h.useState(null);!b&&z!==null&&B(null);let ee=T===`placement`,V=z?iS(z):null,te=z&&ee?aS(z)||`center`:null,ne=V||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":R?`left`:`right`,"inline-start":R?`right`:`left`}[s],H=te||l,U=H===`center`?ne:`${ne}-${H}`,re=f;typeof re==`number`?re={top:re,right:re,bottom:re,left:re}:re&&(re={top:re.top||0,right:re.right||0,bottom:re.bottom||0,left:re.left||0});let ie=+(s===`bottom`),W=+(s===`top`),ae=+(s===`right`),G=+(s===`left`),oe={boundary:d===`clipping-ancestors`?`clippingAncestors`:d,padding:re},se=h.useRef(null),ce=lz(c),le=lz(u),ue=typeof c==`function`?0:c,de=typeof u==`function`?0:u,fe=[];_&&fe.push(_),fe.push(aw(e=>{let t=EU(e,s,R),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof le.current==`function`?le.current(t):le.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ue,de,R,s]));let pe=O===`none`&&D!==`shift`,me=!pe&&(p||j||D===`shift`),he=D===`none`?null:cw(A(A({},oe),{},{padding:{top:re.top+1+ie,right:re.right+1+G,bottom:re.bottom+1+W,left:re.left+1+ae},mainAxis:!j&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k})),ge=pe?null:ow(A(A({},oe),{},{rootBoundary:M,mainAxis:O!==`none`,crossAxis:me,limiter:p||j?void 0:sw(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=cS(iS(e.placement)),i=r===`y`?t:n,a=r===`y`?re.left+re.right:re.top+re.bottom;return{offset:i/2+a/2}})}),[oe,p,j,M,re,O]);D===`shift`||O===`shift`||H===`center`?fe.push(ge,he):fe.push(he,ge),fe.push(lw(A(A({},oe),{},{apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!L.current)return;let i=e.style;i.setProperty(CU,`${t}px`),i.setProperty(wU,`${n}px`);let a=KS(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(bU,`${u}px`),i.setProperty(xU,`${d}px`)}})),hU(e=>({element:se.current||Sz(e.elements.floating).createElement(`div`),padding:se.current?m:0}),[m]),{name:`transformOrigin`,fn(e){var t,n,r;let{elements:{floating:i},middlewareData:a,placement:o,platform:l,rects:u,y:d}=e,f=iS(o),p=aS(o),m=cS(f)===`y`,h=se.current,g=typeof c==`function`?c(EU(e,s,R)):c,_;if(!h&&p&&Math.abs(m?((t=a.shift)==null?void 0:t.x)||0:((n=a.shift)==null?void 0:n.y)||0)<=1){var v;_=p===`start`===(m&&((v=l.isRTL)==null?void 0:v.call(l,i))===!0)?`100%`:`0%`}else{var y,b;_=`${(m?((y=a.arrow)==null?void 0:y.x)||0:((b=a.arrow)==null?void 0:b.y)||0)+(m?(h==null?void 0:h.clientWidth)||0:(h==null?void 0:h.clientHeight)||0)/2}px`}let x=f===`top`||f===`left`?`calc(100% + ${g}px)`:`${-g}px`;return me&&m&&Math.abs(((r=a.shift)==null?void 0:r.y)||0)>g&&(x=`${u.reference.y+u.reference.height/2-d}px`),i.style.setProperty(SU,m?`${_} ${x}`:`${x} ${_}`),{}}},gU,w),DL(()=>{!b&&y&&y.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,y]);let _e=h.useMemo(()=>({ancestorScroll:!g,elementResize:!g&&typeof ResizeObserver<`u`,layoutShift:!g&&typeof IntersectionObserver<`u`}),[g]),{refs:ve,elements:ye,x:be,y:xe,middlewareData:Se,update:Ce,placement:we,context:Te,isPositioned:Ee,floatingStyles:De}=t({rootContext:y,open:v?b:void 0,placement:U,middleware:fe,strategy:o,whileElementsMounted:v?void 0:(...e)=>UC(...e,_e),nodeId:C,externalTree:E}),{sideX:Oe,sideY:ke}=Se.adaptiveOrigin||_U,Ae=Ee?o:`fixed`,je=h.useMemo(()=>{let e;return e=Ee?w?{position:Ae,[Oe]:be,[ke]:xe}:A(A({},De),{},{position:Ae}):{position:Ae,top:0,left:0},e[CU]=`100vw`,e[wU]=`100vh`,Ee||(e.opacity=0),e},[w,Ae,Oe,be,ke,xe,De,Ee]),Me=h.useRef(null);DL(()=>{if(!b)return;let e=I.current,t=typeof e==`function`?e():e,n=(kU(t)?t.current:t)||null;n!==Me.current&&(ve.setPositionReference(n),Me.current=n)},[b,ve,F,I]),h.useEffect(()=>{if(!b)return;let e=I.current;typeof e!=`function`&&kU(e)&&e.current!==Me.current&&(ve.setPositionReference(e.current),Me.current=e.current)},[b,ve,F,I]),h.useEffect(()=>{if(v&&b&&ye.reference&&ye.floating)return UC(ye.reference,ye.floating,Ce,_e)},[v,b,ye,Ce,_e]);let Ne=iS(we),Pe=TU(s,Ne,R),Fe=aS(we)||`center`,Ie=!!((r=Se.hide)!=null&&r.referenceHidden);DL(()=>{T&&b&&Ee&&(Ne!==ne||ee&&Fe!==H)&&B(we)},[T,ee,b,Ee,we,Ne,Fe,ne,H]);let Le=h.useMemo(()=>{var e,t;return{position:`absolute`,top:(e=Se.arrow)==null?void 0:e.y,left:(t=Se.arrow)==null?void 0:t.x}},[Se.arrow]),Re=((i=Se.arrow)==null?void 0:i.centerOffset)!==0;return h.useMemo(()=>({positionerStyles:je,arrowStyles:Le,arrowRef:se,arrowUncentered:Re,side:Pe,align:Fe,physicalSide:Ne,anchorHidden:Ie,refs:ve,context:Te,isPositioned:Ee,update:Ce}),[je,Le,se,Re,Pe,Fe,Ne,Ie,ve,Te,Ee,Ce])}function kU(e){return e!=null&&`current`in e}function AU(e){return e===`starting`?ZB:EL}j();function jU(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c=A({},n);return s&&(c.pointerEvents=`none`),VB(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},AU(r),i],stateAttributesMapping:wR})}var MU=[`render`,`className`,`anchor`,`positionMethod`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`,`style`],NU=h.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:g=$B,style:_}=e,v=G(e,MU),y=jL(),b=iU(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=DU({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=jU(e,h.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,X.jsx)(lU.Provider,{value:O,children:k})});process.env.NODE_ENV!==`production`&&(NU.displayName=`TooltipPositioner`);var PU=[`render`,`className`,`style`],FU=h.forwardRef(function(e,t){let{render:n,className:r,style:i}=e,a=G(e,PU),o=jL(),{side:s,align:c}=uU(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);FV({open:l,ref:o.context.popupRef,onComplete(){if(l){var e,t;(e=(t=o.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),NH(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return VB(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[LV,f,AU(d),a],stateAttributesMapping:TR})});process.env.NODE_ENV!==`production`&&(FU.displayName=`TooltipPopup`);var IU=[`render`,`className`,`style`],LU=h.forwardRef(function(e,t){let{render:n,className:r,style:i}=e,a=G(e,IU),o=jL(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=uU();return VB(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:wR})});process.env.NODE_ENV!==`production`&&(LU.displayName=`TooltipArrow`);var RU=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=h.useMemo(()=>({open:t,close:n}),[t,n]);return(0,X.jsx)(ZH.Provider,{value:t,children:(0,X.jsx)($R,{delay:i,timeoutMs:r,children:e.children})})};process.env.NODE_ENV!==`production`&&(RU.displayName=`TooltipProvider`);function zU(e){return vB(19)?e:e?`true`:void 0}var BU=48,VU=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-BU-t;return n},HU=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},UU=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-BU;n+=i>>>1^-(i&1),t[r]=n}return t},WU=384,GU=[],KU=HU(VU(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),qU=HU(VU(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),JU=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,YU=(()=>{let e=KU.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=KU[n];i<KU[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(KU[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=KU[i];a<KU[i+1];a++)n[r++]=e,e+=t[e]}return n})(),XU=VU(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),ZU=HU(VU(`123333359346463635126536711576`)),QU=VU(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),$U=VU(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),eW=UU(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),tW=(()=>{let e=new Int32Array(319).fill(-1),t=UU(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=UU(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),nW=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),rW=UU(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),iW=UU(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),aW=UU(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±`),oW=new Int32Array(987),sW=new Int32Array(987),cW=new Int32Array(987),lW=``,uW=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<rW.length;r++)for(let i of nW[aW[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),uW[a*2]=lW.length,uW[a*2+1]=i.length,lW+=i),oW[n]=rW[r],sW[n]=iW[r],cW[n]=a,n++}}var dW=UU(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),fW=HU(VU(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),pW=UU(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),mW=VU(`ij`),hW=VU(`—`),gW=VU(`1`),_W={GROUP_COUNT:WU,customValidatorNames:GU,edgeStart:KU,labelStart:qU,labelText:JU,edgeTarget:YU,nodeGroup:XU,nodeVlist:tW,vlistPat:ZU,vlistOps:QU,vlistRef:$U,vlistGroup:eW,litAnchor:oW,litGroup:sW,litPool:cW,poolOffsets:uW,poolText:lW,adjGid:dW,adjStart:fW,adjTgt:pW,patGid:mW,patTgt:hW,postfixLookupGroups:gW,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},vW=`line`in Error(),yW=-1,bW=-1,xW=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},SW=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},CW=(e,t,n={})=>{var r,i,a;let{GROUP_COUNT:o,edgeStart:s,labelStart:c,labelText:l,edgeTarget:u,nodeGroup:d,nodeVlist:f,vlistPat:p,vlistOps:m,vlistRef:h,vlistGroup:g,litAnchor:_,litGroup:v,litPool:y,poolOffsets:b,poolText:x,adjGid:S,adjStart:C,adjTgt:w,patGid:T,patTgt:E,postfixLookupGroups:D,customValidatorNames:O,orderSensitiveModifiers:k}=e,A=new Int32Array(o).fill(-1);for(let e=0;e<S.length;e++)A[S[e]]=e;let j=0;for(let e=0;e+1<C.length;e++){let t=C[e+1]-C[e];t>j&&(j=t)}let M=32;for(;M<2*(1+j+T.length);)M<<=1;let N=new Int32Array(h.length+1);for(let e=0;e<h.length;e++)N[e+1]=N[e]+p[h[e]+1]-p[h[e]];let P=new Uint8Array(o);for(let e=0;e<D.length;e++)P[D[e]]=1;let F=s.length-1,I=new Uint8Array(F),L=0,R=!0;for(let e=0;e<_.length;e++){I[_[e]]=1;let t=b[y[e]*2+1];t>L&&(L=t);let n=x.charCodeAt(b[y[e]*2]);(n===91||n===40)&&(R=!1)}let z=1;for(;z<_.length*2;)z<<=1;let B=new Int32Array(z).fill(-1);for(let e=0;e<_.length;e++){let t=b[y[e]*2],n=(xW(x,t,t+b[y[e]*2+1])^Math.imul(_[e],2654435761)|0)&z-1;for(;B[n]!==-1;)n=n+1&z-1;B[n]=e}let ee=(e,t,n,r)=>{let i=(xW(t,n,r)^Math.imul(e,2654435761)|0)&z-1,a=r-n;for(;;){let r=B[i];if(r===-1)return-1;if(_[r]===e&&b[y[r]*2+1]===a){let e=b[y[r]*2],i=!0;for(let r=0;r<a;r++)if(x.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return v[r]}i=i+1&z-1}},V=(r=n.cacheSize)==null?8192:r,te=(i=(a=n.prefix)==null?e.prefix:a)==null?``:i,ne=te===``?``:te+`:`,H=ne.length,U=(O==null?[]:O).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),re=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,W=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=0,oe=-1,se=-1,ce=-1,le=-1,ue=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,de=e=>/\s/.test(String.fromCharCode(e)),fe=(e,t,n)=>{if(G=0,oe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)G=1;else if(r===40&&i===41)G=2;else return;ce=t+1,le=n-1;let a=t+1;if(ue(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ue(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,se=a,ce=a+1)}},pe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},me=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,he=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ge=e=>!!e&&!Number.isNaN(Number(e)),_e=(e,t,n)=>{if(n-t<11||!pe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&pe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&pe(e,t+10,t+18,`-normal/`)},ve=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ye=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),be=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],xe=(e,t,n,r)=>{if(e>=10){if(e>=25)return U[e-25](t.slice(n,r));let i=e-10;if(G!==ve[i])return!1;if(oe>=0){for(let e of ye[i])if(pe(t,oe,se,e))return!0;return!1}switch(be[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ce,le);return re.test(e)&&!ie.test(e)}case 3:return ge(t.slice(ce,le));case 4:return ae.test(t.slice(ce,le));default:return W.test(t.slice(ce,le))}}switch(e){case 0:return!0;case 1:return G===0;case 2:return G===1;case 3:return G===2;case 4:return me.test(t.slice(n,r));case 5:return ge(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&ge(t.slice(n,r-1));case 8:return he.test(t.slice(n,r));default:return _e(t,n,r)}},Se=new Set(typeof k==`string`?k.split(` `):k),Ce=(e,t,n,r,i,a)=>{let o=xW(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},we=new Map,Te=new Map,Ee=2,De=4096,Oe=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||Se.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Te.get(s);return c===void 0&&Te.set(s,c=Ee++),c},ke=new Map,Ae=o,je=o+4096,Me=()=>Ae++,Ne=2097152,Pe=8192,Fe=new Int32Array(Pe),Ie=Array(Pe).fill(null),Le=new Int32Array(Pe),Re=new Int32Array(Pe),ze=new Uint8Array(Pe),Be=0,Ve=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ie[e]!==null){if(Ie[e|1]===null)c=e|1;else if(!(Be++&3))c=e|Be>>2&1;else return}Ie[c]=t.slice(n,r),Fe[c]=i,Le[c]=a,Re[c]=o,ze[c]=s},He=()=>Ie.fill(null),Ue=256,We=[new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue),new Int32Array(Ue)],[Ge,Ke,qe,Je]=We,Ye=new Uint8Array(Ue),Xe=new Uint8Array(Ue),Ze=()=>{Ue*=2,We=We.map(e=>{let t=new Int32Array(Ue);return t.set(e),t}),[Ge,Ke,qe,Je]=We;let e=new Uint8Array(Ue);e.set(Ye),Ye=e,Xe=new Uint8Array(Ue)},Qe=64,$e=new Int32Array(Qe),et=new Int32Array(Qe),tt=new Int32Array(o),nt=2048,rt=21,it=new Float64Array(nt),at=new Int32Array(nt),ot=0,st=(e,t)=>{if(e===0&&t<o)return tt[t]===ot?1:(tt[t]=ot,0);let n=e*2097152+t+1,r=Math.imul(n,2654435761)>>>rt;for(;at[r]===ot;){if(it[r]===n)return 1;r=r+1&nt-1}return it[r]=n,at[r]=ot,0},ct=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?yW:Ce(ke,e,t+1,r,0,Me)}if(r>=0&&d[r]>=0)return d[r];for(let t=i-1;t>=0;t--){let r=et[t];if(r>n)continue;let i=$e[t],a=n-r;if(I[i]===1&&a>0&&a<=L){let t=e.charCodeAt(r);if(R===!1||t!==91&&t!==40){let t=ee(i,e,r,n);if(t>=0)return t}}let o=f[i];if(o<0)continue;let s=h[o],c=p[s],l=p[s+1];if(c===l)continue;fe(e,r,n);let u=N[o]-c;for(let t=c;t<l;t++)if(xe(m[t],e,r,n))return g[u+t]}return yW},lt=e=>{let t=e.length,n=0,r=0,i=!1;(Ee>De||we.size>De)&&(we=new Map,Te=new Map,Ee=2,He()),Ae>je&&(ke=new Map,Ae=o,He());let a=0;for(;a<t;){let d=e.charCodeAt(a);if(d===32||d>=9&&d<=13||d>=160&&de(d)){d!==32&&(i=!0),a++;continue}let p=a,m=0;for(;a<t;){if(d=e.charCodeAt(a),d<=32){if(d===32)break;if(d>=9&&d<=13){i=!0;break}}else if(d>=160&&de(d)){i=!0;break}m=Math.imul(m^d,16777619),a++}let h=a,g=h-p;n===Ue&&Ze();let _=n++;Ge[_]=p,Ke[_]=h,r+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Fe[y]===v&&Ie[y]!==null&&Ie[y].length===g?t=y:Fe[y|1]===v&&Ie[y|1]!==null&&Ie[y|1].length===g&&(t=y|1),t>=0){let n=Ie[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){qe[_]=Le[t],Je[_]=Re[t],Ye[_]=ze[t];continue}}}let b=p;if(H!==0){if(h-p<=H||!e.startsWith(ne,p)){qe[_]=yW,Ve(y,e,p,h,v,yW,0,0);continue}b=p+H}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let j=E;D-E>1&&e.charCodeAt(E)===45&&(j=E+1);let M=0,N=0,F=0,L=-1,R=0;(f[0]>=0||I[0]===1)&&($e[0]=0,et[0]=j,R=1);let z=bW,B=0;for(let t=j;t<D;t++)if(t===A&&(z=N<F?bW:M,B=R),M!==bW){let n=e.charCodeAt(t),r=-1;if(N<F)l.charCodeAt(N)===n?(N++,N===F&&(r=M=L)):M=bW;else{let e=s[M],t=s[M+1],i=bW;for(let a=e;a<t;a++){let e=c[a];if(l.charCodeAt(e)===n){c[a+1]-e===1?r=i=u[a]:(N=e+1,F=c[a+1],L=u[a],i=M);break}}M=i}if(r>=0&&(f[r]>=0||I[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Qe){Qe*=2;let e=new Int32Array(Qe);e.set($e),$e=e;let t=new Int32Array(Qe);t.set(et),et=t}$e[R]=r,et[R]=t+2,R++}}A===D&&(z=N<F?bW:M,B=R);let ee=N<F?bW:M,V,te=!1;if(A>=0){if(te=!0,V=ct(e,E,A,z,B),V!==yW&&V<o&&P[V]){let t=ct(e,E,D,ee,R);t!==yW&&t!==V&&(V=t,te=!1)}else V===yW&&(V=ct(e,E,D,ee,R),te=!1)}else V=ct(e,E,D,ee,R);let U=0,re=0;V===yW?qe[_]=yW:(re=+!!te,U=b>=C?+!!O:Ce(we,e,b,C,+!!O,e=>Oe(e,O)),qe[_]=V,Ye[_]=re,Je[_]=U),Ve(y,e,p,h,v,V,U,re)}if(n===0)return``;if(n===1)return Ge[0]===0&&Ke[0]===t?e:e.slice(Ge[0],Ke[0]);if(n*M>nt){for(;n*M>nt;)nt<<=1,rt--;it=new Float64Array(nt),at=new Int32Array(nt)}if(Ee>=Ne||Ae>=Ne)throw Error(`cn: too many distinct classes in one merge`);ot=ot+1|0,ot===0&&(tt.fill(0),at.fill(0),ot=1);let d=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===yW){Xe[e]=1;continue}let n=Je[e];if(st(n,t)===1)Xe[e]=0,d=!0;else if(Xe[e]=1,t<o){let r=A[t];if(r>=0)for(let e=C[r];e<C[r+1];e++)st(n,w[e]);if(Ye[e]&1)for(let e=0;e<T.length;e++)T[e]===t&&st(n,E[e])}}if(!d&&!i&&t===r+n-1)return e;let p=``,m=0;for(;m<n;){if(!Xe[m]){m++;continue}let t=Ge[m],r=Ke[m],i=m+1;for(;i<n&&Xe[i]&&Ge[i]===r+1&&e.charCodeAt(r)===32;)r=Ke[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ut=16384,dt=new Int32Array(ut*2),ft=0,pt=1,mt=Object.create(null),ht=Object.create(null),gt=new Map,_t=new Map,vt=0,yt=0,bt=()=>{ft^=ut,pt=pt+1|0,yt=0},xt=e=>{let t=mt[e];if(t!==void 0)return t;let n=SW(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=ht[e],t!==void 0)?(mt[e]=t,t):(t=lt(e),i?(mt[e]=t,++vt>V&&(vt=0,ht=mt,mt=Object.create(null),bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},St=e=>{let t=gt.get(e);if(t!==void 0)return t;let n=SW(e,0,e.length),r=(n&16383)+ft,i=dt[r]===(n^pt)||dt[r^ut]===(n^pt-1);return i&&(t=_t.get(e),t!==void 0)?(gt.set(e,t),t):(t=lt(e),i?(gt.set(e,t),++vt>V&&(vt=0,_t=gt,gt=new Map,bt())):(dt[r]=n^pt,++yt>ut&&bt()),t)},Ct=e=>{let t=SW(e,0,e.length),n=(t&16383)+ft;return dt[n]===(t^pt)||dt[n^ut]===(t^pt-1)||(dt[n]=t^pt,++yt>ut&&bt(),!1)},wt=V===0?lt:vW?e=>{let t=gt.get(e);return t===void 0?St(e):t}:xt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?wt(arguments[0]):wt(EW.apply(null,arguments))},mergeString:wt,seenBefore:V===0?()=>!1:Ct,mergeUncached:lt}},wW=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:wW(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},TW=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:wW(i,t);a&&(n&&(n+=` `),n+=a)}return n},EW=function(){return TW(arguments,!1)},DW=256,OW=16,kW=1024,AW=4096,jW=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(AW).fill(``),l=Array(AW).fill(``),u=Array(AW).fill(``));let i=SW(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=wW(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){var y;let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:(y=c[2])==null?``:y,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>OW&&(_.miss=OW,_.skip=kW,_.e.length=0,_.at=0);let u=_.e;u.length<DW?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(wW(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},MW=CW(_W),Q=jW(MW.mergeString,MW);MW.merge;function NW(e){if(e==null)throw TypeError(`Cannot destructure `+e)}function PW(){return PW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PW.apply(null,arguments)}j();var FW=[`delay`],IW=[`className`,`side`,`sideOffset`,`align`,`alignOffset`,`children`];function LW(e){let{delay:t=0}=e,n=G(e,FW);return(0,X.jsx)(RU,A({"data-slot":`tooltip-provider`,delay:t},n))}function RW(e){let t=PW({},(NW(e),e));return(0,X.jsx)(JH,A({"data-slot":`tooltip`},t))}function zW(e){let t=PW({},(NW(e),e));return(0,X.jsx)(nU,A({"data-slot":`tooltip-trigger`},t))}function BW(e){let{className:t,side:n=`top`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,children:o}=e,s=G(e,IW);return(0,X.jsx)(cU,{children:(0,X.jsx)(NU,{align:i,alignOffset:a,side:n,sideOffset:r,className:`isolate z-50 flex flex-col items-start`,children:(0,X.jsxs)(FU,A(A({"data-slot":`tooltip-content`,className:Q(`relative z-50 inline-flex w-fit max-w-xs origin-(--transform-origin)`,`items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5`,`text-xs text-background`,`has-data-[slot=kbd]:pr-1.5`,`data-[side=bottom]:slide-in-from-top-2`,`data-[side=inline-end]:slide-in-from-left-2`,`data-[side=inline-start]:slide-in-from-right-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`,`data-[state=delayed-open]:animate-in`,`data-[state=delayed-open]:fade-in-0`,`data-[state=delayed-open]:zoom-in-95`,`data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95`,`data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t)},s),{},{children:[o,(0,X.jsx)(LU,{className:Q(`absolute z-50 size-2.5 rotate-45 rounded-[2px]`,`bg-foreground fill-foreground`,`data-[side=bottom]:-top-1`,`data-[side=top]:-bottom-1`,`data-[side=left]:-right-1`,`data-[side=right]:-left-1`,`data-[side=inline-end]:-left-1`,`data-[side=inline-start]:-right-1`)})]}))})})}var VW=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(VW.displayName=`DialogRootContext`);function HW(e){let t=h.useContext(VW);if(!e&&t===void 0)throw Error(process.env.NODE_ENV===`production`?kL(27):`Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.`);return t}var UW=[`render`,`className`,`style`,`forceRender`],WW=h.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1}=e,o=G(e,UW),s=HW(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return VB(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:TR,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});process.env.NODE_ENV!==`production`&&(WW.displayName=`DialogBackdrop`);var GW=SB(`error`,`Base UI`),KW=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(KW.displayName=`CompositeRootContext`);function qW(e=!1){let t=h.useContext(KW);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?kL(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return t}function JW(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:h.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function YW(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(KS(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}var XW=[`onClick`,`onMouseDown`,`onKeyUp`,`onKeyDown`,`onPointerDown`];function ZW(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=h.useRef(null),s=qW(!0),c=a==null?s!==void 0:a,{props:l}=JW({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i});process.env.NODE_ENV!==`production`&&h.useEffect(()=>{if(!o.current)return;let e=QW(o.current);if(i){if(!e){var t;GW(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${((t=dz.captureOwnerStack)==null?void 0:t.call(dz))||``}`)}}else if(e){var n;GW(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${((n=dz.captureOwnerStack)==null?void 0:n.call(dz))||``}`)}},[i]);let u=h.useCallback(()=>{let e=o.current;QW(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return DL(u,[u]),{getButtonProps:h.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s}=e,u=G(e,XW);return OB({onClick(e){t?e.preventDefault():n==null||n(e)},onMouseDown(e){t||r==null||r(e)},onKeyDown(e){if(t||(RB(e),o==null||o(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=QW(r),s=!i&&$W(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=(f==null?void 0:f.startsWith(`menuitem`))||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),YW(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),YW(r,e)))},onKeyUp(e){t||(RB(e),a==null||a(e),e.target===e.currentTarget&&i&&c&&QW(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),YW(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s==null||s(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:mz(e=>{o.current=e,u()})}}function QW(e){return XS(e)&&e.tagName===`BUTTON`}function $W(e){return XS(e)&&e.tagName===`A`&&!!e.href}var eG=[`render`,`className`,`style`,`disabled`,`nativeButton`],tG=h.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0}=e,s=G(e,eG),c=HW(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=ZW({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,BR(KR,e.nativeEvent))}return VB(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})});process.env.NODE_ENV!==`production`&&(tG.displayName=`DialogClose`);var nG=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(nG.displayName=`DialogPortalContext`);function rG(){let e=h.useContext(nG);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?kL(26):`Base UI: <Dialog.Portal> is missing.`);return e}var iG=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),aG=`--nested-dialogs`,oG=`data-nested-dialog-open`;j();var sG=A(A(A({},wR),mR),{},{nestedDialogOpen(e){return e?{[oG]:``}:null}});j();var cG=[`render`,`className`,`style`,`finalFocus`,`initialFocus`],lG=h.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o}=e,s=G(e,cG),c=HW(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);rG(),FV({open:_,ref:c.context.popupRef,onComplete(){if(_){var e,t;(e=(t=c.context).onOpenChangeComplete)==null||e.call(t,!0)}}});let C=o===void 0?RV(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=VB(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,A(A({id:S,"aria-labelledby":y,"aria-describedby":l,role:x},LV),{},{hidden:!m,onKeyDown(e){iG.has(e.key)&&e.stopPropagation()},style:{[aG]:g}}),s],ref:[t,c.context.popupRef,T],stateAttributesMapping:sG});return(0,X.jsx)(xV,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});process.env.NODE_ENV!==`production`&&(lG.displayName=`DialogPopup`),j();var uG=[`cutout`],dG=h.forwardRef(function(e,t){let{cutout:n}=e,r=G(e,uG),i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,A(A({ref:t,role:`presentation`,"data-base-ui-inert":``},r),{},{style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}}))});process.env.NODE_ENV!==`production`&&(dG.displayName=`InternalBackdrop`),j();var fG=[`keepMounted`],pG=h.forwardRef(function(e,t){let{keepMounted:n=!1}=e,r=G(e,fG),i=HW(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,X.jsx)(nG.Provider,{value:n,children:(0,X.jsxs)(oV,A(A({ref:t},r),{},{children:[a&&o===!0&&(0,X.jsx)(dG,{ref:i.context.internalBackdropRef,inert:zU(!s)}),e.children]}))}):null});process.env.NODE_ENV!==`production`&&(pG.displayName=`DialogPortal`),E();var mG={},hG={},gG=``;function _G(e,t){return QS(e)?e:t}function vG(e,t,n){return/hidden|clip/.test(e.getComputedStyle(_G(t,n)).overflowY)}function yG(e){if(typeof document>`u`)return!1;let t=Sz(e);return KS(t).innerWidth-t.documentElement.clientWidth>0}function bG(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Sz(e),n=t.documentElement,r=t.body,i=_G(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function xG(e){let t=Sz(e),n=t.documentElement,r=t.body,i=_G(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function SG(e){var t,n;let r=Sz(e),i=r.documentElement,a=r.body,o=KS(i),s=0,c=0,l=!1,u=bz.create();if(YL&&((t=(n=o.visualViewport)==null?void 0:n.scale)==null?1:t)!==1)return()=>{};function d(){let t=o.getComputedStyle(i),n=o.getComputedStyle(a),r=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;s=i.scrollTop,c=i.scrollLeft,mG={scrollbarGutter:i.style.scrollbarGutter,overflowY:i.style.overflowY,overflowX:i.style.overflowX},gG=i.style.scrollBehavior,hG={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};let u=i.scrollHeight>i.clientHeight,d=i.scrollWidth>i.clientWidth,f=t.overflowY===`scroll`||n.overflowY===`scroll`,p=t.overflowX===`scroll`||n.overflowX===`scroll`,m=Math.max(0,o.innerWidth-a.clientWidth),h=Math.max(0,o.innerHeight-a.clientHeight),g=parseFloat(n.marginTop)+parseFloat(n.marginBottom),_=parseFloat(n.marginLeft)+parseFloat(n.marginRight),v=_G(i,a);l=bG(e),l?(i.style.scrollbarGutter=r,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(i.style,{scrollbarGutter:r,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(i.style.overflowY=`scroll`),(d||p)&&(i.style.overflowX=`scroll`),Object.assign(a.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),a.scrollTop=s,a.scrollLeft=c,i.setAttribute(`data-base-ui-scroll-locked`,``),i.style.scrollBehavior=`unset`)}function f(){Object.assign(i.style,mG),Object.assign(a.style,hG),l||(i.scrollTop=s,i.scrollLeft=c,i.removeAttribute(`data-base-ui-scroll-locked`),i.style.scrollBehavior=gG)}function p(){f(),u.request(d)}d();let m=tz(o,`resize`,p);return()=>{u.cancel(),f(),typeof o.removeEventListener==`function`&&m()}}var CG=new class{constructor(){T(this,`lockCount`,0),T(this,`restore`,null),T(this,`timeoutLock`,PL.create()),T(this,`timeoutUnlock`,PL.create()),T(this,`release`,()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),T(this,`unlock`,()=>{if(this.lockCount===0&&this.restore){var e;(e=this.restore)==null||e.call(this),this.restore=null}})}acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Sz(e),n=t.documentElement,r=t.body,i=KS(n);if(vG(i,n,r)){let t=new i.MutationObserver(()=>{vG(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=HL||!yG(e);this.restore=a?xG(e):SG(e)}};function wG(e=!0,t=null){DL(()=>{if(e)return CG.acquire(t)},[e,t])}function TG({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=h.useState(0),[d,f]=h.useState(0),p=l===0,m=OV(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=sR(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||aR(n,s)&&!(n!=null&&n.hasAttribute(`data-base-ui-portal`)):!0}return!0}return!1},escapeKey:p});return wG(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),DL(()=>{!r&&!i&&(u(0),f(0))},[r,i]),DL(()=>(t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),YV(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}j(),E();var EG=A(A({},wH),{},{modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role}),DG=class extends mH{constructor(e,t,n){let r=new $V,i=OG(e,r,t,n);super(i,kG(r),EG),T(this,`setOpen`,(e,t)=>{var n,r;if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null){var i;t.trigger=(i=this.state.activeTriggerElement)==null?void 0:i}(n=(r=this.context).onOpenChange)==null||n.call(r,e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(UV(this.state,e,t.trigger)))})}};function OG(e,t,n,r=!1){return A(A({},vH(t,n,r)),{},{modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`},e)}function kG(e){return{popupRef:h.createRef(),backdropRef:h.createRef(),internalBackdropRef:h.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}j();function AG(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,g=m?!0:c,_=m||s,v=m?`alertdialog`:`dialog`,y=HW(!0),b={modal:g,disablePointerDismissal:_,nested:y!=null,role:v},x=zV((e,t)=>new DG(A({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d},b),e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);XV(x,S),qV(x);let{forceUnmount:T}=JV(S,x);h.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,BR(XR))}),[T,x]);let E=S||C||u!=null;return(0,X.jsxs)(VW.Provider,{value:x,children:[u&&(0,X.jsx)(BV,{handle:u,store:x}),E&&(0,X.jsx)(TG,{store:x,parentContext:y==null?void 0:y.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var jG=xL(function(e){return AG(`dialog`,e)});process.env.NODE_ENV!==`production`&&(jG.displayName=`DialogRoot`);var MG=[`render`,`className`,`style`,`id`],NG=h.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a}=e,o=G(e,MG),s=HW(),c=XH(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),VB(`h2`,e,{ref:t,props:[{id:c},o]})});process.env.NODE_ENV!==`production`&&(NG.displayName=`DialogTitle`);function PG(e){let t=h.useRef(``),n=h.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:h.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function FG(e,t){let{onClick:n,onPointerDown:r}=PG(mz((n,r)=>{(typeof e==`function`?e():e)||t(r||(HL?`touch`:``))}));return h.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var IG=[`render`,`className`,`style`,`disabled`,`nativeButton`,`id`,`payload`,`handle`],LG=SL(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l}=e,u=G(e,IG),d=HW(!0),f=TH(l),p=f==null?d:f;if(!p)throw Error(process.env.NODE_ENV===`production`?kL(79):`Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.`);let m=XH(s),g=p.useState(`floatingRootContext`),_=p.useState(`isOpenedByTrigger`,m),v=p.useState(`triggerPopupId`,m),y=h.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=KV(m,y,p,{payload:c}),{getButtonProps:S,buttonRef:C}=ZW({disabled:a,native:o}),w=SV(g),T=FG(()=>p.select(`open`),e=>{p.set(`openMethod`,e)}),E={disabled:a,open:_},D=p.useState(`triggerProps`,x);return VB(`button`,e,{state:E,ref:[C,t,b,y],props:[w.reference,D,T,{[QB]:``,id:m,"aria-haspopup":`dialog`,"aria-expanded":_,"aria-controls":v},u,S],stateAttributesMapping:CR})});process.env.NODE_ENV!==`production`&&(LG.displayName=`DialogTrigger`);var RG=[`render`,`className`,`disabled`,`focusableWhenDisabled`,`nativeButton`,`style`],zG=h.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s}=e,c=G(e,RG),{getButtonProps:l,buttonRef:u}=ZW({disabled:i,focusableWhenDisabled:a,native:o});return VB(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});process.env.NODE_ENV!==`production`&&(zG.displayName=`Button`);function BG(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=BG(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function VG(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=BG(e))&&(r&&(r+=` `),r+=t);return r}j();var HG=[`class`,`className`],UG=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,WG=VG,GG=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return WG(e,n==null?void 0:n.class,n==null?void 0:n.className);let{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(e=>{let t=n==null?void 0:n[e],r=a==null?void 0:a[e];if(t===null)return null;let o=UG(t)||UG(r);return i[e][o]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return WG(e,o,t==null||(r=t.compoundVariants)==null?void 0:r.reduce((e,t)=>{let{class:n,className:r}=t,i=G(t,HG);return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes(A(A({},a),s)[t]):A(A({},a),s)[t]===n})?[...e,n,r]:e},[]),n==null?void 0:n.class,n==null?void 0:n.className)};j();var KG=[`className`,`variant`,`size`],qG=GG(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[12.8px] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}}),JG=h.forwardRef((e,t)=>{let{className:n,variant:r=`default`,size:i=`default`}=e,a=G(e,KG);return(0,X.jsx)(zG,A({ref:t,"data-slot":`button`,className:Q(qG({variant:r,size:i,className:n}))},a))});JG.displayName=`Button`,j();var YG=[`className`],XG=[`className`,`children`,`showCloseButton`],ZG=[`className`];function QG(e){let t=PW({},(NW(e),e));return(0,X.jsx)(jG,A({"data-slot":`dialog`},t))}function $G(e){let t=PW({},(NW(e),e));return(0,X.jsx)(LG,A({"data-slot":`dialog-trigger`},t))}function eK(e){let t=PW({},(NW(e),e));return(0,X.jsx)(pG,A({"data-slot":`dialog-portal`},t))}function tK(e){let{className:t}=e,n=G(e,YG);return(0,X.jsx)(WW,A({"data-slot":`dialog-overlay`,className:Q(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,t)},n))}function nK(e){let{className:t,children:n,showCloseButton:r=!0}=e,i=G(e,XG);return(0,X.jsxs)(eK,{children:[(0,X.jsx)(tK,{}),(0,X.jsxs)(lG,A(A({"data-slot":`dialog-content`,className:Q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-32px)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t)},i),{},{children:[n,r&&(0,X.jsxs)(tG,{"data-slot":`dialog-close`,render:(0,X.jsx)(JG,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,X.jsx)(mL,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]}))]})}function rK(e){let{className:t}=e,n=G(e,ZG);return(0,X.jsx)(NG,A({"data-slot":`dialog-title`,className:Q(`font-heading text-base leading-none font-medium`,t)},n))}var iK=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(iK.displayName=`AvatarRootContext`);function aK(){let e=h.useContext(iK);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?kL(13):`Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.`);return e}var oK={imageLoadingStatus:()=>null},sK=[`className`,`render`,`style`],cK=h.forwardRef(function(e,t){let{className:n,render:r,style:i}=e,a=G(e,sK),[o,s]=h.useState(`idle`),c={imageLoadingStatus:o},l=h.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=VB(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:oK});return(0,X.jsx)(iK.Provider,{value:l,children:u})});process.env.NODE_ENV!==`production`&&(cK.displayName=`AvatarRoot`);function lK(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=h.useState(`idle`),s=o[1];return DL(()=>{if(!a)return wL;if(!e&&!i)return s(`error`),wL;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n==null?null:n,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}j();var uK=[`className`,`render`,`onLoadingStatusChange`,`keepMounted`,`style`,`sizes`,`srcSet`,`src`],dK=A(A({},oK),mR),fK=h.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l}=e,u=G(e,uK),{setImageLoadingStatus:d}=aK(),[f,p]=lK(l,e,!a),m=f===`loaded`,{mounted:g,transitionStatus:_,setMounted:v}=AV(m),y=h.useRef(null),b=h.useRef(!0);DL(()=>{if(!a)return;let e=b.current;b.current=!1;let t=y.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&v(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,v]);let x=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,S=mz(e=>{i==null||i(e),d(e)});DL(()=>{f!==`idle`&&S(f)},[f,S]),DL(()=>()=>d(`idle`),[d]),FV({enabled:!m,open:m,ref:y,onComplete(){m||v(!1)}});let C={imageLoadingStatus:f,transitionStatus:a&&_===`ending`?void 0:_},w=a||g,T={};s!==void 0&&(T.sizes=s),c!==void 0&&(T.srcSet=c),l!==void 0&&(T.src=l);let E=VB(`img`,e,{state:C,ref:[t,y],props:[x,u,T],stateAttributesMapping:dK,enabled:w});return w?E:null});process.env.NODE_ENV!==`production`&&(fK.displayName=`AvatarImage`);var pK=[`className`,`render`,`delay`,`style`],mK=h.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a}=e,o=G(e,pK),{imageLoadingStatus:s}=aK(),[c,l]=h.useState(i===0),u=FL();return h.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),VB(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:oK,enabled:s!==`loaded`&&(i===0||c)})});process.env.NODE_ENV!==`production`&&(mK.displayName=`AvatarFallback`),j();var hK=[`className`,`size`],gK=[`className`],_K=[`className`];function vK(e){let{className:t,size:n=`default`}=e,r=G(e,hK);return(0,X.jsx)(cK,A({"data-slot":`avatar`,"data-size":n,className:Q(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,t)},r))}function yK(e){let{className:t}=e,n=G(e,gK);return(0,X.jsx)(fK,A({"data-slot":`avatar-image`,className:Q(`aspect-square size-full rounded-full object-cover`,t)},n))}function bK(e){let{className:t}=e,n=G(e,_K);return(0,X.jsx)(mK,A({"data-slot":`avatar-fallback`,className:Q(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,t)},n))}j();var xK=[`children`,`tooltip`,`side`,`className`],SK=(0,h.forwardRef)((e,t)=>{let{children:n,tooltip:r,side:i=`bottom`,className:a}=e,o=G(e,xK);return(0,X.jsx)(LW,{children:(0,X.jsxs)(RW,{children:[(0,X.jsxs)(zW,{render:(0,X.jsx)(JG,A(A({variant:`ghost`,size:`icon`},o),{},{className:Q(`aui-button-icon size-6 p-1 active:scale-90`,a),ref:t})),children:[n,(0,X.jsx)(`span`,{className:`aui-sr-only sr-only`,children:r})]}),(0,X.jsx)(BW,{side:i,children:r})]})})});SK.displayName=`TooltipIconButton`;var CK=e=>Symbol.iterator in e,wK=e=>`entries`in e,TK=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},EK=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function DK(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:CK(e)&&CK(t)?wK(e)&&wK(t)?TK(e,t):EK(e,t):TK({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function OK(e){let t=h.default.useRef(void 0);return n=>{let r=e(n);return DK(t.current,r)?t.current:t.current=r}}var kK=e=>{let[t,n]=(0,h.useState)(void 0);return(0,h.useEffect)(()=>{if(!e){n(void 0);return}let t=URL.createObjectURL(e);return n({file:e,url:t}),()=>{URL.revokeObjectURL(t)}},[e]),t!==void 0&&t.file===e?t.url:void 0},AK=()=>{var e;let{file:t,src:n}=Y(OK(e=>{var t;if(e.attachment.type!==`image`)return{};if(e.attachment.file)return{file:e.attachment.file};let n=(t=e.attachment.content)==null||(t=t.filter(e=>e.type===`image`)[0])==null?void 0:t.image;return n?{src:n}:{}}));return(e=kK(t))==null?n:e};function jK(){let e=Xa().attachment.source!==`message`,t=AK(),n=Y(e=>e.attachment.type===`image`),r=Y(e=>e.attachment.name),i=Y(e=>{let t=e.attachment.type;switch(t){case`image`:return`Image`;case`document`:return`Document`;case`file`:return`File`;default:return t}}),a=Y(e=>{var t;return e.attachment.status.type===`incomplete`&&e.attachment.status.reason===`error`?`error`:e.attachment.status.type===`running`||((t=e.optional.message)==null?void 0:t.submission)!==void 0&&e.attachment.status.type!==`complete`?`uploading`:void 0});return{isComposer:e,src:t,isImage:n,name:r,typeLabel:i,isUploading:a===`uploading`,isError:a===`error`,errorMessage:Y(e=>{var t;return e.attachment.status.type===`incomplete`&&e.attachment.status.reason===`error`?(t=e.attachment.status.message)==null?`Upload failed`:t:void 0})}}var MK=({src:e,name:t})=>{let[n,r]=(0,h.useState)(!1);return(0,X.jsx)(`img`,{src:e,alt:`${t}的预览`,className:Q(`block h-auto max-h-[80vh] w-auto max-w-full rounded-sm object-contain transition-opacity duration-300 motion-reduce:transition-none`,n?`aui-attachment-preview-image-loaded opacity-100`:`aui-attachment-preview-image-loading opacity-0`),onLoad:()=>r(!0)})},NK=({children:e,src:t,name:n})=>t?(0,X.jsxs)(QG,{children:[(0,X.jsx)($G,{nativeButton:!1,className:`aui-attachment-preview-trigger cursor-zoom-in`,render:(0,h.isValidElement)(e)?e:(0,X.jsx)(`button`,{type:`button`,children:e})}),(0,X.jsxs)(nK,{className:`aui-attachment-preview-dialog-content [&>button]:bg-foreground/60 [&>button]:hover:bg-foreground/80 [&_svg]:text-background p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0!`,children:[(0,X.jsxs)(rK,{className:`aui-sr-only sr-only`,children:[`预览:`,n]}),(0,X.jsx)(`div`,{className:`aui-attachment-preview bg-background relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden rounded-sm`,children:(0,X.jsx)(MK,{src:t,name:n})})]})]}):e,PK=({src:e})=>(0,X.jsxs)(vK,{className:`aui-attachment-tile-avatar h-full w-full rounded-none after:hidden`,children:[(0,X.jsx)(yK,{src:e,alt:``,className:`aui-attachment-tile-image rounded-none object-cover`}),(0,X.jsx)(bK,{children:(0,X.jsx)(EI,{className:`aui-attachment-tile-fallback-icon text-muted-foreground/80 size-6 stroke-[1.5]`})})]}),FK=()=>{let{isComposer:e,src:t,isImage:n,name:r,typeLabel:i,isUploading:a,isError:o,errorMessage:s}=jK();return(0,X.jsx)(LW,{children:(0,X.jsxs)(RW,{children:[(0,X.jsxs)(Wk.Root,{className:Q(`aui-attachment-root relative`,e&&`animate-in fade-in-0 zoom-in-95 duration-200 motion-reduce:animate-none`,n&&!e&&`aui-attachment-root-message only:*:first:size-24`),children:[(0,X.jsx)(NK,{src:t,name:r,children:(0,X.jsxs)(zW,{render:(0,X.jsx)(`div`,{className:Q(`aui-attachment-tile bg-muted hover:after:bg-foreground/10 focus-visible:ring-ring/50 relative size-14 overflow-hidden rounded-[calc(var(--composer-radius,16px)-var(--composer-padding,8px))] transition-transform outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-black/10 after:transition-colors after:ring-inset focus-visible:ring-1 motion-reduce:transition-none dark:after:ring-white/10`,t?`cursor-zoom-in active:scale-[0.96]`:`cursor-default`,o&&`after:ring-destructive/60 dark:after:ring-destructive/60`),role:t?`button`:`group`,tabIndex:0,"aria-label":`${t?`预览${r}`:`${i}附件:${r}`}${o?`,上传失败`:a?`,正在上传`:``}`}),children:[(0,X.jsx)(PK,{src:t}),a&&(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`aui-attachment-tile-uploading bg-background/60 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none`,children:(0,X.jsx)(PI,{className:`text-muted-foreground size-4 animate-spin`})}),o&&(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`aui-attachment-tile-error bg-background/70 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none`,children:(0,X.jsx)(fI,{className:`text-destructive size-4`})})]})}),e&&(0,X.jsx)(IK,{name:r})]}),(0,X.jsxs)(BW,{side:`top`,children:[(0,X.jsx)(Wk.Name,{}),s&&(0,X.jsx)(`p`,{className:`aui-attachment-error-message`,children:s})]})]})})},IK=({name:e})=>(0,X.jsx)(Wk.Remove,{render:(0,X.jsx)(SK,{tooltip:`移除附件:${e}`,className:`aui-attachment-tile-remove absolute end-1 top-1 size-5 rounded-full bg-black/50! text-white after:absolute after:-inset-1.5 hover:bg-black/70! hover:text-white! active:scale-[0.96] motion-reduce:transition-none`,side:`top`}),children:(0,X.jsx)(mL,{className:`aui-attachment-remove-icon size-3 stroke-[2.5]`})}),LK=()=>(0,X.jsx)(`div`,{className:`aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2 empty:hidden`,children:(0,X.jsx)(MN.Attachments,{children:()=>(0,X.jsx)(FK,{})})}),RK=()=>(0,X.jsx)(`div`,{className:`aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden`,children:(0,X.jsx)(_M.Attachments,{children:()=>(0,X.jsx)(FK,{})})}),zK=()=>(0,X.jsx)(_M.AddAttachment,{render:(0,X.jsx)(SK,{tooltip:`添加附件`,side:`bottom`,variant:`ghost`,size:`icon`,className:`aui-composer-add-attachment text-muted-foreground hover:text-foreground hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30 size-7 rounded-full active:scale-[0.96] motion-reduce:transition-none`,"aria-label":`添加附件`}),children:(0,X.jsx)(QI,{className:`aui-attachment-add-icon size-4`})}),BK=globalThis.window===void 0?h.useEffect:h.useLayoutEffect,VK=`bg-background border border-border/60 dark:bg-popover`,HK=`bg-foreground/[0.04] forced-colors:border dark:bg-foreground/[0.06]`,UK=`bg-foreground text-background transition-[opacity,scale] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] hover:opacity-90 active:scale-[0.96] motion-reduce:transition-none forced-colors:border`,WK=`font-mono text-[11px] tracking-tight`;j();var GK=[`src`,`title`,`artwork`,`durationMs`,`className`],KK=[`src`,`poster`,`title`,`ratio`,`durationMs`,`className`];function qK(e){let t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function JK(e,t,n){var r;let[i,a]=(0,h.useState)({src:t});(0,h.useEffect)(()=>{let n=e.current;!n||n.readyState<HTMLMediaElement.HAVE_METADATA||Number.isFinite(n.duration)&&n.duration>=0&&a({src:t,duration:n.duration})},[e,t]);let o=n!==void 0&&Number.isFinite(n)?Math.max(0,n/1e3):void 0;return{duration:i.src===t?(r=i.duration)==null?o:r:o,setDurationFromMetadata:e=>{Number.isFinite(e)&&e>=0&&a({src:t,duration:e})}}}function YK(e){let{src:t,title:n,artwork:r,durationMs:i,className:a}=e,o=G(e,GK),s=(0,h.useRef)(null),[c,l]=(0,h.useState)({src:t,currentTime:0,playing:!1,hasError:!1}),{duration:u,setDurationFromMetadata:d}=JK(s,t,i),{currentTime:f,playing:p,hasError:m}=c.src===t?c:{src:t,currentTime:0,playing:!1,hasError:!1},g=e=>l(n=>A(A({},n.src===t?n:{src:t,currentTime:0,playing:!1,hasError:!1}),e)),_=n==null?`Audio`:n,v=n?` ${n}`:` audio`,y=u===void 0?`--:--`:qK(u);return(0,h.useEffect)(()=>{var e;(e=s.current)!=null&&e.error&&l({src:t,currentTime:0,playing:!1,hasError:!0})},[t]),(0,X.jsxs)(`div`,A(A({"data-slot":`audio-player`,className:Q(VK,`flex w-full max-w-md items-center gap-3 rounded-2xl p-3`,a)},o),{},{children:[r?(0,X.jsx)(`img`,{src:r,alt:``,className:`size-10 shrink-0 rounded-lg object-cover`}):null,(0,X.jsx)(`button`,{type:`button`,"aria-label":`${p?`Pause`:`Play`}${v}`,disabled:m,onClick:()=>{let e=s.current;e&&!m&&(p?(e.pause(),g({playing:!1})):e.play().then(()=>g({playing:!0}),()=>g(e.error?{hasError:!0,playing:!1}:{playing:!1})))},className:Q(UK,`flex size-9 shrink-0 items-center justify-center rounded-full disabled:cursor-default disabled:opacity-40`),children:p?(0,X.jsx)(WI,{"aria-hidden":!0,className:`size-4`}):(0,X.jsx)(XI,{"aria-hidden":!0,className:`ml-0.5 size-4`})}),(0,X.jsxs)(`div`,{className:`flex min-w-0 grow basis-16 flex-col gap-1.5`,children:[(0,X.jsx)(`span`,{className:`truncate text-[13.5px] font-medium`,children:_}),(0,X.jsx)(`input`,{type:`range`,min:0,max:u==null?0:u,step:.1,value:Math.min(f,u==null?0:u),"aria-label":`Seek`,"aria-valuetext":`${qK(f)} of ${y}`,disabled:m,onChange:e=>{let t=Number(e.currentTarget.value);if(!Number.isFinite(t))return;let n=Math.min(t,u==null?t:u);s.current&&(s.current.currentTime=n),g({currentTime:n})},className:`accent-foreground w-full`})]}),(0,X.jsxs)(`span`,{className:Q(WK,`text-muted-foreground tabular-nums`),children:[qK(f),`\xA0/ `,y]}),(0,X.jsx)(`audio`,{ref:s,src:t,preload:`metadata`,className:`hidden`,onLoadedMetadata:e=>{d(e.currentTarget.duration)},onTimeUpdate:e=>g({currentTime:e.currentTarget.currentTime}),onPlay:()=>g({playing:!0}),onPause:()=>g({playing:!1}),onError:()=>g({hasError:!0,playing:!1})}),m?(0,X.jsx)(`span`,{role:`alert`,className:`text-muted-foreground text-xs`,children:`Can't play this audio`}):null]}))}function XK(e){let{src:t,poster:n,title:r,ratio:i=`16:9`,durationMs:a,className:o}=e,s=G(e,KK),c=(0,h.useRef)(null),{duration:l,setDurationFromMetadata:u}=JK(c,t,a),d=i===`1:1`?`aspect-square`:i===`4:3`?`aspect-[4/3]`:i===`16:9`?`aspect-video`:i===`9:16`?`aspect-[9/16]`:void 0;return(0,X.jsxs)(`div`,A(A({"data-slot":`video-player`,className:Q(`flex w-full max-w-xl flex-col gap-2`,o)},s),{},{children:[(0,X.jsx)(`div`,{className:Q(HK,`overflow-hidden rounded-xl`,d),children:(0,X.jsx)(`video`,{ref:c,src:t,poster:n,controls:!0,playsInline:!0,preload:`metadata`,"aria-label":r==null?`Video`:r,className:Q(`block max-w-full`,i!==`auto`&&`h-full w-full object-contain`),onLoadedMetadata:e=>{u(e.currentTarget.duration)}})}),(r||l!==void 0)&&(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 px-1`,children:[r?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13.5px] font-medium`,children:r}):null,l===void 0?null:(0,X.jsx)(`span`,{className:Q(`font-mono text-[11px] tracking-tight`,`text-muted-foreground shrink-0 tabular-nums`),children:qK(l)})]})]}))}j();var ZK=[`className`,`variant`,`size`,`children`],QK=[`mimeType`,`className`,`children`],$K=[`className`,`children`],eq=[`bytes`,`className`],tq=[`data`,`mimeType`,`filename`,`sourceType`,`className`,`children`],nq=[`data`,`mimeType`,`filename`,`sourceType`,`className`],rq=GG(`aui-file-root inline-flex items-center gap-3 rounded-lg transition-colors`,{variants:{variant:{outline:`border-border hover:bg-muted/50 border`,ghost:`hover:bg-muted/50`,muted:`bg-muted/50 hover:bg-muted/70`},size:{sm:`px-2.5 py-1.5 text-xs`,default:`px-3 py-2 text-sm`,lg:`px-4 py-3 text-base`}},defaultVariants:{variant:`outline`,size:`default`}});function iq(e){let t=e.toLowerCase();return t.startsWith(`image/`)?MI:t===`application/pdf`?EI:t===`application/json`?eI:t.startsWith(`text/`)?EI:t.startsWith(`audio/`)?SI:t.startsWith(`video/`)?fL:OI}function aq(e,t){return t===`url`&&/^data:/i.test(e)?`data-uri`:t||(/^data:/i.test(e)?`data-uri`:/^(https?:\/\/|blob:)/i.test(e)?`url`:`base64`)}function oq(e){return/^[a-z][a-z\d+.-]*:/i.test(e)&&!/^(data:|https?:\/\/|blob:)/i.test(e)}function sq(e,t,n){if(oq(e))return null;let r=aq(e,n);return r===`id`?null:r===`data-uri`?/^data:[^,]*,/i.test(e)?e:null:r===`url`?/^(https?:\/\/|blob:)/i.test(e)?e:null:`data:${t};base64,${e}`}function cq(e){let t=e.endsWith(`==`)?2:+!!e.endsWith(`=`),n=e.search(/[^A-Za-z\d+/]/);return n!==-1&&n!==e.length-t||e.length%4==1||t>0&&e.length%4!=0?0:Math.floor(e.length*3/4)-t}function lq(e){return cq(/[\t\n\f\r ]/.test(e)?e.replace(/[\t\n\f\r ]/g,``):e)}function uq(e){let t=e.indexOf(`#`),n=t<0?e.length:t,r=e.indexOf(`,`);if(r<0||r>=n)return 0;let i=e.slice(r+1,n);return/;base64$/i.test(e.slice(0,r))?(/[%\t\n\f\r ]/.test(i)&&(i=i.replace(/%([\da-f]{2})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16))).replace(/[\t\n\f\r ]/g,``)),cq(i)):new TextEncoder().encode(i.replace(/%[\da-f]{2}/gi,`_`)).byteLength}function dq(e){var t;let n=(t=/^[^/;]+\/(?:x-)?(?:[^;+]*\.)?([^;+.\s]+)/.exec(e.toLowerCase()))==null?void 0:t[1];return!n||n===`octet-stream`?`文件`:n===`plain`?`文本文件`:`${n.toUpperCase()} 文件`}function fq(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function pq(e){let{className:t,variant:n,size:r,children:i}=e,a=G(e,ZK);return(0,X.jsx)(`div`,A(A({"data-slot":`file-root`,"data-variant":n,"data-size":r,className:Q(rq({variant:n,size:r,className:t}))},a),{},{children:i}))}function mq(e){let{mimeType:t,className:n,children:r}=e,i=G(e,QK),a=t?iq(t):OI;return(0,X.jsx)(`span`,A(A({"data-slot":`file-icon`,className:Q(`text-muted-foreground shrink-0`,n)},i),{},{children:r==null?(0,X.jsx)(a,{className:`size-5`}):r}))}function hq(e){let{className:t,children:n}=e,r=G(e,$K);return(0,X.jsx)(`span`,A(A({"data-slot":`file-name`,className:Q(`min-w-0 flex-1 truncate font-medium`,t)},r),{},{children:n||`未命名文件`}))}function gq(e){let{bytes:t,className:n}=e,r=G(e,eq);return(0,X.jsx)(`span`,A(A({"data-slot":`file-size`,className:Q(`text-muted-foreground shrink-0`,n)},r),{},{children:fq(t)}))}function _q(e){let{data:t,mimeType:n,filename:r,sourceType:i,className:a,children:o}=e,s=G(e,tq);if(typeof t!=`string`)return null;let c=aq(t,i),l=sq(t,n,i);return l?(0,X.jsx)(`a`,A(A(A({"data-slot":`file-download`,href:l,download:r||`download`},c===`url`&&{target:`_blank`,rel:`noopener noreferrer`}),{},{className:Q(`text-muted-foreground hover:bg-accent hover:text-accent-foreground shrink-0 rounded-md p-1 transition-colors`,a),"aria-label":o?void 0:`下载 ${r||`文件`}`},s),{},{children:o||(0,X.jsx)(bI,{className:`size-4`})})):null}function vq(e){let{data:t,mimeType:n,filename:r,sourceType:i,className:a}=e,o=G(e,nq),s=sq(t,n,i),c=n.toLowerCase();return!s||!c.startsWith(`audio/`)&&!c.startsWith(`video/`)?null:(0,X.jsx)(`div`,A(A({"data-slot":`file-player`,className:Q(`w-full`,a)},o),{},{children:c.startsWith(`audio/`)?(0,X.jsx)(YK,{src:s,title:r}):(0,X.jsx)(XK,{src:s,title:r})}))}var yq=(0,h.memo)(({filename:e,data:t,mimeType:n,sourceType:r})=>{let i=aq(t,r),a=typeof t==`string`&&(i===`base64`||i===`data-uri`),o=sq(t,n,r),s=n.toLowerCase().startsWith(`audio/`)||n.toLowerCase().startsWith(`video/`);return o&&s?(0,X.jsxs)(`div`,{className:`flex w-full max-w-xl flex-col gap-2`,children:[(0,X.jsx)(vq,A(A({data:t,mimeType:n},e!==void 0&&{filename:e}),r!==void 0&&{sourceType:r})),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-2 px-1`,children:[a&&(0,X.jsx)(gq,{bytes:i===`data-uri`?uq(t):lq(t),className:`text-muted-foreground text-[11px]`}),(0,X.jsx)(_q,A(A({data:t,mimeType:n},e!==void 0&&{filename:e}),r!==void 0&&{sourceType:r}))]})]}):(0,X.jsxs)(pq,{children:[(0,X.jsx)(mq,{mimeType:n}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,X.jsx)(hq,{children:e||dq(n)}),a&&(0,X.jsx)(gq,{bytes:i===`data-uri`?uq(t):lq(t),className:`text-xs`})]}),(0,X.jsx)(_q,A(A({data:t,mimeType:n},e!==void 0&&{filename:e}),r!==void 0&&{sourceType:r}))]})});yq.displayName=`File`,yq.Root=pq,yq.Icon=mq,yq.Name=hq,yq.Size=gq,yq.Download=_q,yq.Player=vq;var bq=()=>{let e=Y(e=>e.thread.suggestions);return(0,X.jsx)(`div`,{role:`group`,"aria-label":`后续问题建议`,className:`aui-thread-followup-suggestions -my-1 flex w-full flex-wrap items-center gap-2 py-1`,children:e.map((e,t)=>(0,X.jsx)(CP.Suggestion,{className:`aui-thread-followup-suggestion border-foreground/10 hover:bg-foreground/[0.03] hover:border-foreground/25 rounded-md border px-2.5 py-1 text-sm transition-colors ease-in motion-reduce:transition-none`,prompt:e.prompt,send:!0,children:e.label&&(0,X.jsx)(`span`,{className:`aui-thread-followup-suggestion-label text-muted-foreground`,children:e.label})},t))})},xq=()=>(0,X.jsx)(Td,{condition:e=>!e.thread.isEmpty&&!e.thread.isRunning&&e.thread.suggestions.length>0,children:(0,X.jsx)(bq,{})}),Sq=/^(?:[/?#]|\.{1,2}\/)/,Cq=new Set([`http:`,`https:`,`mailto:`]),wq=e=>{try{return new URL(e)}catch(e){return}};function Tq(e){if(typeof e!=`string`)return;let t=e.trim();if(t===``)return;let n=wq(t);return n?Cq.has(n.protocol)?t:void 0:Sq.test(t)?t:void 0}function Eq(e){var t,n;let r=Tq(e);return(r===void 0||(t=(n=wq(r))==null?void 0:n.hostname)==null?``:t).replace(/^www\./,``)||void 0}j();var Dq=[`className`,`variant`,`size`,`children`],Oq=[`className`,`containerClassName`,`ratio`,`fit`,`onLoad`,`onError`,`alt`,`src`],kq=[`className`,`label`,`url`,`iconUrl`],Aq=[`className`,`children`],jq=e=>{switch(e){case`image/png`:return`png`;case`image/jpeg`:case`image/jpg`:return`jpg`;case`image/webp`:return`webp`;case`image/gif`:return`gif`;case`image/svg+xml`:return`svg`;default:return`png`}},Mq=e=>{var t,n;let r=e.indexOf(`,`),i=r>=0?e.slice(0,r):e,a=r>=0?e.slice(r+1):``,o=(t=(n=i.match(/data:([^;]+)/i))==null||(n=n[1])==null?void 0:n.toLowerCase())==null?`application/octet-stream`:t;if(!/;base64/i.test(i)){let e=[],t=0;for(let n of a.matchAll(/(?:%[\da-f]{2})+/gi)){n.index>t&&e.push(a.slice(t,n.index));let r=n[0],i=new Uint8Array(r.length/3);for(let e=0;e<i.length;e++)i[e]=Number.parseInt(r.slice(e*3+1,e*3+3),16);e.push(i),t=n.index+r.length}return e.push(a.slice(t)),new Blob(e,{type:o})}let s;try{let e=a.replace(/%([\da-f]{2})/gi,(e,t)=>String.fromCharCode(Number.parseInt(t,16)));s=atob(e)}catch(e){return null}let c=new Uint8Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);return new Blob([c],{type:o})},Nq=e=>{var t;return(t=e.match(/^data:([^;,]+)/i))==null||(t=t[1])==null?void 0:t.toLowerCase()},Pq=e=>{let t=Nq(e);if(t)return`image.${jq(t)}`;try{var n;let t=(n=new URL(e,document.baseURI).pathname.split(`/`).pop())==null?``:n,r=t;try{r=decodeURIComponent(t)}catch(e){}if(/\.(png|jpe?g|webp|gif|svg)$/i.test(r))return r}catch(e){}return`image.png`},Fq=e=>{try{let t=new URL(e,document.baseURI);return t.protocol===`http:`||t.protocol===`https:`||t.protocol===`blob:`?e:null}catch(e){return null}},Iq=e=>{var t;if(typeof document>`u`)return;let n=(t=e.filename)==null?Pq(e.image):t,r=/^data:/i.test(e.image),i=r?Mq(e.image):null;if(r&&!i)return;let a=i?URL.createObjectURL(i):null,o=a==null?Fq(e.image):a;if(!o)return;let s=document.createElement(`a`);s.href=o,s.download=n,s.rel=`noopener`,document.body.appendChild(s),s.click(),document.body.removeChild(s),a&&setTimeout(()=>URL.revokeObjectURL(a),4e4)},Lq=function(){var e=O(function*(e){var t,n;if(typeof navigator>`u`||!navigator.clipboard||typeof ClipboardItem>`u`)throw Error(`Clipboard API is not available in this environment.`);let r=/^data:/i.test(e.image)?Mq(e.image):yield fetch(e.image).then(e=>e.blob());if(!r)return;let i=(t=(n=Nq(e.image))==null?r.type:n)==null?`image/png`:t;yield navigator.clipboard.write([new ClipboardItem({[i]:r})])});return function(t){return e.apply(this,arguments)}}(),Rq=GG(`aui-image-root relative overflow-hidden rounded-lg`,{variants:{variant:{outline:`border-border border`,ghost:``,muted:`bg-muted/50`},size:{sm:`max-w-64`,default:`max-w-96`,lg:`max-w-[512px]`,full:`w-full`}},defaultVariants:{variant:`outline`,size:`default`}});function zq(e){let{className:t,variant:n,size:r,children:i}=e,a=G(e,Dq);return(0,X.jsx)(`div`,A(A({"data-slot":`image-root`,"data-variant":n,"data-size":r,className:Q(Rq({variant:n,size:r,className:t}))},a),{},{children:i}))}function Bq(e){let{className:t,containerClassName:n,ratio:r=`auto`,fit:i=`contain`,onLoad:a,onError:o,alt:s=`Image content`,src:c}=e,l=G(e,Oq),u=(0,h.useRef)(null),[d,f]=(0,h.useState)(void 0),[p,m]=(0,h.useState)(void 0),g=d===c,_=p===c,v=r!==`auto`,y=r===`1:1`?`aspect-square`:r===`4:3`?`aspect-[4/3]`:r===`16:9`?`aspect-video`:r===`9:16`?`aspect-[9/16]`:void 0;return(0,h.useEffect)(()=>{let e=u.current;typeof c==`string`&&e!=null&&e.complete&&(e.naturalWidth>0?f(c):m(c))},[c]),(0,X.jsxs)(`div`,{"data-slot":`image-preview`,className:Q(`relative`,v?y:`min-h-32`,n),children:[!g&&!_&&(0,X.jsx)(`div`,{"data-slot":`image-preview-loading`,className:`bg-muted/50 absolute inset-0 flex items-center justify-center`,children:(0,X.jsx)(MI,{className:`text-muted-foreground size-8 animate-pulse`})}),_?(0,X.jsx)(`div`,{"data-slot":`image-preview-error`,className:Q(`bg-muted/50 flex min-h-32 items-center justify-center p-4`,v&&`absolute inset-0`),children:(0,X.jsx)(AI,{className:`text-muted-foreground size-8`})}):(0,X.jsx)(`img`,A({ref:u,src:c,alt:s,className:Q(v?Q(`block h-full w-full`,{"object-cover":i===`cover`,"object-contain":i===`contain`}):`block h-auto w-full object-contain`,!g&&`invisible`,t),onLoad:e=>{typeof c==`string`&&f(c),a==null||a(e)},onError:e=>{typeof c==`string`&&m(c),o==null||o(e)}},l))]})}function Vq(e){let{className:t,label:n,url:r,iconUrl:i}=e,a=G(e,kq),o=Tq(r),s=Eq(r),c=n||s,[l,u]=(0,h.useState)();if(!c)return null;let d=i!==void 0&&l!==i;return(0,X.jsxs)(`div`,A(A({"data-slot":`image-source`,className:Q(`text-muted-foreground flex items-center gap-2 border-t px-2 py-1.5 text-xs`,t)},a),{},{children:[d?(0,X.jsx)(`img`,{"data-slot":`image-source-icon`,src:i,alt:``,className:`size-4 shrink-0 rounded-sm`,onError:()=>u(i)}):(0,X.jsx)(`span`,{"data-slot":`image-source-icon-fallback`,"aria-hidden":`true`,className:`bg-muted flex size-4 shrink-0 items-center justify-center rounded-sm text-[10px] font-medium`,children:c.charAt(0).toUpperCase()}),o?(0,X.jsxs)(`a`,{"data-slot":`image-source-label`,href:o,target:`_blank`,rel:`noopener noreferrer`,className:`hover:text-foreground truncate`,children:[c,(0,X.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]}):(0,X.jsx)(`span`,{"data-slot":`image-source-label`,className:`truncate`,children:c})]}))}function Hq(e){let{className:t,children:n}=e,r=G(e,Aq);return n?(0,X.jsx)(`span`,A(A({"data-slot":`image-filename`,className:Q(`text-muted-foreground block truncate px-2 py-1.5 text-xs`,t)},r),{},{children:n})):null}function Uq({src:e,alt:t=`Image preview`,children:r}){let[i,a]=(0,h.useState)(!1),o=(0,h.useRef)(null),s=(0,h.useRef)(null),c=(0,h.useRef)(null),l=(0,h.useCallback)(()=>a(!0),[]),u=(0,h.useCallback)(()=>{var e;a(!1),(e=o.current)==null||e.focus()},[]);return(0,h.useEffect)(()=>{if(!i)return;let e=e=>{var t;if(e.key===`Escape`){u();return}if(e.key!==`Tab`)return;let n=(t=c.current)==null?void 0:t.querySelectorAll(`a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n==null?void 0:n[0],i=n==null?void 0:n[n.length-1];r&&i&&(e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus()))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i,u]),(0,h.useEffect)(()=>{if(!i)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i]),(0,h.useEffect)(()=>{var e;i&&((e=s.current)==null||e.focus())},[i]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{ref:o,onClick:l,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.click()):e.key===` `&&e.preventDefault()},onKeyUp:e=>{e.key===` `&&e.currentTarget.click()},role:`button`,tabIndex:0,className:`aui-image-zoom-trigger cursor-zoom-in`,"aria-label":`Click to zoom image`,children:r}),i&&(0,n.createPortal)((0,X.jsxs)(`div`,{ref:c,"data-slot":`image-zoom-overlay`,role:`dialog`,"aria-modal":`true`,className:`aui-image-zoom-overlay fade-in animate-in fixed inset-0 z-50 flex items-center justify-center bg-black/80 duration-200`,onClick:u,"aria-label":`Zoomed image`,children:[(0,X.jsx)(`img`,{"data-slot":`image-zoom-content`,src:e,alt:t,className:`aui-image-zoom-content fade-in zoom-in-95 animate-in max-h-[90%] max-w-[90%] cursor-zoom-out object-contain duration-200`,onClick:e=>{e.stopPropagation(),u()}}),(0,X.jsx)(`button`,{ref:s,type:`button`,"aria-label":`Close zoomed image`,onClick:e=>{e.stopPropagation(),u()},className:`text-muted-foreground hover:text-foreground bg-background/80 absolute end-4 top-4 rounded-md p-2`,children:(0,X.jsx)(mL,{className:`size-5`})})]}),document.body)]})}function Wq({className:e}){return(0,X.jsxs)(`div`,{"data-slot":`image-generating`,className:Q(`bg-muted/50 flex min-h-32 items-center justify-center p-4`,e),children:[(0,X.jsx)(PI,{className:`text-muted-foreground size-8 animate-spin`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Generating image…`})]})}function Gq({className:e,reason:t}){return(0,X.jsxs)(`div`,{"data-slot":`image-content-filter-error`,className:Q(`bg-muted/50 flex min-h-32 flex-col items-center justify-center gap-2 p-4 text-center`,e),children:[(0,X.jsx)(nL,{className:`text-muted-foreground size-8`}),(0,X.jsx)(`p`,{className:`text-sm font-medium`,children:`Image could not be generated`}),t&&(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:t})]})}function Kq({onRegenerate:e}){let[t,n]=(0,h.useState)(!1);return(0,X.jsx)(`button`,{type:`button`,onClick:function(){var t=O(function*(){n(!0);try{yield e()}catch(e){}finally{n(!1)}});return function(){return t.apply(this,arguments)}}(),disabled:t,"data-slot":`image-regenerate`,"aria-label":`Regenerate image`,className:`hover:bg-muted inline-flex size-7 items-center justify-center rounded disabled:opacity-50`,children:(0,X.jsx)(eL,{className:Q(`size-4`,t&&`animate-spin`)})})}function qq({part:e,onRegenerate:t,className:n}){return(0,X.jsxs)(`div`,{"data-slot":`image-actions`,className:Q(`flex items-center gap-1 p-1`,n),children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>Iq(e),"data-slot":`image-download`,"aria-label":`Download image`,className:`hover:bg-muted inline-flex size-7 items-center justify-center rounded`,children:(0,X.jsx)(bI,{className:`size-4`})}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>{Lq(e).catch(()=>{})},"data-slot":`image-copy`,"aria-label":`Copy image`,className:`hover:bg-muted inline-flex size-7 items-center justify-center rounded`,children:(0,X.jsx)(vI,{className:`size-4`})}),t&&(0,X.jsx)(Kq,{onRegenerate:t})]})}var Jq=(0,h.memo)(e=>{let{image:t,filename:n,status:r}=e;return(r==null?void 0:r.type)===`running`?(0,X.jsxs)(zq,{children:[(0,X.jsx)(Wq,{}),(0,X.jsx)(Hq,{children:n})]}):(r==null?void 0:r.type)===`incomplete`&&r.reason===`content-filter`?(0,X.jsx)(zq,{children:(0,X.jsx)(Gq,{reason:`The provider blocked this image.`})}):(0,X.jsxs)(zq,{children:[(0,X.jsx)(Uq,{src:t,alt:n||`Image content`,children:(0,X.jsx)(Bq,{src:t,alt:n||`Image content`})}),(0,X.jsx)(Hq,{children:n})]})});Jq.displayName=`Image`,Jq.Root=zq,Jq.Preview=Bq,Jq.Source=Vq,Jq.Filename=Hq,Jq.Zoom=Uq,Jq.Actions=qq,Jq.Generating=Wq,Jq.ContentFilterError=Gq,j();var Yq=[`node`],Xq=(e,t,n=0,r=!1)=>{if(Object.is(e,t))return!0;if(n>=100||typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Xq(e[r],t[r],n+1))return!1;return!0}if(Array.isArray(t))return!1;let i=Object.getPrototypeOf(e),a=Object.getPrototypeOf(t);if(i!==Object.prototype&&i!==null||a!==Object.prototype&&a!==null)return!1;let o=e,s=t,c=0;for(let e in o)if(Object.hasOwn(o,e)&&(!r||e!==`position`&&e!==`data`)){if(!Object.prototype.propertyIsEnumerable.call(s,e)||!Xq(o[e],s[e],n+1))return!1;c++}let l=0;for(let e in s)Object.hasOwn(s,e)&&(!r||e!==`position`&&e!==`data`)&&l++;return c===l},Zq=(e,t)=>!e||!t?!1:e===t||Xq(e.properties,t.properties,0,!0)&&Xq(e.children,t.children),Qq=(e,t)=>Zq(e.node,t.node),$q=(e={})=>Object.fromEntries(Object.entries(e==null?{}:e).map(([e,t])=>{if(!t)return[e,t];let n=t;return[e,(0,h.memo)(e=>{let{node:t}=e,r=G(e,Yq);return(0,X.jsx)(n,A({},r))},Qq)]}));j();var eJ=[`children`,`fallbackPre`],tJ=(0,h.createContext)(null),nJ=()=>(0,h.useContext)(tJ)!==null,rJ=(0,h.memo)(e=>{var t,n;let{children:r,fallbackPre:i}=e,a=G(e,eJ);return(t=(n=a.node)==null?void 0:n.children.some(e=>e.type===`element`&&e.tagName===`code`))==null||t?(0,X.jsx)(tJ.Provider,{value:a,children:r}):(0,X.jsx)(i,A(A({},a),{},{children:r}))},(e,t)=>e.fallbackPre===t.fallbackPre&&Qq(e,t));j();var iJ=[`node`],aJ=[`node`],oJ=e=>{let{node:t}=e,n=G(e,iJ);return(0,X.jsx)(`pre`,A({},n))},sJ=e=>{let{node:t}=e,n=G(e,aJ);return(0,X.jsx)(`code`,A({},n))},cJ=({node:e,components:{Pre:t,Code:n},code:r})=>(0,X.jsx)(t,{children:(0,X.jsx)(n,{node:e,children:r})}),lJ=()=>null,uJ=e=>{var t,n;return(t=(n=/language-([^\s]+)/.exec(e==null?``:e))==null?void 0:n[1])==null?``:t},dJ=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},language:a,code:o})=>{let s=(0,h.useMemo)(()=>({Pre:t,Code:n}),[t,n]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(i,{node:e,language:a,code:o}),(0,X.jsx)(r,{node:e,components:s,language:a,code:o})]})},fJ=m(u(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1);j();var pJ=[`className`],mJ=[`className`],hJ=e=>{let{className:t}=e,n=G(e,pJ);return e=>{let{className:r}=e,i=G(e,mJ);return A(A({className:(0,fJ.default)(t,r)},n),i)}};j();var gJ=[`node`,`components`,`componentsByLanguage`,`children`],_J=[`node`,`components`,`componentsByLanguage`],vJ=(0,h.createContext)(null);function yJ(e){let{Pre:t,preProps:n}=(0,h.useContext)(vJ);return(0,X.jsx)(t,A({},hJ(n)(e)))}function bJ(e){let{Code:t,codeProps:n}=(0,h.useContext)(vJ);return(0,X.jsx)(t,A({},hJ(n)(e)))}function xJ(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=``;for(let n of e)t+=xJ(n);return t}return(0,h.isValidElement)(e)?xJ(e.props.children):``}var SJ=e=>{var t,n,r,i;let{node:a,components:{Pre:o,Code:s,SyntaxHighlighter:c,CodeHeader:l},componentsByLanguage:u={},children:d}=e,f=G(e,gJ),p={Pre:o,Code:s,preProps:(0,h.useContext)(tJ),codeProps:f},m=uJ(f.className),g=(t=(n=u[m])==null?void 0:n.SyntaxHighlighter)==null?c:t,_=(r=(i=u[m])==null?void 0:i.CodeHeader)==null?l:r;return d!=null&&typeof d!=`string`?(0,X.jsxs)(vJ.Provider,{value:p,children:[(0,X.jsx)(_,{node:a,language:m,code:xJ(d)}),(0,X.jsx)(cJ,{node:a,components:{Pre:yJ,Code:bJ},code:d})]}):(0,X.jsx)(vJ.Provider,{value:p,children:(0,X.jsx)(dJ,{node:a,components:{Pre:yJ,Code:bJ,SyntaxHighlighter:g,CodeHeader:_},language:m,code:d==null?``:d})})},CJ=e=>{let{node:t,components:n,componentsByLanguage:r}=e,i=G(e,_J);return nJ()?(0,X.jsx)(SJ,A({node:t,components:n,componentsByLanguage:r},i)):(0,X.jsx)(n.Code,A({},i))},wJ=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n){if(!Object.hasOwn(t,r))return!1;let n=e[r],i=t[r];if(n!==i&&(!n||!i||n.SyntaxHighlighter!==i.SyntaxHighlighter||n.CodeHeader!==i.CodeHeader))return!1}return!0},TJ=(0,h.memo)(CJ,(e,t)=>e.components===t.components&&wJ(e.componentsByLanguage,t.componentsByLanguage)&&Qq(e,t));function EJ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}RegExp(`[$_\\p{ID_Start}]`,`u`),RegExp(`[$_\\u{200C}\\u{200D}\\p{ID_Continue}]`,`u`),RegExp(`[-$_\\u{200C}\\u{200D}\\p{ID_Continue}]`,`u`);var DJ=RegExp(`^[$_\\p{ID_Start}][$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$`,`u`),OJ=RegExp(`^[$_\\p{ID_Start}][-$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$`,`u`),kJ={};function AJ(e,t){return((t||kJ).jsx?OJ:DJ).test(e)}var jJ=/[ \t\n\f\r]/g;function MJ(e){return typeof e==`object`?e.type===`text`&&NJ(e.value):NJ(e)}function NJ(e){return e.replace(jJ,``)===``}var PJ=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};PJ.prototype.normal={},PJ.prototype.property={},PJ.prototype.space=void 0;function FJ(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new PJ(n,r,t)}function IJ(e){return e.toLowerCase()}var LJ=class{constructor(e,t){this.attribute=t,this.property=e}};LJ.prototype.attribute=``,LJ.prototype.booleanish=!1,LJ.prototype.boolean=!1,LJ.prototype.commaOrSpaceSeparated=!1,LJ.prototype.commaSeparated=!1,LJ.prototype.defined=!1,LJ.prototype.mustUseProperty=!1,LJ.prototype.number=!1,LJ.prototype.overloadedBoolean=!1,LJ.prototype.property=``,LJ.prototype.spaceSeparated=!1,LJ.prototype.space=void 0;var RJ=d({boolean:()=>BJ,booleanish:()=>VJ,commaOrSpaceSeparated:()=>GJ,commaSeparated:()=>WJ,number:()=>$,overloadedBoolean:()=>HJ,spaceSeparated:()=>UJ}),zJ=0,BJ=KJ(),VJ=KJ(),HJ=KJ(),$=KJ(),UJ=KJ(),WJ=KJ(),GJ=KJ();function KJ(){return Math.pow(2,++zJ)}var qJ=Object.keys(RJ),JJ=class extends LJ{constructor(e,t,n,r){let i=-1;if(super(e,t),YJ(this,`space`,r),typeof n==`number`)for(;++i<qJ.length;){let e=qJ[i];YJ(this,qJ[i],(n&RJ[e])===RJ[e])}}};JJ.prototype.defined=!0;function YJ(e,t,n){n&&(e[t]=n)}function XJ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new JJ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[IJ(r)]=r,n[IJ(a.attribute)]=r}return new PJ(t,n,e.space)}var ZJ=XJ({properties:{ariaActiveDescendant:null,ariaAtomic:VJ,ariaAutoComplete:null,ariaBusy:VJ,ariaChecked:VJ,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:UJ,ariaCurrent:null,ariaDescribedBy:UJ,ariaDetails:null,ariaDisabled:VJ,ariaDropEffect:UJ,ariaErrorMessage:null,ariaExpanded:VJ,ariaFlowTo:UJ,ariaGrabbed:VJ,ariaHasPopup:null,ariaHidden:VJ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:UJ,ariaLevel:$,ariaLive:null,ariaModal:VJ,ariaMultiLine:VJ,ariaMultiSelectable:VJ,ariaOrientation:null,ariaOwns:UJ,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:VJ,ariaReadOnly:VJ,ariaRelevant:null,ariaRequired:VJ,ariaRoleDescription:UJ,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:VJ,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function QJ(e,t){return t in e?e[t]:t}function $J(e,t){return QJ(e,t.toLowerCase())}var eY=XJ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:WJ,acceptCharset:UJ,accessKey:UJ,action:null,allow:null,allowFullScreen:BJ,allowPaymentRequest:BJ,allowUserMedia:BJ,alpha:BJ,alt:null,as:null,async:BJ,autoCapitalize:null,autoComplete:UJ,autoFocus:BJ,autoPlay:BJ,blocking:UJ,capture:null,charSet:null,checked:BJ,cite:null,className:UJ,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:VJ,controls:BJ,controlsList:UJ,coords:$|WJ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:BJ,defer:BJ,dir:null,dirName:null,disabled:BJ,download:HJ,draggable:VJ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:BJ,formTarget:null,headers:UJ,height:$,hidden:HJ,high:$,href:null,hrefLang:null,htmlFor:UJ,httpEquiv:UJ,id:null,imageSizes:null,imageSrcSet:null,inert:BJ,inputMode:null,integrity:null,is:null,isMap:BJ,itemId:null,itemProp:UJ,itemRef:UJ,itemScope:BJ,itemType:UJ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:BJ,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:BJ,muted:BJ,name:null,nonce:null,noModule:BJ,noValidate:BJ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:BJ,optimum:$,pattern:null,ping:UJ,placeholder:null,playsInline:BJ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:BJ,referrerPolicy:null,rel:UJ,required:BJ,reversed:BJ,rows:$,rowSpan:$,sandbox:UJ,scope:null,scoped:BJ,seamless:BJ,selected:BJ,shadowRootClonable:BJ,shadowRootCustomElementRegistry:BJ,shadowRootDelegatesFocus:BJ,shadowRootMode:null,shadowRootSerializable:BJ,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:VJ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:BJ,useMap:null,value:VJ,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:UJ,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:BJ,declare:BJ,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:BJ,noHref:BJ,noShade:BJ,noWrap:BJ,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:VJ,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:BJ,disablePictureInPicture:BJ,disableRemotePlayback:BJ,exportParts:WJ,part:UJ,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:$J}),tY=XJ({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:GJ,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:UJ,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:BJ,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:WJ,g2:WJ,glyphName:WJ,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:GJ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:UJ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:GJ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:GJ,rev:GJ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:GJ,requiredFeatures:GJ,requiredFonts:GJ,requiredFormats:GJ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:GJ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:GJ,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:GJ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:QJ}),nY=XJ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),rY=XJ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$J}),iY=XJ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),aY={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},oY=/[A-Z]/g,sY=/-[a-z]/g,cY=/^data[-\w.:]+$/i;function lY(e,t){let n=IJ(t),r=t,i=LJ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&cY.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(sY,dY);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!sY.test(e)){let n=e.replace(oY,uY);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=JJ}return new i(r,t)}function uY(e){return`-`+e.toLowerCase()}function dY(e){return e.charAt(1).toUpperCase()}var fY=FJ([ZJ,eY,nY,rY,iY],`html`),pY=FJ([ZJ,tY,nY,rY,iY],`svg`);function mY(e){return e.join(` `).trim()}var hY=/\/\*(?:[^*]|\*(?!\/))*\*\//g,gY=/\n/g,_Y=/^\s*/,vY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,yY=/^:\s*/,bY=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,xY=/^[;\s]*/,SY=`
61
+ `,CY=`/`,wY=`*`,TY=``,EY=`comment`,DY=`declaration`;function OY(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t=t||{};var n=1,r=1;function i(e){var t=e.match(gY);t&&(n+=t.length);var i=e.lastIndexOf(SY);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(_Y)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(CY==e.charAt(0)&&wY==e.charAt(1)){for(var n=2;TY!=e.charAt(n)&&(wY!=e.charAt(n)||CY!=e.charAt(n+1));)++n;if(n+=2,TY===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:EY,comment:o})}}function f(){var e=a(),t=c(vY);if(t){if(d(),!c(yY))return s(`property missing ':'`);var n=c(bY),r=e({type:DY,property:t[0].replace(hY,TY).trim(),value:n?n[0].replace(hY,TY).trim():TY});return c(xY),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function kY(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=OY(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;if(i)t(r,a,e);else if(a){var o;n=(o=n)==null?{}:o,n[r]=a}}),n}var AY=MY(`end`),jY=MY(`start`);function MY(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function NY(e){let t=jY(e),n=AY(e);if(t&&n)return{start:t,end:n}}function PY(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?IY(e.position):`start`in e||`end`in e?IY(e):`line`in e||`column`in e?FY(e):``}function FY(e){return LY(e&&e.line)+`:`+LY(e&&e.column)}function IY(e){return FY(e&&e.start)+`-`+FY(e&&e.end)}function LY(e){return e&&typeof e==`number`?e:1}j();var RY=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:A({},t)),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=PY(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};RY.prototype.file=``,RY.prototype.name=``,RY.prototype.reason=``,RY.prototype.message=``,RY.prototype.stack=``,RY.prototype.column=void 0,RY.prototype.line=void 0,RY.prototype.ancestors=void 0,RY.prototype.cause=void 0,RY.prototype.fatal=void 0,RY.prototype.place=void 0,RY.prototype.ruleId=void 0,RY.prototype.source=void 0;var zY={}.hasOwnProperty,BY=new Map,VY=/[A-Z]/g,HY=/-([a-z])/g,UY=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),WY=new Set([`td`,`th`]),GY=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function KY(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=rX(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=nX(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?pY:fY,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=qY(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function qY(e,t,n){if(t.type===`element`)return JY(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return YY(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return ZY(e,t,n);if(t.type===`mdxjsEsm`)return XY(e,t);if(t.type===`root`)return QY(e,t,n);if(t.type===`text`)return $Y(e,t)}function JY(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=pY,e.schema=i),e.ancestors.push(t);let a=lX(e,t.tagName,!1),o=iX(e,t),s=oX(e,t);return UY.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!MJ(e)})),eX(e,o,a,t),tX(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function YY(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}uX(e,t.position)}function XY(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);uX(e,t.position)}function ZY(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=pY,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:lX(e,t.name,!0),o=aX(e,t),s=oX(e,t);return eX(e,o,a,t),tX(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function QY(e,t,n){let r={};return tX(r,oX(e,t)),e.create(t,e.Fragment,r,n)}function $Y(e,t){return t.value}function eX(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tX(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function nX(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function rX(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=jY(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function iX(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&zY.call(t.properties,i)){let a=sX(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&WY.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||(n.style={});t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function aX(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else uX(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else uX(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function oX(e,t){let n=[],r=-1,i=e.passKeys?new Map:BY;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=qY(e,a,o);s!==void 0&&n.push(s)}return n}function sX(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=lY(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?EJ(n):mY(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:dX(n):cX(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?aY[r.property]||r.property:r.attribute,n]}function cX(e,t){let n={};try{kY(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(HY,mX))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new RY("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=GY+`#cannot-parse-style-attribute`,r}return n}function lX(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=AJ(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=AJ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return zY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);uX(e)}function uX(e,t){let n=new RY("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=GY+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function dX(e){let t={},n;for(n in e)zY.call(e,n)&&(t[fX(n)]=e[n]);return t}function fX(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(VY,pX);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function pX(e){return`-`+e.toLowerCase()}function mX(e,t){return t.toUpperCase()}var hX={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},gX={};function _X(e,t){let n=t||gX;return vX(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function vX(e,t,n){if(bX(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return yX(e.children,t,n)}return Array.isArray(e)?yX(e,t,n):``}function yX(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=vX(e[i],t,n);return r.join(``)}function bX(e){return!!(e&&typeof e==`object`)}var xX=document.createElement(`i`);function SX(e){let t=`&`+e+`;`;xX.innerHTML=t;let n=xX.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function CX(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function wX(e,t){return e.length>0?(CX(e,e.length,0,t),e):t}var TX={}.hasOwnProperty;function EX(e){let t={},n=-1;for(;++n<e.length;)DX(t,e[n]);return t}function DX(e,t){let n;for(n in t){let r=(TX.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){TX.call(r,a)||(r[a]=[]);let e=i[a];OX(r[a],Array.isArray(e)?e:e?[e]:[])}}}function OX(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);CX(e,0,0,r)}function kX(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function AX(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var jX=UX(/[A-Za-z]/),MX=UX(/[\dA-Za-z]/),NX=UX(/[#-'*+\--9=?A-Z^-~]/);function PX(e){return e!==null&&(e<32||e===127)}var FX=UX(/\d/),IX=UX(/[\dA-Fa-f]/),LX=UX(/[!-/:-@[-`{-~]/);function RX(e){return e!==null&&e<-2}function zX(e){return e!==null&&(e<0||e===32)}function BX(e){return e===-2||e===-1||e===32}var VX=UX(RegExp(`\\p{P}|\\p{S}`,`u`)),HX=UX(/\s/);function UX(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function WX(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&MX(e.charCodeAt(n+1))&&MX(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=``),i&&(n+=i,i=0)}return t.join(``)+e.slice(r)}function GX(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return BX(r)?(e.enter(n),s(r)):t(r)}function s(r){return BX(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function KX(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&BX(t)?(e.enter(r),c(t)):l(t)}function c(t){return BX(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var qX={tokenize:JX};function JX(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GX(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return RX(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var YX=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){XX(this,e,t,n,!1)}addBefore(e,t,n){XX(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function XX(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}j();var ZX={tokenize:$X},QX={tokenize:eZ};function $X(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end=A({},o),s++;let c=new YX;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(QX,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(QX,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i=i||t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return RX(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end=A({},c),e++;let l=new YX;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function eZ(e,t,n){return GX(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function tZ(e){if(e===null||zX(e)||HX(e))return 1;if(VX(e))return 2}function nZ(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}j();var rZ={name:`attention`,resolveAll:iZ,tokenize:aZ};function iZ(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o=A({},e[i][1].end),s=A({},e[n][1].start);oZ(o,-a),oZ(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:A({},e[i][1].end)},l={type:a>1?`strongSequence`:`emphasisSequence`,start:A({},e[n][1].start),end:s},u={type:a>1?`strongText`:`emphasisText`,start:A({},e[i][1].end),end:A({},e[n][1].start)},d={type:a>1?`strong`:`emphasis`,start:A({},c.start),end:A({},l.end)};e[i][1].end=A({},c.start),e[n][1].start=A({},l.end),r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=wX(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=wX(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=wX(r,nZ(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=wX(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=wX(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),CX(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function aZ(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tZ(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=tZ(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function oZ(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var sZ={name:`autolink`,tokenize:cZ};function cZ(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return jX(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||MX(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||MX(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||PX(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):NX(t)?(e.consume(t),l):n(t)}function u(e){return MX(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||MX(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var lZ={partial:!0,tokenize:uZ};function uZ(e,t,n){return r;function r(t){return BX(t)?GX(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||RX(e)?t(e):n(e)}}var dZ={continuation:{tokenize:pZ},exit:mZ,name:`blockQuote`,tokenize:fZ};function fZ(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||(e.enter(`blockQuote`,{_container:!0}),n.open=!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return BX(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pZ(e,t,n){let r=this;return i;function i(t){return BX(t)?GX(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dZ,t,n)(r)}}function mZ(e){e.exit(`blockQuote`)}var hZ={name:`characterEscape`,tokenize:gZ};function gZ(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return LX(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _Z={name:`characterReference`,tokenize:vZ};function vZ(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=MX,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=IX,u):(e.enter(`characterReferenceValue`),a=7,o=FX,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===MX&&!SX(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var yZ={partial:!0,tokenize:bZ};function bZ(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var xZ={concrete:!0,name:`codeFenced`,tokenize:SZ};function SZ(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),BX(t)?GX(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||RX(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yZ,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||RX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):BX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),GX(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||RX(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||RX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&BX(t)?GX(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||RX(t)?e.check(yZ,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||RX(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),BX(t)?GX(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),BX(t)?GX(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||RX(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var CZ={name:`codeIndented`,tokenize:TZ},wZ={partial:!0,tokenize:EZ};function TZ(e,t,n){return r;function r(t){return e.enter(`codeIndented`),KX(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):RX(t)?e.attempt(wZ,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||RX(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function EZ(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):RX(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):KX(e,t,a,`linePrefix`,4,4)(o)}function a(e){return RX(e)?i(e):n(e)}}var DZ={name:`codeText`,previous:kZ,resolve:OZ,tokenize:AZ};function OZ(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function kZ(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function AZ(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):RX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||RX(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var jZ=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t==null?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&MZ(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),MZ(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),MZ(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);MZ(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);MZ(this.left,t.reverse())}}}};function MZ(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}j();function NZ(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jZ(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,PZ(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end=A({},u.get(i)[1].start),s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return CX(e,0,1/0,u.slice(0)),!l}function PZ(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var FZ={resolve:LZ,tokenize:RZ},IZ={partial:!0,tokenize:zZ};function LZ(e){return NZ(e),e}function RZ(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):RX(t)?e.check(IZ,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function zZ(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GX(e,a,`linePrefix`)}function a(i){if(i===null||RX(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function BZ(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||PX(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||RX(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||zX(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||PX(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function VZ(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):RX(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||RX(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||(c=!BX(t)),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function HZ(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):RX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GX(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||RX(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function UZ(e,t){let n;return r;function r(i){return RX(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):BX(i)?GX(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var WZ={name:`definition`,tokenize:KZ},GZ={partial:!0,tokenize:qZ};function KZ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return VZ.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=AX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return zX(t)?UZ(e,l)(t):l(t)}function l(t){return BZ(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(GZ,d,d)(t)}function d(t){return BX(t)?GX(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||RX(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qZ(e,t,n){return r;function r(t){return zX(t)?UZ(e,i)(t):n(t)}function i(t){return HZ(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return BX(t)?GX(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||RX(e)?t(e):n(e)}}var JZ={name:`hardBreakEscape`,tokenize:YZ};function YZ(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return RX(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var XZ={name:`headingAtx`,resolve:ZZ,tokenize:QZ};function ZZ(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};CX(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function QZ(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||zX(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||RX(n)?(e.exit(`atxHeading`),t(n)):BX(n)?GX(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||zX(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $Z=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),eQ=[`pre`,`script`,`style`,`textarea`],tQ={concrete:!0,name:`htmlFlow`,resolveTo:rQ,tokenize:iQ},nQ={partial:!0,tokenize:aQ};function rQ(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function iQ(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):jX(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):jX(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return jX(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||zX(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&eQ.includes(l)?(i=1,r.interrupt?t(s):O(s)):$Z.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||MX(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return BX(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||jX(t)?(e.consume(t),b):BX(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||MX(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):BX(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):BX(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||RX(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||zX(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||BX(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||RX(t)?O(t):BX(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):RX(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(nQ,R,k)(t)):t===null||RX(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(yZ,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||RX(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return eQ.includes(n)?(e.consume(t),L):O(t)}return jX(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||RX(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function aQ(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lZ,t,n)}}var oQ={name:`htmlText`,tokenize:sQ};function sQ(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):jX(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):jX(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):RX(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):RX(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):RX(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):RX(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return jX(t)?(e.consume(t),S):n(t)}function S(t){return t===45||MX(t)?(e.consume(t),S):C(t)}function C(t){return RX(t)?(o=C,N(t)):BX(t)?(e.consume(t),C):M(t)}function w(t){return t===45||MX(t)?(e.consume(t),w):t===47||t===62||zX(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||jX(t)?(e.consume(t),E):RX(t)?(o=T,N(t)):BX(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||MX(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):RX(t)?(o=D,N(t)):BX(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):RX(t)?(o=O,N(t)):BX(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):RX(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||zX(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||zX(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return BX(t)?GX(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}j();var cQ={name:`labelEnd`,resolveAll:fQ,resolveTo:pQ,tokenize:mQ},lQ={tokenize:hQ},uQ={tokenize:gQ},dQ={tokenize:_Q};function fQ(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&CX(e,0,e.length,n),e}function pQ(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:A({},e[i][1].start),end:A({},e[e.length-1][1].end)},c={type:`label`,start:A({},e[i][1].start),end:A({},e[a][1].end)},l={type:`labelText`,start:A({},e[i+r+2][1].end),end:A({},e[a-2][1].start)};return o=[[`enter`,s,t],[`enter`,c,t]],o=wX(o,e.slice(i+1,i+r+3)),o=wX(o,[[`enter`,l,t]]),o=wX(o,nZ(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=wX(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=wX(o,e.slice(a+1)),o=wX(o,[[`exit`,s,t]]),CX(e,i,e.length,o),e}function mQ(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(AX(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(lQ,u,o?u:d)(t):t===91?e.attempt(uQ,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(dQ,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function hQ(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return zX(t)?UZ(e,a)(t):a(t)}function a(t){return t===41?u(t):BZ(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return zX(t)?UZ(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?HZ(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return zX(t)?UZ(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function gQ(e,t,n){let r=this;return i;function i(t){return VZ.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(AX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function _Q(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var vQ={name:`labelStartImage`,resolveAll:cQ.resolveAll,tokenize:yQ};function yQ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var bQ={name:`labelStartLink`,resolveAll:cQ.resolveAll,tokenize:xQ};function xQ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var SQ={name:`lineEnding`,tokenize:CQ};function CQ(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GX(e,t,`linePrefix`)}}var wQ={name:`thematicBreak`,tokenize:TQ};function TQ(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||RX(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),BX(t)?GX(e,s,`whitespace`)(t):s(t))}}var EQ={continuation:{tokenize:AQ},exit:MQ,name:`list`,tokenize:kQ},DQ={partial:!0,tokenize:NQ},OQ={partial:!0,tokenize:jQ};function kQ(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:FX(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(wQ,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return FX(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(lZ,r.interrupt?n:u,e.attempt(DQ,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return BX(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function AQ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lZ,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,GX(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!BX(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(OQ,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,GX(e,e.attempt(EQ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function jQ(e,t,n){let r=this;return GX(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function MQ(e){e.exit(this.containerState.type)}function NQ(e,t,n){let r=this;return GX(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!BX(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}j();var PQ={name:`setextUnderline`,resolveTo:FQ,tokenize:IQ};function FQ(e,t){let n=new YX,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:A({},e[i][1].start),end:A({},e[e.length-1][1].end)};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end=A({},e[o][1].end)):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function IQ(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),BX(t)?GX(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||RX(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var LQ={tokenize:RQ};function RQ(e){let t=this,n=e.attempt(lZ,r,e.attempt(this.parser.constructs.flowInitial,i,GX(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FZ,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}j();var zQ={resolveAll:UQ()},BQ=HQ(`string`),VQ=HQ(`text`);function HQ(e){return{resolveAll:UQ(e===`text`?WQ:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function UQ(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function WQ(e,t){let n=new YX,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:A({},i.end)};i.end=A({},a.start),i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var GQ=d({attentionMarkers:()=>$Q,contentInitial:()=>qQ,disable:()=>e$,document:()=>KQ,flow:()=>YQ,flowInitial:()=>JQ,insideSpan:()=>QQ,string:()=>XQ,text:()=>ZQ}),KQ={42:EQ,43:EQ,45:EQ,48:EQ,49:EQ,50:EQ,51:EQ,52:EQ,53:EQ,54:EQ,55:EQ,56:EQ,57:EQ,62:dZ},qQ={91:WZ},JQ={[-2]:CZ,[-1]:CZ,32:CZ},YQ={35:XZ,42:wQ,45:[PQ,wQ],60:tQ,61:PQ,95:wQ,96:xZ,126:xZ},XQ={38:_Z,92:hZ},ZQ={[-5]:SQ,[-4]:SQ,[-3]:SQ,33:vQ,38:_Z,42:rZ,60:[sZ,oQ],91:bQ,92:[JZ,hZ],93:cQ,95:rZ,96:DZ},QQ={null:[rZ,zQ]},$Q={null:[42,95]},e$={null:[]};function t$(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=wX(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=nZ(a,l.events,l),l.events):[]}function f(e,t){return r$(p(e),t)}function p(e){return n$(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){RX(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&CX(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function n$(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function r$(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
62
62
  `;break;case-3:o=`\r
63
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function n$(e){let t={constructs:wX([UQ,...(e||{}).extensions||[]]),content:n(GX),defined:[],document:n(YX),flow:n(FQ),lazy:{},string:n(RQ),text:n(zQ)};return t;function n(e){return n;function n(n){return $Q(t,e,n)}}}function r$(e){for(;!jZ(e););return e}var i$=/[\0\t\n\r]/g;function a$(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&(i.charCodeAt(0)===65279&&c++,n=void 0);c<i.length;){i$.lastIndex=c;let n=i$.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var o$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s$(e){return e.replace(o$,c$)}function c$(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return DX(n.slice(t?2:1),t?16:10)}return bX(n)||e}j();var l$={}.hasOwnProperty;function u$(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),d$(n)(r$(n$(n).document().write(a$()(e,t,!0))))}function d$(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(de),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(se),blockQuote:o(ie),characterEscape:E,characterReference:E,codeFenced:o(W),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(W,s),codeText:o(ae,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(G),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(oe),hardBreakEscape:o(ce),hardBreakTrailing:o(ce),htmlFlow:o(le,s),htmlFlowData:E,htmlText:o(le,s),htmlTextData:E,image:o(ue),label:s,link:o(de),listItem:o(pe),listItemValue:p,listOrdered:o(fe,f),listUnordered:o(fe),paragraph:o(me),reference:ee,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(se),strong:o(he),thematicBreak:o(_e)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:re,autolinkProtocol:U,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:H,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(N),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(j),htmlFlowData:D,htmlText:l(M),htmlTextData:D,image:l(F),label:L,labelText:I,lineEnding:O,link:l(P),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:R,resourceTitleString:z,resource:B,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};p$(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,A(A({},o),{},{sliceSerialize:e[p][2].sliceSerialize}),e[p][1]),l$.call(n,e[p][1].type)&&n[e[p][1].type].call(A(A({},o),{},{sliceSerialize:e[p][2].sliceSerialize}),e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,A(A({},o),{},{sliceSerialize:e[p][2].sliceSerialize}),e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||h$).call(o,void 0,e[0])}for(r.position={start:f$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:f$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:f$(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+MY({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||h$).call(this,e,r[0])),n.position.end=f$(e.end)}function d(){return hX(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=OX(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=ge(),n.position={start:f$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=f$(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=f$(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function I(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=s$(t),n.identifier=OX(t).toLowerCase()}function L(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function z(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function B(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function V(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=OX(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function te(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=DX(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=bX(t);let i=this.stack[this.stack.length-1];i.value+=r}function H(e){let t=this.stack.pop();t.position.end=f$(e.end)}function U(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ie(){return{type:`blockquote`,children:[],position:void 0}}function W(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function ae(){return{type:`inlineCode`,value:``,position:void 0}}function G(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function oe(){return{type:`emphasis`,children:[],position:void 0}}function se(){return{type:`heading`,depth:0,children:[],position:void 0}}function ce(){return{type:`break`,position:void 0}}function le(){return{type:`html`,value:``,position:void 0}}function ue(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function de(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function fe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function pe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function me(){return{type:`paragraph`,children:[],position:void 0}}function he(){return{type:`strong`,children:[],position:void 0}}function ge(){return{type:`text`,value:``,position:void 0}}function _e(){return{type:`thematicBreak`,position:void 0}}}function f$(e){return{line:e.line,column:e.column,offset:e.offset}}function p$(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?p$(e,r):m$(e,r)}}function m$(e,t){let n;for(n in t)if(l$.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function h$(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+MY({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+MY({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+MY({start:t.start,end:t.end})+`) is still open`)}j();function g$(e){let t=this;t.parser=n;function n(n){return u$(n,A(A(A({},t.data(`settings`)),e),{},{extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]}))}}function _$(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function v$(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
64
- `}]}function y$(e,t){let n=t.value?t.value+`
65
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function b$(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x$(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S$(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=HX(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function C$(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w$(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function T$(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function E$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return T$(e,t);let i={src:HX(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function D$(e,t){let n={src:HX(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function O$(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function k$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return T$(e,t);let i={href:HX(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function A$(e,t){let n={href:HX(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function j$(e,t,n){let r=e.all(t),i=n?M$(n):N$(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
63
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function i$(e){let t={constructs:EX([GQ,...(e||{}).extensions||[]]),content:n(qX),defined:[],document:n(ZX),flow:n(LQ),lazy:{},string:n(BQ),text:n(VQ)};return t;function n(e){return n;function n(n){return t$(t,e,n)}}}function a$(e){for(;!NZ(e););return e}var o$=/[\0\t\n\r]/g;function s$(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&(i.charCodeAt(0)===65279&&c++,n=void 0);c<i.length;){o$.lastIndex=c;let n=o$.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var c$=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l$(e){return e.replace(c$,u$)}function u$(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return kX(n.slice(t?2:1),t?16:10)}return SX(n)||e}j();var d$={}.hasOwnProperty;function f$(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),p$(n)(a$(i$(n).document().write(s$()(e,t,!0))))}function p$(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(de),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(se),blockQuote:o(ie),characterEscape:E,characterReference:E,codeFenced:o(W),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(W,s),codeText:o(ae,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(G),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(oe),hardBreakEscape:o(ce),hardBreakTrailing:o(ce),htmlFlow:o(le,s),htmlFlowData:E,htmlText:o(le,s),htmlTextData:E,image:o(ue),label:s,link:o(de),listItem:o(pe),listItemValue:p,listOrdered:o(fe,f),listUnordered:o(fe),paragraph:o(me),reference:ee,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(se),strong:o(he),thematicBreak:o(_e)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:re,autolinkProtocol:U,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:H,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(N),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(j),htmlFlowData:D,htmlText:l(M),htmlTextData:D,image:l(F),label:L,labelText:I,lineEnding:O,link:l(P),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:R,resourceTitleString:z,resource:B,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};h$(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,A(A({},o),{},{sliceSerialize:e[p][2].sliceSerialize}),e[p][1]),d$.call(n,e[p][1].type)&&n[e[p][1].type].call(A(A({},o),{},{sliceSerialize:e[p][2].sliceSerialize}),e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,A(A({},o),{},{sliceSerialize:e[p][2].sliceSerialize}),e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||_$).call(o,void 0,e[0])}for(r.position={start:m$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:m$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:m$(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+PY({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||_$).call(this,e,r[0])),n.position.end=m$(e.end)}function d(){return _X(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=AX(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=ge(),n.position={start:m$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=m$(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=m$(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function I(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=l$(t),n.identifier=AX(t).toLowerCase()}function L(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function z(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function B(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function V(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=AX(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function te(e){this.data.characterReferenceType=e.type}function ne(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=kX(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=SX(t);let i=this.stack[this.stack.length-1];i.value+=r}function H(e){let t=this.stack.pop();t.position.end=m$(e.end)}function U(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ie(){return{type:`blockquote`,children:[],position:void 0}}function W(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function ae(){return{type:`inlineCode`,value:``,position:void 0}}function G(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function oe(){return{type:`emphasis`,children:[],position:void 0}}function se(){return{type:`heading`,depth:0,children:[],position:void 0}}function ce(){return{type:`break`,position:void 0}}function le(){return{type:`html`,value:``,position:void 0}}function ue(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function de(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function fe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function pe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function me(){return{type:`paragraph`,children:[],position:void 0}}function he(){return{type:`strong`,children:[],position:void 0}}function ge(){return{type:`text`,value:``,position:void 0}}function _e(){return{type:`thematicBreak`,position:void 0}}}function m$(e){return{line:e.line,column:e.column,offset:e.offset}}function h$(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?h$(e,r):g$(e,r)}}function g$(e,t){let n;for(n in t)if(d$.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function _$(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+PY({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+PY({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+PY({start:t.start,end:t.end})+`) is still open`)}j();function v$(e){let t=this;t.parser=n;function n(n){return f$(n,A(A(A({},t.data(`settings`)),e),{},{extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]}))}}function y$(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function b$(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
64
+ `}]}function x$(e,t){let n=t.value?t.value+`
65
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function S$(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function C$(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w$(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=WX(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function T$(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E$(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function D$(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function O$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return D$(e,t);let i={src:WX(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function k$(e,t){let n={src:WX(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function A$(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function j$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return D$(e,t);let i={href:WX(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function M$(e,t){let n={href:WX(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function N$(e,t,n){let r=e.all(t),i=n?P$(n):F$(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
66
66
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
67
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function M$(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=N$(n[r])}return t}function N$(e){let t=e.spread;return t==null?e.children.length>1:t}function P$(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function F$(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I$(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function L$(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R$(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=kY(t.children[1]),o=OY(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function z$(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function B$(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var V$=9,H$=32;function U$(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(W$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(W$(t.slice(i),i>0,!1)),a.join(``)}function W$(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===V$||t===H$;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===V$||t===H$;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function G$(e,t){let n={type:`text`,value:U$(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function K$(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var q$={blockquote:_$,break:v$,code:y$,delete:b$,emphasis:x$,footnoteReference:S$,heading:C$,html:w$,imageReference:E$,image:D$,inlineCode:O$,linkReference:k$,link:A$,listItem:j$,list:P$,paragraph:F$,root:I$,strong:L$,table:R$,tableCell:B$,tableRow:z$,text:G$,thematicBreak:K$,toml:J$,yaml:J$,definition:J$,footnoteDefinition:J$};function J$(){}var{defineProperty:Y$}=Object,X$=typeof self==`object`?self:globalThis,Z$=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new X$[e](t)},Q$=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Y$(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof X$[e]==`function`?Z$(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Z$(a,o),i)};return r},$$=e=>Q$(new Map,e)(0),e1=``,{toString:t1}={},{keys:n1,is:r1}=Object,i1=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=t1.call(e).slice(8,-1);switch(n){case`Array`:return[1,e1];case`Object`:return[2,e1];case`Date`:return[3,e1];case`RegExp`:return[4,e1];case`Map`:return[5,e1];case`Set`:return[6,e1];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},a1=([e,t])=>e===0&&(t===`function`||t===`symbol`),o1=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=i1(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&r1(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of n1(o))(e||!a1(i1(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?e1:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(a1(i1(n))||a1(i1(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!a1(i1(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},s1=(e,{json:t,lossy:n}={})=>{let r=[];return o1(!(t||n),!!t,new Map,r)(e),r},c1=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?$$(s1(e,t)):structuredClone(e):(e,t)=>$$(s1(e,t));j();function l1(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function u1(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function d1(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||l1,r=e.options.footnoteBackLabel||u1,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=HX(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:A(A({},c1(o)),{},{id:`footnote-label`}),children:[{type:`text`,value:i}]},{type:`text`,value:`
67
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function P$(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=F$(n[r])}return t}function F$(e){let t=e.spread;return t==null?e.children.length>1:t}function I$(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function L$(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R$(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function z$(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function B$(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=jY(t.children[1]),o=AY(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function V$(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function H$(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var U$=9,W$=32;function G$(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(K$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(K$(t.slice(i),i>0,!1)),a.join(``)}function K$(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===U$||t===W$;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===U$||t===W$;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function q$(e,t){let n={type:`text`,value:G$(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function J$(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Y$={blockquote:y$,break:b$,code:x$,delete:S$,emphasis:C$,footnoteReference:w$,heading:T$,html:E$,imageReference:O$,image:k$,inlineCode:A$,linkReference:j$,link:M$,listItem:N$,list:I$,paragraph:L$,root:R$,strong:z$,table:B$,tableCell:H$,tableRow:V$,text:q$,thematicBreak:J$,toml:X$,yaml:X$,definition:X$,footnoteDefinition:X$};function X$(){}var{defineProperty:Z$}=Object,Q$=typeof self==`object`?self:globalThis,$$=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Q$[e](t)},e1=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Z$(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Q$[e]==`function`?$$(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n($$(a,o),i)};return r},t1=e=>e1(new Map,e)(0),n1=``,{toString:r1}={},{keys:i1,is:a1}=Object,o1=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=r1.call(e).slice(8,-1);switch(n){case`Array`:return[1,n1];case`Object`:return[2,n1];case`Date`:return[3,n1];case`RegExp`:return[4,n1];case`Map`:return[5,n1];case`Set`:return[6,n1];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},s1=([e,t])=>e===0&&(t===`function`||t===`symbol`),c1=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=o1(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&a1(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of i1(o))(e||!s1(o1(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?n1:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(s1(o1(n))||s1(o1(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!s1(o1(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},l1=(e,{json:t,lossy:n}={})=>{let r=[];return c1(!(t||n),!!t,new Map,r)(e),r},u1=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?t1(l1(e,t)):structuredClone(e):(e,t)=>t1(l1(e,t));j();function d1(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function f1(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function p1(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||d1,r=e.options.footnoteBackLabel||f1,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=WX(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:A(A({},u1(o)),{},{id:`footnote-label`}),children:[{type:`text`,value:i}]},{type:`text`,value:`
68
68
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
69
- `}]}}var f1=(function(e){if(e==null)return _1;if(typeof e==`function`)return g1(e);if(typeof e==`object`)return Array.isArray(e)?p1(e):m1(e);if(typeof e==`string`)return h1(e);throw Error(`Expected function, string, or object as test`)});function p1(e){let t=[],n=-1;for(;++n<e.length;)t[n]=f1(e[n]);return g1(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function m1(e){let t=e;return g1(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function h1(e){return g1(t);function t(t){return t&&t.type===e}}function g1(e){return t;function t(t,n,r){return!!(v1(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function _1(){return!0}function v1(e){return typeof e==`object`&&!!e&&`type`in e}function y1(e){return e}var b1=[],x1=`skip`;function S1(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=f1(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+y1(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=b1;if(s&&r&&(o=C1(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=C1(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function C1(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?b1:[e]}function w1(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?S1(e,i,E1(a),o):S1(e,i,T1(a),o)}function T1(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?E1(e.enter):e.enter,exit:typeof e.exit==`function`?E1(e.exit):e.exit}}function E1(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}j();var D1=[`children`],O1={}.hasOwnProperty,k1={};function A1(e,t){let n=t||k1,r=new Map,i=new Map,a={all:s,applyData:M1,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:A(A({},q$),n.handlers),one:o,options:n,patch:j1,wrap:P1};return w1(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(O1.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t}=e,n=c1(G(e,D1));return n.children=a.all(e),n}return c1(e)}return(a.options.unknownHandler||N1)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=F1(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=F1(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function j1(e,t){e.position&&(t.position=jY(e))}function M1(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,c1(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function N1(e,t){let n=t.data||{},r=`value`in t&&!(O1.call(n,`hProperties`)||O1.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function P1(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
69
+ `}]}}var m1=(function(e){if(e==null)return y1;if(typeof e==`function`)return v1(e);if(typeof e==`object`)return Array.isArray(e)?h1(e):g1(e);if(typeof e==`string`)return _1(e);throw Error(`Expected function, string, or object as test`)});function h1(e){let t=[],n=-1;for(;++n<e.length;)t[n]=m1(e[n]);return v1(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function g1(e){let t=e;return v1(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function _1(e){return v1(t);function t(t){return t&&t.type===e}}function v1(e){return t;function t(t,n,r){return!!(b1(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function y1(){return!0}function b1(e){return typeof e==`object`&&!!e&&`type`in e}function x1(e){return e}var S1=[],C1=`skip`;function w1(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=m1(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+x1(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=S1;if(s&&r&&(o=T1(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=T1(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function T1(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?S1:[e]}function E1(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?w1(e,i,O1(a),o):w1(e,i,D1(a),o)}function D1(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?O1(e.enter):e.enter,exit:typeof e.exit==`function`?O1(e.exit):e.exit}}function O1(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}j();var k1=[`children`],A1={}.hasOwnProperty,j1={};function M1(e,t){let n=t||j1,r=new Map,i=new Map,a={all:s,applyData:P1,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:A(A({},Y$),n.handlers),one:o,options:n,patch:N1,wrap:I1};return E1(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(A1.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t}=e,n=u1(G(e,k1));return n.children=a.all(e),n}return u1(e)}return(a.options.unknownHandler||F1)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=L1(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=L1(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function N1(e,t){e.position&&(t.position=NY(e))}function P1(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,u1(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function F1(e,t){let n=t.data||{},r=`value`in t&&!(A1.call(n,`hProperties`)||A1.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function I1(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
70
70
  `});++r<e.length;)r&&n.push({type:`text`,value:`
71
71
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
72
- `}),n}function F1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function I1(e,t){let n=A1(e,t),r=n.one(e,void 0),i=d1(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
73
- `},i)),a}j();function L1(e,t){return e&&`run`in e?function(){var n=O(function*(n,r){let i=I1(n,A({file:r},t));yield e.run(i,r)});return function(e,t){return n.apply(this,arguments)}}():function(n,r){return I1(n,A({file:r},e||t))}}function R1(e){if(e)throw e}var z1=u(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function B1(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function V1(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?H1(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function H1(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var U1={basename:W1,dirname:G1,extname:K1,join:q1,sep:`/`};function W1(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);X1(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function G1(e){if(X1(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function K1(e){X1(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function q1(...e){let t=-1,n;for(;++t<e.length;)X1(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:J1(n)}function J1(e){X1(e);let t=e.codePointAt(0)===47,n=Y1(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Y1(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function X1(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Z1={cwd:Q1};function Q1(){return`/`}function $1(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function e0(e){if(typeof e==`string`)e=new URL(e);else if(!$1(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return t0(e)}function t0(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var n0=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],r0=class{constructor(e){let t;t=e?$1(e)?{path:e}:typeof e==`string`||s0(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Z1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<n0.length;){let e=n0[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)n0.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?U1.basename(this.path):void 0}set basename(e){a0(e,`basename`),i0(e,`basename`),this.path=U1.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?U1.dirname(this.path):void 0}set dirname(e){o0(this.basename,`dirname`),this.path=U1.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?U1.extname(this.path):void 0}set extname(e){if(i0(e,`extname`),o0(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=U1.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){$1(e)&&(e=e0(e)),a0(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?U1.basename(this.path,this.extname):void 0}set stem(e){a0(e,`stem`),i0(e,`stem`),this.path=U1.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new IY(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function i0(e,t){if(e&&e.includes(U1.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+U1.sep+"`")}function a0(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function o0(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function s0(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var c0=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),l0=m(z1(),1),u0={}.hasOwnProperty,d0=new class e extends c0{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=V1()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,l0.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(m0(`data`,this.frozen),this.namespace[e]=t,this):u0.call(this.namespace,e)&&this.namespace[e]||void 0:e?(m0(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=_0(e),n=this.parser||this.Parser;return f0(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),f0(`process`,this.parser||this.Parser),p0(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=_0(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);y0(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),f0(`processSync`,this.parser||this.Parser),p0(`processSync`,this.compiler||this.Compiler),this.process(e,r),g0(`processSync`,`process`,t),n;function r(e,r){t=!0,R1(e),n=r}}run(e,t,n){h0(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=_0(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),g0(`runSync`,`run`,n),r;function i(e,t){R1(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=_0(t),r=this.compiler||this.Compiler;return p0(`stringify`,r),h0(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(m0(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,l0.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];B1(o)&&B1(r)&&(r=(0,l0.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function f0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function p0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function m0(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function h0(e){if(!B1(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function g0(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _0(e){return v0(e)?e:new r0(e)}function v0(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function y0(e){return typeof e==`string`||b0(e)}function b0(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}j();var x0=[],S0={allowDangerousHtml:!0},C0=/^(https?|ircs?|mailto|xmpp)$/i,w0=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function T0(e){let t=E0(e),n=D0(e);return O0(t.runSync(t.parse(n),n),e)}function E0(e){let t=e.rehypePlugins||x0,n=e.remarkPlugins||x0,r=e.remarkRehypeOptions?A(A({},e.remarkRehypeOptions),S0):S0;return d0().use(g$).use(n).use(L1,r).use(t)}function D0(e){let t=e.children||``,n=new r0;return typeof t==`string`?n.value=t:``+t,n}function O0(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||k0;for(let e of w0)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return w1(e,l),WY(e,{Fragment:X.Fragment,components:i,ignoreInvalidStyle:!0,jsx:X.jsx,jsxs:X.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in pX)if(Object.hasOwn(pX,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=pX[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function k0(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||C0.test(e.slice(0,t))?e:``}j();var A0=[`text`],j0=[`text`],M0=[`components`,`componentsByLanguage`,`smooth`,`defer`,`preprocess`],N0=[`pre`,`code`,`SyntaxHighlighter`,`CodeHeader`],P0=[`className`,`containerProps`,`containerComponent`],{useSmooth:F0,useSmoothStatus:I0,withSmoothContextProvider:L0}=eF,R0=(0,h.createContext)(null),z0=e=>{let t=(0,h.useContext)(R0);return(0,X.jsx)(CJ,A(A({},t),e))},B0=e=>{let{components:t}=(0,h.useContext)(R0);return(0,X.jsx)(tJ,A(A({},e),{},{fallbackPre:t.Pre}))},V0=(0,h.memo)(e=>{let{text:t}=e,n=G(e,A0);return(0,X.jsx)(T0,A(A({},n),{},{children:t}))});V0.displayName=`MarkdownRenderer`;var H0=e=>{let{text:t}=e,n=G(e,j0),r=(0,h.useDeferredValue)(t);return(0,X.jsx)(V0,A({text:r},n))},U0=e=>typeof e==`object`&&!!e&&!Array.isArray(e),W0=(e,t,n=1)=>{if(Object.is(e,t))return!0;if(n<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!W0(e[r],t[r],n-1))return!1;return!0}if(U0(e)&&U0(t)){let r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Object.hasOwn(t,r)&&W0(e[r],t[r],n-1))}return!1};function G0(e,t){let n=(0,h.useRef)(e);return W0(e,n.current,t)||(n.current=e),n.current}function K0(e){let t=(0,h.useRef)(e),n=(e,t)=>e[t],r=Object.keys(e),i=Object.keys(t.current);return r.length===i.length&&r.every(r=>Object.hasOwn(t.current,r)&&W0(n(e,r),n(t.current,r)))||(t.current=e),t.current}var q0=e=>{let{components:t,componentsByLanguage:n,smooth:r=!0,defer:i=!1,preprocess:a}=e,o=G(e,M0),{text:s}=F0(bM(),r),c=(0,h.useMemo)(()=>a?a(s):s,[a,s]),{pre:l=iJ,code:u=aJ,SyntaxHighlighter:d=oJ,CodeHeader:f=sJ}=t==null?{}:t,p=(0,h.useMemo)(()=>({Pre:l,Code:u,SyntaxHighlighter:d,CodeHeader:f}),[l,u,d,f]),m=G0((0,h.useMemo)(()=>({components:p,componentsByLanguage:n}),[p,n]),3),g=K0((0,h.useMemo)(()=>{let e=t==null?{}:t,{pre:n,code:r,SyntaxHighlighter:i,CodeHeader:a}=e;return A(A({},G(e,N0)),{},{pre:B0,code:z0})},[t])),_=i?H0:V0,v=K0(o);return(0,X.jsx)(R0.Provider,{value:m,children:(0,X.jsx)(_,A({text:c,components:g},v))})},J0=(0,h.forwardRef)((e,t)=>{let{className:n,containerProps:r,containerComponent:i=`div`}=e,a=G(e,P0),o=I0();return(0,X.jsx)(i,A(A({"data-status":o.type},r),{},{className:(0,uJ.default)(n,r==null?void 0:r.className),ref:t,children:(0,X.jsx)(q0,A({},a))}))});J0.displayName=`MarkdownTextPrimitive`;var Y0=L0(J0);function X0(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Z0(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Q0(e,t,n){let r=f1((n||{}).ignore||[]),i=$0(t),a=-1;for(;++a<i.length;)S1(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return x1}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function $0(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([e2(e[0]),t2(e[1])])}return t}function e2(e){return typeof e==`string`?new RegExp(Z0(e),`g`):e}function t2(e){return typeof e==`function`?e:function(){return e}}var n2=`phrasing`,r2=[`autolink`,`link`,`image`,`label`];function i2(){return{transforms:[f2],enter:{literalAutolink:o2,literalAutolinkEmail:s2,literalAutolinkHttp:s2,literalAutolinkWww:s2},exit:{literalAutolink:d2,literalAutolinkEmail:u2,literalAutolinkHttp:c2,literalAutolinkWww:l2}}}function a2(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:n2,notInConstruct:r2},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:n2,notInConstruct:r2},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:n2,notInConstruct:r2}]}}function o2(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function s2(e){this.config.enter.autolinkProtocol.call(this,e)}function c2(e){this.config.exit.autolinkProtocol.call(this,e)}function l2(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function u2(e){this.config.exit.autolinkEmail.call(this,e)}function d2(e){this.exit(e)}function f2(e){Q0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,p2],[RegExp(`(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)`,`gu`),m2]],{ignore:[`link`,`linkReference`]})}function p2(e,t,n,r,i){let a=``;if(!_2(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!h2(n)))return!1;let o=g2(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function m2(e,t,n,r){return!_2(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function h2(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function g2(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=X0(e,`(`),a=X0(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function _2(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||BX(n)||zX(n))&&(!t||n!==47)}D2.peek=E2;function v2(){this.buffer()}function y2(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function b2(){this.buffer()}function x2(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function S2(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=OX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function C2(e){this.exit(e)}function w2(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=OX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function T2(e){this.exit(e)}function E2(){return`[`}function D2(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function O2(){return{enter:{gfmFootnoteCallString:v2,gfmFootnoteCall:y2,gfmFootnoteDefinitionLabelString:b2,gfmFootnoteDefinition:x2},exit:{gfmFootnoteCallString:S2,gfmFootnoteCall:C2,gfmFootnoteDefinitionLabelString:w2,gfmFootnoteDefinition:T2}}}function k2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:D2},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
74
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?j2:A2))),s(),o}}function A2(e,t,n){return t===0?e:j2(e,t,n)}function j2(e,t,n){return(n?``:` `)+e}j();var M2=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];L2.attention=R2,L2.peek=z2;function N2(){return{canContainEols:[`delete`],enter:{strikethrough:F2},exit:{strikethrough:I2}}}function P2(){return{handlers:{delete:L2},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:M2}]}}function F2(e){this.enter({type:`delete`,children:[],position:void 0},e)}function I2(e){this.exit(e)}function L2(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,A(A({},i.current()),{},{before:s,after:`~`})),s+=i.move(a),o(),s}function R2(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function z2(){return`~`}function B2(e){return e.length}function V2(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||B2,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=H2(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=U2(r[d]);else{let e=U2(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
75
- `)}function H2(e){return e==null?``:String(e)}function U2(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var W2=f1([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function G2(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),K2);return i(),o}function K2(e,t,n){return`>`+(n?``:` `)+e}function q2(e,t){return J2(e,t.inConstruct,!0)&&!J2(e,t.notInConstruct,!1)}function J2(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Y2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
76
- `&&!e.before&&!e.after&&q2(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
77
- `}function X2(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Z2(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Q2(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}j();function $2(e,t,n,r){let i=Q2(n),a=e.value||``;if(Z2(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,e4);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(X2(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,A({before:u,after:` `,encode:["`"]},o.current()))),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,A({before:u,after:`
72
+ `}),n}function L1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function R1(e,t){let n=M1(e,t),r=n.one(e,void 0),i=p1(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
73
+ `},i)),a}j();function z1(e,t){return e&&`run`in e?function(){var n=O(function*(n,r){let i=R1(n,A({file:r},t));yield e.run(i,r)});return function(e,t){return n.apply(this,arguments)}}():function(n,r){return R1(n,A({file:r},e||t))}}function B1(e){if(e)throw e}var V1=u(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function H1(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function U1(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?W1(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function W1(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var G1={basename:K1,dirname:q1,extname:J1,join:Y1,sep:`/`};function K1(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Q1(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function q1(e){if(Q1(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function J1(e){Q1(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Y1(...e){let t=-1,n;for(;++t<e.length;)Q1(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:X1(n)}function X1(e){Q1(e);let t=e.codePointAt(0)===47,n=Z1(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Z1(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Q1(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var $1={cwd:e0};function e0(){return`/`}function t0(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function n0(e){if(typeof e==`string`)e=new URL(e);else if(!t0(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return r0(e)}function r0(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var i0=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],a0=class{constructor(e){let t;t=e?t0(e)?{path:e}:typeof e==`string`||l0(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:$1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<i0.length;){let e=i0[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)i0.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?G1.basename(this.path):void 0}set basename(e){s0(e,`basename`),o0(e,`basename`),this.path=G1.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?G1.dirname(this.path):void 0}set dirname(e){c0(this.basename,`dirname`),this.path=G1.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?G1.extname(this.path):void 0}set extname(e){if(o0(e,`extname`),c0(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=G1.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){t0(e)&&(e=n0(e)),s0(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?G1.basename(this.path,this.extname):void 0}set stem(e){s0(e,`stem`),o0(e,`stem`),this.path=G1.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new RY(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function o0(e,t){if(e&&e.includes(G1.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+G1.sep+"`")}function s0(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function c0(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function l0(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var u0=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),d0=m(V1(),1),f0={}.hasOwnProperty,p0=new class e extends u0{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=U1()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,d0.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(g0(`data`,this.frozen),this.namespace[e]=t,this):f0.call(this.namespace,e)&&this.namespace[e]||void 0:e?(g0(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=y0(e),n=this.parser||this.Parser;return m0(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),m0(`process`,this.parser||this.Parser),h0(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=y0(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);x0(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),m0(`processSync`,this.parser||this.Parser),h0(`processSync`,this.compiler||this.Compiler),this.process(e,r),v0(`processSync`,`process`,t),n;function r(e,r){t=!0,B1(e),n=r}}run(e,t,n){_0(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=y0(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),v0(`runSync`,`run`,n),r;function i(e,t){B1(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=y0(t),r=this.compiler||this.Compiler;return h0(`stringify`,r),_0(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(g0(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,d0.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];H1(o)&&H1(r)&&(r=(0,d0.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function m0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function h0(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function g0(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _0(e){if(!H1(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function v0(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function y0(e){return b0(e)?e:new a0(e)}function b0(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function x0(e){return typeof e==`string`||S0(e)}function S0(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}j();var C0=[],w0={allowDangerousHtml:!0},T0=/^(https?|ircs?|mailto|xmpp)$/i,E0=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function D0(e){let t=O0(e),n=k0(e);return A0(t.runSync(t.parse(n),n),e)}function O0(e){let t=e.rehypePlugins||C0,n=e.remarkPlugins||C0,r=e.remarkRehypeOptions?A(A({},e.remarkRehypeOptions),w0):w0;return p0().use(v$).use(n).use(z1,r).use(t)}function k0(e){let t=e.children||``,n=new a0;return typeof t==`string`?n.value=t:``+t,n}function A0(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||j0;for(let e of E0)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return E1(e,l),KY(e,{Fragment:X.Fragment,components:i,ignoreInvalidStyle:!0,jsx:X.jsx,jsxs:X.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in hX)if(Object.hasOwn(hX,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=hX[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function j0(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||T0.test(e.slice(0,t))?e:``}j();var M0=[`text`],N0=[`text`],P0=[`components`,`componentsByLanguage`,`smooth`,`defer`,`preprocess`],F0=[`pre`,`code`,`SyntaxHighlighter`,`CodeHeader`],I0=[`className`,`containerProps`,`containerComponent`],{useSmooth:L0,useSmoothStatus:R0,withSmoothContextProvider:z0}=eF,B0=(0,h.createContext)(null),V0=e=>{let t=(0,h.useContext)(B0);return(0,X.jsx)(TJ,A(A({},t),e))},H0=e=>{let{components:t}=(0,h.useContext)(B0);return(0,X.jsx)(rJ,A(A({},e),{},{fallbackPre:t.Pre}))},U0=(0,h.memo)(e=>{let{text:t}=e,n=G(e,M0);return(0,X.jsx)(D0,A(A({},n),{},{children:t}))});U0.displayName=`MarkdownRenderer`;var W0=e=>{let{text:t}=e,n=G(e,N0),r=(0,h.useDeferredValue)(t);return(0,X.jsx)(U0,A({text:r},n))},G0=e=>typeof e==`object`&&!!e&&!Array.isArray(e),K0=(e,t,n=1)=>{if(Object.is(e,t))return!0;if(n<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!K0(e[r],t[r],n-1))return!1;return!0}if(G0(e)&&G0(t)){let r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Object.hasOwn(t,r)&&K0(e[r],t[r],n-1))}return!1};function q0(e,t){let n=(0,h.useRef)(e);return K0(e,n.current,t)||(n.current=e),n.current}function J0(e){let t=(0,h.useRef)(e),n=(e,t)=>e[t],r=Object.keys(e),i=Object.keys(t.current);return r.length===i.length&&r.every(r=>Object.hasOwn(t.current,r)&&K0(n(e,r),n(t.current,r)))||(t.current=e),t.current}var Y0=e=>{let{components:t,componentsByLanguage:n,smooth:r=!0,defer:i=!1,preprocess:a}=e,o=G(e,P0),{text:s}=L0(bM(),r),c=(0,h.useMemo)(()=>a?a(s):s,[a,s]),{pre:l=oJ,code:u=sJ,SyntaxHighlighter:d=cJ,CodeHeader:f=lJ}=t==null?{}:t,p=(0,h.useMemo)(()=>({Pre:l,Code:u,SyntaxHighlighter:d,CodeHeader:f}),[l,u,d,f]),m=q0((0,h.useMemo)(()=>({components:p,componentsByLanguage:n}),[p,n]),3),g=J0((0,h.useMemo)(()=>{let e=t==null?{}:t,{pre:n,code:r,SyntaxHighlighter:i,CodeHeader:a}=e;return A(A({},G(e,F0)),{},{pre:H0,code:V0})},[t])),_=i?W0:U0,v=J0(o);return(0,X.jsx)(B0.Provider,{value:m,children:(0,X.jsx)(_,A({text:c,components:g},v))})},X0=(0,h.forwardRef)((e,t)=>{let{className:n,containerProps:r,containerComponent:i=`div`}=e,a=G(e,I0),o=R0();return(0,X.jsx)(i,A(A({"data-status":o.type},r),{},{className:(0,fJ.default)(n,r==null?void 0:r.className),ref:t,children:(0,X.jsx)(Y0,A({},a))}))});X0.displayName=`MarkdownTextPrimitive`;var Z0=z0(X0);function Q0(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function $0(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function e2(e,t,n){let r=m1((n||{}).ignore||[]),i=t2(t),a=-1;for(;++a<i.length;)w1(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return C1}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function t2(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([n2(e[0]),r2(e[1])])}return t}function n2(e){return typeof e==`string`?new RegExp($0(e),`g`):e}function r2(e){return typeof e==`function`?e:function(){return e}}var i2=`phrasing`,a2=[`autolink`,`link`,`image`,`label`];function o2(){return{transforms:[m2],enter:{literalAutolink:c2,literalAutolinkEmail:l2,literalAutolinkHttp:l2,literalAutolinkWww:l2},exit:{literalAutolink:p2,literalAutolinkEmail:f2,literalAutolinkHttp:u2,literalAutolinkWww:d2}}}function s2(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:i2,notInConstruct:a2},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:i2,notInConstruct:a2},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:i2,notInConstruct:a2}]}}function c2(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function l2(e){this.config.enter.autolinkProtocol.call(this,e)}function u2(e){this.config.exit.autolinkProtocol.call(this,e)}function d2(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function f2(e){this.config.exit.autolinkEmail.call(this,e)}function p2(e){this.exit(e)}function m2(e){e2(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,h2],[RegExp(`(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)`,`gu`),g2]],{ignore:[`link`,`linkReference`]})}function h2(e,t,n,r,i){let a=``;if(!y2(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!_2(n)))return!1;let o=v2(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function g2(e,t,n,r){return!y2(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function _2(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function v2(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Q0(e,`(`),a=Q0(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function y2(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||HX(n)||VX(n))&&(!t||n!==47)}k2.peek=O2;function b2(){this.buffer()}function x2(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function S2(){this.buffer()}function C2(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function w2(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=AX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function T2(e){this.exit(e)}function E2(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=AX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function D2(e){this.exit(e)}function O2(){return`[`}function k2(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function A2(){return{enter:{gfmFootnoteCallString:b2,gfmFootnoteCall:x2,gfmFootnoteDefinitionLabelString:S2,gfmFootnoteDefinition:C2},exit:{gfmFootnoteCallString:w2,gfmFootnoteCall:T2,gfmFootnoteDefinitionLabelString:E2,gfmFootnoteDefinition:D2}}}function j2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:k2},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
74
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?N2:M2))),s(),o}}function M2(e,t,n){return t===0?e:N2(e,t,n)}function N2(e,t,n){return(n?``:` `)+e}j();var P2=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];z2.attention=B2,z2.peek=V2;function F2(){return{canContainEols:[`delete`],enter:{strikethrough:L2},exit:{strikethrough:R2}}}function I2(){return{handlers:{delete:z2},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:P2}]}}function L2(e){this.enter({type:`delete`,children:[],position:void 0},e)}function R2(e){this.exit(e)}function z2(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,A(A({},i.current()),{},{before:s,after:`~`})),s+=i.move(a),o(),s}function B2(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function V2(){return`~`}function H2(e){return e.length}function U2(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||H2,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=W2(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=G2(r[d]);else{let e=G2(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
75
+ `)}function W2(e){return e==null?``:String(e)}function G2(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var K2=m1([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function q2(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),J2);return i(),o}function J2(e,t,n){return`>`+(n?``:` `)+e}function Y2(e,t){return X2(e,t.inConstruct,!0)&&!X2(e,t.notInConstruct,!1)}function X2(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Z2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
76
+ `&&!e.before&&!e.after&&Y2(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
77
+ `}function Q2(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function $2(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function e4(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}j();function t4(e,t,n,r){let i=e4(n),a=e.value||``;if($2(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,n4);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(Q2(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,A({before:u,after:` `,encode:["`"]},o.current()))),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,A({before:u,after:`
78
78
  `,encode:["`"]},o.current()))),t()}return u+=o.move(`
79
79
  `),a&&(u+=o.move(a+`
80
- `)),u+=o.move(s),c(),u}function e4(e,t,n){return(n?``:` `)+e}function t4(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}j();function n4(e,t,n,r){let i=t4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),A({before:l,after:`]`},c.current()))),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,A({before:l,after:`>`},c.current()))),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,A({before:l,after:e.title?` `:`
81
- `},c.current())))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,A({before:l,after:i},c.current()))),l+=c.move(i),s()),o(),l}function r4(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function i4(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function a4(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function o4(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function s4(e,t,n){let r=$X(e),i=$X(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function c4(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:kX(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!kX(a))return;for(;a===45||AX(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&QZ.includes(o)?1:ZZ.includes(o)?6:7}j();var l4=new Map([[`*`,!1],[`_`,!0]]);function u4(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function d4(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=l4.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=$X(u.charCodeAt(u.length-1)),f=$X((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(m4(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:u4(e,t,a),index:o}}}function f4(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?i4(n.value):a4(n.value),i=o4(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function p4(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=v4(e,c,r,i),u=d4(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function m4(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function h4(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!FX(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function g4(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?i4(n(i[o+1],e,t,A({before:``,after:``},c.current()))):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
82
- `)&&l.type===`html`&&c4(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(y4(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=_4(l,f.attention,t,c);a.push(e),s=a4(e.sequences[0])}else{let n=t.handle(l,e,t,A(A({},c.current()),{},{after:u,before:s}));if(!n)continue;c.move(n),a.push(n),s=a4(n)}}return r.pop(),a}function _4(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=h4(e.type,a,o),c=s[0],l=n.enter(i);r.move(c);let u=g4(e,n,A(A({},r.current()),{},{before:c,after:c}));return r.move(y4(u,c,c)),r.move(c),l(),{children:u,sequences:s}}function v4(e,t,n,r){let i=[],a,o=a4(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===i4(n)&&f4([e],!0),a=void 0,i.push(e),e.value&&(o=a4(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=i4(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=v4(n.children,t,c,c),m=p.length>0?p[0].value:``,h=s4(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&f4(p,!0);let g=p.length>0?a4(p[p.length-1].value):``,_=s4(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&f4(p,!1),h.outside&&d!==`
83
- `&&d!==`\r`&&f4(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function y4(e,t,n){let r=new Map,i=v4(e,r,t,n),a=i,o=d4(a,t,n);for(;o;){let s=p4(e,r,o,t,n);if(!s){a=i;break}r=s.chosen,a=s.tokens,o=s.mistake}let s=``;for(let e of a)s+=e.value;return s}b4.attention=x4,b4.peek=S4;function b4(e,t,n,r){let i=n.enter(`phrasing`),a=y4([_4(e,x4,n,n.createTracker(r))],r.before,r.after);return i(),a}function x4(e,t){return{construct:`emphasis`,markers:r4(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function S4(e,t,n){return n.options.emphasis||`*`}function C4(e,t){let n=!1;return w1(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&hX(e)&&(t.options.setext||n))}j();function w4(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(C4(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,A(A({},a.current()),{},{before:`
80
+ `)),u+=o.move(s),c(),u}function n4(e,t,n){return(n?``:` `)+e}function r4(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}j();function i4(e,t,n,r){let i=r4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),A({before:l,after:`]`},c.current()))),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,A({before:l,after:`>`},c.current()))),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,A({before:l,after:e.title?` `:`
81
+ `},c.current())))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,A({before:l,after:i},c.current()))),l+=c.move(i),s()),o(),l}function a4(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function o4(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function s4(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function c4(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function l4(e,t,n){let r=tZ(e),i=tZ(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function u4(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:jX(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!jX(a))return;for(;a===45||MX(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&eQ.includes(o)?1:$Z.includes(o)?6:7}j();var d4=new Map([[`*`,!1],[`_`,!0]]);function f4(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function p4(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=d4.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=tZ(u.charCodeAt(u.length-1)),f=tZ((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(g4(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:f4(e,t,a),index:o}}}function m4(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?o4(n.value):s4(n.value),i=c4(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function h4(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=b4(e,c,r,i),u=p4(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function g4(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function _4(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!LX(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function v4(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?o4(n(i[o+1],e,t,A({before:``,after:``},c.current()))):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
82
+ `)&&l.type===`html`&&u4(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(x4(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=y4(l,f.attention,t,c);a.push(e),s=s4(e.sequences[0])}else{let n=t.handle(l,e,t,A(A({},c.current()),{},{after:u,before:s}));if(!n)continue;c.move(n),a.push(n),s=s4(n)}}return r.pop(),a}function y4(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=_4(e.type,a,o),c=s[0],l=n.enter(i);r.move(c);let u=v4(e,n,A(A({},r.current()),{},{before:c,after:c}));return r.move(x4(u,c,c)),r.move(c),l(),{children:u,sequences:s}}function b4(e,t,n,r){let i=[],a,o=s4(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===o4(n)&&m4([e],!0),a=void 0,i.push(e),e.value&&(o=s4(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=o4(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=b4(n.children,t,c,c),m=p.length>0?p[0].value:``,h=l4(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&m4(p,!0);let g=p.length>0?s4(p[p.length-1].value):``,_=l4(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&m4(p,!1),h.outside&&d!==`
83
+ `&&d!==`\r`&&m4(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function x4(e,t,n){let r=new Map,i=b4(e,r,t,n),a=i,o=p4(a,t,n);for(;o;){let s=h4(e,r,o,t,n);if(!s){a=i;break}r=s.chosen,a=s.tokens,o=s.mistake}let s=``;for(let e of a)s+=e.value;return s}S4.attention=C4,S4.peek=w4;function S4(e,t,n,r){let i=n.enter(`phrasing`),a=x4([y4(e,C4,n,n.createTracker(r))],r.before,r.after);return i(),a}function C4(e,t){return{construct:`emphasis`,markers:a4(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function w4(e,t,n){return n.options.emphasis||`*`}function T4(e,t){let n=!1;return E1(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&_X(e)&&(t.options.setext||n))}j();function E4(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(T4(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,A(A({},a.current()),{},{before:`
84
84
  `,after:`
85
85
  `}));return r(),t(),o+`
86
86
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
87
87
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,A({before:`# `,after:`
88
- `},a.current())),u=l.charCodeAt(0);return(u===9||u===32)&&(l=o4(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}T4.peek=E4;function T4(e){return e.value||``}function E4(){return`<`}j(),D4.peek=O4;function D4(e,t,n,r){let i=t4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,A({before:l,after:`]`},c.current()))),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,A({before:l,after:`>`},c.current()))),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,A({before:l,after:e.title?` `:`)`},c.current())))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,A({before:l,after:i},c.current()))),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function O4(){return`!`}j(),k4.peek=A4;function k4(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,A({before:c,after:`]`},s.current()));c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),A({before:c,after:`]`},s.current()));return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function A4(){return`!`}j4.peek=M4;function j4(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function M4(){return"`"}function N4(e,t){let n=hX(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}j(),P4.peek=F4;function P4(e,t,n,r){let i=t4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(N4(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,A({before:i,after:`>`},o.current()))),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,A({before:l,after:`](`},o.current()));l+=o.move(u),c(),l+=o.move(`](`);let d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
89
- `||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,A({before:l,after:`>`},o.current()))),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,A({before:l,after:typeof p==`string`?` `:`)`},o.current())))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,A({before:l,after:i},o.current()))),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function F4(e,t,n){return N4(e,n)?`<`:`[`}j(),I4.peek=L4;function I4(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,A({before:c,after:`]`},s.current()));c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),A({before:c,after:`]`},s.current()));return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function L4(){return`[`}function R4(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function z4(e){let t=R4(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function B4(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function V4(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function H4(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?B4(n):R4(n),s=e.ordered?o===`.`?`)`:`.`:z4(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),V4(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function U4(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function W4(e,t,n,r){let i=U4(n),a=n.bulletCurrent||R4(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function G4(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function K4(e,t,n,r){if(!e.children.some(function(e){return W2(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function q4(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}J4.attention=Y4,J4.peek=X4;function J4(e,t,n,r){let i=n.enter(`phrasing`),a=y4([_4(e,Y4,n,n.createTracker(r))],r.before,r.after);return i(),a}function Y4(e,t){return{construct:`strong`,markers:q4(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function X4(e,t,n){return n.options.strong||`*`}j();function Z4(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,A(A({},r),{},{afterNode:i[a+1],beforeNode:i[a-1]}))}function Q4(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function $4(e,t,n){let r=(V4(n)+(n.options.ruleSpaces?` `:``)).repeat(Q4(n));return n.options.ruleSpaces?r.slice(0,-1):r}var e3={blockquote:G2,break:Y2,code:$2,definition:n4,emphasis:b4,hardBreak:Y2,heading:w4,html:T4,image:D4,imageReference:k4,inlineCode:j4,link:P4,linkReference:I4,list:H4,listItem:W4,paragraph:G4,root:K4,strong:J4,text:Z4,thematicBreak:$4};j();function t3(){return{enter:{table:n3,tableData:o3,tableHeader:o3,tableRow:i3},exit:{codeText:s3,table:r3,tableData:a3,tableHeader:a3,tableRow:a3}}}function n3(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function r3(e){this.exit(e),this.data.inTable=void 0}function i3(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function a3(e){this.exit(e)}function o3(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function s3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,c3));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function c3(e,t){return t===`|`?t:e}function l3(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[u3],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
88
+ `},a.current())),u=l.charCodeAt(0);return(u===9||u===32)&&(l=c4(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}D4.peek=O4;function D4(e){return e.value||``}function O4(){return`<`}j(),k4.peek=A4;function k4(e,t,n,r){let i=r4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,A({before:l,after:`]`},c.current()))),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,A({before:l,after:`>`},c.current()))),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,A({before:l,after:e.title?` `:`)`},c.current())))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,A({before:l,after:i},c.current()))),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function A4(){return`!`}j(),j4.peek=M4;function j4(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,A({before:c,after:`]`},s.current()));c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),A({before:c,after:`]`},s.current()));return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function M4(){return`!`}N4.peek=P4;function N4(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function P4(){return"`"}function F4(e,t){let n=_X(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}j(),I4.peek=L4;function I4(e,t,n,r){let i=r4(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(F4(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,A({before:i,after:`>`},o.current()))),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,A({before:l,after:`](`},o.current()));l+=o.move(u),c(),l+=o.move(`](`);let d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
89
+ `||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,A({before:l,after:`>`},o.current()))),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,A({before:l,after:typeof p==`string`?` `:`)`},o.current())))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,A({before:l,after:i},o.current()))),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function L4(e,t,n){return F4(e,n)?`<`:`[`}j(),R4.peek=z4;function R4(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,A({before:c,after:`]`},s.current()));c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),A({before:c,after:`]`},s.current()));return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function z4(){return`[`}function B4(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function V4(e){let t=B4(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function H4(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function U4(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function W4(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?H4(n):B4(n),s=e.ordered?o===`.`?`)`:`.`:V4(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),U4(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function G4(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function K4(e,t,n,r){let i=G4(n),a=n.bulletCurrent||B4(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function q4(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function J4(e,t,n,r){if(!e.children.some(function(e){return K2(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function Y4(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}X4.attention=Z4,X4.peek=Q4;function X4(e,t,n,r){let i=n.enter(`phrasing`),a=x4([y4(e,Z4,n,n.createTracker(r))],r.before,r.after);return i(),a}function Z4(e,t){return{construct:`strong`,markers:Y4(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function Q4(e,t,n){return n.options.strong||`*`}j();function $4(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,A(A({},r),{},{afterNode:i[a+1],beforeNode:i[a-1]}))}function e3(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function t3(e,t,n){let r=(U4(n)+(n.options.ruleSpaces?` `:``)).repeat(e3(n));return n.options.ruleSpaces?r.slice(0,-1):r}var n3={blockquote:q2,break:Z2,code:t4,definition:i4,emphasis:S4,hardBreak:Z2,heading:E4,html:D4,image:k4,imageReference:j4,inlineCode:N4,link:I4,linkReference:R4,list:W4,listItem:K4,paragraph:q4,root:J4,strong:X4,text:$4,thematicBreak:t3};j();function r3(){return{enter:{table:i3,tableData:c3,tableHeader:c3,tableRow:o3},exit:{codeText:l3,table:a3,tableData:s3,tableHeader:s3,tableRow:s3}}}function i3(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function a3(e){this.exit(e),this.data.inTable=void 0}function o3(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function s3(e){this.exit(e)}function c3(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function l3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,u3));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function u3(e,t){return t===`|`?t:e}function d3(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[f3],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
90
90
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
91
- `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,A(A({},r),{},{before:i,after:i}));return o(),a(),s}function c(e,i){return V2(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=e3.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function u3(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&d3(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function d3(e,t){let n=!1;return w1(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&hX(e)&&(t.options.setext||n))}j();function f3(){return{exit:{taskListCheckValueChecked:m3,taskListCheckValueUnchecked:m3,paragraph:h3}}}function p3(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:g3}}}function m3(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function h3(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function g3(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=e3.listItem(e,t,n,A(A({},r),s.current()));return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function _3(){return[i2(),O2(),N2(),t3(),f3()]}function v3(e){return{extensions:[a2(),k2(e),P2(),l3(e),p3()]}}var y3={tokenize:N3,partial:!0},b3={tokenize:P3,partial:!0},x3={tokenize:F3,partial:!0},S3={tokenize:I3,partial:!0},C3={tokenize:L3,partial:!0},w3={name:`wwwAutolink`,tokenize:j3,previous:R3},T3={name:`protocolAutolink`,tokenize:M3,previous:z3},E3={name:`emailAutolink`,tokenize:A3,previous:B3},D3={};function O3(){return{text:D3}}for(var k3=48;k3<123;)D3[k3]=E3,k3++,k3===58?k3=65:k3===91&&(k3=97);D3[43]=E3,D3[45]=E3,D3[46]=E3,D3[95]=E3,D3[72]=[E3,T3],D3[104]=[E3,T3],D3[87]=[E3,w3],D3[119]=[E3,w3];function A3(e,t,n){let r=this,i,a;return o;function o(t){return!V3(t)||!B3.call(r,r.previous)||H3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return V3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(C3,u,l)(t):t===45||t===95||AX(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&kX(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function j3(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!R3.call(r,r.previous)||H3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(y3,e.attempt(b3,e.attempt(x3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function M3(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&z3.call(r,r.previous)&&!H3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(kX(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||MX(t)||LX(t)||BX(t)||zX(t)?n(t):e.attempt(b3,e.attempt(x3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function N3(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function P3(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(S3,c,s)(t):t===null||LX(t)||BX(t)||t!==45&&zX(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function F3(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(S3,t,a)(o):o===null||LX(o)||BX(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function I3(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||LX(o)||BX(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||LX(e)||BX(e)?t(e):r(e)}function a(e){return kX(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):kX(t)?(e.consume(t),o):n(t)}}function L3(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return AX(e)?n(e):t(e)}}function R3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||LX(e)}function z3(e){return!kX(e)}function B3(e){return!(e===47||V3(e))}function V3(e){return e===43||e===45||e===46||e===95||AX(e)}function H3(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var U3={tokenize:Z3,partial:!0};function W3(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:J3,continuation:{tokenize:Y3},exit:X3}},text:{91:{name:`gfmFootnoteCall`,tokenize:q3},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:G3,resolveTo:K3}}}}function G3(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=OX(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function K3(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function q3(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||LX(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(OX(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return LX(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function J3(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||LX(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=OX(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return LX(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),UX(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Y3(e,t,n){return e.check(sZ,t,e.attempt(U3,t,n))}function X3(e){e.exit(`gfmFootnoteDefinition`)}function Z3(e,t,n){let r=this;return UX(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Q3(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&xX(o,o.length,0,eZ(s,e.slice(r+1,n),t)),xX(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),xX(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=$X(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=$X(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var $3=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){e6(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function e6(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function t6(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function n6(){return{flow:{null:{name:`table`,tokenize:r6,resolveAll:i6}}}}function r6(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):IX(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):RX(t)?UX(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||LX(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,RX(t)?UX(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return RX(t)?UX(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||IX(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return RX(t)?UX(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||IX(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||IX(n)?(e.exit(`tableRow`),t(n)):RX(n)?UX(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||LX(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function i6(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new $3;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(o6(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=a6(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=a6(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=a6(f,t,o,i,n,d)):(o[0]=o[1],d=a6(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&o6(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=t6(t.events,n))}return e}function a6(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},s6(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=s6(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=s6(t.events,n[2]),a=s6(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},s6(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function o6(e,t,n,r,i){let a=[],o=s6(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function s6(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var c6={name:`tasklistCheck`,tokenize:u6};function l6(){return{text:{91:c6}}}function u6(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return LX(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return IX(r)?t(r):RX(r)?e.check({tokenize:d6},t,n)(r):n(r)}}function d6(e,t,n){return UX(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function f6(e){return wX([O3(),W3(),Q3(e),n6(),l6()])}var p6={};function m6(e){let t=this,n=e||p6,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(f6(n)),a.push(_3()),o.push(v3(n))}var h6=({copiedDuration:e=3e3}={})=>{let[t,n]=(0,h.useState)(!1),r=(0,h.useRef)(void 0),i=(0,h.useRef)(0);return(0,h.useEffect)(()=>()=>{i.current+=1,r.current!==void 0&&(clearTimeout(r.current),r.current=void 0,n(!1))},[]),{isCopied:t,copyToClipboard:t=>{if(!t||typeof navigator>`u`||!navigator.clipboard)return;let a=i.current;navigator.clipboard.writeText(t).then(()=>{a===i.current&&(r.current!==void 0&&clearTimeout(r.current),n(!0),r.current=setTimeout(()=>{r.current=void 0,n(!1)},e))},()=>{})}}},g6=m(u(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a=a||{};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code)i.hooks.run(`complete`,c),r&&r.call(c.element);else if(i.hooks.run(`before-highlight`,c),!c.grammar)l(i.util.encode(c.code));else if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var T=1,E;if(v){if(E=o(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof a)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=o(x,0,w,_),!E)continue;var D=E.index,j=E[0],M=w.slice(0,D),N=w.slice(D+j.length),P=C+w.length;d&&P>d.reach&&(d.reach=P);var F=S.prev;M&&(F=l(t,F,M),C+=M.length),u(t,F,T);var I=new a(f,g?i.tokenize(j,g):j,y,j);if(S=l(t,F,I),N&&l(t,S,N),T>1){var L={cause:f+`,`+m,reach:P};s(e,t,n,S.prev,C,L),d&&L.reach>d.reach&&(d.reach=L.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
92
- `),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),f=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};var _6=`mine`,v6={builtinFunctions:/strategy\.closedtrades\.max_drawdown_percent|strategy\.opentrades\.max_drawdown_percent|strategy\.risk\.max_intraday_filled_orders|strategy\.closedtrades\.max_runup_percent|array\.percentile_linear_interpolation|strategy\.closedtrades\.entry_bar_index|strategy\.opentrades\.max_runup_percent|strategy\.closedtrades\.exit_bar_index|strategy\.closedtrades\.profit_percent|strategy\.closedtrades\.entry_comment|strategy\.opentrades\.entry_bar_index|strategy\.closedtrades\.exit_comment|strategy\.closedtrades\.max_drawdown|strategy\.opentrades\.profit_percent|ta\.percentile_linear_interpolation|strategy\.closedtrades\.entry_price|strategy\.opentrades\.entry_comment|strategy\.closedtrades\.commission|strategy\.closedtrades\.entry_time|strategy\.closedtrades\.exit_price|strategy\.opentrades\.max_drawdown|strategy\.risk\.max_cons_loss_days|strategy\.closedtrades\.exit_time|strategy\.closedtrades\.max_runup|strategy\.opentrades\.entry_price|strategy\.risk\.max_intraday_loss|strategy\.risk\.max_position_size|table\.cell_set_text_font_family|strategy\.closedtrades\.entry_id|strategy\.opentrades\.commission|strategy\.opentrades\.entry_time|table\.cell_set_text_formatting|array\.binary_search_rightmost|array\.percentile_nearest_rank|strategy\.closedtrades\.exit_id|strategy\.opentrades\.direction|strategy\.opentrades\.max_runup|array\.binary_search_leftmost|strategy\.closedtrades\.profit|strategy\.opentrades\.entry_id|strategy\.risk\.allow_entry_in|strategy\.convert_to_account|box\.set_bottom_right_point|label\.set_text_font_family|strategy\.closedtrades\.size|strategy\.convert_to_symbol|strategy\.default_entry_qty|strategy\.opentrades\.profit|strategy\.risk\.max_drawdown|ta\.percentile_nearest_rank|table\.cell_set_text_halign|table\.cell_set_text_valign|label\.set_text_formatting|request\.security_lower_tf|table\.cell_set_text_color|box\.set_text_font_family|strategy\.close_all_short|strategy\.opentrades\.size|table\.cell_set_text_size|box\.set_text_formatting|matrix\.is_antisymmetric|strategy\.close_all_long|box\.set_top_left_point|chart\.point\.from_index|matrix\.is_antidiagonal|table\.cell_set_bgcolor|table\.cell_set_tooltip|table\.set_border_color|table\.set_border_width|timeframe\.from_seconds|chart\.point\.from_time|line\.set_second_point|math\.round_to_mintick|matrix\.elements_count|ta\.pivot_point_levels|table\.cell_set_height|table\.set_frame_color|table\.set_frame_width|box\.set_border_color|box\.set_border_style|box\.set_border_width|line\.set_first_point|matrix\.is_stochastic|matrix\.is_triangular|table\.cell_set_width|timeframe\.in_seconds|array\.binary_search|box\.set_rightbottom|box\.set_text_halign|box\.set_text_valign|color\.from_gradient|label\.set_textalign|label\.set_textcolor|matrix\.eigenvectors|matrix\.is_symmetric|matrix\.swap_columns|strategy\.cancel_all|table\.cell_set_text|array\.new_linefill|array\.sort_indices|box\.set_text_color|linefill\.get_line1|linefill\.get_line2|linefill\.set_color|map\.new|matrix\.eigenvalues|matrix\.is_diagonal|matrix\.is_identity|strategy\.close_all|table\.set_position|array\.lastindexof|array\.percentrank|array\.standardize|box\.set_text_size|box\.set_text_wrap|label\.set_tooltip|matrix\.remove_col|matrix\.remove_row|table\.merge_cells|table\.set_bgcolor|array\.covariance|array\.new_string|chart\.point\.copy|matrix\.is_binary|matrix\.is_square|matrix\.new|matrix\.submatrix|matrix\.swap_rows|matrix\.transpose|request\.security|timeframe\.change|array\.new|array\.new_color|array\.new_float|array\.new_label|array\.new_table|box\.set_bgcolor|box\.set_lefttop|chart\.point\.new|chart\.point\.now|input\.text_area|input\.timeframe|label\.set_color|label\.set_point|label\.set_style|line\.set_extend|linefill\.delete|polyline\.delete|str\.format_time|str\.replace_all|strategy\.cancel|alertcondition|array\.includes|array\.new_bool|array\.new_line|array\.variance|box\.get_bottom|box\.set_bottom|box\.set_extend|label\.get_text|label\.set_size|label\.set_text|label\.set_xloc|label\.set_yloc|line\.get_price|line\.set_color|line\.set_style|line\.set_width|math\.todegrees|math\.toradians|matrix\.add_col|matrix\.add_row|matrix\.columns|matrix\.is_zero|matrix\.reshape|matrix\.reverse|str\.startswith|strategy\.close|strategy\.entry|strategy\.order|syminfo\.prefix|syminfo\.ticker|ta\.correlation|ta\.highestbars|ta\.percentrank|array\.indexof|array\.new_box|array\.new_int|array\.reverse|array\.unshift|box\.get_right|box\.set_right|input\.session|line\.set_xloc|matrix\.concat|matrix\.median|max_bars_back|runtime\.error|str\.substring|strategy\.exit|ta\.crossunder|ta\.lowestbars|ta\.supertrend|array\.concat|array\.insert|array\.median|array\.remove|box\.get_left|box\.set_left|box\.set_text|box\.set_xloc|input\.source|input\.string|input\.symbol|label\.delete|label\.set_xy|line\.set_xy1|line\.set_xy2|linefill\.new|map\.contains|matrix\.trace|polyline\.new|str\.contains|str\.endswith|str\.tonumber|str\.tostring|ta\.barssince|ta\.crossover|ta\.pivothigh|ta\.valuewhen|table\.delete|array\.clear|array\.every|array\.first|array\.range|array\.shift|array\.slice|array\.stdev|box\.get_top|box\.set_top|input\.color|input\.float|input\.price|label\.get_x|label\.get_y|label\.set_x|label\.set_y|line\.delete|line\.get_x1|line\.get_x2|line\.get_y1|line\.get_y2|line\.set_x1|line\.set_x2|line\.set_y1|line\.set_y2|log\.warning|map\.put_all|math\.random|matrix\.copy|matrix\.diff|matrix\.fill|matrix\.kron|matrix\.mode|matrix\.mult|matrix\.pinv|matrix\.rank|matrix\.rows|matrix\.sort|str\.replace|ta\.pivotlow|ta\.variance|table\.clear|array\.copy|array\.fill|array\.from|array\.join|array\.last|array\.mode|array\.push|array\.size|array\.some|array\.sort|box\.delete|dayofmonth|input\.bool|input\.enum|input\.time|label\.copy|map\.remove|map\.values|math\.floor|math\.log10|math\.round|matrix\.avg|matrix\.col|matrix\.det|matrix\.get|matrix\.inv|matrix\.max|matrix\.min|matrix\.pow|matrix\.row|matrix\.set|matrix\.sum|plotcandle|str\.format|str\.length|str\.repeat|ta\.falling|ta\.highest|table\.cell|time_close|weekofyear|array\.abs|array\.avg|array\.get|array\.max|array\.min|array\.pop|array\.set|array\.sum|color\.new|color\.rgb|dayofweek|indicator|input\.int|label\.new|line\.copy|log\.error|map\.clear|math\.acos|math\.asin|math\.atan|math\.ceil|math\.sign|math\.sqrt|plotarrow|plotshape|str\.lower|str\.match|str\.split|str\.upper|ta\.change|ta\.linreg|ta\.lowest|ta\.median|ta\.rising|table\.new|timestamp|barcolor|box\.copy|line\.new|linefill|log\.info|map\.copy|map\.keys|map\.size|math\.abs|math\.avg|math\.cos|math\.exp|math\.log|math\.max|math\.min|math\.pow|math\.sin|math\.sum|math\.tan|plotchar|str\.trim|strategy|ta\.cross|ta\.range|ta\.stdev|ta\.stoch|bgcolor|box\.new|color\.b|color\.g|color\.r|color\.t|library|map\.get|map\.put|plotbar|str\.pos|ta\.alma|ta\.macd|ta\.mode|ta\.swma|ta\.vwap|ta\.vwma|fixnan|minute|second|string|ta\.atr|ta\.bbw|ta\.cci|ta\.cmo|ta\.cog|ta\.cum|ta\.dev|ta\.dmi|ta\.ema|ta\.hma|ta\.kcw|ta\.max|ta\.mfi|ta\.min|ta\.mom|ta\.rci|ta\.rma|ta\.roc|ta\.rsi|ta\.sar|ta\.sma|ta\.tsi|ta\.wma|ta\.wpr|alert|color|float|hline|input|label|month|ta\.bb|ta\.kc|ta\.tr|table|bool|fill|hour|line|plot|time|year|box|int|na|nz/,keywords:/continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|enum|type|and|for|not|var|as|by|if|in|or|to/,tokenizer:{root:[[/\/\/\s*(?=@)/,`comment`,`@comments`],[/\/\/.*(?!@).*/,`comment`],[/\'([^\'\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/\"/,{token:`string`,bracket:`@open`,next:`@stringDouble`}],[/(type|enum)\s+[a-zA-Z]\w*/,`entity.name.type`],[/'/,{token:`string`,bracket:`@open`,next:`@stringSingle`}],[/(@builtinFunctions)(?=\s*\(|\s*<.*>)/,{token:`support.function`,next:`@template`}],[/@punctuation/,{token:`punctuation.operator`,next:`@property`}],[/(varip|var)\b(\s+)((?!(?:chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map|continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)[\w.\d_$]+)(\[\]|)(\s+)((?!(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)[\w\d_$]+)/,[{token:`keyword`},{token:`source`},{token:`entity.name.type`},{token:`paren`},{token:`source`},{token:`variable.other`}]],[/\b(?:@builtinTypes)(?=(\s*)[\[|<|(]|(?=\s+(?=[^.=][\w\(]*))|\s*$)/,{token:`support.type`,next:`@template`}],[/^(\s*)\b(?!(?:chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map|continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)([\w.\d_$]+)(\[\]|)(\s+)((?!(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)[\w\d_$]+)(\s+)(\=)/,[{token:`source`},{token:`entity.name.type`},{token:`paren`},{token:`source`},{token:`variable.other`},{token:`source`},{token:`keyword.equals`}]],[/(\((?:\s+))?((?!(?:chart\.point|linefill|polyline|continue|for\.\.\.in|matrix|series|simple|string|export|import|method|switch|array|color|const|float|label|table|break|varip|while|bool|line|else|type|enum|box|int|map|and|for|not|var|as|by|if|in|or|to)\b)\b[\w.\d_$]+(?=[\[\]]*(?:\s+)(?:[\w\d_$]+\s*(?:\,|\))+\s*).+(?:\=\>|\→)))/,`entity.name.type`],[/import(?=\s+@importName)/,{token:`keyword`,next:`@import`}],[/import(?=\s+[a-zA-Z\d\$_\-\.\u00a1-\uffff\/]+)/,`keyword`],[/[+-]?\d+\.\d*([eE][\-+]?\d+)?(?!\w+)/,`constant.numeric.float`],[/[+-]?\.\d+([eE][\-+]?\d+)?(?!\w+)/,`constant.numeric.float`],[/([+-]?(\d+))(?!\w+)(?!\w+)/,`constant.numeric.integer`],[/(?:true|false)\b/,`constant.other.boolean`],[/#[0-9a-fA-F]{6,8}\b/,`constant.other.color`],[/\+=|\-=|\*=|\/=|%=|[\/%*+\-]|==|!=|<=|>=|=>|<|>|\?|\:=|\:|\,/,`keyword.operator`],[/\b(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b/,`keyword`],[/^[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/,`entity.name.function`],[/[0-9]+\b/,`constant.numeric.integer`],[/=/,`keyword.equals`],[/\b(?:@builtinVariables)\b(?!\s*=\s*\w+)/,`support.variable`],[/[(|)|\[|\]]/,`paren`],[/[a-zA-Z_][a-zA-Z_0-9]*(?=\s*\()/,{token:`entity.name.method`}],[/\w+\b/,`variable.other`]],comments:[[/@[A-Za-z]+(\s*=\s*)?$/,{token:`comment.annotation`,next:`@pop`}],[/@[A-Za-z]+(\s*=\s*)?/,{token:`comment.annotation`}],[/(?!\s*@[A-Za-z]+).+$/,{token:`comment`,next:`@pop`}]],stringDouble:[[/[^\\\"]+/,`string`],[/\\./,`string.invalid`],[/\"/,{token:`string.quote`,bracket:`@close`,next:`@pop`}]],stringSingle:[[/[^\\']+/,`string`],[/\\./,`string.invalid`],[/'/,{token:`string`,bracket:`@close`,next:`@pop`}]],template:[[/(@builtinTypes)/,{token:`support.type`}],[/(\((?:\s+))?((?!(?:chart\.point|linefill|polyline|continue|for\.\.\.in|matrix|series|simple|string|export|import|method|switch|array|color|const|float|label|table|break|varip|while|bool|line|else|type|enum|box|int|map|and|for|not|var|as|by|if|in|or|to)\b)\b[\w.\d_$]+(?=[\[\]]*(?:\s+)(?:[\w\d_$]+\s*(?:\,|\))+\s*).+(?:\=\>|\→)))/,`entity.name.type`],[/\(|\)|\[|\]|\=|\>/,{token:`paren`,next:`@pop`}],[/(\,)(\s+)/,[`keyword.operator`,`source`]],[/(\,)/,{token:`keyword.operator`}],[/([\w.\d$]+)/,{token:`entity.name.type`}],[/(<|>)/,{token:`paren`}],[/\s(?=\w)|$/,{token:`source`,next:`@pop`}]],property:[[/@punctuation/,{token:`punctuation.operator`}],[/(@builtinTypes)(?=\s*[(])/,{token:`support.method`,next:`@pop`}],[/[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/,{token:`entity.name.method`,next:`@pop`}],[/[a-zA-Z0-9_]+/,{token:`variable.other.property`,next:`@pop`}],[/@empty/,{token:`source`,next:`@pop`}]],import:[[/\s+/,{token:`source`}],[/(@importName)(\s+)(as\b)(\s+)(@importAlias)/,[{token:`entity.name.module`},{token:`source`},{token:`keyword`},{token:`source`},{token:`entity.name.module.name`,next:`@pop`}]],[/@importName/,{token:`entity.name.module`,next:`@pop`}]]},builtinVariables:/strategy\.commission\.cash_per_contract|syminfo\.recommendations_sell_strong|strategy\.commission\.cash_per_order|strategy\.avg_winning_trade_percent|syminfo\.recommendations_buy_strong|strategy\.avg_losing_trade_percent|strategy\.closedtrades\.first_index|strategy\.margin_liquidation_price|strategy\.max_contracts_held_short|strategy\.max_contracts_held_long|strategy\.opentrades\.capital_held|syminfo\.shares_outstanding_float|syminfo\.shares_outstanding_total|barstate\.islastconfirmedhistory|earnings\.future_period_end_time|strategy\.max_contracts_held_all|syminfo\.target_price_estimates|alert\.freq_once_per_bar_close|label\.style_label_lower_right|label\.style_label_upper_right|strategy\.max_drawdown_percent|syminfo\.recommendations_total|label\.style_label_lower_left|label\.style_label_upper_left|chart\.right_visible_bar_time|strategy\.grossprofit_percent|strategy\.position_entry_name|strategy\.position_size_short|strategy\.position_size_total|strategy\.price_highest_short|syminfo\.recommendations_date|syminfo\.recommendations_hold|syminfo\.recommendations_sell|syminfo\.target_price_average|plot\.style_stepline_diamond|strategy\.commission\.percent|chart\.left_visible_bar_time|strategy\.openprofit_percent|strategy\.position_avg_price|strategy\.position_size_long|strategy\.price_highest_long|strategy\.price_lowest_short|syminfo\.recommendations_buy|syminfo\.target_price_median|strategy\.percent_of_equity|session\.isfirstbar_regular|strategy\.avg_trade_percent|strategy\.avg_winning_trade|strategy\.grossloss_percent|strategy\.max_runup_percent|strategy\.netprofit_percent|strategy\.price_first_short|strategy\.price_lowest_long|dividends\.future_pay_date|session\.islastbar_regular|strategy\.account_currency|strategy\.avg_losing_trade|strategy\.openprofit_short|strategy\.opentrades_short|strategy\.price_first_long|strategy\.price_last_short|syminfo\.target_price_date|syminfo\.target_price_high|label\.style_label_center|label\.style_text_outline|label\.style_triangledown|strategy\.direction\.short|dividends\.future_ex_date|strategy\.avg_price_short|strategy\.initial_capital|strategy\.openprofit_long|strategy\.opentrades_long|strategy\.price_last_long|syminfo\.current_contract|syminfo\.target_price_low|alert\.freq_once_per_bar|label\.style_label_right|strategy\.direction\.long|dividends\.future_amount|earnings\.future_revenue|strategy\.avg_price_long|syminfo\.expiration_date|barmerge\.lookahead_off|label\.style_label_down|label\.style_label_left|label\.style_triangleup|line\.style_arrow_right|position\.bottom_center|position\.middle_center|strategy\.direction\.all|strategy\.position_size|barmerge\.lookahead_on|earnings\.standardized|font\.family_monospace|label\.style_arrowdown|line\.style_arrow_both|line\.style_arrow_left|plot\.style_steplinebr|position\.bottom_right|position\.middle_right|strategy\.closedtrades|strategy\.max_drawdown|syminfo\.main_tickerid|timeframe\.main_period|label\.style_label_up|plot\.style_histogram|position\.bottom_left|position\.middle_left|barstate\.isconfirmed|earnings\.future_time|session\.ispostmarket|strategy\.grossprofit|syminfo\.basecurrency|syminfo\.shareholders|timeframe\.isintraday|timeframe\.multiplier|dayofweek\.wednesday|display\.data_window|display\.price_scale|display\.status_line|font\.family_default|label\.style_arrowup|label\.style_diamond|plot\.style_stepline|position\.top_center|strategy\.oca\.cancel|strategy\.oca\.reduce|barstate\.isrealtime|chart\.is_heikinashi|earnings\.future_eps|session\.ispremarket|strategy\.eventrades|strategy\.losstrades|strategy\.openprofit|strategy\.opentrades|syminfo\.description|syminfo\.mincontract|timeframe\.isminutes|timeframe\.ismonthly|timeframe\.isseconds|dayofweek\.saturday|dayofweek\.thursday|hline\.style_dashed|hline\.style_dotted|label\.style_circle|label\.style_square|label\.style_xcross|plot\.style_circles|plot\.style_columns|position\.top_right|shape\.triangledown|splits\.denominator|text\.format_italic|barstate\.ishistory|chart\.is_linebreak|session\.isfirstbar|strategy\.avg_trade|strategy\.grossloss|strategy\.max_runup|strategy\.netprofit|strategy\.wintrades|syminfo\.pointvalue|syminfo\.pricescale|syminfo\.volumetype|timeframe\.isweekly|barmerge\.gaps_off|dayofweek\.tuesday|earnings\.estimate|hline\.style_solid|label\.style_cross|line\.style_dashed|line\.style_dotted|location\.abovebar|location\.absolute|location\.belowbar|plot\.style_areabr|plot\.style_linebr|position\.top_left|strategy\.oca\.none|text\.align_bottom|text\.align_center|chart\.is_standard|session\.islastbar|syminfo\.employees|timeframe\.isdaily|barmerge\.gaps_on|dayofweek\.friday|dayofweek\.monday|dayofweek\.sunday|label\.style_flag|label\.style_none|line\.style_solid|order\.descending|plot\.style_cross|session\.extended|shape\.triangleup|splits\.numerator|text\.align_right|text\.format_bold|text\.format_none|barstate\.isfirst|session\.ismarket|syminfo\.currency|syminfo\.industry|syminfo\.tickerid|syminfo\.timezone|timeframe\.period|dividends\.gross|earnings\.actual|location\.bottom|order\.ascending|plot\.style_area|plot\.style_line|session\.regular|shape\.arrowdown|shape\.labeldown|text\.align_left|barstate\.islast|strategy\.equity|syminfo\.country|syminfo\.minmove|syminfo\.mintick|syminfo\.session|time_tradingday|timeframe\.isdwm|alert\.freq_all|format\.inherit|format\.mintick|format\.percent|strategy\.fixed|strategy\.short|text\.align_top|text\.wrap_auto|text\.wrap_none|xloc\.bar_index|barstate\.isnew|chart\.bg_color|chart\.fg_color|chart\.is_range|chart\.is_renko|last_bar_index|syminfo\.prefix|syminfo\.sector|syminfo\.ticker|color\.fuchsia|currency\.NONE|currency\.USDT|dividends\.net|format\.volume|shape\.arrowup|shape\.diamond|shape\.labelup|strategy\.cash|strategy\.long|xloc\.bar_time|yloc\.abovebar|yloc\.belowbar|chart\.is_kagi|last_bar_time|color\.maroon|color\.orange|color\.purple|color\.silver|color\.yellow|currency\.AUD|currency\.BTC|currency\.CAD|currency\.CHF|currency\.EGP|currency\.ETH|currency\.EUR|currency\.GBP|currency\.HKD|currency\.INR|currency\.JPY|currency\.KRW|currency\.MYR|currency\.NOK|currency\.NZD|currency\.PKR|currency\.PLN|currency\.RUB|currency\.SEK|currency\.SGD|currency\.TRY|currency\.USD|currency\.ZAR|display\.none|display\.pane|extend\.right|format\.price|location\.top|shape\.circle|shape\.square|shape\.xcross|chart\.is_pnf|linefill\.all|polyline\.all|syminfo\.root|syminfo\.type|color\.black|color\.green|color\.olive|color\.white|display\.all|extend\.both|extend\.left|extend\.none|scale\.right|shape\.cross|size\.normal|color\.aqua|color\.blue|color\.gray|color\.lime|color\.navy|color\.teal|scale\.left|scale\.none|shape\.flag|size\.large|size\.small|yloc\.price|dayofmonth|ta\.accdist|time_close|weekofyear|color\.red|math\.rphi|size\.auto|size\.huge|size\.tiny|bar_index|dayofweek|label\.all|table\.all|math\.phi|line\.all|math\.pi|box\.all|ta\.vwap|ta\.wvad|timenow|math\.e|minute|second|ta\.iii|ta\.nvi|ta\.obv|ta\.pvi|ta\.pvt|ta\.wad|volume|false|close|hlcc4|month|ohlc4|ta\.tr|true|high|hlc3|hour|open|time|year|ask|bid|hl2|low|na/,builtinTypes:/chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map/,punctuation:/[.](?![.])/,importName:/[a-zA-Z\d\$_\-\.\u00a1-\uffff\/]+/,importAlias:/[a-zA-Z\d\_\u00a1\uffff\/]+/,empty:/^$/},y6=e=>v6[e].source,b6=y6(`builtinFunctions`),x6=y6(`builtinVariables`),S6=y6(`builtinTypes`),C6=y6(`keywords`),w6=y6(`punctuation`),T6={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0,inside:{"comment-annotation":/@[a-zA-Z]+(?:\s*=\s*)?/}},string:{pattern:/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/,greedy:!0},"builtin-function":{pattern:RegExp(`\\b(?:${b6})(?=\\s*(?:\\(|<))`),greedy:!0,alias:`function`},"builtin-variable":{pattern:RegExp(`\\b(?:${x6})\\b`),greedy:!0,alias:`variable`},"builtin-type":{pattern:RegExp(`\\b(?:${S6})\\b`),greedy:!0,alias:`class-name`},keyword:RegExp(`\\b(?:${C6})\\b`),boolean:/\b(?:true|false)\b/,number:{pattern:/[+-]?(?:\d+\.\d*|\.\d+|\d+)(?:[eE][+-]?\d+)?/,greedy:!0},"color-hex":/#[0-9a-fA-F]{6,8}\b/,"function-definition":{pattern:/\b[a-zA-Z_]\w*(?=\s*\()/,alias:`function`},property:{pattern:/(\.)[a-zA-Z_]\w*/,lookbehind:!0,alias:`property`},operator:/\+=|-=|\*=|\/=|%=|==|!=|<=|>=|=>|:=|[+\-*/%<>=?:,]/,punctuation:new RegExp(w6),bracket:/[()[\]{}]/,identifier:/\b[a-zA-Z_]\w*\b/};g6.default.languages.mine=T6,j();var E6=[`className`,`children`],D6=[`className`],O6=[`className`],k6=[`className`],A6=[`className`],j6=[`className`],M6=[`className`],N6=[`className`],P6=[`className`],F6=[`className`],I6=[`className`],L6=[`className`],R6=[`className`],z6=[`className`],B6=[`className`],V6=[`className`],H6=[`className`],U6=[`className`],W6=[`className`],G6=[`className`],K6=[`className`],q6=e=>{let t=(0,h.useRef)(e);if(e!==t.current){let n=t.current;e!==void 0&&n!==void 0&&Object.keys(n).length===Object.keys(e).length&&Object.keys(e).every(t=>n[t]===e[t])||(t.current=e)}return t.current},J6=e=>{let{className:t,children:n}=e,r=G(e,E6),i=eJ(),a=/\blanguage-mine\b/.test(t==null?``:t)||!t,o=String(n==null?``:n).replace(/\n$/,``),s=(0,h.useMemo)(()=>!i||!a?null:g6.default.highlight(o,T6,_6),[o,i,a]),c=Q(`font-mono`,i?`tcc-code text-inherit`:Q(`aui-md-inline-code`,`rounded-md border border-border/60`,`bg-muted px-1.5 py-0.5`,`text-[0.85em] text-foreground`),t);return!i||!a||s===null?(0,X.jsx)(`code`,A(A({className:c},r),{},{children:n})):(0,X.jsx)(`code`,A(A({className:c},r),{},{dangerouslySetInnerHTML:{__html:s}}))},Y6=(0,h.memo)(({components:e,componentsByLanguage:t})=>{let n=q6(e),r=q6(t),i=(0,h.useMemo)(()=>n?A(A({},X6),Zq(n)):X6,[n]);return(0,X.jsx)(Y0,{remarkPlugins:[m6],className:Q(`aui-md`,`min-w-0 break-words`,`text-[15px] leading-[1.75] text-foreground`,`[&_img]:max-w-full`,`[&_svg]:max-w-full`),components:i,componentsByLanguage:r,defer:!0})}),X6=Zq({h1:e=>{let{className:t}=e,n=G(e,D6);return(0,X.jsx)(`h1`,A({className:Q(`aui-md-h1`,`mt-7 mb-3 scroll-m-20`,`text-2xl font-semibold tracking-tight`,`leading-tight text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h2:e=>{let{className:t}=e,n=G(e,O6);return(0,X.jsx)(`h2`,A({className:Q(`aui-md-h2`,`mt-6 mb-3 scroll-m-20`,`text-xl font-semibold tracking-tight`,`leading-snug text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h3:e=>{let{className:t}=e,n=G(e,k6);return(0,X.jsx)(`h3`,A({className:Q(`aui-md-h3`,`mt-5 mb-2 scroll-m-20`,`text-lg font-semibold`,`leading-snug text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h4:e=>{let{className:t}=e,n=G(e,A6);return(0,X.jsx)(`h4`,A({className:Q(`aui-md-h4`,`mt-4 mb-2 scroll-m-20`,`text-base font-semibold text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h5:e=>{let{className:t}=e,n=G(e,j6);return(0,X.jsx)(`h5`,A({className:Q(`aui-md-h5`,`mt-3 mb-1`,`text-sm font-semibold text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h6:e=>{let{className:t}=e,n=G(e,M6);return(0,X.jsx)(`h6`,A({className:Q(`aui-md-h6`,`mt-3 mb-1`,`text-sm font-medium text-muted-foreground`,`first:mt-0 last:mb-0`,t)},n))},p:e=>{let{className:t}=e,n=G(e,N6);return(0,X.jsx)(`p`,A({className:Q(`aui-md-p`,`my-3`,`text-[15px] leading-[1.75] text-foreground`,`first:mt-0 last:mb-0`,t)},n))},a:e=>{let{className:t}=e,n=G(e,P6);return(0,X.jsx)(`a`,A({className:Q(`aui-md-a`,`text-primary underline decoration-primary/40`,`underline-offset-4 transition-colors`,`hover:decoration-primary`,t)},n))},blockquote:e=>{let{className:t}=e,n=G(e,F6);return(0,X.jsx)(`blockquote`,A({className:Q(`aui-md-blockquote`,`my-4 border-s-2 border-border ps-4`,`text-muted-foreground`,`[&>p]:my-1`,t)},n))},ul:e=>{let{className:t}=e,n=G(e,I6);return(0,X.jsx)(`ul`,A({className:Q(`aui-md-ul`,`my-3 ms-6 list-disc`,`space-y-1`,`marker:text-muted-foreground`,`[&_ul]:my-1`,t)},n))},ol:e=>{let{className:t}=e,n=G(e,L6);return(0,X.jsx)(`ol`,A({className:Q(`aui-md-ol`,`my-3 ms-6 list-decimal`,`space-y-1`,`marker:text-muted-foreground`,`[&_ol]:my-1`,t)},n))},hr:e=>{let{className:t}=e,n=G(e,R6);return(0,X.jsx)(`hr`,A({className:Q(`aui-md-hr`,`my-6 border-0 border-t border-border`,t)},n))},table:e=>{let{className:t}=e,n=G(e,z6);return(0,X.jsx)(`div`,{className:`aui-md-table-wrapper my-4 w-full overflow-x-auto rounded-lg border border-border`,children:(0,X.jsx)(`table`,A({className:Q(`aui-md-table`,`w-full border-collapse text-sm`,t)},n))})},th:e=>{let{className:t}=e,n=G(e,B6);return(0,X.jsx)(`th`,A({className:Q(`aui-md-th`,`border-b border-border`,`bg-muted/60 px-3 py-2.5`,`text-start text-sm font-semibold text-foreground`,`[[align=center]]:text-center`,`[[align=right]]:text-right`,t)},n))},td:e=>{let{className:t}=e,n=G(e,V6);return(0,X.jsx)(`td`,A({className:Q(`aui-md-td`,`border-b border-border/70`,`px-3 py-2.5`,`text-start text-foreground`,`[[align=center]]:text-center`,`[[align=right]]:text-right`,t)},n))},tr:e=>{let{className:t}=e,n=G(e,H6);return(0,X.jsx)(`tr`,A({className:Q(`aui-md-tr`,`transition-colors`,`last:[&>td]:border-b-0`,`hover:bg-muted/30`,t)},n))},li:e=>{let{className:t}=e,n=G(e,U6);return(0,X.jsx)(`li`,A({className:Q(`aui-md-li`,`ps-0 leading-[1.75] text-foreground`,`[&>p]:my-1`,t)},n))},strong:e=>{let{className:t}=e,n=G(e,W6);return(0,X.jsx)(`strong`,A({className:Q(`aui-md-strong`,`font-semibold text-foreground`,t)},n))},sup:e=>{let{className:t}=e,n=G(e,G6);return(0,X.jsx)(`sup`,A({className:Q(`aui-md-sup`,`text-muted-foreground`,`[&>a]:text-xs [&>a]:no-underline`,t)},n))},pre:e=>{let{className:t}=e,n=G(e,K6);return(0,X.jsx)(`pre`,A({className:Q(`aui-md-pre`,`my-0 overflow-x-auto`,`rounded-b-xl border border-border`,`bg-[#f4f4f4] px-4 py-4`,`font-mono text-[13px] leading-6`,`text-[#242424]`,`dark:bg-[#2f2f2f] dark:text-[#ededed]`,`[&>code]:bg-transparent`,`[&>code]:p-0`,`[&>code]:text-inherit`,`[&>code]:border-0`,t)},n))},code:J6,CodeHeader:({language:e,code:t})=>{let{isCopied:n,copyToClipboard:r}=h6();return(0,X.jsxs)(`div`,{className:Q(`aui-code-header-root`,`mt-4 flex items-center justify-between`,`rounded-t-xl border border-b-0 border-border`,`bg-[#f4f4f4] px-4 py-2`,`dark:bg-[#2f2f2f]`,`text-xs`),children:[(0,X.jsx)(`span`,{className:`aui-code-header-language font-medium text-muted-foreground`,children:e||`code`}),(0,X.jsx)(bK,{tooltip:n?`已复制`:`复制代码`,onClick:()=>{t&&!n&&r(t)},className:Q(`size-7 rounded-md`,`text-muted-foreground`,`hover:bg-black/5 hover:text-foreground`,`dark:hover:bg-white/10`),children:n?(0,X.jsx)(nI,{className:`size-4`}):(0,X.jsx)(gI,{className:`size-4`})})]})}});function Z6({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=h.useRef(e!==void 0),[a,o]=h.useState(()=>t),s=i&&e!==void 0?e:a;if(process.env.NODE_ENV!==`production`){h.useEffect(()=>{i!==(e!==void 0)&&UW([`A component is changing the ${i?``:`un`}controlled ${r} state of ${n} to be ${i?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
93
- `))},[r,n,e]);let{current:a}=h.useRef(t);h.useEffect(()=>{!i&&Q6(a)!==Q6(t)&&UW([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
94
- `))},[t])}return[s,h.useCallback(e=>{i||o(e)},[])]}function Q6(e){let t=0,n=new WeakMap;try{let r=JSON.stringify(e,function(e,r){if(!(e===`_owner`&&this!=null&&typeof this==`object`&&`$$typeof`in this)){if(typeof r==`bigint`)return`__bigint__:${r}`;if(typeof r==`object`&&r){let e=n.get(r);if(e!==void 0)return`__object__:${e}`;n.set(r,t),t+=1}return r}});return r==null?`__top__:${typeof e}`:r}catch(e){return`__unserializable__`}}function $6(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=Z6({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=OV(a,!0,!0),u=JH(),[d,f]=h.useState(),p=d===null?void 0:d==null?u:d,m=fz(e=>{let t=!a,n=RR(BR,e.nativeEvent);r(t,n),n.isCanceled||o(t)});return h.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var e8=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(e8.displayName=`CollapsibleRootContext`);function t8(){let e=h.useContext(e8);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?DL(15):`Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.`);return e}var n8=`data-open`,r8=`data-closed`,i8=cR,a8=`data-panel-open`,o8={[n8]:``},s8={[r8]:``},c8={open(e){return e?{[a8]:``}:null}},l8={open(e){return e?o8:s8}};j();var u8=A(A({},l8),fR);j();var d8=[`render`,`className`,`defaultOpen`,`disabled`,`onOpenChange`,`open`,`style`],f8=h.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c}=e,l=G(e,d8),u=fz(o),d=$6({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=h.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=h.useMemo(()=>A(A({},d),{},{onOpenChange:u,state:f}),[d,u,f]),m=zB(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:u8});return(0,X.jsx)(e8.Provider,{value:p,children:m})});process.env.NODE_ENV!==`production`&&(f8.displayName=`CollapsibleRoot`),j();var p8=[`className`,`disabled`,`render`,`nativeButton`,`style`],m8=A(A({},c8),fR),h8=h.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=t8(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d}=e,f=G(e,p8),{getButtonProps:p,buttonRef:m}=YW({disabled:c,native:u});return zB(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:m8})});process.env.NODE_ENV!==`production`&&(h8.displayName=`CollapsibleTrigger`),j();var g8={height:void 0,width:void 0};function _8(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=h.useRef(null),f=h.useRef(null),[p,m]=h.useState(g8),g=h.useRef(g8),_=h.useRef(!1),v=h.useRef(s),y=h.useRef(!1),[b,x]=h.useState(!1),S=h.useRef(null),C=tz(t,d),w=sz(s),T=MV(d),E=!s&&!a,D=b?`idle`:u,O=s&&(v.current||y.current),k=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?g.current:p,j=n&&E&&f.current!==`css-animation`,M=fz((e,t=!0)=>{t&&(g.current=e),m(e)}),N=fz(()=>{var e;(e=S.current)==null||e.call(S),S.current=null}),P=fz(e=>{N(),S.current=()=>{S.current=null,e()}}),F=fz(()=>{s&&a&&f.current===`css-animation`&&(y.current=!0)});TL(()=>{b&&u!==`starting`&&x(!1)},[b,u]),h.useEffect(()=>()=>{F(),N()},[F,N]),TL(()=>{s||(v.current=!1,y.current=!1);let e=d.current;if(!e)return;!s&&S.current&&N();let t=y8(e,O);if(f.current=t,s&&u===`idle`&&v.current&&t===`css-animation`){g.current=v8(e);return}if(s&&u===`starting`){let n=_.current;if(_.current=!1,t===`none`){M(v8(e)),x(!0);return}if(t===`css-transition`){let t=S8(e);if(M(v8(e)),!n)return t;let r=x8(e,`transition-duration`,`0s`);return P(r),x(!0),t}M(v8(e));let r=x8(e,`animation-name`,`none`);if(!n){r();return}let i=x8(e,`animation-duration`,`0s`);r(),P(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){M(g8,!1),c(!1);return}M(v8(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=v8(e);n.height>0||n.width>0?(M(n),t===`css-animation`&&x8(e,`animation-name`,`none`)()):c(!1)},[a,s,N,M,c,P,O,u]),NV({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&M(g8,!1)}}),h.useEffect(()=>{if(s||!a||D!==`ending`)return;if(!d.current){c(!1),M(g8,!1);return}let e=new AbortController,t=-1;function n(){w.current||(c(!1),M(g8,!1))}return t=vz.request(()=>{T(n,e.signal)}),()=>{vz.cancel(t),e.abort()}},[w,a,s,D,T,M,c]),TL(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),h.useEffect(function(){let e=d.current;if(!e)return;let t=ML.create(),n=-1,r=(r,i)=>{t.start(0,()=>{w.current||(n=vz.request(()=>{w.current||(r&&(_.current=!1),i&&e.setAttribute(i8,``),e.setAttribute(`hidden`,`until-found`))}))})},i=$R(e,`beforematch`,t=>{let n=RR(zR,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}_.current=!0;let i=e.hasAttribute(i8);e.removeAttribute(i8),l(!0),r(!0,i)});return()=>{t.clear(),vz.cancel(n),i()}},[w,o,l]);let I=i||n||a||s;return{height:k.height,props:A(A({},j?{[i8]:``}:void 0),{},{hidden:E,id:r}),ref:C,shouldPreventOpenAnimation:O,shouldRender:I,transitionStatus:D,width:k.width}}function v8(e){return{height:e.scrollHeight,width:e.scrollWidth}}function y8(e,t){let n=KS(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&b8(n.animationDuration),i=b8(n.transitionDuration);return r&&i?(process.env.NODE_ENV!==`production`&&xB(`CSS transitions and CSS animations both detected on Collapsible or Accordion panel.`,`Only one of either animation type should be used.`),`css-transition`):i?`css-transition`:r?`css-animation`:`none`}function b8(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function x8(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function S8(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=vz.request(n);return()=>{vz.cancel(r),n()}}var C8=`--collapsible-panel-height`,w8=`--collapsible-panel-width`;j();var T8=[`className`,`hiddenUntilFound`,`keepMounted`,`render`,`id`,`style`],E8=h.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s}=e,c=G(e,T8);process.env.NODE_ENV!==`production`&&h.useEffect(()=>{r&&i===!1&&xB("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.")},[r,i]);let{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:g,state:_,transitionStatus:v}=t8(),y=r!=null&&r,b=i!=null&&i,x=o||void 0,S=x==null?l:x;TL(()=>(m(e=>x==null?e===null?void 0:e:x),()=>{m(e=>e===x?null:e)}),[x,m]);let{height:C,props:w,ref:T,shouldPreventOpenAnimation:E,shouldRender:D,transitionStatus:O,width:k}=_8({externalRef:t,hiddenUntilFound:y,id:S,keepMounted:b,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:g,transitionStatus:v}),j=A(A({},_),{},{transitionStatus:O}),M=wB(s,j),N=zB(`div`,A(A({},e),{},{style:void 0}),{state:j,ref:T,props:[w,{style:{[C8]:C===void 0?`auto`:`${C}px`,[w8]:k===void 0?`auto`:`${k}px`}},c,M?{style:M}:void 0,E?{style:{animationName:`none`}}:void 0],stateAttributesMapping:u8});return D?N:null});process.env.NODE_ENV!==`production`&&(E8.displayName=`CollapsiblePanel`),j();var D8=(0,h.forwardRef)(function(e,t){return(0,X.jsx)(f8,A({ref:t,"data-slot":`collapsible`},e))});function O8(e){let t=MW({},(jW(e),e));return(0,X.jsx)(h8,A({"data-slot":`collapsible-trigger`},t))}function k8(e){let t=MW({},(jW(e),e));return(0,X.jsx)(E8,A({"data-slot":`collapsible-content`},t))}j();var A8=[`className`,`variant`,`open`,`onOpenChange`,`defaultOpen`,`streaming`,`showContent`,`onAnimationStart`,`style`,`children`],j8=[`side`,`className`],M8=[`active`,`duration`,`className`],N8=[`className`,`children`],P8=[`className`,`children`],F8=(0,h.createContext)({isPreview:!1,showContent:!0}),I8=UG(`aui-reasoning-root mb-0 w-full`,{variants:{variant:{outline:`rounded-lg px-0 py-2`,ghost:``,muted:`bg-muted/50 rounded-lg px-3 py-2`}},defaultVariants:{variant:`outline`}}),L8=(0,h.forwardRef)(function(e,t){let{className:n,variant:r,open:i,onOpenChange:a,defaultOpen:o=!1,streaming:s,showContent:c=!0,onAnimationStart:l,style:u,children:d}=e,f=G(e,A8),[p]=(0,h.useState)(o),[m,g]=(0,h.useState)(null),_=i!==void 0,v=_?i:m==null?s||p:m,y=s===!0&&v,b=(0,h.useRef)(s);RK(()=>{b.current!==s&&(b.current=s,_||m!==null||p||l==null||l())},[s,_,m,p,l]);let x=(0,h.useCallback)(e=>{l==null||l(),_||g(e),a==null||a(e)},[l,_,a]),S={isPreview:c&&y,showContent:c};return c?(0,X.jsx)(D8,A(A({ref:t,"data-slot":`reasoning-root`,"data-variant":r,open:v,onOpenChange:x,className:Q(`group/reasoning-root`,I8({variant:r,className:n})),style:A({"--animation-duration":`200ms`},typeof u==`object`&&u||{})},f),{},{children:(0,X.jsx)(F8.Provider,{value:S,children:d})})):(0,X.jsx)(`div`,A(A({ref:t,"data-slot":`reasoning-root`,"data-variant":r,className:Q(`group/reasoning-root`,I8({variant:r,className:n})),style:typeof u==`function`?void 0:u},f),{},{children:(0,X.jsx)(F8.Provider,{value:S,children:d})}))});function R8(e){let{side:t=`bottom`,className:n}=e,r=G(e,j8);return t===`top`?(0,X.jsx)(`div`,A({"data-slot":`reasoning-fade`,className:Q(`aui-reasoning-fade pointer-events-none absolute inset-x-0 top-0 z-10 h-8`,`bg-[linear-gradient(to_bottom,var(--color-background),transparent)]`,`group-data-[variant=muted]/reasoning-root:bg-[linear-gradient(to_bottom,color-mix(in_oklab,var(--color-muted)_50%,var(--color-background)),transparent)]`,`fade-in-0 animate-in`,`animation-duration-(--animation-duration)`,n)},r)):(0,X.jsx)(`div`,A({"data-slot":`reasoning-fade`,className:Q(`aui-reasoning-fade pointer-events-none absolute inset-x-0 bottom-0 z-10 h-8`,`bg-[linear-gradient(to_top,var(--color-background),transparent)]`,`group-data-[variant=muted]/reasoning-root:bg-[linear-gradient(to_top,color-mix(in_oklab,var(--color-muted)_50%,var(--color-background)),transparent)]`,`fade-in-0 animate-in`,`animation-duration-(--animation-duration)`,n)},r))}function z8(e){let{active:t,duration:n,className:r}=e,i=G(e,M8),{showContent:a}=(0,h.useContext)(F8),o=t?`正在思考...`:n===void 0?`思考过程`:`思考了 ${n} 秒`,s=Q(`aui-reasoning-trigger flex max-w-[75%] origin-left items-center gap-2 py-1.5 text-sm text-muted-foreground`,t&&a&&`hover:text-foreground transition-colors active:scale-[0.98]`,r),c=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(eI,{"data-slot":`reasoning-trigger-icon`,className:`aui-reasoning-trigger-icon size-4 shrink-0`}),(0,X.jsx)(`span`,{"data-slot":`reasoning-trigger-label`,className:Q(`aui-reasoning-trigger-label-wrapper inline-block leading-none tabular-nums`,t&&`shimmer motion-reduce:animate-none`),children:o})]});return!a||!t?(0,X.jsx)(`div`,{"data-slot":`reasoning-trigger`,className:s,children:c}):(0,X.jsx)(O8,A(A({"data-slot":`reasoning-trigger`,className:s},i),{},{children:c}))}function B8(e){let{className:t,children:n}=e,r=G(e,N8),{showContent:i}=(0,h.useContext)(F8);return i?(0,X.jsx)(k8,A(A({"data-slot":`reasoning-content`,className:Q(`aui-reasoning-content relative overflow-hidden text-sm text-muted-foreground outline-none`,`group/collapsible-content ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`data-closed:animate-collapsible-up`,`data-open:animate-collapsible-down`,`data-closed:fill-mode-forwards`,`data-closed:pointer-events-none`,`[--tw-duration:var(--animation-duration)]`,t)},r),{},{children:n})):null}function V8(e){let{className:t,children:n}=e,r=G(e,P8),{showContent:i}=(0,h.useContext)(F8);return i?(0,X.jsx)(`div`,A(A({"data-slot":`reasoning-text`,className:Q(`aui-reasoning-text relative z-0 max-h-64 overflow-y-auto ps-6 pt-2 pb-2 leading-relaxed text-pretty`,`motion-reduce:animate-none`,t)},r),{},{children:(0,X.jsx)(`div`,{className:`aui-reasoning-text-content space-y-4`,children:n})})):null}j();var H8=[`onAnimationStart`],U8=(0,h.forwardRef)(function(e,t){let{onAnimationStart:n}=e,r=G(e,H8),i=(0,h.useRef)(null),a=$P(i,200),o=(0,h.useCallback)(()=>{a(),n==null||n()},[a,n]),s=(0,h.useCallback)(e=>{if(i.current=e,typeof t==`function`){let n=t(e);if(typeof n==`function`)return()=>{i.current=null,n()}}else t&&(t.current=e)},[t]);return(0,X.jsx)(L8,A({ref:s,onAnimationStart:o},r))}),W8=()=>(0,X.jsx)(Y6,{}),G8=({children:e,startIndex:t,endIndex:n})=>{let r=Y(e=>{var r;if(((r=e.message.status)==null?void 0:r.type)!==`running`)return!1;for(let r=t;r<=n;r++){var i;if(((i=e.message.parts[r])==null?void 0:i.status.type)===`running`)return!0}return!1});return(0,X.jsxs)(U8,{streaming:r,showContent:!1,children:[(0,X.jsx)(z8,{active:r}),(0,X.jsx)(B8,{"aria-busy":r,"aria-label":`AI 思考过程`,children:(0,X.jsx)(V8,{children:e})})]})},K8=(0,h.memo)(W8);K8.displayName=`Reasoning`,K8.Root=U8,K8.Trigger=z8,K8.Content=B8,K8.Text=V8,K8.Fade=R8;var q8=(0,h.memo)(G8);q8.displayName=`ReasoningGroup`,j();var J8=[`className`];function Y8(e){let{className:t}=e,n=G(e,J8);return(0,X.jsx)(`textarea`,A({"data-slot":`textarea`,className:Q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,t)},n))}j();var X8=[`className`,`open`,`onOpenChange`,`defaultOpen`,`children`],Z8=[`className`],Q8=[`toolName`,`status`,`responseDeliveryStatus`,`className`],$8=[`className`,`children`],e5=[`argsText`,`className`],t5=[`result`,`className`],n5=[`status`,`className`],r5=[`approval`,`className`,`focusReceiptRef`,`receiptRef`],i5=[`className`,`forwardedRef`,`carryFocusRef`,`addResult`,`resume`,`interrupt`,`approval`,`respondToApproval`,`status`],a5=200,o5=`active:scale-[0.98]`;function s5(e){let{className:t,open:n,onOpenChange:r,defaultOpen:i=!1,children:a}=e,o=G(e,X8),s=(0,h.useRef)(null),[c,l]=(0,h.useState)(i),u=$P(s,a5),d=n!==void 0,f=d?n:c,p=(0,h.useCallback)(e=>{u(),d||l(e),r==null||r(e)},[u,d,r]);return(0,X.jsx)(D8,A(A({ref:s,"data-slot":`tool-fallback-root`,open:f,onOpenChange:p,className:Q(`aui-tool-fallback-root group/tool-fallback-root w-full`,t),style:{"--animation-duration":`${a5}ms`}},o),{},{children:a}))}var c5={running:PI,complete:nI,incomplete:mI,"requires-action":uI},l5=e=>{if(e<1e3)return`<1秒`;let t=e/1e3;return t<10?`${(Math.floor(t*10)/10).toFixed(1)}秒`:t<60?`${Math.floor(t)}秒`:`${Math.floor(t/60)}分 ${Math.floor(t%60)}秒`};function u5(e){let{className:t}=e,n=G(e,Z8),r=jy();return r===void 0?null:(0,X.jsx)(`span`,A(A({"data-slot":`tool-fallback-duration`,className:Q(`aui-tool-fallback-duration text-muted-foreground text-xs tabular-nums`,t)},n),{},{children:l5(r)}))}function d5(e){var t;let{toolName:n,status:r,responseDeliveryStatus:i,className:a}=e,o=G(e,Q8),s=(t=r==null?void 0:r.type)==null?`complete`:t,c=s===`running`,l=(r==null?void 0:r.type)===`incomplete`&&r.reason===`cancelled`,u=c5[s],d=i===`queued`?`回复已排队,尚未发送`:s===`running`?`正在执行工具`:s===`requires-action`?`等待工具操作`:s===`incomplete`?l?`已取消工具调用`:`工具执行失败`:`已调用工具`;return(0,X.jsxs)(O8,A(A({"data-slot":`tool-fallback-trigger`,className:Q(`aui-tool-fallback-trigger group/trigger text-muted-foreground hover:text-foreground flex w-fit max-w-full origin-left items-center gap-2 py-1.5 text-sm transition-[color,scale] active:scale-[0.98]`,a)},o),{},{children:[(0,X.jsx)(u,{"data-slot":`tool-fallback-trigger-icon`,className:Q(`aui-tool-fallback-trigger-icon size-4 shrink-0`,l&&`text-muted-foreground`,c&&`animate-spin [animation-duration:0.6s]`)}),(0,X.jsxs)(`span`,{"data-slot":`tool-fallback-trigger-label`,className:Q(`aui-tool-fallback-trigger-label-wrapper inline-block min-w-0 text-start leading-none wrap-anywhere`,l&&`text-muted-foreground line-through`,c&&`shimmer motion-reduce:animate-none`),children:[d,`:`,(0,X.jsx)(`b`,{children:n})]}),(0,X.jsx)(u5,{}),(0,X.jsx)(iI,{"data-slot":`tool-fallback-trigger-chevron`,className:Q(`aui-tool-fallback-trigger-chevron size-4 shrink-0`,`transition-transform duration-(--animation-duration) ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none`,`-rotate-90`,`group-data-open/trigger:rotate-0`,`group-data-panel-open/trigger:rotate-0`)})]}))}function f5(e){let{className:t,children:n}=e,r=G(e,$8);return(0,X.jsx)(k8,A(A({"data-slot":`tool-fallback-content`,className:Q(`aui-tool-fallback-content relative overflow-hidden text-sm outline-none`,`group/collapsible-content ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`data-closed:animate-collapsible-up`,`data-open:animate-collapsible-down`,`data-closed:fill-mode-forwards`,`data-closed:pointer-events-none`,`[--tw-duration:var(--animation-duration)]`,t)},r),{},{children:(0,X.jsx)(`div`,{className:Q(`flex flex-col gap-2 ps-6 pt-1 pb-2 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`group-data-open/collapsible-content:animate-in group-data-open/collapsible-content:fade-in-0 group-data-open/collapsible-content:blur-in-[2px] group-data-open/collapsible-content:slide-in-from-top-1`,`group-data-closed/collapsible-content:animate-out group-data-closed/collapsible-content:fade-out-0 group-data-closed/collapsible-content:blur-out-[2px] group-data-closed/collapsible-content:slide-out-to-top-1`,`group-data-closed/collapsible-content:animation-duration-(--animation-duration) group-data-open/collapsible-content:animation-duration-(--animation-duration)`),children:n})}))}function p5(e){let{argsText:t,className:n}=e,r=G(e,e5);return t?(0,X.jsx)(`div`,A(A({"data-slot":`tool-fallback-args`,className:Q(`aui-tool-fallback-args`,n)},r),{},{children:(0,X.jsx)(`pre`,{className:`aui-tool-fallback-args-value bg-muted/50 text-foreground/90 rounded-md p-2.5 text-xs break-words whitespace-pre-wrap`,children:t})})):null}var m5=(e,t)=>{if(typeof e==`string`)return e;try{if(e instanceof Error)return String(e);let n=JSON.stringify(e,null,t);if(n!==void 0)return n}catch(e){}try{return String(e)}catch(e){return`[无法序列化的数据]`}};function h5(e){let{result:t,className:n}=e,r=G(e,t5);return t===void 0?null:(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-result`,className:Q(`aui-tool-fallback-result`,n)},r),{},{children:[(0,X.jsx)(`p`,{className:`aui-tool-fallback-result-header text-muted-foreground text-xs font-medium`,children:`执行结果:`}),(0,X.jsx)(`pre`,{className:`aui-tool-fallback-result-content bg-muted/50 text-foreground/90 mt-1 rounded-md p-2.5 text-xs break-words whitespace-pre-wrap`,children:m5(t,2)})]}))}function g5(e){let{status:t,className:n}=e,r=G(e,n5);if((t==null?void 0:t.type)!==`incomplete`)return null;let i=t.error,a=i==null?null:m5(i);if(!a)return null;let o=t.reason===`cancelled`?`取消原因:`:`错误信息:`;return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-error`,className:Q(`aui-tool-fallback-error`,n)},r),{},{children:[(0,X.jsx)(`p`,{className:`aui-tool-fallback-error-header text-muted-foreground font-semibold`,children:o}),(0,X.jsx)(`p`,{className:`aui-tool-fallback-error-reason text-muted-foreground break-words whitespace-pre-line`,children:a})]}))}var _5=`Approved by user`,v5=`User denied tool execution`,y5={"allow-once":`允许一次`,"allow-always":`始终允许`,"reject-once":`拒绝一次`,"reject-always":`始终拒绝`},b5=e=>Object.hasOwn(y5,e),x5=e=>e===`allow-once`||e===`allow-always`,S5=e=>{var t,n;return(t=(n=e.label)==null?b5(e.kind)?y5[e.kind]:void 0:n)==null?e.id:t},C5=e=>(e==null?void 0:e.display)===`select`||(e==null?void 0:e.display)===`text`||(e==null?void 0:e.display)===`questions`,w5=e=>{var t;return!((t=e.options)!=null&&t.length)||e.allowFreeform===!0},T5=(e,t)=>{var n,r;return[...((n=t==null?void 0:t.optionIds)==null?[]:n).map(t=>{var n,r;return(n=(r=e.options)==null||(r=r.find(e=>e.id===t))==null?void 0:r.label)==null?t:n}),...t!=null&&(r=t.text)!=null&&r.trim()?[t.text]:[]]},E5=e=>e!=null&&(e.approved!==void 0||e.resolution!==void 0),D5=e=>{var t;if(e.resolution!==void 0)return{outcome:`closed`,label:e.resolution===`cancelled`?`已取消,未作出决定`:`已过期,未作出决定`};let n=e.optionId===void 0||(t=e.options)==null?void 0:t.find(t=>t.id===e.optionId),r=n===void 0?e.optionId===void 0?void 0:e.optionId:S5(n),i=C5(e)||n!==void 0&&!b5(n.kind),a=e.isAutomatic?`(自动处理)`:``;return e.approved?{outcome:`allowed`,label:`${i?`已回答`:`已允许`}${a}`,option:r}:{outcome:`refused`,label:`${i?`已关闭`:`已拒绝`}${a}`,option:r}},O5={allowed:nI,refused:mI,closed:fI};function k5(e){var t;let{approval:n,className:r,focusReceiptRef:i,receiptRef:a}=e,o=G(e,r5);(0,h.useLayoutEffect)(()=>{var e;let t=i.current===n.id;i.current=null,t&&((e=a.current)==null||e.focus({preventScroll:!0}))},[n.id,i,a]);let s=D5(n),c=O5[s.outcome],l=[...new Set([n.text,n.reason].filter(e=>typeof e==`string`&&e!==``))];return(0,X.jsxs)(`div`,A(A({ref:a,"data-slot":`tool-fallback-approval-receipt`,"data-outcome":s.outcome,tabIndex:-1,className:Q(`aui-tool-fallback-approval-receipt flex flex-col gap-1.5 pt-1`,r)},o),{},{children:[n.prompt?(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-prompt text-muted-foreground whitespace-pre-line`,children:n.prompt}):null,(0,X.jsxs)(`p`,{className:`aui-tool-fallback-approval-receipt-label flex items-center gap-1.5`,children:[(0,X.jsx)(c,{"aria-hidden":!0,className:`text-muted-foreground size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`font-medium`,children:s.label}),s.option===void 0?null:(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,s.option]})]}),n.answers&&((t=n.questions)==null?void 0:t.map(e=>{var t;let r=T5(e,n.answers&&Object.hasOwn(n.answers,e.id)?n.answers[e.id]:void 0);return r.length===0?null:(0,X.jsxs)(`p`,{className:`aui-tool-fallback-approval-receipt-answer whitespace-pre-line`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:(t=e.header)==null?e.prompt:t}),` `,`· `,r.join(`、`)]},e.id)})),l.map(e=>(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-receipt-note text-muted-foreground whitespace-pre-line`,children:e},e))]}))}function A5({questions:e,dismissible:t,locked:n,onSend:r,onDismiss:i}){let[a,o]=(0,h.useState)(()=>new Map),[s,c]=(0,h.useState)(()=>new Map),l=(e,t)=>o(n=>{var r;let i=(r=n.get(e.id))==null?[]:r,a=i.includes(t)?i.filter(e=>e!==t):e.multiple?[...i,t]:[t];return new Map(n).set(e.id,a)}),u=e=>{var t;let n=(t=a.get(e.id))==null?[]:t,r=s.get(e.id),i=r!=null&&r.trim()?r:void 0;return A(A({},n.length>0&&{optionIds:n}),i!==void 0&&{text:i})},d=e.length>0&&e.every(e=>{let t=u(e);return t.optionIds!==void 0||t.text!==void 0});return(0,X.jsxs)(X.Fragment,{children:[e.map(e=>{var t,r,i,o,u;let d=(t=a.get(e.id))==null?[]:t,f=(r=(i=e.options)==null?void 0:i.some(e=>e.description))!=null&&r;return(0,X.jsxs)(`div`,{role:`group`,"aria-label":e.prompt,"data-slot":`tool-fallback-approval-question`,className:`aui-tool-fallback-approval-question flex flex-col gap-2`,children:[(0,X.jsxs)(`p`,{className:`aui-tool-fallback-approval-question-prompt text-foreground whitespace-pre-line`,children:[e.header?(0,X.jsx)(`span`,{className:`text-muted-foreground me-1.5 text-xs font-medium uppercase`,children:e.header}):null,e.prompt]}),e.options&&e.options.length>0?(0,X.jsx)(`div`,{className:Q(`flex gap-2`,f?`flex-col items-stretch`:`flex-wrap items-center`),children:e.options.map(t=>{let r=d.includes(t.id);return(0,X.jsxs)(KG,{size:`sm`,variant:r?`default`:`outline`,className:Q(o5,f&&`h-auto flex-col items-start gap-0.5 py-2 text-start whitespace-normal`),"aria-pressed":r,onClick:()=>l(e,t.id),disabled:n,children:[(0,X.jsx)(`span`,{children:t.label}),t.description?(0,X.jsx)(`span`,{className:`text-xs font-normal opacity-80`,children:t.description}):null]},t.id)})}):null,w5(e)?(0,X.jsx)(Y8,{value:(o=s.get(e.id))==null?``:o,onChange:t=>c(n=>new Map(n).set(e.id,t.target.value)),disabled:n,"aria-label":e.prompt,placeholder:(u=e.options)!=null&&u.length?`或者输入其他答案`:`请输入你的答案`}):null]},e.id)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(KG,{size:`sm`,className:o5,onClick:()=>{!n&&d&&r(Object.fromEntries(e.map(e=>[e.id,u(e)])))},disabled:n||!d,children:`发送`}),t?(0,X.jsx)(KG,{size:`sm`,variant:`outline`,className:o5,onClick:i,disabled:n,children:`关闭`}):null]})]})}var j5=(e,t,n)=>(e==null?void 0:e.type)!==`requires-action`||e.reason!==`interrupt`||t!=null||n!=null,M5=(0,h.forwardRef)(function(e,t){var n;let r=(0,h.useRef)(!1);return(0,X.jsx)(N5,A({carryFocusRef:r,forwardedRef:t},e),(n=e.approval)==null?void 0:n.id)});function N5(e){var t;let{className:n,forwardedRef:r,carryFocusRef:i,addResult:a,resume:o,interrupt:s,approval:c,respondToApproval:l,status:u}=e,d=G(e,i5),[f,p]=(0,h.useState)(!1),m=Y(e=>e.thread.voice!==void 0),g=Y(e=>e.thread.capabilities.answerToolCall),_=f||m,[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(``),[S,C]=(0,h.useState)(null),w=(u==null?void 0:u.type)===`requires-action`,[T,E]=(0,h.useState)(w),[D,k]=(0,h.useState)(0),j=(0,h.useRef)(D);(0,h.useLayoutEffect)(()=>{j.current=D},[D]),w!==T&&(E(w),w&&(p(!1),y(null),x(``),C(null),k(D+1)));let M=(0,h.useRef)(null),N=(0,h.useRef)(null),P=(0,h.useRef)(null);(0,h.useLayoutEffect)(()=>{if(i.current){var e;i.current=!1,(e=M.current)==null||e.focus({preventScroll:!0})}return()=>{var e,t;let n=(e=M.current)==null?N.current:e;i.current=(t=n==null?void 0:n.contains(n.ownerDocument.activeElement))!=null&&t}},[i]),(0,h.useImperativeHandle)(r,()=>{var e;return(e=M.current)==null?N.current:e});let F=(0,h.useCallback)(e=>{let t=M.current;P.current=!e&&t!=null&&t.contains(t.ownerDocument.activeElement)?c==null?void 0:c.id:null,M.current=e},[c==null?void 0:c.id]),I=c!=null&&!E5(c)&&u!==void 0&&u.type!==`requires-action`&&!(f&&u.type===`running`);(0,h.useLayoutEffect)(()=>{I&&(P.current=null)},[I]);let L=()=>{let e=M.current;e!=null&&e.contains(e.ownerDocument.activeElement)&&e.focus({preventScroll:!0})};if(c!=null&&E5(c))return(0,X.jsx)(k5,A({approval:c,receiptRef:N,focusReceiptRef:P,className:n},d));if(I||!j5(u,c,s))return null;let R=c!=null&&c.prompt?(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-prompt text-foreground whitespace-pre-line`,children:c.prompt}):null;if(!g)return R&&(0,X.jsx)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:R}));let z=l?c==null?void 0:c.options:void 0,B=c!=null&&l!=null&&ie(c),ee=e=>{L(),p(!0),y(null),C(null),O(function*(){try{yield e()}catch(e){if(j.current!==D)return;p(!1),C(e instanceof Error?e.message:String(e))}})()},V=e=>{if(!_){if(c!=null&&c.approved===void 0&&l)ee(()=>l(A({approved:e},ne())));else if(s)ee(()=>o==null?void 0:o({approved:e}));else if((u==null?void 0:u.type)===`requires-action`&&u.reason===`interrupt`)return;else ee(()=>a==null?void 0:a(e?_5:v5))}},te=e=>{_||ee(()=>l==null?void 0:l(b5(e.kind)?A({optionId:e.id},ne()):A({optionId:e.id,approved:!0},ne())))},ne=()=>b.trim()?{text:b}:{},H=()=>{_||ee(()=>l==null?void 0:l({text:b}))},U=()=>{_||ee(()=>l==null?void 0:l({approved:!1}))},re=e=>{e.confirm?(L(),y(e.id)):te(e)},W=v==null||z==null?void 0:z.find(e=>e.id===v),ae=C5(c),oe=ae&&l!=null&&(c==null?void 0:c.dismissible)===!0?(0,X.jsx)(KG,{size:`sm`,variant:`outline`,className:o5,onClick:U,disabled:_,children:`关闭`}):null,se=S?(0,X.jsx)(`p`,{role:`alert`,className:`aui-tool-fallback-approval-error text-destructive text-xs whitespace-pre-line`,children:S}):null,ce=B?(0,X.jsxs)(`div`,{className:`aui-tool-fallback-approval-answer flex flex-col items-start gap-2`,children:[(0,X.jsx)(Y8,{value:b,onChange:e=>x(e.target.value),disabled:_,"aria-label":ae?(t=c==null?void 0:c.prompt)==null?`答案`:t:`备注`,placeholder:ae?`请输入你的答案`:`填写决策备注`}),ae&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(KG,{size:`sm`,className:o5,onClick:H,disabled:_,children:`发送`}),oe]})]}):null;if((c==null?void 0:c.display)===`questions`&&l){var le;return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-3 pt-1`,n)},d),{},{ref:F,children:[R,(0,X.jsx)(A5,{questions:(le=c.questions)==null?[]:le,dismissible:c.dismissible===!0,locked:_,onSend:e=>ee(()=>l({answers:e})),onDismiss:U}),se]}))}if(W){var ue,de;let e=typeof W.confirm==`object`?W.confirm:void 0,t=(ue=e==null?void 0:e.description)==null?W.description:ue;return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval-confirm`,tabIndex:-1,className:Q(`aui-tool-fallback-approval-confirm flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-confirm-title font-semibold`,children:(de=e==null?void 0:e.title)==null?`${S5(W)}?`:de}),t&&(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-confirm-description text-muted-foreground whitespace-pre-line`,children:t}),W.grants&&W.grants.length>0&&(0,X.jsx)(`ul`,{className:`aui-tool-fallback-approval-confirm-grants flex flex-col gap-1`,children:W.grants.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`code`,{className:`aui-tool-fallback-approval-confirm-grant bg-muted rounded px-1.5 py-0.5 text-xs`,children:e})},e))}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(KG,{size:`sm`,className:o5,onClick:()=>te(W),disabled:_,children:`确认`}),(0,X.jsx)(KG,{size:`sm`,variant:`outline`,className:o5,onClick:()=>{L(),y(null)},disabled:_,children:`返回`})]})]}))}if(z&&z.length>0){let e=z.filter(e=>x5(e.kind)),t=z.filter(e=>!b5(e.kind)),r=z.filter(e=>b5(e.kind)&&!x5(e.kind));return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[R,(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[[...e,...t,...r].map(t=>(0,X.jsx)(KG,{size:`sm`,variant:t===e[0]?`default`:`outline`,className:o5,onClick:()=>re(t),disabled:_,children:S5(t)},t.id)),r.length===0&&!ae&&(0,X.jsx)(KG,{size:`sm`,variant:`outline`,className:o5,onClick:()=>V(!1),disabled:_,children:`拒绝`}),!B&&oe]}),ce,se]}))}return ae?(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[R,ce,!B&&oe&&(0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:oe}),se]})):(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[R,(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(KG,{size:`sm`,className:o5,onClick:()=>V(!0),disabled:_,children:`允许`}),(0,X.jsx)(KG,{size:`sm`,variant:`outline`,className:o5,onClick:()=>V(!1),disabled:_,children:`拒绝`})]}),ce,se]}))}var P5=(0,h.memo)(({toolName:e,argsText:t,result:n,status:r,responseDeliveryStatus:i,addResult:a,resume:o,interrupt:s,approval:c,respondToApproval:l})=>{let u=(r==null?void 0:r.type)===`incomplete`&&r.reason===`cancelled`,d=(r==null?void 0:r.type)===`requires-action`,f=c!=null||d&&j5(r,c,s),[p,m]=(0,h.useState)(d),[g,_]=(0,h.useState)(d);d!==g&&(_(d),d&&m(!0));let v=(0,h.useRef)(!1),y=(0,h.useRef)(null),b=(0,h.useRef)(null);return(0,h.useLayoutEffect)(()=>{let e=y.current;if(!e||e.isConnected||d||!v.current)return;let t=c==null||!E5(c);v.current=!1;let{activeElement:n,body:r}=e.ownerDocument;if(t&&(n==null||n===r)){var i;(i=b.current)==null||i.focus({preventScroll:!0})}},[c,d,r==null?void 0:r.type]),(0,X.jsxs)(s5,{open:p,onOpenChange:m,children:[(0,X.jsx)(d5,{toolName:e,status:r,responseDeliveryStatus:i}),(0,X.jsxs)(f5,{children:[(0,X.jsx)(g5,{status:r}),(0,X.jsx)(p5,{argsText:t,className:Q(u&&`opacity-60`)}),f&&(0,X.jsx)(M5,{addResult:a,resume:o,interrupt:s,approval:c,respondToApproval:l,status:r,onFocusCapture:e=>{var t;let n=e.currentTarget.closest(`[data-slot="tool-fallback-root"]`);b.current=(t=n==null?void 0:n.querySelector(`[data-slot="tool-fallback-trigger"]`))==null?null:t,y.current=e.currentTarget,v.current=!0},onBlurCapture:e=>{let t=e.relatedTarget;(t?e.currentTarget.contains(t):e.currentTarget.contains(e.currentTarget.ownerDocument.activeElement))||(v.current=!1)}}),(0,X.jsx)(h5,{result:n})]})]})});P5.displayName=`ToolFallback`,P5.Root=s5,P5.Trigger=d5,P5.Content=f5,P5.Args=p5,P5.Result=h5,P5.Error=g5,P5.Approval=M5,j();var F5=[`className`,`variant`,`open`,`onOpenChange`,`defaultOpen`,`children`],I5=[`count`,`active`,`className`],L5=[`className`,`children`],R5=200,z5=UG(`aui-tool-group-root group/tool-group w-full`,{variants:{variant:{outline:`rounded-lg border py-3`,ghost:``,muted:`border-muted-foreground/30 bg-muted/30 rounded-lg border py-3`}},defaultVariants:{variant:`outline`}});function B5(e){let{className:t,variant:n,open:r,onOpenChange:i,defaultOpen:a=!1,children:o}=e,s=G(e,F5),c=(0,h.useRef)(null),[l,u]=(0,h.useState)(a),d=$P(c,R5),f=r!==void 0,p=f?r:l,m=(0,h.useCallback)(e=>{d(),f||u(e),i==null||i(e)},[d,f,i]);return(0,X.jsx)(D8,A(A({ref:c,"data-slot":`tool-group-root`,"data-variant":n==null?`outline`:n,open:p,onOpenChange:m,className:Q(z5({variant:n}),`group/tool-group-root`,t),style:{"--animation-duration":`${R5}ms`}},s),{},{children:o}))}function V5(e){let{count:t,active:n=!1,className:r}=e,i=G(e,I5),a=`${t} 次工具调用`;return(0,X.jsxs)(O8,A(A({"data-slot":`tool-group-trigger`,className:Q(`aui-tool-group-trigger group/trigger flex origin-left items-center gap-2 text-sm transition-[color,scale] active:scale-[0.98]`,`group-data-[variant=ghost]/tool-group-root:text-muted-foreground group-data-[variant=ghost]/tool-group-root:hover:text-foreground group-data-[variant=ghost]/tool-group-root:py-1.5`,`group-data-[variant=outline]/tool-group-root:w-full group-data-[variant=outline]/tool-group-root:px-4`,`group-data-[variant=muted]/tool-group-root:w-full group-data-[variant=muted]/tool-group-root:px-4`,r)},i),{},{children:[n&&(0,X.jsx)(PI,{"data-slot":`tool-group-trigger-loader`,className:`aui-tool-group-trigger-loader size-3 shrink-0 animate-spin [animation-duration:0.6s]`}),(0,X.jsx)(`span`,{"data-slot":`tool-group-trigger-label`,className:Q(`aui-tool-group-trigger-label-wrapper inline-block text-start text-xs leading-none font-medium`,`group-data-[variant=ghost]/tool-group-root:font-normal`,`group-data-[variant=outline]/tool-group-root:grow`,`group-data-[variant=muted]/tool-group-root:grow`,n&&`shimmer motion-reduce:animate-none`),children:a}),(0,X.jsx)(iI,{"data-slot":`tool-group-trigger-chevron`,className:Q(`aui-tool-group-trigger-chevron size-3 shrink-0`,`transition-transform duration-(--animation-duration) ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none`,`-rotate-90`,`group-data-open/trigger:rotate-0`,`group-data-panel-open/trigger:rotate-0`)})]}))}function H5(e){let{className:t,children:n}=e,r=G(e,L5);return(0,X.jsx)(k8,A(A({"data-slot":`tool-group-content`,className:Q(`aui-tool-group-content relative overflow-hidden text-sm outline-none`,`group/collapsible-content ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`data-closed:animate-collapsible-up`,`data-open:animate-collapsible-down`,`data-closed:fill-mode-forwards`,`data-closed:pointer-events-none`,`[--tw-duration:var(--animation-duration)]`,t)},r),{},{children:(0,X.jsx)(`div`,{className:Q(`mt-2 flex flex-col gap-2`,`group-data-[variant=ghost]/tool-group-root:mt-1 group-data-[variant=ghost]/tool-group-root:gap-1`,`group-data-[variant=outline]/tool-group-root:mt-3 group-data-[variant=outline]/tool-group-root:border-t group-data-[variant=outline]/tool-group-root:px-4 group-data-[variant=outline]/tool-group-root:pt-3`,`group-data-[variant=muted]/tool-group-root:mt-3 group-data-[variant=muted]/tool-group-root:border-t group-data-[variant=muted]/tool-group-root:px-4 group-data-[variant=muted]/tool-group-root:pt-3`,`[&>*]:animate-in [&>*]:fade-in-0 [&>*]:blur-in-[2px] [&>*]:slide-in-from-top-1 [&>*]:animation-duration-(--animation-duration) [&>*]:ease-[cubic-bezier(0.32,0.72,0,1)]`,`[&>*]:motion-reduce:animate-none`,`[&>*:nth-child(2)]:[animation-delay:40ms]`,`[&>*:nth-child(3)]:[animation-delay:80ms]`,`[&>*:nth-child(4)]:[animation-delay:120ms]`,`[&>*:nth-child(n+5)]:[animation-delay:160ms]`),children:n})}))}var U5=(0,h.memo)(({children:e,startIndex:t,endIndex:n})=>{let r=n-t+1;return(0,X.jsxs)(B5,{children:[(0,X.jsx)(V5,{count:r}),(0,X.jsx)(H5,{children:e})]})});U5.displayName=`ToolGroup`,U5.Root=B5,U5.Trigger=V5,U5.Content=H5,j();var W5=[`className`];function G5(e){let{className:t}=e,n=G(e,W5);return(0,X.jsx)(`div`,A({"data-slot":`skeleton`,className:Q(`animate-pulse rounded-md bg-muted`,t)},n))}j();var K5=[`className`],q5=({group:e,children:t})=>{let[n,r]=(0,h.useState)(!1);return(0,X.jsxs)(B5,{variant:`ghost`,open:n||e.counts.requiresAction>0,onOpenChange:r,children:[(0,X.jsx)(V5,{count:e.indices.length,active:e.status.type===`running`}),(0,X.jsx)(H5,{children:t})]})},J5=e=>!!e.thread.canResume&&e.composer.type===`thread`&&e.composer.isEmpty,Y5=e=>(e==null?void 0:e.completedAt)===void 0?void 0:Number(((e.completedAt-e.startedAt)/1e3).toFixed(1)),X5=__({reasoning:[`group-chainOfThought`,`group-reasoning`],"tool-call":[`group-chainOfThought`,`group-reasoning`],"standalone-tool-call":[]}),Z5=[`group-chainOfThought`,`group-task`],Q5=(e,t)=>{var n;let r=X5(e,t);return e.type===`tool-call`&&e.messages!==void 0&&r.length>0&&!(t!=null&&(n=t.toolUIs)!=null&&(n=n[e.toolName])!=null&&n.length)?Z5:r},$5={},e7=(0,h.createContext)($5),t7=e=>e.thread.messages.length===0&&(!e.thread.isLoading||e.threads.isLoading),n7=e=>e.thread.messages.length===0&&e.thread.isLoading&&!e.thread.isDisabled&&!e.threads.isLoading,r7=()=>(0,X.jsxs)(`div`,{"data-slot":`aui_thread-history-skeleton`,role:`status`,className:`animate-in fade-in fill-mode-both flex flex-col gap-y-6 [animation-delay:150ms] [animation-duration:200ms]`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`正在加载对话`}),(0,X.jsx)(G5,{className:`ml-auto h-9 w-2/5 rounded-xl motion-reduce:animate-none`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,X.jsx)(G5,{className:`h-4 w-11/12 motion-reduce:animate-none`}),(0,X.jsx)(G5,{className:`h-4 w-4/5 motion-reduce:animate-none`}),(0,X.jsx)(G5,{className:`h-4 w-3/5 motion-reduce:animate-none`})]}),(0,X.jsx)(G5,{className:`ml-auto h-9 w-1/3 rounded-xl motion-reduce:animate-none`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,X.jsx)(G5,{className:`h-4 w-10/12 motion-reduce:animate-none`}),(0,X.jsx)(G5,{className:`h-4 w-2/3 motion-reduce:animate-none`})]})]}),i7=({components:e=$5,autoFocus:t=!0})=>{let n=Y(t7);return(0,X.jsx)(e7.Provider,{value:e,children:(0,X.jsx)(a7,{isEmpty:n,autoFocus:t})})},a7=({isEmpty:e,autoFocus:t})=>{let{Welcome:n=h7}=(0,h.useContext)(e7);return(0,X.jsx)(CP.Root,{className:`aui-root aui-thread-root bg-background @container flex h-full flex-col`,style:{"--thread-max-width":`704px`,"--composer-bg":`color-mix(in oklab, var(--color-muted) 30%, transparent)`,"--composer-radius":`16px`,"--composer-padding":`8px`},children:(0,X.jsx)(CP.Viewport,{turnAnchor:`top`,"data-slot":`aui_thread-viewport`,className:`relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth`,children:(0,X.jsxs)(`div`,{className:Q(`mx-auto flex w-full max-w-(--thread-max-width) flex-1 flex-col px-4 pt-4`,e&&`justify-center`),children:[(0,X.jsx)(Td,{condition:t7,children:(0,X.jsx)(n,{})}),(0,X.jsx)(Td,{condition:n7,children:(0,X.jsx)(r7,{})}),(0,X.jsx)(p7,{}),(0,X.jsx)(`div`,{"data-slot":`aui_message-group`,className:`mb-14 flex flex-col gap-y-6 empty:hidden`,children:(0,X.jsx)(CP.Messages,{children:()=>(0,X.jsx)(o7,{})})}),(0,X.jsxs)(CP.ViewportFooter,{className:Q(`aui-thread-viewport-footer bg-background flex flex-col gap-2 overflow-visible pb-4 md:pb-6`,!e&&`sticky bottom-0 mt-auto rounded-t-(--composer-radius)`),children:[(0,X.jsx)(m7,{}),(0,X.jsx)(yq,{}),!e&&(0,X.jsx)(`div`,{className:`mx-auto flex w-full max-w-(--thread-max-width) justify-start`,children:(0,X.jsxs)(HP.New,{render:(0,X.jsx)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-1 rounded text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`}),children:[(0,X.jsx)(XI,{className:`size-3`}),`新建对话`]})}),(0,X.jsx)(v7,{autoFocus:t}),(0,X.jsx)(Td,{condition:e=>t7(e)&&e.composer.isEmpty,children:(0,X.jsx)(g7,{})})]})]})})})},o7=()=>{let{AssistantMessage:e=x7}=(0,h.useContext)(e7),t=Y(e=>e.message.role),n=Y(e=>e.message.composer.isEditing),r=Y(e=>e.message.metadata.modality===`voice`);return n?(0,X.jsx)(O7,{}):r?(0,X.jsx)(l7,{}):t===`user`?(0,X.jsx)(E7,{}):(0,X.jsx)(e,{})},s7=()=>Y(e=>{var t,n;let r=((t=e.thread.messages[e.message.index-1])==null?void 0:t.metadata.modality)===`voice`,i=((n=e.thread.messages[e.message.index+1])==null?void 0:n.metadata.modality)===`voice`;return r?i?`middle`:`end`:i?`start`:`single`}),c7=({text:e})=>(0,X.jsx)(`p`,{className:`aui-spoken-message-text m-0`,children:e}),l7=()=>{let e=Y(e=>e.message.role),t=s7(),n=Y(e=>{var t;return e.message.role===`assistant`&&((t=e.message.status)==null?void 0:t.type)===`running`}),r=t===`start`||t===`single`;return(0,X.jsxs)(MN.Root,{"data-slot":`aui_spoken-message-root`,"data-role":e,"data-voice-run":t,className:Q(`aui-spoken-message bg-muted/40 mx-2 px-3 py-1.5 [contain-intrinsic-size:auto_48px] [content-visibility:auto]`,t===`single`&&`rounded-xl py-2`,t===`start`&&`rounded-t-xl pt-2`,t===`middle`&&`-mt-6`,t===`end`&&`-mt-6 rounded-b-xl pb-2`),children:[r&&(0,X.jsxs)(`div`,{"data-slot":`aui_spoken-exchange-header`,className:`text-muted-foreground mb-1.5 flex items-center gap-1.5 text-xs`,children:[(0,X.jsx)(KI,{className:`size-3`,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:`语音对话`})]}),(0,X.jsxs)(`div`,{"data-slot":`aui_spoken-message-content`,className:`text-foreground flex items-start gap-2 text-sm leading-relaxed`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground mt-1 shrink-0`,"aria-hidden":!0,children:e===`user`?(0,X.jsx)(BI,{className:`size-3.5`}):(0,X.jsx)(XF,{className:`size-3.5`})}),(0,X.jsx)(`span`,{className:`sr-only`,children:e===`user`?`你说`:`助手说`}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 wrap-break-word`,children:[(0,X.jsx)(MN.Parts,{components:{Text:c7}}),n&&(0,X.jsx)(`span`,{"data-slot":`aui_spoken-message-indicator`,role:`status`,className:`text-muted-foreground ms-1 animate-pulse font-sans`,"aria-label":`助手正在说话`,children:`●`})]}),(0,X.jsx)(u7,{})]})]})},u7=()=>(0,X.jsx)(xk.Root,{hideWhenRunning:!0,autohide:`always`,className:`aui-spoken-action-bar text-muted-foreground flex shrink-0 gap-1`,children:(0,X.jsxs)(xk.Copy,{render:(0,X.jsx)(bK,{tooltip:`复制`,className:`size-6`}),children:[(0,X.jsx)(Td,{condition:e=>e.message.isCopied,children:(0,X.jsx)(nI,{className:`animate-in zoom-in-50 fade-in duration-200 ease-out`})}),(0,X.jsx)(Td,{condition:e=>!e.message.isCopied,children:(0,X.jsx)(gI,{className:`animate-in zoom-in-75 fade-in duration-150`})})]})}),d7=`a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1']):not([disabled])`,f7=e=>{for(let t=e.nextElementSibling;t;t=t.nextElementSibling){let e=t.matches(d7)?t:t.querySelector(d7);if(e instanceof HTMLElement)return e}return null},p7=()=>{let e=Xa(),t=Y(e=>e.thread.hasEarlier),n=Y(e=>e.thread.isLoadingEarlier),r=t||n,i=(0,h.useRef)(null),a=(0,h.useRef)(null),o=(0,h.useRef)(null),s=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{if(!t||n){n||(s.current=!1);return}let r=a.current;if(!r)return;let i=r.closest(`[data-slot="aui_thread-viewport"]`);if(!i)return;let o=new IntersectionObserver(t=>{let n=t[0];n!=null&&n.isIntersecting&&!s.current&&(s.current=!0,e.thread.loadEarlier().catch(e=>{console.error(`加载更早的消息失败:`,e),s.current=!1}))},{root:i,rootMargin:`120px 0px 0px 0px`,threshold:0});return o.observe(r),()=>{o.disconnect()}},[e,t,n]),(0,h.useLayoutEffect)(()=>{var e;let t=o.current,n=i.current;if(r||!t||t.isConnected||!n)return;o.current=null;let a=document.activeElement;a&&a!==document.body||(e=f7(n))==null||e.focus()},[r]),(0,X.jsxs)(`div`,{ref:i,className:`contents`,onFocus:e=>{o.current=e.target},children:[(0,X.jsx)(`div`,{ref:a,"aria-hidden":`true`,className:`h-px w-full shrink-0`}),(0,X.jsx)(`span`,{role:`status`,className:`sr-only`,children:n?`正在加载更早的消息`:``}),r&&(0,X.jsx)(CP.LoadEarlier,{render:(0,X.jsx)(KG,{variant:`ghost`,size:`sm`,"data-slot":`aui_thread-load-earlier`,className:`aui-thread-load-earlier text-muted-foreground mb-6 self-center rounded-full`}),children:(0,X.jsx)(`span`,{className:Q(n&&`shimmer motion-reduce:animate-none`),children:n?`正在加载更早的消息...`:`加载更早的消息`})})]})},m7=()=>(0,X.jsx)(CP.ScrollToBottom,{render:(0,X.jsx)(bK,{tooltip:`滚动到底部`,variant:`outline`,className:`aui-thread-scroll-to-bottom dark:border-border dark:bg-background dark:hover:bg-accent absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible`}),children:(0,X.jsx)(KF,{})}),h7=()=>(0,X.jsx)(`div`,{className:`aui-thread-welcome-root mb-6 flex flex-col px-2`,children:(0,X.jsx)(`p`,{className:`aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-2xl font-medium tracking-tight text-foreground duration-200 text-center`,children:`今天有什么可以帮你?`})}),g7=()=>(0,X.jsx)(`div`,{className:`aui-thread-welcome-suggestions flex w-full flex-col`,children:(0,X.jsx)(CP.Suggestions,{children:()=>(0,X.jsx)(_7,{})})}),_7=()=>(0,X.jsx)(`div`,{className:`aui-thread-welcome-suggestion-display fade-in slide-in-from-bottom-2 animate-in fill-mode-both duration-200`,children:(0,X.jsxs)(AP.Trigger,{send:!0,render:(0,X.jsx)(`button`,{type:`button`,className:`aui-thread-welcome-suggestion group hover:bg-foreground/[0.03] focus-visible:ring-ring/50 flex w-full items-baseline gap-2.5 rounded-md px-2 py-2 text-start text-sm transition-colors outline-none focus-visible:ring-1 motion-reduce:transition-none`}),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/60 group-hover:text-foreground font-mono text-xs transition-colors motion-reduce:transition-none`,children:`>`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,X.jsx)(AP.Title,{className:`aui-thread-welcome-suggestion-text-1 text-foreground`}),` `,(0,X.jsx)(AP.Description,{className:`aui-thread-welcome-suggestion-text-2 text-muted-foreground empty:hidden`})]})]})}),v7=({autoFocus:e})=>(0,X.jsx)(_M.Root,{className:`aui-composer-root relative flex w-full flex-col`,children:(0,X.jsxs)(_M.AttachmentDropzone,{render:(0,X.jsx)(`div`,{"data-slot":`aui_composer-shell`,className:`border-foreground/10 focus-within:border-foreground/25 data-[dragging=true]:border-ring flex w-full cursor-text flex-col gap-2 rounded-(--composer-radius) border bg-(--composer-bg) p-(--composer-padding) transition-[border-color] data-[dragging=true]:border-dashed data-[dragging=true]:bg-[color-mix(in_oklab,var(--color-accent)_50%,var(--color-background))]`}),children:[(0,X.jsx)(IK,{}),(0,X.jsx)(_M.Input,{placeholder:`请输入你的问题...`,className:`aui-composer-input text-foreground caret-primary placeholder:text-muted-foreground/60 max-h-48 min-h-10 w-full resize-none bg-transparent px-2.5 py-1 text-base leading-6 outline-none`,rows:1,autoFocus:e,enterKeyHint:`send`,"aria-label":`消息输入框`}),(0,X.jsx)(y7,{})]})}),y7=()=>{let{ComposerExtra:e}=(0,h.useContext)(e7),t=Y(e=>e.composer.submission!==void 0&&!(e.thread.isRunning&&e.thread.capabilities.cancel));return(0,X.jsxs)(`div`,{className:`aui-composer-action-wrapper relative flex items-center justify-between`,children:[e?(0,X.jsxs)(`div`,{className:`aui-composer-action-start flex items-center gap-1.5`,children:[(0,X.jsx)(LK,{}),(0,X.jsx)(e,{})]}):(0,X.jsx)(LK,{}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsxs)(Td,{condition:e=>e.thread.capabilities.dictation,children:[(0,X.jsx)(Td,{condition:e=>e.composer.dictation==null,children:(0,X.jsx)(_M.Dictate,{render:(0,X.jsx)(bK,{tooltip:`语音输入`,side:`bottom`,type:`button`,variant:`ghost`,size:`icon`,className:`aui-composer-dictate text-muted-foreground hover:text-foreground size-7 rounded-full`,"aria-label":`开始语音输入`}),children:(0,X.jsx)(BI,{className:`aui-composer-dictate-icon size-4`})})}),(0,X.jsx)(Td,{condition:e=>e.composer.dictation!=null,children:(0,X.jsx)(_M.StopDictation,{render:(0,X.jsx)(bK,{tooltip:`停止语音输入`,side:`bottom`,type:`button`,variant:`ghost`,size:`icon`,className:`aui-composer-stop-dictation text-destructive size-7 rounded-full`,"aria-label":`停止语音输入`}),children:(0,X.jsx)(nL,{className:`aui-composer-stop-dictation-icon size-3.5 animate-pulse fill-current`})})})]}),(0,X.jsx)(Td,{condition:e=>(!e.composer.canCancel||e.thread.voice!==void 0&&e.composer.submission===void 0)&&!J5(e),children:(0,X.jsx)(_M.Send,{render:(0,X.jsx)(bK,{tooltip:`发送消息`,side:`bottom`,type:`button`,variant:`default`,size:`icon`,className:`aui-composer-send size-7 rounded-full`,"aria-label":`发送消息`}),children:(0,X.jsx)(JF,{className:`aui-composer-send-icon size-4`})})}),(0,X.jsx)(Td,{condition:J5,children:(0,X.jsx)(_M.Resume,{render:(0,X.jsx)(bK,{tooltip:`继续生成`,side:`bottom`,type:`button`,variant:`default`,size:`icon`,className:`aui-composer-resume size-7 rounded-full`,"aria-label":`继续生成`}),children:(0,X.jsx)(JI,{className:`aui-composer-resume-icon size-4`})})}),(0,X.jsx)(Td,{condition:e=>e.composer.canCancel&&(e.thread.voice===void 0||e.composer.submission!==void 0),children:(0,X.jsx)(_M.Cancel,{render:(0,X.jsx)(KG,{type:`button`,variant:`default`,size:`icon`,className:`aui-composer-cancel size-7 rounded-full`,"aria-label":t?`取消发送`:`停止生成`}),children:(0,X.jsx)(nL,{className:`aui-composer-cancel-icon size-3.5 fill-current`})})})]})]})},b7=()=>(0,X.jsx)(MN.Error,{children:(0,X.jsx)(GM.Root,{className:`aui-message-error-root border-destructive bg-destructive/10 text-destructive dark:bg-destructive/5 mt-2 rounded-md border p-3 text-sm dark:text-red-200`,children:(0,X.jsx)(GM.Message,{className:`aui-message-error-message line-clamp-2`})})}),x7=()=>{let{ToolFallback:e=P5,ToolGroup:t,ReasoningGroup:n,TaskGroup:r}=(0,h.useContext)(e7),i=r?Q5:X5;return(0,X.jsxs)(MN.Root,{"data-slot":`aui_assistant-message-root`,"data-role":`assistant`,className:`fade-in slide-in-from-bottom-1 animate-in relative -mb-7.5 pb-7.5 duration-150 [contain-intrinsic-size:auto_200px] [content-visibility:auto]`,children:[(0,X.jsxs)(`div`,{"data-slot":`aui_assistant-message-content`,className:`text-foreground px-2 text-left leading-relaxed wrap-break-word`,children:[(0,X.jsx)(MN.GroupedParts,{groupBy:i,children:({part:i,children:a})=>{switch(i.type){case`group-chainOfThought`:return(0,X.jsx)(`div`,{"data-slot":`aui_chain-of-thought`,children:a});case`group-task`:return r?(0,X.jsx)(r,{group:i}):null;case`group-tool`:return t?(0,X.jsx)(t,{group:i,children:a}):(0,X.jsx)(q5,{group:i,children:a});case`group-reasoning`:{if(n)return(0,X.jsx)(n,{group:i,children:a});let e=i.status.type===`running`;return(0,X.jsxs)(U8,{streaming:e,children:[(0,X.jsx)(z8,{active:e,duration:Y5(i.timing)}),(0,X.jsx)(B8,{"aria-busy":e,children:(0,X.jsx)(V8,{children:a})})]})}case`text`:return(0,X.jsx)(Y6,{});case`reasoning`:return(0,X.jsx)(K8,A({},i));case`tool-call`:var o;return(o=i.toolUI)==null?(0,X.jsx)(e,A({},i)):o;case`data`:return i.dataRendererUI;case`file`:return(0,X.jsx)(`div`,{"data-slot":`aui_assistant-message-file`,className:`py-1`,children:(0,X.jsx)(C7,A({},i))});case`image`:return(0,X.jsx)(`div`,{"data-slot":`aui_assistant-message-image`,className:`py-1`,children:(0,X.jsx)(Kq,A({},i))});case`indicator`:return(0,X.jsx)(`span`,{"data-slot":`aui_assistant-message-indicator`,className:`animate-pulse font-sans`,"aria-label":`助手正在处理`,children:`●`});default:return null}}}),(0,X.jsx)(b7,{})]}),(0,X.jsxs)(`div`,{"data-slot":`aui_assistant-message-footer`,className:Q(`ms-2 flex items-center`,`min-h-7.5 pt-1.5`),children:[(0,X.jsx)(k7,{}),(0,X.jsx)(S7,{})]})]})},S7=()=>(0,X.jsxs)(xk.Root,{hideWhenRunning:!0,autohide:`not-last`,className:`aui-assistant-action-bar-root text-muted-foreground animate-in fade-in col-start-3 row-start-2 -ms-1 flex gap-1 duration-200`,children:[(0,X.jsxs)(xk.Copy,{render:(0,X.jsx)(bK,{tooltip:`复制`}),children:[(0,X.jsx)(Td,{condition:e=>e.message.isCopied,children:(0,X.jsx)(nI,{className:`animate-in zoom-in-50 fade-in duration-200 ease-out`})}),(0,X.jsx)(Td,{condition:e=>!e.message.isCopied,children:(0,X.jsx)(gI,{className:`animate-in zoom-in-75 fade-in duration-150`})})]}),(0,X.jsxs)(Td,{condition:e=>e.thread.capabilities.feedback,children:[(0,X.jsx)(xk.FeedbackPositive,{render:(0,X.jsx)(bK,{tooltip:`有帮助`,className:`data-[submitted=true]:bg-accent data-[submitted=true]:text-accent-foreground`}),children:(0,X.jsx)(iL,{})}),(0,X.jsx)(xk.FeedbackNegative,{render:(0,X.jsx)(bK,{tooltip:`没有帮助`,className:`data-[submitted=true]:bg-accent data-[submitted=true]:text-accent-foreground`}),children:(0,X.jsx)(oL,{})})]}),(0,X.jsx)(xk.Reload,{render:(0,X.jsx)(bK,{tooltip:`重新生成`}),children:(0,X.jsx)(QI,{})}),(0,X.jsxs)(Lk.Root,{children:[(0,X.jsx)(Lk.Trigger,{render:(0,X.jsx)(bK,{tooltip:`更多`,className:`data-[state=open]:bg-accent`}),children:(0,X.jsx)(SI,{})}),(0,X.jsx)(Lk.Content,{side:`bottom`,align:`start`,sideOffset:6,className:`aui-action-bar-more-content bg-popover text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out 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 z-50 min-w-[128px] overflow-hidden rounded-xl border p-1.5`,children:(0,X.jsxs)(xk.ExportMarkdown,{render:(0,X.jsx)(Lk.Item,{className:`aui-action-bar-more-item hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none`}),children:[(0,X.jsx)(vI,{className:`size-4`}),`导出为 Markdown`]})})]})]}),C7=e=>{let t=e.mimeType.toLowerCase().startsWith(`image/`)?aq(e.data,e.mimeType,e.sourceType):null;return t?(0,X.jsx)(Kq,A({type:`image`,image:t,status:e.status},e.filename!==void 0&&{filename:e.filename})):(0,X.jsx)(_q,A({},e))},w7=e=>(0,X.jsx)(`div`,{"data-slot":`aui_user-message-file`,className:`py-1`,children:(0,X.jsx)(C7,A({},e))}),T7=e=>(0,X.jsx)(`div`,{"data-slot":`aui_user-message-image`,className:`py-1`,children:(0,X.jsx)(Kq,A({},e))}),E7=()=>(0,X.jsxs)(MN.Root,{"data-slot":`aui_user-message-root`,className:`fade-in slide-in-from-bottom-1 animate-in grid auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 duration-150 [contain-intrinsic-size:auto_200px] [content-visibility:auto] [&:where(>*)]:col-start-2`,"data-role":`user`,children:[(0,X.jsx)(FK,{}),(0,X.jsx)(`div`,{className:`aui-user-message-content-wrapper relative col-start-2 min-w-0`,children:(0,X.jsx)(`div`,{className:`aui-user-message-content peer rounded-(--composer-radius) bg-muted px-4 py-2 text-foreground wrap-break-word empty:hidden`,children:(0,X.jsx)(MN.Parts,{components:{File:w7,Image:T7}})})}),(0,X.jsx)(`div`,{className:`col-start-2 -mt-1 flex justify-end min-h-8`,children:(0,X.jsx)(D7,{})}),(0,X.jsx)(k7,{"data-slot":`aui_user-branch-picker`,className:`col-span-full col-start-1 -me-1 justify-end`})]}),D7=()=>(0,X.jsxs)(xk.Root,{hideWhenRunning:!0,autohide:`not-last`,className:`aui-user-action-bar-root flex flex-row items-center gap-1`,children:[(0,X.jsxs)(xk.Copy,{render:(0,X.jsx)(bK,{tooltip:`复制`,className:`aui-user-action-copy size-8 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`}),children:[(0,X.jsx)(Td,{condition:e=>e.message.isCopied,children:(0,X.jsx)(nI,{className:`animate-in zoom-in-50 fade-in duration-200 ease-out`})}),(0,X.jsx)(Td,{condition:e=>!e.message.isCopied,children:(0,X.jsx)(gI,{className:`animate-in zoom-in-75 fade-in duration-150`})})]}),(0,X.jsx)(xk.Edit,{render:(0,X.jsx)(bK,{tooltip:`编辑`,className:`aui-user-action-edit size-8 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`}),children:(0,X.jsx)(WI,{className:`size-4`})})]}),O7=()=>(0,X.jsx)(MN.Root,{"data-slot":`aui_edit-composer-wrapper`,className:`flex flex-col px-2 [contain-intrinsic-size:auto_200px] [content-visibility:auto]`,children:(0,X.jsxs)(_M.Root,{className:`aui-edit-composer-root border-foreground/10 focus-within:border-foreground/25 ms-auto flex w-full max-w-[85%] cursor-text flex-col rounded-(--composer-radius) border bg-(--composer-bg) transition-[border-color]`,children:[(0,X.jsx)(_M.Input,{className:`aui-edit-composer-input text-foreground min-h-14 w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base outline-none`,autoFocus:!0}),(0,X.jsxs)(`div`,{className:`aui-edit-composer-footer mx-2.5 mb-2.5 flex items-center gap-1.5 self-end`,children:[(0,X.jsx)(_M.Cancel,{render:(0,X.jsx)(KG,{variant:`ghost`,size:`sm`,className:`h-8 px-3`}),children:`取消`}),(0,X.jsx)(_M.Send,{render:(0,X.jsx)(KG,{size:`sm`,className:`h-8 px-3`}),children:`更新`})]})]})}),k7=e=>{let{className:t}=e,n=G(e,K5);return(0,X.jsxs)(tA.Root,A(A({hideWhenSingleBranch:!0,className:Q(`aui-branch-picker-root text-muted-foreground -ms-2 me-2 inline-flex items-center text-xs`,t)},n),{},{children:[(0,X.jsx)(tA.Previous,{render:(0,X.jsx)(bK,{tooltip:`上一条回复`}),children:(0,X.jsx)(oI,{})}),(0,X.jsxs)(`span`,{className:`aui-branch-picker-state font-medium`,children:[(0,X.jsx)(tA.Number,{}),` /`,` `,(0,X.jsx)(tA.Count,{})]}),(0,X.jsx)(tA.Next,{render:(0,X.jsx)(bK,{tooltip:`下一条回复`}),children:(0,X.jsx)(cI,{})})]}))};function A7({onSelect:e}){return(0,X.jsxs)(`div`,{className:`flex h-full flex-col bg-background text-foreground`,children:[(0,X.jsx)(`div`,{className:`p-4`,children:(0,X.jsxs)(HP.New,{render:(0,X.jsx)(`button`,{type:`button`,onClick:e,className:`\r
91
+ `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,A(A({},r),{},{before:i,after:i}));return o(),a(),s}function c(e,i){return U2(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=n3.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function f3(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&p3(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function p3(e,t){let n=!1;return E1(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&_X(e)&&(t.options.setext||n))}j();function m3(){return{exit:{taskListCheckValueChecked:g3,taskListCheckValueUnchecked:g3,paragraph:_3}}}function h3(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:v3}}}function g3(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function _3(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function v3(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=n3.listItem(e,t,n,A(A({},r),s.current()));return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function y3(){return[o2(),A2(),F2(),r3(),m3()]}function b3(e){return{extensions:[s2(),j2(e),I2(),d3(e),h3()]}}var x3={tokenize:F3,partial:!0},S3={tokenize:I3,partial:!0},C3={tokenize:L3,partial:!0},w3={tokenize:R3,partial:!0},T3={tokenize:z3,partial:!0},E3={name:`wwwAutolink`,tokenize:N3,previous:B3},D3={name:`protocolAutolink`,tokenize:P3,previous:V3},O3={name:`emailAutolink`,tokenize:M3,previous:H3},k3={};function A3(){return{text:k3}}for(var j3=48;j3<123;)k3[j3]=O3,j3++,j3===58?j3=65:j3===91&&(j3=97);k3[43]=O3,k3[45]=O3,k3[46]=O3,k3[95]=O3,k3[72]=[O3,D3],k3[104]=[O3,D3],k3[87]=[O3,E3],k3[119]=[O3,E3];function M3(e,t,n){let r=this,i,a;return o;function o(t){return!U3(t)||!H3.call(r,r.previous)||W3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return U3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(T3,u,l)(t):t===45||t===95||MX(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&jX(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function N3(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!B3.call(r,r.previous)||W3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(x3,e.attempt(S3,e.attempt(C3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function P3(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&V3.call(r,r.previous)&&!W3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(jX(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||PX(t)||zX(t)||HX(t)||VX(t)?n(t):e.attempt(S3,e.attempt(C3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function F3(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function I3(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(w3,c,s)(t):t===null||zX(t)||HX(t)||t!==45&&VX(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function L3(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(w3,t,a)(o):o===null||zX(o)||HX(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function R3(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||zX(o)||HX(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||zX(e)||HX(e)?t(e):r(e)}function a(e){return jX(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):jX(t)?(e.consume(t),o):n(t)}}function z3(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return MX(e)?n(e):t(e)}}function B3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||zX(e)}function V3(e){return!jX(e)}function H3(e){return!(e===47||U3(e))}function U3(e){return e===43||e===45||e===46||e===95||MX(e)}function W3(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var G3={tokenize:$3,partial:!0};function K3(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:X3,continuation:{tokenize:Z3},exit:Q3}},text:{91:{name:`gfmFootnoteCall`,tokenize:Y3},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:q3,resolveTo:J3}}}}function q3(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=AX(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function J3(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Y3(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||zX(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(AX(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return zX(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function X3(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||zX(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=AX(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return zX(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),GX(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Z3(e,t,n){return e.check(lZ,t,e.attempt(G3,t,n))}function Q3(e){e.exit(`gfmFootnoteDefinition`)}function $3(e,t,n){let r=this;return GX(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function e6(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&CX(o,o.length,0,nZ(s,e.slice(r+1,n),t)),CX(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),CX(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=tZ(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=tZ(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var t6=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){n6(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function n6(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function r6(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function i6(){return{flow:{null:{name:`table`,tokenize:a6,resolveAll:o6}}}}function a6(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):RX(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):BX(t)?GX(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||zX(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,BX(t)?GX(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return BX(t)?GX(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||RX(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return BX(t)?GX(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||RX(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||RX(n)?(e.exit(`tableRow`),t(n)):BX(n)?GX(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||zX(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function o6(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new t6;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(c6(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=s6(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=s6(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=s6(f,t,o,i,n,d)):(o[0]=o[1],d=s6(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&c6(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=r6(t.events,n))}return e}function s6(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},l6(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=l6(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=l6(t.events,n[2]),a=l6(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},l6(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function c6(e,t,n,r,i){let a=[],o=l6(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function l6(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var u6={name:`tasklistCheck`,tokenize:f6};function d6(){return{text:{91:u6}}}function f6(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return zX(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return RX(r)?t(r):BX(r)?e.check({tokenize:p6},t,n)(r):n(r)}}function p6(e,t,n){return GX(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function m6(e){return EX([A3(),K3(),e6(e),i6(),d6()])}var h6={};function g6(e){let t=this,n=e||h6,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(m6(n)),a.push(y3()),o.push(b3(n))}var _6=({copiedDuration:e=3e3}={})=>{let[t,n]=(0,h.useState)(!1),r=(0,h.useRef)(void 0),i=(0,h.useRef)(0);return(0,h.useEffect)(()=>()=>{i.current+=1,r.current!==void 0&&(clearTimeout(r.current),r.current=void 0,n(!1))},[]),{isCopied:t,copyToClipboard:t=>{if(!t||typeof navigator>`u`||!navigator.clipboard)return;let a=i.current;navigator.clipboard.writeText(t).then(()=>{a===i.current&&(r.current!==void 0&&clearTimeout(r.current),n(!0),r.current=setTimeout(()=>{r.current=void 0,n(!1)},e))},()=>{})}}},v6=m(u(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a=a||{};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code)i.hooks.run(`complete`,c),r&&r.call(c.element);else if(i.hooks.run(`before-highlight`,c),!c.grammar)l(i.util.encode(c.code));else if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var T=1,E;if(v){if(E=o(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof a)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=o(x,0,w,_),!E)continue;var D=E.index,j=E[0],M=w.slice(0,D),N=w.slice(D+j.length),P=C+w.length;d&&P>d.reach&&(d.reach=P);var F=S.prev;M&&(F=l(t,F,M),C+=M.length),u(t,F,T);var I=new a(f,g?i.tokenize(j,g):j,y,j);if(S=l(t,F,I),N&&l(t,S,N),T>1){var L={cause:f+`,`+m,reach:P};s(e,t,n,S.prev,C,L),d&&L.reach>d.reach&&(d.reach=L.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
92
+ `),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),f=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};var y6=`mine`,b6={builtinFunctions:/strategy\.closedtrades\.max_drawdown_percent|strategy\.opentrades\.max_drawdown_percent|strategy\.risk\.max_intraday_filled_orders|strategy\.closedtrades\.max_runup_percent|array\.percentile_linear_interpolation|strategy\.closedtrades\.entry_bar_index|strategy\.opentrades\.max_runup_percent|strategy\.closedtrades\.exit_bar_index|strategy\.closedtrades\.profit_percent|strategy\.closedtrades\.entry_comment|strategy\.opentrades\.entry_bar_index|strategy\.closedtrades\.exit_comment|strategy\.closedtrades\.max_drawdown|strategy\.opentrades\.profit_percent|ta\.percentile_linear_interpolation|strategy\.closedtrades\.entry_price|strategy\.opentrades\.entry_comment|strategy\.closedtrades\.commission|strategy\.closedtrades\.entry_time|strategy\.closedtrades\.exit_price|strategy\.opentrades\.max_drawdown|strategy\.risk\.max_cons_loss_days|strategy\.closedtrades\.exit_time|strategy\.closedtrades\.max_runup|strategy\.opentrades\.entry_price|strategy\.risk\.max_intraday_loss|strategy\.risk\.max_position_size|table\.cell_set_text_font_family|strategy\.closedtrades\.entry_id|strategy\.opentrades\.commission|strategy\.opentrades\.entry_time|table\.cell_set_text_formatting|array\.binary_search_rightmost|array\.percentile_nearest_rank|strategy\.closedtrades\.exit_id|strategy\.opentrades\.direction|strategy\.opentrades\.max_runup|array\.binary_search_leftmost|strategy\.closedtrades\.profit|strategy\.opentrades\.entry_id|strategy\.risk\.allow_entry_in|strategy\.convert_to_account|box\.set_bottom_right_point|label\.set_text_font_family|strategy\.closedtrades\.size|strategy\.convert_to_symbol|strategy\.default_entry_qty|strategy\.opentrades\.profit|strategy\.risk\.max_drawdown|ta\.percentile_nearest_rank|table\.cell_set_text_halign|table\.cell_set_text_valign|label\.set_text_formatting|request\.security_lower_tf|table\.cell_set_text_color|box\.set_text_font_family|strategy\.close_all_short|strategy\.opentrades\.size|table\.cell_set_text_size|box\.set_text_formatting|matrix\.is_antisymmetric|strategy\.close_all_long|box\.set_top_left_point|chart\.point\.from_index|matrix\.is_antidiagonal|table\.cell_set_bgcolor|table\.cell_set_tooltip|table\.set_border_color|table\.set_border_width|timeframe\.from_seconds|chart\.point\.from_time|line\.set_second_point|math\.round_to_mintick|matrix\.elements_count|ta\.pivot_point_levels|table\.cell_set_height|table\.set_frame_color|table\.set_frame_width|box\.set_border_color|box\.set_border_style|box\.set_border_width|line\.set_first_point|matrix\.is_stochastic|matrix\.is_triangular|table\.cell_set_width|timeframe\.in_seconds|array\.binary_search|box\.set_rightbottom|box\.set_text_halign|box\.set_text_valign|color\.from_gradient|label\.set_textalign|label\.set_textcolor|matrix\.eigenvectors|matrix\.is_symmetric|matrix\.swap_columns|strategy\.cancel_all|table\.cell_set_text|array\.new_linefill|array\.sort_indices|box\.set_text_color|linefill\.get_line1|linefill\.get_line2|linefill\.set_color|map\.new|matrix\.eigenvalues|matrix\.is_diagonal|matrix\.is_identity|strategy\.close_all|table\.set_position|array\.lastindexof|array\.percentrank|array\.standardize|box\.set_text_size|box\.set_text_wrap|label\.set_tooltip|matrix\.remove_col|matrix\.remove_row|table\.merge_cells|table\.set_bgcolor|array\.covariance|array\.new_string|chart\.point\.copy|matrix\.is_binary|matrix\.is_square|matrix\.new|matrix\.submatrix|matrix\.swap_rows|matrix\.transpose|request\.security|timeframe\.change|array\.new|array\.new_color|array\.new_float|array\.new_label|array\.new_table|box\.set_bgcolor|box\.set_lefttop|chart\.point\.new|chart\.point\.now|input\.text_area|input\.timeframe|label\.set_color|label\.set_point|label\.set_style|line\.set_extend|linefill\.delete|polyline\.delete|str\.format_time|str\.replace_all|strategy\.cancel|alertcondition|array\.includes|array\.new_bool|array\.new_line|array\.variance|box\.get_bottom|box\.set_bottom|box\.set_extend|label\.get_text|label\.set_size|label\.set_text|label\.set_xloc|label\.set_yloc|line\.get_price|line\.set_color|line\.set_style|line\.set_width|math\.todegrees|math\.toradians|matrix\.add_col|matrix\.add_row|matrix\.columns|matrix\.is_zero|matrix\.reshape|matrix\.reverse|str\.startswith|strategy\.close|strategy\.entry|strategy\.order|syminfo\.prefix|syminfo\.ticker|ta\.correlation|ta\.highestbars|ta\.percentrank|array\.indexof|array\.new_box|array\.new_int|array\.reverse|array\.unshift|box\.get_right|box\.set_right|input\.session|line\.set_xloc|matrix\.concat|matrix\.median|max_bars_back|runtime\.error|str\.substring|strategy\.exit|ta\.crossunder|ta\.lowestbars|ta\.supertrend|array\.concat|array\.insert|array\.median|array\.remove|box\.get_left|box\.set_left|box\.set_text|box\.set_xloc|input\.source|input\.string|input\.symbol|label\.delete|label\.set_xy|line\.set_xy1|line\.set_xy2|linefill\.new|map\.contains|matrix\.trace|polyline\.new|str\.contains|str\.endswith|str\.tonumber|str\.tostring|ta\.barssince|ta\.crossover|ta\.pivothigh|ta\.valuewhen|table\.delete|array\.clear|array\.every|array\.first|array\.range|array\.shift|array\.slice|array\.stdev|box\.get_top|box\.set_top|input\.color|input\.float|input\.price|label\.get_x|label\.get_y|label\.set_x|label\.set_y|line\.delete|line\.get_x1|line\.get_x2|line\.get_y1|line\.get_y2|line\.set_x1|line\.set_x2|line\.set_y1|line\.set_y2|log\.warning|map\.put_all|math\.random|matrix\.copy|matrix\.diff|matrix\.fill|matrix\.kron|matrix\.mode|matrix\.mult|matrix\.pinv|matrix\.rank|matrix\.rows|matrix\.sort|str\.replace|ta\.pivotlow|ta\.variance|table\.clear|array\.copy|array\.fill|array\.from|array\.join|array\.last|array\.mode|array\.push|array\.size|array\.some|array\.sort|box\.delete|dayofmonth|input\.bool|input\.enum|input\.time|label\.copy|map\.remove|map\.values|math\.floor|math\.log10|math\.round|matrix\.avg|matrix\.col|matrix\.det|matrix\.get|matrix\.inv|matrix\.max|matrix\.min|matrix\.pow|matrix\.row|matrix\.set|matrix\.sum|plotcandle|str\.format|str\.length|str\.repeat|ta\.falling|ta\.highest|table\.cell|time_close|weekofyear|array\.abs|array\.avg|array\.get|array\.max|array\.min|array\.pop|array\.set|array\.sum|color\.new|color\.rgb|dayofweek|indicator|input\.int|label\.new|line\.copy|log\.error|map\.clear|math\.acos|math\.asin|math\.atan|math\.ceil|math\.sign|math\.sqrt|plotarrow|plotshape|str\.lower|str\.match|str\.split|str\.upper|ta\.change|ta\.linreg|ta\.lowest|ta\.median|ta\.rising|table\.new|timestamp|barcolor|box\.copy|line\.new|linefill|log\.info|map\.copy|map\.keys|map\.size|math\.abs|math\.avg|math\.cos|math\.exp|math\.log|math\.max|math\.min|math\.pow|math\.sin|math\.sum|math\.tan|plotchar|str\.trim|strategy|ta\.cross|ta\.range|ta\.stdev|ta\.stoch|bgcolor|box\.new|color\.b|color\.g|color\.r|color\.t|library|map\.get|map\.put|plotbar|str\.pos|ta\.alma|ta\.macd|ta\.mode|ta\.swma|ta\.vwap|ta\.vwma|fixnan|minute|second|string|ta\.atr|ta\.bbw|ta\.cci|ta\.cmo|ta\.cog|ta\.cum|ta\.dev|ta\.dmi|ta\.ema|ta\.hma|ta\.kcw|ta\.max|ta\.mfi|ta\.min|ta\.mom|ta\.rci|ta\.rma|ta\.roc|ta\.rsi|ta\.sar|ta\.sma|ta\.tsi|ta\.wma|ta\.wpr|alert|color|float|hline|input|label|month|ta\.bb|ta\.kc|ta\.tr|table|bool|fill|hour|line|plot|time|year|box|int|na|nz/,keywords:/continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|enum|type|and|for|not|var|as|by|if|in|or|to/,tokenizer:{root:[[/\/\/\s*(?=@)/,`comment`,`@comments`],[/\/\/.*(?!@).*/,`comment`],[/\'([^\'\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/\"/,{token:`string`,bracket:`@open`,next:`@stringDouble`}],[/(type|enum)\s+[a-zA-Z]\w*/,`entity.name.type`],[/'/,{token:`string`,bracket:`@open`,next:`@stringSingle`}],[/(@builtinFunctions)(?=\s*\(|\s*<.*>)/,{token:`support.function`,next:`@template`}],[/@punctuation/,{token:`punctuation.operator`,next:`@property`}],[/(varip|var)\b(\s+)((?!(?:chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map|continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)[\w.\d_$]+)(\[\]|)(\s+)((?!(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)[\w\d_$]+)/,[{token:`keyword`},{token:`source`},{token:`entity.name.type`},{token:`paren`},{token:`source`},{token:`variable.other`}]],[/\b(?:@builtinTypes)(?=(\s*)[\[|<|(]|(?=\s+(?=[^.=][\w\(]*))|\s*$)/,{token:`support.type`,next:`@template`}],[/^(\s*)\b(?!(?:chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map|continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)([\w.\d_$]+)(\[\]|)(\s+)((?!(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b)[\w\d_$]+)(\s+)(\=)/,[{token:`source`},{token:`entity.name.type`},{token:`paren`},{token:`source`},{token:`variable.other`},{token:`source`},{token:`keyword.equals`}]],[/(\((?:\s+))?((?!(?:chart\.point|linefill|polyline|continue|for\.\.\.in|matrix|series|simple|string|export|import|method|switch|array|color|const|float|label|table|break|varip|while|bool|line|else|type|enum|box|int|map|and|for|not|var|as|by|if|in|or|to)\b)\b[\w.\d_$]+(?=[\[\]]*(?:\s+)(?:[\w\d_$]+\s*(?:\,|\))+\s*).+(?:\=\>|\→)))/,`entity.name.type`],[/import(?=\s+@importName)/,{token:`keyword`,next:`@import`}],[/import(?=\s+[a-zA-Z\d\$_\-\.\u00a1-\uffff\/]+)/,`keyword`],[/[+-]?\d+\.\d*([eE][\-+]?\d+)?(?!\w+)/,`constant.numeric.float`],[/[+-]?\.\d+([eE][\-+]?\d+)?(?!\w+)/,`constant.numeric.float`],[/([+-]?(\d+))(?!\w+)(?!\w+)/,`constant.numeric.integer`],[/(?:true|false)\b/,`constant.other.boolean`],[/#[0-9a-fA-F]{6,8}\b/,`constant.other.color`],[/\+=|\-=|\*=|\/=|%=|[\/%*+\-]|==|!=|<=|>=|=>|<|>|\?|\:=|\:|\,/,`keyword.operator`],[/\b(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|enum|and|for|not|var|as|by|if|in|or|to)\b/,`keyword`],[/^[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/,`entity.name.function`],[/[0-9]+\b/,`constant.numeric.integer`],[/=/,`keyword.equals`],[/\b(?:@builtinVariables)\b(?!\s*=\s*\w+)/,`support.variable`],[/[(|)|\[|\]]/,`paren`],[/[a-zA-Z_][a-zA-Z_0-9]*(?=\s*\()/,{token:`entity.name.method`}],[/\w+\b/,`variable.other`]],comments:[[/@[A-Za-z]+(\s*=\s*)?$/,{token:`comment.annotation`,next:`@pop`}],[/@[A-Za-z]+(\s*=\s*)?/,{token:`comment.annotation`}],[/(?!\s*@[A-Za-z]+).+$/,{token:`comment`,next:`@pop`}]],stringDouble:[[/[^\\\"]+/,`string`],[/\\./,`string.invalid`],[/\"/,{token:`string.quote`,bracket:`@close`,next:`@pop`}]],stringSingle:[[/[^\\']+/,`string`],[/\\./,`string.invalid`],[/'/,{token:`string`,bracket:`@close`,next:`@pop`}]],template:[[/(@builtinTypes)/,{token:`support.type`}],[/(\((?:\s+))?((?!(?:chart\.point|linefill|polyline|continue|for\.\.\.in|matrix|series|simple|string|export|import|method|switch|array|color|const|float|label|table|break|varip|while|bool|line|else|type|enum|box|int|map|and|for|not|var|as|by|if|in|or|to)\b)\b[\w.\d_$]+(?=[\[\]]*(?:\s+)(?:[\w\d_$]+\s*(?:\,|\))+\s*).+(?:\=\>|\→)))/,`entity.name.type`],[/\(|\)|\[|\]|\=|\>/,{token:`paren`,next:`@pop`}],[/(\,)(\s+)/,[`keyword.operator`,`source`]],[/(\,)/,{token:`keyword.operator`}],[/([\w.\d$]+)/,{token:`entity.name.type`}],[/(<|>)/,{token:`paren`}],[/\s(?=\w)|$/,{token:`source`,next:`@pop`}]],property:[[/@punctuation/,{token:`punctuation.operator`}],[/(@builtinTypes)(?=\s*[(])/,{token:`support.method`,next:`@pop`}],[/[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/,{token:`entity.name.method`,next:`@pop`}],[/[a-zA-Z0-9_]+/,{token:`variable.other.property`,next:`@pop`}],[/@empty/,{token:`source`,next:`@pop`}]],import:[[/\s+/,{token:`source`}],[/(@importName)(\s+)(as\b)(\s+)(@importAlias)/,[{token:`entity.name.module`},{token:`source`},{token:`keyword`},{token:`source`},{token:`entity.name.module.name`,next:`@pop`}]],[/@importName/,{token:`entity.name.module`,next:`@pop`}]]},builtinVariables:/strategy\.commission\.cash_per_contract|syminfo\.recommendations_sell_strong|strategy\.commission\.cash_per_order|strategy\.avg_winning_trade_percent|syminfo\.recommendations_buy_strong|strategy\.avg_losing_trade_percent|strategy\.closedtrades\.first_index|strategy\.margin_liquidation_price|strategy\.max_contracts_held_short|strategy\.max_contracts_held_long|strategy\.opentrades\.capital_held|syminfo\.shares_outstanding_float|syminfo\.shares_outstanding_total|barstate\.islastconfirmedhistory|earnings\.future_period_end_time|strategy\.max_contracts_held_all|syminfo\.target_price_estimates|alert\.freq_once_per_bar_close|label\.style_label_lower_right|label\.style_label_upper_right|strategy\.max_drawdown_percent|syminfo\.recommendations_total|label\.style_label_lower_left|label\.style_label_upper_left|chart\.right_visible_bar_time|strategy\.grossprofit_percent|strategy\.position_entry_name|strategy\.position_size_short|strategy\.position_size_total|strategy\.price_highest_short|syminfo\.recommendations_date|syminfo\.recommendations_hold|syminfo\.recommendations_sell|syminfo\.target_price_average|plot\.style_stepline_diamond|strategy\.commission\.percent|chart\.left_visible_bar_time|strategy\.openprofit_percent|strategy\.position_avg_price|strategy\.position_size_long|strategy\.price_highest_long|strategy\.price_lowest_short|syminfo\.recommendations_buy|syminfo\.target_price_median|strategy\.percent_of_equity|session\.isfirstbar_regular|strategy\.avg_trade_percent|strategy\.avg_winning_trade|strategy\.grossloss_percent|strategy\.max_runup_percent|strategy\.netprofit_percent|strategy\.price_first_short|strategy\.price_lowest_long|dividends\.future_pay_date|session\.islastbar_regular|strategy\.account_currency|strategy\.avg_losing_trade|strategy\.openprofit_short|strategy\.opentrades_short|strategy\.price_first_long|strategy\.price_last_short|syminfo\.target_price_date|syminfo\.target_price_high|label\.style_label_center|label\.style_text_outline|label\.style_triangledown|strategy\.direction\.short|dividends\.future_ex_date|strategy\.avg_price_short|strategy\.initial_capital|strategy\.openprofit_long|strategy\.opentrades_long|strategy\.price_last_long|syminfo\.current_contract|syminfo\.target_price_low|alert\.freq_once_per_bar|label\.style_label_right|strategy\.direction\.long|dividends\.future_amount|earnings\.future_revenue|strategy\.avg_price_long|syminfo\.expiration_date|barmerge\.lookahead_off|label\.style_label_down|label\.style_label_left|label\.style_triangleup|line\.style_arrow_right|position\.bottom_center|position\.middle_center|strategy\.direction\.all|strategy\.position_size|barmerge\.lookahead_on|earnings\.standardized|font\.family_monospace|label\.style_arrowdown|line\.style_arrow_both|line\.style_arrow_left|plot\.style_steplinebr|position\.bottom_right|position\.middle_right|strategy\.closedtrades|strategy\.max_drawdown|syminfo\.main_tickerid|timeframe\.main_period|label\.style_label_up|plot\.style_histogram|position\.bottom_left|position\.middle_left|barstate\.isconfirmed|earnings\.future_time|session\.ispostmarket|strategy\.grossprofit|syminfo\.basecurrency|syminfo\.shareholders|timeframe\.isintraday|timeframe\.multiplier|dayofweek\.wednesday|display\.data_window|display\.price_scale|display\.status_line|font\.family_default|label\.style_arrowup|label\.style_diamond|plot\.style_stepline|position\.top_center|strategy\.oca\.cancel|strategy\.oca\.reduce|barstate\.isrealtime|chart\.is_heikinashi|earnings\.future_eps|session\.ispremarket|strategy\.eventrades|strategy\.losstrades|strategy\.openprofit|strategy\.opentrades|syminfo\.description|syminfo\.mincontract|timeframe\.isminutes|timeframe\.ismonthly|timeframe\.isseconds|dayofweek\.saturday|dayofweek\.thursday|hline\.style_dashed|hline\.style_dotted|label\.style_circle|label\.style_square|label\.style_xcross|plot\.style_circles|plot\.style_columns|position\.top_right|shape\.triangledown|splits\.denominator|text\.format_italic|barstate\.ishistory|chart\.is_linebreak|session\.isfirstbar|strategy\.avg_trade|strategy\.grossloss|strategy\.max_runup|strategy\.netprofit|strategy\.wintrades|syminfo\.pointvalue|syminfo\.pricescale|syminfo\.volumetype|timeframe\.isweekly|barmerge\.gaps_off|dayofweek\.tuesday|earnings\.estimate|hline\.style_solid|label\.style_cross|line\.style_dashed|line\.style_dotted|location\.abovebar|location\.absolute|location\.belowbar|plot\.style_areabr|plot\.style_linebr|position\.top_left|strategy\.oca\.none|text\.align_bottom|text\.align_center|chart\.is_standard|session\.islastbar|syminfo\.employees|timeframe\.isdaily|barmerge\.gaps_on|dayofweek\.friday|dayofweek\.monday|dayofweek\.sunday|label\.style_flag|label\.style_none|line\.style_solid|order\.descending|plot\.style_cross|session\.extended|shape\.triangleup|splits\.numerator|text\.align_right|text\.format_bold|text\.format_none|barstate\.isfirst|session\.ismarket|syminfo\.currency|syminfo\.industry|syminfo\.tickerid|syminfo\.timezone|timeframe\.period|dividends\.gross|earnings\.actual|location\.bottom|order\.ascending|plot\.style_area|plot\.style_line|session\.regular|shape\.arrowdown|shape\.labeldown|text\.align_left|barstate\.islast|strategy\.equity|syminfo\.country|syminfo\.minmove|syminfo\.mintick|syminfo\.session|time_tradingday|timeframe\.isdwm|alert\.freq_all|format\.inherit|format\.mintick|format\.percent|strategy\.fixed|strategy\.short|text\.align_top|text\.wrap_auto|text\.wrap_none|xloc\.bar_index|barstate\.isnew|chart\.bg_color|chart\.fg_color|chart\.is_range|chart\.is_renko|last_bar_index|syminfo\.prefix|syminfo\.sector|syminfo\.ticker|color\.fuchsia|currency\.NONE|currency\.USDT|dividends\.net|format\.volume|shape\.arrowup|shape\.diamond|shape\.labelup|strategy\.cash|strategy\.long|xloc\.bar_time|yloc\.abovebar|yloc\.belowbar|chart\.is_kagi|last_bar_time|color\.maroon|color\.orange|color\.purple|color\.silver|color\.yellow|currency\.AUD|currency\.BTC|currency\.CAD|currency\.CHF|currency\.EGP|currency\.ETH|currency\.EUR|currency\.GBP|currency\.HKD|currency\.INR|currency\.JPY|currency\.KRW|currency\.MYR|currency\.NOK|currency\.NZD|currency\.PKR|currency\.PLN|currency\.RUB|currency\.SEK|currency\.SGD|currency\.TRY|currency\.USD|currency\.ZAR|display\.none|display\.pane|extend\.right|format\.price|location\.top|shape\.circle|shape\.square|shape\.xcross|chart\.is_pnf|linefill\.all|polyline\.all|syminfo\.root|syminfo\.type|color\.black|color\.green|color\.olive|color\.white|display\.all|extend\.both|extend\.left|extend\.none|scale\.right|shape\.cross|size\.normal|color\.aqua|color\.blue|color\.gray|color\.lime|color\.navy|color\.teal|scale\.left|scale\.none|shape\.flag|size\.large|size\.small|yloc\.price|dayofmonth|ta\.accdist|time_close|weekofyear|color\.red|math\.rphi|size\.auto|size\.huge|size\.tiny|bar_index|dayofweek|label\.all|table\.all|math\.phi|line\.all|math\.pi|box\.all|ta\.vwap|ta\.wvad|timenow|math\.e|minute|second|ta\.iii|ta\.nvi|ta\.obv|ta\.pvi|ta\.pvt|ta\.wad|volume|false|close|hlcc4|month|ohlc4|ta\.tr|true|high|hlc3|hour|open|time|year|ask|bid|hl2|low|na/,builtinTypes:/chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map/,punctuation:/[.](?![.])/,importName:/[a-zA-Z\d\$_\-\.\u00a1-\uffff\/]+/,importAlias:/[a-zA-Z\d\_\u00a1\uffff\/]+/,empty:/^$/},x6=e=>b6[e].source,S6=x6(`builtinFunctions`),C6=x6(`builtinVariables`),w6=x6(`builtinTypes`),T6=x6(`keywords`),E6=x6(`punctuation`),D6={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0,inside:{"comment-annotation":/@[a-zA-Z]+(?:\s*=\s*)?/}},string:{pattern:/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/,greedy:!0},"color-hex":/#[0-9a-fA-F]{6,8}\b/,"builtin-function":{pattern:RegExp(`\\b(?:${S6})(?=\\s*(?:\\(|<))`),greedy:!0},"builtin-variable":{pattern:RegExp(`\\b(?:${C6})\\b`),greedy:!0},"builtin-type":{pattern:RegExp(`\\b(?:${w6})\\b(?!\\s*=)`),greedy:!0},boolean:/\b(?:true|false)\b/,keyword:RegExp(`\\b(?:${T6})\\b`),number:{pattern:/[+-]?(?:\d+\.\d*|\.\d+|\d+)(?:[eE][+-]?\d+)?/,greedy:!0},"function-definition":{pattern:RegExp(`(?<!\\.)\\b[a-zA-Z_]\\w*(?=\\s*\\()`,``),alias:`function`},"method-call":{pattern:/(\.)[a-zA-Z_]\w*(?=\s*\()/,lookbehind:!0,alias:`method`},property:{pattern:/(\.)[a-zA-Z_]\w*/,lookbehind:!0},variable:/\b[a-zA-Z_]\w*\b/,operator:/\+=|-=|\*=|\/=|%=|==|!=|<=|>=|=>|:=|[+\-*/%<>=?:,]/,punctuation:new RegExp(E6),bracket:/[()[\]{}]/};v6.default.languages.mine=D6,j();var O6=[`className`,`children`],k6=[`className`],A6=[`className`],j6=[`className`],M6=[`className`],N6=[`className`],P6=[`className`],F6=[`className`],I6=[`className`],L6=[`className`],R6=[`className`],z6=[`className`],B6=[`className`],V6=[`className`],H6=[`className`,`align`],U6=[`className`,`align`],W6=[`className`],G6=[`className`],K6=[`className`],q6=[`className`],J6=[`className`],Y6=e=>{let t=(0,h.useRef)(e);if(e!==t.current){let n=t.current;e!==void 0&&n!==void 0&&Object.keys(n).length===Object.keys(e).length&&Object.keys(e).every(t=>n[t]===e[t])||(t.current=e)}return t.current},X6=e=>{let{className:t,children:n}=e,r=G(e,O6),i=nJ(),a=/\blanguage-mine\b/.test(t==null?``:t)||!t,o=String(n==null?``:n).replace(/\n$/,``),s=(0,h.useMemo)(()=>!i||!a?null:v6.default.highlight(o,D6,y6),[o,i,a]),c=Q(`font-mono`,i?`tcc-code text-inherit`:Q(`aui-md-inline-code`,`rounded-md border border-border/60`,`bg-muted px-1.5 py-0.5`,`text-[0.85em] text-foreground`),t);return!i||!a||s===null?(0,X.jsx)(`code`,A(A({className:c},r),{},{children:n})):(0,X.jsx)(`code`,A(A({className:c},r),{},{dangerouslySetInnerHTML:{__html:s}}))},Z6=(0,h.memo)(({components:e,componentsByLanguage:t})=>{let n=Y6(e),r=Y6(t),i=(0,h.useMemo)(()=>n?A(A({},Q6),$q(n)):Q6,[n]);return(0,X.jsx)(Z0,{remarkPlugins:[g6],className:Q(`aui-md`,`min-w-0 break-words`,`text-[15px] leading-[1.75] text-foreground`,`[&_img]:max-w-full`,`[&_svg]:max-w-full`),components:i,componentsByLanguage:r,defer:!0})}),Q6=$q({h1:e=>{let{className:t}=e,n=G(e,k6);return(0,X.jsx)(`h1`,A({className:Q(`aui-md-h1`,`mt-7 mb-3 scroll-m-20`,`text-2xl font-semibold tracking-tight`,`leading-tight text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h2:e=>{let{className:t}=e,n=G(e,A6);return(0,X.jsx)(`h2`,A({className:Q(`aui-md-h2`,`mt-6 mb-3 scroll-m-20`,`text-xl font-semibold tracking-tight`,`leading-snug text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h3:e=>{let{className:t}=e,n=G(e,j6);return(0,X.jsx)(`h3`,A({className:Q(`aui-md-h3`,`mt-5 mb-2 scroll-m-20`,`text-lg font-semibold`,`leading-snug text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h4:e=>{let{className:t}=e,n=G(e,M6);return(0,X.jsx)(`h4`,A({className:Q(`aui-md-h4`,`mt-4 mb-2 scroll-m-20`,`text-base font-semibold text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h5:e=>{let{className:t}=e,n=G(e,N6);return(0,X.jsx)(`h5`,A({className:Q(`aui-md-h5`,`mt-3 mb-1`,`text-sm font-semibold text-foreground`,`first:mt-0 last:mb-0`,t)},n))},h6:e=>{let{className:t}=e,n=G(e,P6);return(0,X.jsx)(`h6`,A({className:Q(`aui-md-h6`,`mt-3 mb-1`,`text-sm font-medium text-muted-foreground`,`first:mt-0 last:mb-0`,t)},n))},p:e=>{let{className:t}=e,n=G(e,F6);return(0,X.jsx)(`p`,A({className:Q(`aui-md-p`,`my-3`,`text-[15px] leading-[1.75] text-foreground`,`first:mt-0 last:mb-0`,t)},n))},a:e=>{let{className:t}=e,n=G(e,I6);return(0,X.jsx)(`a`,A({className:Q(`aui-md-a`,`text-primary underline decoration-primary/40`,`underline-offset-4 transition-colors`,`hover:decoration-primary`,t)},n))},blockquote:e=>{let{className:t}=e,n=G(e,L6);return(0,X.jsx)(`blockquote`,A({className:Q(`aui-md-blockquote`,`my-4 border-s-2 border-border ps-4`,`text-muted-foreground`,`[&>p]:my-1`,t)},n))},ul:e=>{let{className:t}=e,n=G(e,R6);return(0,X.jsx)(`ul`,A({className:Q(`aui-md-ul`,`my-3 ms-6 list-disc`,`space-y-1`,`marker:text-muted-foreground`,`[&_ul]:my-1`,t)},n))},ol:e=>{let{className:t}=e,n=G(e,z6);return(0,X.jsx)(`ol`,A({className:Q(`aui-md-ol`,`my-3 ms-6 list-decimal`,`space-y-1`,`marker:text-muted-foreground`,`[&_ol]:my-1`,t)},n))},hr:e=>{let{className:t}=e,n=G(e,B6);return(0,X.jsx)(`hr`,A({className:Q(`aui-md-hr`,`my-6 border-0 border-t border-border`,t)},n))},table:e=>{let{className:t}=e,n=G(e,V6);return(0,X.jsx)(`div`,{className:`aui-md-table-wrapper my-4 w-full overflow-x-auto rounded-lg border border-zinc-200 bg-white dark:border-zinc-700 dark:bg-zinc-900`,children:(0,X.jsx)(`table`,A({className:Q(`aui-md-table w-full border-collapse text-sm`,`text-zinc-800 dark:text-zinc-200`,t)},n))})},th:e=>{let{className:t,align:n}=e,r=G(e,H6);return(0,X.jsx)(`th`,A({align:n,className:Q(`aui-md-th border-b border-zinc-200`,`bg-zinc-100 px-3 py-2.5`,`text-left font-semibold text-zinc-900`,`dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100`,n===`center`&&`text-center`,n===`right`&&`text-right`,t)},r))},td:e=>{let{className:t,align:n}=e,r=G(e,U6);return(0,X.jsx)(`td`,A({align:n,className:Q(`aui-md-td border-b border-zinc-200`,`px-3 py-2.5`,`text-zinc-800 dark:border-zinc-700 dark:text-zinc-200`,n===`center`&&`text-center`,n===`right`&&`text-right`,t)},r))},tr:e=>{let{className:t}=e,n=G(e,W6);return(0,X.jsx)(`tr`,A({className:Q(`aui-md-tr transition-colors`,`hover:bg-zinc-50 dark:hover:bg-zinc-800/70`,`last:[&>td]:border-b-0`,t)},n))},li:e=>{let{className:t}=e,n=G(e,G6);return(0,X.jsx)(`li`,A({className:Q(`aui-md-li`,`ps-0 leading-[1.75] text-foreground`,`[&>p]:my-1`,t)},n))},strong:e=>{let{className:t}=e,n=G(e,K6);return(0,X.jsx)(`strong`,A({className:Q(`aui-md-strong`,`font-semibold text-foreground`,t)},n))},sup:e=>{let{className:t}=e,n=G(e,q6);return(0,X.jsx)(`sup`,A({className:Q(`aui-md-sup`,`text-muted-foreground`,`[&>a]:text-xs [&>a]:no-underline`,t)},n))},pre:e=>{let{className:t}=e,n=G(e,J6);return(0,X.jsx)(`pre`,A({className:Q(`aui-md-pre`,`my-0 overflow-x-auto`,`rounded-b-xl border border-border`,`bg-[#f4f4f4] px-4 py-4`,`font-mono text-[13px] leading-6`,`text-[#242424]`,`dark:bg-[#2f2f2f] dark:text-[#ededed]`,`[&>code]:bg-transparent`,`[&>code]:p-0`,`[&>code]:text-inherit`,`[&>code]:border-0`,t)},n))},code:X6,CodeHeader:({language:e,code:t})=>{let{isCopied:n,copyToClipboard:r}=_6();return(0,X.jsxs)(`div`,{className:Q(`aui-code-header-root`,`mt-4 flex items-center justify-between`,`rounded-t-xl border border-b-0 border-border`,`bg-[#f4f4f4] px-4 py-2`,`dark:bg-[#2f2f2f]`,`text-xs`),children:[(0,X.jsx)(`span`,{className:`aui-code-header-language font-medium text-muted-foreground`,children:e||`code`}),(0,X.jsx)(SK,{tooltip:n?`已复制`:`复制代码`,onClick:()=>{t&&!n&&r(t)},className:Q(`size-7 rounded-md`,`text-muted-foreground`,`hover:bg-black/5 hover:text-foreground`,`dark:hover:bg-white/10`),children:n?(0,X.jsx)(iI,{className:`size-4`}):(0,X.jsx)(vI,{className:`size-4`})})]})}});function $6({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=h.useRef(e!==void 0),[a,o]=h.useState(()=>t),s=i&&e!==void 0?e:a;if(process.env.NODE_ENV!==`production`){h.useEffect(()=>{i!==(e!==void 0)&&GW([`A component is changing the ${i?``:`un`}controlled ${r} state of ${n} to be ${i?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
93
+ `))},[r,n,e]);let{current:a}=h.useRef(t);h.useEffect(()=>{!i&&e8(a)!==e8(t)&&GW([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
94
+ `))},[t])}return[s,h.useCallback(e=>{i||o(e)},[])]}function e8(e){let t=0,n=new WeakMap;try{let r=JSON.stringify(e,function(e,r){if(!(e===`_owner`&&this!=null&&typeof this==`object`&&`$$typeof`in this)){if(typeof r==`bigint`)return`__bigint__:${r}`;if(typeof r==`object`&&r){let e=n.get(r);if(e!==void 0)return`__object__:${e}`;n.set(r,t),t+=1}return r}});return r==null?`__top__:${typeof e}`:r}catch(e){return`__unserializable__`}}function t8(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=$6({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=AV(a,!0,!0),u=XH(),[d,f]=h.useState(),p=d===null?void 0:d==null?u:d,m=mz(e=>{let t=!a,n=BR(HR,e.nativeEvent);r(t,n),n.isCanceled||o(t)});return h.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var n8=h.createContext(void 0);process.env.NODE_ENV!==`production`&&(n8.displayName=`CollapsibleRootContext`);function r8(){let e=h.useContext(n8);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?kL(15):`Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.`);return e}var i8=`data-open`,a8=`data-closed`,o8=uR,s8=`data-panel-open`,c8={[i8]:``},l8={[a8]:``},u8={open(e){return e?{[s8]:``}:null}},d8={open(e){return e?c8:l8}};j();var f8=A(A({},d8),mR);j();var p8=[`render`,`className`,`defaultOpen`,`disabled`,`onOpenChange`,`open`,`style`],m8=h.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c}=e,l=G(e,p8),u=mz(o),d=t8({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=h.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=h.useMemo(()=>A(A({},d),{},{onOpenChange:u,state:f}),[d,u,f]),m=VB(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:f8});return(0,X.jsx)(n8.Provider,{value:p,children:m})});process.env.NODE_ENV!==`production`&&(m8.displayName=`CollapsibleRoot`),j();var h8=[`className`,`disabled`,`render`,`nativeButton`,`style`],g8=A(A({},u8),mR),_8=h.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=r8(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d}=e,f=G(e,h8),{getButtonProps:p,buttonRef:m}=ZW({disabled:c,native:u});return VB(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:g8})});process.env.NODE_ENV!==`production`&&(_8.displayName=`CollapsibleTrigger`),j();var v8={height:void 0,width:void 0};function y8(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=h.useRef(null),f=h.useRef(null),[p,m]=h.useState(v8),g=h.useRef(v8),_=h.useRef(!1),v=h.useRef(s),y=h.useRef(!1),[b,x]=h.useState(!1),S=h.useRef(null),C=rz(t,d),w=lz(s),T=PV(d),E=!s&&!a,D=b?`idle`:u,O=s&&(v.current||y.current),k=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?g.current:p,j=n&&E&&f.current!==`css-animation`,M=mz((e,t=!0)=>{t&&(g.current=e),m(e)}),N=mz(()=>{var e;(e=S.current)==null||e.call(S),S.current=null}),P=mz(e=>{N(),S.current=()=>{S.current=null,e()}}),F=mz(()=>{s&&a&&f.current===`css-animation`&&(y.current=!0)});DL(()=>{b&&u!==`starting`&&x(!1)},[b,u]),h.useEffect(()=>()=>{F(),N()},[F,N]),DL(()=>{s||(v.current=!1,y.current=!1);let e=d.current;if(!e)return;!s&&S.current&&N();let t=x8(e,O);if(f.current=t,s&&u===`idle`&&v.current&&t===`css-animation`){g.current=b8(e);return}if(s&&u===`starting`){let n=_.current;if(_.current=!1,t===`none`){M(b8(e)),x(!0);return}if(t===`css-transition`){let t=w8(e);if(M(b8(e)),!n)return t;let r=C8(e,`transition-duration`,`0s`);return P(r),x(!0),t}M(b8(e));let r=C8(e,`animation-name`,`none`);if(!n){r();return}let i=C8(e,`animation-duration`,`0s`);r(),P(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){M(v8,!1),c(!1);return}M(b8(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=b8(e);n.height>0||n.width>0?(M(n),t===`css-animation`&&C8(e,`animation-name`,`none`)()):c(!1)},[a,s,N,M,c,P,O,u]),FV({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&M(v8,!1)}}),h.useEffect(()=>{if(s||!a||D!==`ending`)return;if(!d.current){c(!1),M(v8,!1);return}let e=new AbortController,t=-1;function n(){w.current||(c(!1),M(v8,!1))}return t=bz.request(()=>{T(n,e.signal)}),()=>{bz.cancel(t),e.abort()}},[w,a,s,D,T,M,c]),DL(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),h.useEffect(function(){let e=d.current;if(!e)return;let t=PL.create(),n=-1,r=(r,i)=>{t.start(0,()=>{w.current||(n=bz.request(()=>{w.current||(r&&(_.current=!1),i&&e.setAttribute(o8,``),e.setAttribute(`hidden`,`until-found`))}))})},i=tz(e,`beforematch`,t=>{let n=BR(VR,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}_.current=!0;let i=e.hasAttribute(o8);e.removeAttribute(o8),l(!0),r(!0,i)});return()=>{t.clear(),bz.cancel(n),i()}},[w,o,l]);let I=i||n||a||s;return{height:k.height,props:A(A({},j?{[o8]:``}:void 0),{},{hidden:E,id:r}),ref:C,shouldPreventOpenAnimation:O,shouldRender:I,transitionStatus:D,width:k.width}}function b8(e){return{height:e.scrollHeight,width:e.scrollWidth}}function x8(e,t){let n=KS(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&S8(n.animationDuration),i=S8(n.transitionDuration);return r&&i?(process.env.NODE_ENV!==`production`&&CB(`CSS transitions and CSS animations both detected on Collapsible or Accordion panel.`,`Only one of either animation type should be used.`),`css-transition`):i?`css-transition`:r?`css-animation`:`none`}function S8(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function C8(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function w8(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=bz.request(n);return()=>{bz.cancel(r),n()}}var T8=`--collapsible-panel-height`,E8=`--collapsible-panel-width`;j();var D8=[`className`,`hiddenUntilFound`,`keepMounted`,`render`,`id`,`style`],O8=h.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s}=e,c=G(e,D8);process.env.NODE_ENV!==`production`&&h.useEffect(()=>{r&&i===!1&&CB("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.")},[r,i]);let{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:g,state:_,transitionStatus:v}=r8(),y=r!=null&&r,b=i!=null&&i,x=o||void 0,S=x==null?l:x;DL(()=>(m(e=>x==null?e===null?void 0:e:x),()=>{m(e=>e===x?null:e)}),[x,m]);let{height:C,props:w,ref:T,shouldPreventOpenAnimation:E,shouldRender:D,transitionStatus:O,width:k}=y8({externalRef:t,hiddenUntilFound:y,id:S,keepMounted:b,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:g,transitionStatus:v}),j=A(A({},_),{},{transitionStatus:O}),M=EB(s,j),N=VB(`div`,A(A({},e),{},{style:void 0}),{state:j,ref:T,props:[w,{style:{[T8]:C===void 0?`auto`:`${C}px`,[E8]:k===void 0?`auto`:`${k}px`}},c,M?{style:M}:void 0,E?{style:{animationName:`none`}}:void 0],stateAttributesMapping:f8});return D?N:null});process.env.NODE_ENV!==`production`&&(O8.displayName=`CollapsiblePanel`),j();var k8=(0,h.forwardRef)(function(e,t){return(0,X.jsx)(m8,A({ref:t,"data-slot":`collapsible`},e))});function A8(e){let t=PW({},(NW(e),e));return(0,X.jsx)(_8,A({"data-slot":`collapsible-trigger`},t))}function j8(e){let t=PW({},(NW(e),e));return(0,X.jsx)(O8,A({"data-slot":`collapsible-content`},t))}j();var M8=[`className`,`variant`,`open`,`onOpenChange`,`defaultOpen`,`streaming`,`showContent`,`onAnimationStart`,`style`,`children`],N8=[`side`,`className`],P8=[`active`,`duration`,`className`],F8=[`className`,`children`],I8=[`className`,`children`],L8=(0,h.createContext)({isPreview:!1,showContent:!0}),R8=GG(`aui-reasoning-root mb-0 w-full`,{variants:{variant:{outline:`rounded-lg px-0 py-2`,ghost:``,muted:`bg-muted/50 rounded-lg px-3 py-2`}},defaultVariants:{variant:`outline`}}),z8=(0,h.forwardRef)(function(e,t){let{className:n,variant:r,open:i,onOpenChange:a,defaultOpen:o=!1,streaming:s,showContent:c=!0,onAnimationStart:l,style:u,children:d}=e,f=G(e,M8),[p]=(0,h.useState)(o),[m,g]=(0,h.useState)(null),_=i!==void 0,v=_?i:m==null?s||p:m,y=s===!0&&v,b=(0,h.useRef)(s);BK(()=>{b.current!==s&&(b.current=s,_||m!==null||p||l==null||l())},[s,_,m,p,l]);let x=(0,h.useCallback)(e=>{l==null||l(),_||g(e),a==null||a(e)},[l,_,a]),S={isPreview:c&&y,showContent:c};return c?(0,X.jsx)(k8,A(A({ref:t,"data-slot":`reasoning-root`,"data-variant":r,open:v,onOpenChange:x,className:Q(`group/reasoning-root`,R8({variant:r,className:n})),style:A({"--animation-duration":`200ms`},typeof u==`object`&&u||{})},f),{},{children:(0,X.jsx)(L8.Provider,{value:S,children:d})})):(0,X.jsx)(`div`,A(A({ref:t,"data-slot":`reasoning-root`,"data-variant":r,className:Q(`group/reasoning-root`,R8({variant:r,className:n})),style:typeof u==`function`?void 0:u},f),{},{children:(0,X.jsx)(L8.Provider,{value:S,children:d})}))});function B8(e){let{side:t=`bottom`,className:n}=e,r=G(e,N8);return t===`top`?(0,X.jsx)(`div`,A({"data-slot":`reasoning-fade`,className:Q(`aui-reasoning-fade pointer-events-none absolute inset-x-0 top-0 z-10 h-8`,`bg-[linear-gradient(to_bottom,var(--color-background),transparent)]`,`group-data-[variant=muted]/reasoning-root:bg-[linear-gradient(to_bottom,color-mix(in_oklab,var(--color-muted)_50%,var(--color-background)),transparent)]`,`fade-in-0 animate-in`,`animation-duration-(--animation-duration)`,n)},r)):(0,X.jsx)(`div`,A({"data-slot":`reasoning-fade`,className:Q(`aui-reasoning-fade pointer-events-none absolute inset-x-0 bottom-0 z-10 h-8`,`bg-[linear-gradient(to_top,var(--color-background),transparent)]`,`group-data-[variant=muted]/reasoning-root:bg-[linear-gradient(to_top,color-mix(in_oklab,var(--color-muted)_50%,var(--color-background)),transparent)]`,`fade-in-0 animate-in`,`animation-duration-(--animation-duration)`,n)},r))}function V8(e){let{active:t,duration:n,className:r}=e,i=G(e,P8),{showContent:a}=(0,h.useContext)(L8),o=t?`正在思考...`:n===void 0?``:`思考了 ${n} 秒`;if(!o)return null;let s=Q(`aui-reasoning-trigger flex max-w-[75%] origin-left items-center gap-2 py-1.5 text-sm text-muted-foreground`,t&&a&&`hover:text-foreground transition-colors active:scale-[0.98]`,r),c=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(nI,{"data-slot":`reasoning-trigger-icon`,className:`aui-reasoning-trigger-icon size-4 shrink-0`}),(0,X.jsx)(`span`,{"data-slot":`reasoning-trigger-label`,className:Q(`aui-reasoning-trigger-label-wrapper inline-block leading-none tabular-nums`,t&&`shimmer motion-reduce:animate-none`),children:o})]});return!a||!t?(0,X.jsx)(`div`,{"data-slot":`reasoning-trigger`,className:s,children:c}):(0,X.jsx)(A8,A(A({"data-slot":`reasoning-trigger`,className:s},i),{},{children:c}))}function H8(e){let{className:t,children:n}=e,r=G(e,F8),{showContent:i}=(0,h.useContext)(L8);return i?(0,X.jsx)(j8,A(A({"data-slot":`reasoning-content`,className:Q(`aui-reasoning-content relative overflow-hidden text-sm text-muted-foreground outline-none`,`group/collapsible-content ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`data-closed:animate-collapsible-up`,`data-open:animate-collapsible-down`,`data-closed:fill-mode-forwards`,`data-closed:pointer-events-none`,`[--tw-duration:var(--animation-duration)]`,t)},r),{},{children:n})):null}function U8(e){let{className:t,children:n}=e,r=G(e,I8),{showContent:i}=(0,h.useContext)(L8);return i?(0,X.jsx)(`div`,A(A({"data-slot":`reasoning-text`,className:Q(`aui-reasoning-text relative z-0 max-h-64 overflow-y-auto ps-6 pt-2 pb-2 leading-relaxed text-pretty`,`motion-reduce:animate-none`,t)},r),{},{children:(0,X.jsx)(`div`,{className:`aui-reasoning-text-content space-y-4`,children:n})})):null}j();var W8=[`onAnimationStart`],G8=(0,h.forwardRef)(function(e,t){let{onAnimationStart:n}=e,r=G(e,W8),i=(0,h.useRef)(null),a=$P(i,200),o=(0,h.useCallback)(()=>{a(),n==null||n()},[a,n]),s=(0,h.useCallback)(e=>{if(i.current=e,typeof t==`function`){let n=t(e);if(typeof n==`function`)return()=>{i.current=null,n()}}else t&&(t.current=e)},[t]);return(0,X.jsx)(z8,A({ref:s,onAnimationStart:o},r))}),K8=()=>(0,X.jsx)(Z6,{}),q8=({children:e,startIndex:t,endIndex:n})=>{let r=Y(e=>{var r;if(((r=e.message.status)==null?void 0:r.type)!==`running`)return!1;for(let r=t;r<=n;r++){var i;if(((i=e.message.parts[r])==null?void 0:i.status.type)===`running`)return!0}return!1});return(0,X.jsxs)(G8,{streaming:r,showContent:!1,children:[(0,X.jsx)(V8,{active:r}),(0,X.jsx)(H8,{"aria-busy":r,"aria-label":`AI 思考过程`,children:(0,X.jsx)(U8,{children:e})})]})},J8=(0,h.memo)(K8);J8.displayName=`Reasoning`,J8.Root=G8,J8.Trigger=V8,J8.Content=H8,J8.Text=U8,J8.Fade=B8;var Y8=(0,h.memo)(q8);Y8.displayName=`ReasoningGroup`,j();var X8=[`className`];function Z8(e){let{className:t}=e,n=G(e,X8);return(0,X.jsx)(`textarea`,A({"data-slot":`textarea`,className:Q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,t)},n))}function Q8(e=``){let t=v6.default.highlight(e,D6,y6);return(0,X.jsx)(`code`,{className:`tcc-code block whitespace-pre-wrap bg-transparent font-mono text-inherit`,dangerouslySetInnerHTML:{__html:t}})}var $8={scriptWriteTool:e=>Q8(e.script),searchMineCapabilitiesTool:e=>{let t=e;return!t.query||typeof t.query==`string`?t.query:t.query.join(`,`)},modifyScriptTool:e=>{let t=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`rounded-md bg-red-500/10 [&_code]:line-through`,children:Q8(t.originalCode)}),(0,X.jsx)(`div`,{className:`rounded-md bg-green-500/10`,children:Q8(t.newCode)})]})}};j();var e5=[`className`,`open`,`onOpenChange`,`defaultOpen`,`children`],t5=[`className`],n5=[`toolName`,`status`,`className`],r5=[`className`,`children`],i5=[`toolName`,`args`,`className`],a5=[`result`,`className`],o5=[`status`,`className`],s5=[`approval`,`className`,`focusReceiptRef`,`receiptRef`],c5=[`className`,`forwardedRef`,`carryFocusRef`,`addResult`,`resume`,`interrupt`,`approval`,`respondToApproval`,`status`],l5=200,u5=`active:scale-[0.98]`;function d5(e){let{className:t,open:n,onOpenChange:r,defaultOpen:i=!1,children:a}=e,o=G(e,e5),s=(0,h.useRef)(null),[c,l]=(0,h.useState)(i),u=$P(s,l5),d=n!==void 0,f=d?n:c,p=(0,h.useCallback)(e=>{u(),d||l(e),r==null||r(e)},[u,d,r]);return(0,X.jsx)(k8,A(A({ref:s,"data-slot":`tool-fallback-root`,open:f,onOpenChange:p,className:Q(`aui-tool-fallback-root group/tool-fallback-root w-full`,t),style:{"--animation-duration":`${l5}ms`}},o),{},{children:a}))}var f5={running:II,complete:iI,incomplete:gI,"requires-action":fI},p5=e=>{if(e<1e3)return`<1秒`;let t=e/1e3;return t<10?`${(Math.floor(t*10)/10).toFixed(1)}秒`:t<60?`${Math.floor(t)}秒`:`${Math.floor(t/60)}分 ${Math.floor(t%60)}秒`};function m5(e){let{className:t}=e,n=G(e,t5),r=jy();return r===void 0?null:(0,X.jsx)(`span`,A(A({"data-slot":`tool-fallback-duration`,className:Q(`aui-tool-fallback-duration text-muted-foreground text-xs tabular-nums`,t)},n),{},{children:p5(r)}))}function h5(e){var t,n;let{toolName:r,status:i,className:a}=e,o=G(e,n5),s=(t=i==null?void 0:i.type)==null?`complete`:t,c=s===`running`,l=(i==null?void 0:i.type)===`incomplete`&&i.reason===`cancelled`,u=f5[s];return(0,X.jsxs)(A8,A(A({"data-slot":`tool-fallback-trigger`,className:Q(`aui-tool-fallback-trigger group/trigger text-muted-foreground hover:text-foreground flex w-fit max-w-full origin-left items-center gap-2 py-1.5 text-sm transition-[color,scale] active:scale-[0.98]`,a)},o),{},{children:[(0,X.jsx)(u,{"data-slot":`tool-fallback-trigger-icon`,className:Q(`aui-tool-fallback-trigger-icon size-4 shrink-0`,l&&`text-muted-foreground`,c&&`animate-spin [animation-duration:0.6s]`)}),(0,X.jsx)(`span`,{"data-slot":`tool-fallback-trigger-label`,className:Q(`aui-tool-fallback-trigger-label-wrapper inline-block min-w-0 text-start leading-none wrap-anywhere`,l&&`text-muted-foreground line-through`,c&&`shimmer motion-reduce:animate-none`),children:(n=tF[r])==null?`执行操作`:n}),(0,X.jsx)(m5,{}),(0,X.jsx)(oI,{"data-slot":`tool-fallback-trigger-chevron`,className:Q(`aui-tool-fallback-trigger-chevron size-4 shrink-0`,`transition-transform duration-(--animation-duration) ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none`,`-rotate-90`,`group-data-open/trigger:rotate-0`,`group-data-panel-open/trigger:rotate-0`)})]}))}function g5(e){let{className:t,children:n}=e,r=G(e,r5);return(0,X.jsx)(j8,A(A({"data-slot":`tool-fallback-content`,className:Q(`aui-tool-fallback-content relative overflow-hidden text-sm outline-none`,`group/collapsible-content ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`data-closed:animate-collapsible-up`,`data-open:animate-collapsible-down`,`data-closed:fill-mode-forwards`,`data-closed:pointer-events-none`,`[--tw-duration:var(--animation-duration)]`,t)},r),{},{children:(0,X.jsx)(`div`,{className:Q(`flex flex-col gap-2 ps-6 pt-1 pb-2 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`group-data-open/collapsible-content:animate-in group-data-open/collapsible-content:fade-in-0 group-data-open/collapsible-content:blur-in-[2px] group-data-open/collapsible-content:slide-in-from-top-1`,`group-data-closed/collapsible-content:animate-out group-data-closed/collapsible-content:fade-out-0 group-data-closed/collapsible-content:blur-out-[2px] group-data-closed/collapsible-content:slide-out-to-top-1`,`group-data-closed/collapsible-content:animation-duration-(--animation-duration) group-data-open/collapsible-content:animation-duration-(--animation-duration)`),children:n})}))}function _5(e){let{toolName:t,args:n,className:r}=e,i=G(e,i5);if(n==null)return null;let a=$8[t];if(!a)return null;let o=a(n);return o==null||o===``?null:(0,X.jsx)(`div`,A(A({"data-slot":`tool-fallback-args`,className:Q(`aui-tool-fallback-args`,r)},i),{},{children:(0,X.jsx)(`pre`,{className:`aui-tool-fallback-args-value bg-muted/50 text-foreground/90 rounded-md p-2.5 text-xs break-words whitespace-pre-wrap`,children:o})}))}var v5=(e,t)=>{if(typeof e==`string`)return e;try{if(e instanceof Error)return String(e);let n=JSON.stringify(e,null,t);if(n!==void 0)return n}catch(e){}try{return String(e)}catch(e){return`[无法序列化的数据]`}};function y5(e){let{result:t,className:n}=e,r=G(e,a5);return t===void 0?null:(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-result`,className:Q(`aui-tool-fallback-result`,n)},r),{},{children:[(0,X.jsx)(`p`,{className:`aui-tool-fallback-result-header text-muted-foreground text-xs font-medium`,children:`执行结果:`}),(0,X.jsx)(`pre`,{className:`aui-tool-fallback-result-content bg-muted/50 text-foreground/90 mt-1 rounded-md p-2.5 text-xs break-words whitespace-pre-wrap`,children:v5(t,2)})]}))}function b5(e){let{status:t,className:n}=e,r=G(e,o5);if((t==null?void 0:t.type)!==`incomplete`)return null;let i=t.error,a=i==null?null:v5(i);if(!a)return null;let o=t.reason===`cancelled`?`取消原因:`:`错误信息:`;return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-error`,className:Q(`aui-tool-fallback-error`,n)},r),{},{children:[(0,X.jsx)(`p`,{className:`aui-tool-fallback-error-header text-muted-foreground font-semibold`,children:o}),(0,X.jsx)(`p`,{className:`aui-tool-fallback-error-reason text-muted-foreground break-words whitespace-pre-line`,children:a})]}))}var x5=`Approved by user`,S5=`User denied tool execution`,C5={"allow-once":`允许一次`,"allow-always":`始终允许`,"reject-once":`拒绝一次`,"reject-always":`始终拒绝`},w5=e=>Object.hasOwn(C5,e),T5=e=>e===`allow-once`||e===`allow-always`,E5=e=>{var t,n;return(t=(n=e.label)==null?w5(e.kind)?C5[e.kind]:void 0:n)==null?e.id:t},D5=e=>(e==null?void 0:e.display)===`select`||(e==null?void 0:e.display)===`text`||(e==null?void 0:e.display)===`questions`,O5=e=>{var t;return!((t=e.options)!=null&&t.length)||e.allowFreeform===!0},k5=(e,t)=>{var n,r;return[...((n=t==null?void 0:t.optionIds)==null?[]:n).map(t=>{var n,r;return(n=(r=e.options)==null||(r=r.find(e=>e.id===t))==null?void 0:r.label)==null?t:n}),...t!=null&&(r=t.text)!=null&&r.trim()?[t.text]:[]]},A5=e=>e!=null&&(e.approved!==void 0||e.resolution!==void 0),j5=e=>{var t;if(e.resolution!==void 0)return{outcome:`closed`,label:e.resolution===`cancelled`?`已取消,未作出决定`:`已过期,未作出决定`};let n=e.optionId===void 0||(t=e.options)==null?void 0:t.find(t=>t.id===e.optionId),r=n===void 0?e.optionId===void 0?void 0:e.optionId:E5(n),i=D5(e)||n!==void 0&&!w5(n.kind),a=e.isAutomatic?`(自动处理)`:``;return e.approved?{outcome:`allowed`,label:`${i?`已回答`:`已允许`}${a}`,option:r}:{outcome:`refused`,label:`${i?`已关闭`:`已拒绝`}${a}`,option:r}},M5={allowed:iI,refused:gI,closed:mI};function N5(e){var t;let{approval:n,className:r,focusReceiptRef:i,receiptRef:a}=e,o=G(e,s5);(0,h.useLayoutEffect)(()=>{var e;let t=i.current===n.id;i.current=null,t&&((e=a.current)==null||e.focus({preventScroll:!0}))},[n.id,i,a]);let s=j5(n),c=M5[s.outcome],l=[...new Set([n.text,n.reason].filter(e=>typeof e==`string`&&e!==``))];return(0,X.jsxs)(`div`,A(A({ref:a,"data-slot":`tool-fallback-approval-receipt`,"data-outcome":s.outcome,tabIndex:-1,className:Q(`aui-tool-fallback-approval-receipt flex flex-col gap-1.5 pt-1`,r)},o),{},{children:[n.prompt?(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-prompt text-muted-foreground whitespace-pre-line`,children:n.prompt}):null,(0,X.jsxs)(`p`,{className:`aui-tool-fallback-approval-receipt-label flex items-center gap-1.5`,children:[(0,X.jsx)(c,{"aria-hidden":!0,className:`text-muted-foreground size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`font-medium`,children:s.label}),s.option===void 0?null:(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,s.option]})]}),n.answers&&((t=n.questions)==null?void 0:t.map(e=>{var t;let r=k5(e,n.answers&&Object.hasOwn(n.answers,e.id)?n.answers[e.id]:void 0);return r.length===0?null:(0,X.jsxs)(`p`,{className:`aui-tool-fallback-approval-receipt-answer whitespace-pre-line`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:(t=e.header)==null?e.prompt:t}),` `,`· `,r.join(`、`)]},e.id)})),l.map(e=>(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-receipt-note text-muted-foreground whitespace-pre-line`,children:e},e))]}))}function P5({questions:e,dismissible:t,locked:n,onSend:r,onDismiss:i}){let[a,o]=(0,h.useState)(()=>new Map),[s,c]=(0,h.useState)(()=>new Map),l=(e,t)=>o(n=>{var r;let i=(r=n.get(e.id))==null?[]:r,a=i.includes(t)?i.filter(e=>e!==t):e.multiple?[...i,t]:[t];return new Map(n).set(e.id,a)}),u=e=>{var t;let n=(t=a.get(e.id))==null?[]:t,r=s.get(e.id),i=r!=null&&r.trim()?r:void 0;return A(A({},n.length>0&&{optionIds:n}),i!==void 0&&{text:i})},d=e.length>0&&e.every(e=>{let t=u(e);return t.optionIds!==void 0||t.text!==void 0});return(0,X.jsxs)(X.Fragment,{children:[e.map(e=>{var t,r,i,o,u;let d=(t=a.get(e.id))==null?[]:t,f=(r=(i=e.options)==null?void 0:i.some(e=>e.description))!=null&&r;return(0,X.jsxs)(`div`,{role:`group`,"aria-label":e.prompt,"data-slot":`tool-fallback-approval-question`,className:`aui-tool-fallback-approval-question flex flex-col gap-2`,children:[(0,X.jsxs)(`p`,{className:`aui-tool-fallback-approval-question-prompt text-foreground whitespace-pre-line`,children:[e.header?(0,X.jsx)(`span`,{className:`text-muted-foreground me-1.5 text-xs font-medium uppercase`,children:e.header}):null,e.prompt]}),e.options&&e.options.length>0?(0,X.jsx)(`div`,{className:Q(`flex gap-2`,f?`flex-col items-stretch`:`flex-wrap items-center`),children:e.options.map(t=>{let r=d.includes(t.id);return(0,X.jsxs)(JG,{size:`sm`,variant:r?`default`:`outline`,className:Q(u5,f&&`h-auto flex-col items-start gap-0.5 py-2 text-start whitespace-normal`),"aria-pressed":r,onClick:()=>l(e,t.id),disabled:n,children:[(0,X.jsx)(`span`,{children:t.label}),t.description?(0,X.jsx)(`span`,{className:`text-xs font-normal opacity-80`,children:t.description}):null]},t.id)})}):null,O5(e)?(0,X.jsx)(Z8,{value:(o=s.get(e.id))==null?``:o,onChange:t=>c(n=>new Map(n).set(e.id,t.target.value)),disabled:n,"aria-label":e.prompt,placeholder:(u=e.options)!=null&&u.length?`或者输入其他答案`:`请输入你的答案`}):null]},e.id)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(JG,{size:`sm`,className:u5,onClick:()=>{!n&&d&&r(Object.fromEntries(e.map(e=>[e.id,u(e)])))},disabled:n||!d,children:`发送`}),t?(0,X.jsx)(JG,{size:`sm`,variant:`outline`,className:u5,onClick:i,disabled:n,children:`关闭`}):null]})]})}var F5=(e,t,n)=>(e==null?void 0:e.type)!==`requires-action`||e.reason!==`interrupt`||t!=null||n!=null,I5=(0,h.forwardRef)(function(e,t){var n;let r=(0,h.useRef)(!1);return(0,X.jsx)(L5,A({carryFocusRef:r,forwardedRef:t},e),(n=e.approval)==null?void 0:n.id)});function L5(e){var t;let{className:n,forwardedRef:r,carryFocusRef:i,addResult:a,resume:o,interrupt:s,approval:c,respondToApproval:l,status:u}=e,d=G(e,c5),[f,p]=(0,h.useState)(!1),m=Y(e=>e.thread.voice!==void 0),g=Y(e=>e.thread.capabilities.answerToolCall),_=f||m,[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(``),[S,C]=(0,h.useState)(null),w=(u==null?void 0:u.type)===`requires-action`,[T,E]=(0,h.useState)(w),[D,k]=(0,h.useState)(0),j=(0,h.useRef)(D);(0,h.useLayoutEffect)(()=>{j.current=D},[D]),w!==T&&(E(w),w&&(p(!1),y(null),x(``),C(null),k(D+1)));let M=(0,h.useRef)(null),N=(0,h.useRef)(null),P=(0,h.useRef)(null);(0,h.useLayoutEffect)(()=>{if(i.current){var e;i.current=!1,(e=M.current)==null||e.focus({preventScroll:!0})}return()=>{var e,t;let n=(e=M.current)==null?N.current:e;i.current=(t=n==null?void 0:n.contains(n.ownerDocument.activeElement))!=null&&t}},[i]),(0,h.useImperativeHandle)(r,()=>{var e;return(e=M.current)==null?N.current:e});let F=(0,h.useCallback)(e=>{let t=M.current;P.current=!e&&t!=null&&t.contains(t.ownerDocument.activeElement)?c==null?void 0:c.id:null,M.current=e},[c==null?void 0:c.id]),I=c!=null&&!A5(c)&&u!==void 0&&u.type!==`requires-action`&&!(f&&u.type===`running`);(0,h.useLayoutEffect)(()=>{I&&(P.current=null)},[I]);let L=()=>{let e=M.current;e!=null&&e.contains(e.ownerDocument.activeElement)&&e.focus({preventScroll:!0})};if(c!=null&&A5(c))return(0,X.jsx)(N5,A({approval:c,receiptRef:N,focusReceiptRef:P,className:n},d));if(I||!F5(u,c,s))return null;let R=c!=null&&c.prompt?(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-prompt text-foreground whitespace-pre-line`,children:c.prompt}):null;if(!g)return R&&(0,X.jsx)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:R}));let z=l?c==null?void 0:c.options:void 0,B=c!=null&&l!=null&&ie(c),ee=e=>{L(),p(!0),y(null),C(null),O(function*(){try{yield e()}catch(e){if(j.current!==D)return;p(!1),C(e instanceof Error?e.message:String(e))}})()},V=e=>{if(!_){if(c!=null&&c.approved===void 0&&l)ee(()=>l(A({approved:e},ne())));else if(s)ee(()=>o==null?void 0:o({approved:e}));else if((u==null?void 0:u.type)===`requires-action`&&u.reason===`interrupt`)return;else ee(()=>a==null?void 0:a(e?x5:S5))}},te=e=>{_||ee(()=>l==null?void 0:l(w5(e.kind)?A({optionId:e.id},ne()):A({optionId:e.id,approved:!0},ne())))},ne=()=>b.trim()?{text:b}:{},H=()=>{_||ee(()=>l==null?void 0:l({text:b}))},U=()=>{_||ee(()=>l==null?void 0:l({approved:!1}))},re=e=>{e.confirm?(L(),y(e.id)):te(e)},W=v==null||z==null?void 0:z.find(e=>e.id===v),ae=D5(c),oe=ae&&l!=null&&(c==null?void 0:c.dismissible)===!0?(0,X.jsx)(JG,{size:`sm`,variant:`outline`,className:u5,onClick:U,disabled:_,children:`关闭`}):null,se=S?(0,X.jsx)(`p`,{role:`alert`,className:`aui-tool-fallback-approval-error text-destructive text-xs whitespace-pre-line`,children:S}):null,ce=B?(0,X.jsxs)(`div`,{className:`aui-tool-fallback-approval-answer flex flex-col items-start gap-2`,children:[(0,X.jsx)(Z8,{value:b,onChange:e=>x(e.target.value),disabled:_,"aria-label":ae?(t=c==null?void 0:c.prompt)==null?`答案`:t:`备注`,placeholder:ae?`请输入你的答案`:`填写决策备注`}),ae&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(JG,{size:`sm`,className:u5,onClick:H,disabled:_,children:`发送`}),oe]})]}):null;if((c==null?void 0:c.display)===`questions`&&l){var le;return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-3 pt-1`,n)},d),{},{ref:F,children:[R,(0,X.jsx)(P5,{questions:(le=c.questions)==null?[]:le,dismissible:c.dismissible===!0,locked:_,onSend:e=>ee(()=>l({answers:e})),onDismiss:U}),se]}))}if(W){var ue,de;let e=typeof W.confirm==`object`?W.confirm:void 0,t=(ue=e==null?void 0:e.description)==null?W.description:ue;return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval-confirm`,tabIndex:-1,className:Q(`aui-tool-fallback-approval-confirm flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-confirm-title font-semibold`,children:(de=e==null?void 0:e.title)==null?`${E5(W)}?`:de}),t&&(0,X.jsx)(`p`,{className:`aui-tool-fallback-approval-confirm-description text-muted-foreground whitespace-pre-line`,children:t}),W.grants&&W.grants.length>0&&(0,X.jsx)(`ul`,{className:`aui-tool-fallback-approval-confirm-grants flex flex-col gap-1`,children:W.grants.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(`code`,{className:`aui-tool-fallback-approval-confirm-grant bg-muted rounded px-1.5 py-0.5 text-xs`,children:e})},e))}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(JG,{size:`sm`,className:u5,onClick:()=>te(W),disabled:_,children:`确认`}),(0,X.jsx)(JG,{size:`sm`,variant:`outline`,className:u5,onClick:()=>{L(),y(null)},disabled:_,children:`返回`})]})]}))}if(z&&z.length>0){let e=z.filter(e=>T5(e.kind)),t=z.filter(e=>!w5(e.kind)),r=z.filter(e=>w5(e.kind)&&!T5(e.kind));return(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[R,(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[[...e,...t,...r].map(t=>(0,X.jsx)(JG,{size:`sm`,variant:t===e[0]?`default`:`outline`,className:u5,onClick:()=>re(t),disabled:_,children:E5(t)},t.id)),r.length===0&&!ae&&(0,X.jsx)(JG,{size:`sm`,variant:`outline`,className:u5,onClick:()=>V(!1),disabled:_,children:`拒绝`}),!B&&oe]}),ce,se]}))}return ae?(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[R,ce,!B&&oe&&(0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:oe}),se]})):(0,X.jsxs)(`div`,A(A({"data-slot":`tool-fallback-approval`,tabIndex:-1,className:Q(`aui-tool-fallback-approval flex flex-col gap-2 pt-1`,n)},d),{},{ref:F,children:[R,(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(JG,{size:`sm`,className:u5,onClick:()=>V(!0),disabled:_,children:`允许`}),(0,X.jsx)(JG,{size:`sm`,variant:`outline`,className:u5,onClick:()=>V(!1),disabled:_,children:`拒绝`})]}),ce,se]}))}var R5=(0,h.memo)(({toolName:e,args:t,result:n,status:r,addResult:i,resume:a,interrupt:o,approval:s,respondToApproval:c})=>{let l=(r==null?void 0:r.type)===`incomplete`&&r.reason===`cancelled`,u=(r==null?void 0:r.type)===`requires-action`,d=s!=null||u&&F5(r,s,o),[f,p]=(0,h.useState)(u),[m,g]=(0,h.useState)(u);u!==m&&(g(u),u&&p(!0));let _=(0,h.useRef)(!1),v=(0,h.useRef)(null),y=(0,h.useRef)(null);return(0,h.useLayoutEffect)(()=>{let e=v.current;if(!e||e.isConnected||u||!_.current)return;let t=s==null||!A5(s);_.current=!1;let{activeElement:n,body:r}=e.ownerDocument;if(t&&(n==null||n===r)){var i;(i=y.current)==null||i.focus({preventScroll:!0})}},[s,u,r==null?void 0:r.type]),(0,X.jsxs)(d5,{open:f,onOpenChange:p,children:[(0,X.jsx)(h5,{toolName:e,status:r}),(0,X.jsxs)(g5,{children:[(0,X.jsx)(b5,{status:r}),(0,X.jsx)(_5,{toolName:e,args:t,className:Q(l&&`opacity-60`)}),d&&(0,X.jsx)(I5,{addResult:i,resume:a,interrupt:o,approval:s,respondToApproval:c,status:r,onFocusCapture:e=>{var t;let n=e.currentTarget.closest(`[data-slot="tool-fallback-root"]`);y.current=(t=n==null?void 0:n.querySelector(`[data-slot="tool-fallback-trigger"]`))==null?null:t,v.current=e.currentTarget,_.current=!0},onBlurCapture:e=>{let t=e.relatedTarget;(t?e.currentTarget.contains(t):e.currentTarget.contains(e.currentTarget.ownerDocument.activeElement))||(_.current=!1)}}),(0,X.jsx)(y5,{result:n})]})]})});R5.displayName=`ToolFallback`,R5.Root=d5,R5.Trigger=h5,R5.Content=g5,R5.Args=_5,R5.Result=y5,R5.Error=b5,R5.Approval=I5,j();var z5=[`className`,`variant`,`open`,`onOpenChange`,`defaultOpen`,`children`],B5=[`count`,`active`,`className`],V5=[`className`,`children`],H5=200,U5=GG(`aui-tool-group-root group/tool-group w-full`,{variants:{variant:{outline:`rounded-lg border py-3`,ghost:``,muted:`border-muted-foreground/30 bg-muted/30 rounded-lg border py-3`}},defaultVariants:{variant:`outline`}});function W5(e){let{className:t,variant:n,open:r,onOpenChange:i,defaultOpen:a=!1,children:o}=e,s=G(e,z5),c=(0,h.useRef)(null),[l,u]=(0,h.useState)(a),d=$P(c,H5),f=r!==void 0,p=f?r:l,m=(0,h.useCallback)(e=>{d(),f||u(e),i==null||i(e)},[d,f,i]);return(0,X.jsx)(k8,A(A({ref:c,"data-slot":`tool-group-root`,"data-variant":n==null?`outline`:n,open:p,onOpenChange:m,className:Q(U5({variant:n}),`group/tool-group-root`,t),style:{"--animation-duration":`${H5}ms`}},s),{},{children:o}))}function G5(e){let{count:t,active:n=!1,className:r}=e,i=G(e,B5),a=`${t} 次工具调用`;return(0,X.jsxs)(A8,A(A({"data-slot":`tool-group-trigger`,className:Q(`aui-tool-group-trigger group/trigger flex origin-left items-center gap-2 text-sm transition-[color,scale] active:scale-[0.98]`,`group-data-[variant=ghost]/tool-group-root:text-muted-foreground group-data-[variant=ghost]/tool-group-root:hover:text-foreground group-data-[variant=ghost]/tool-group-root:py-1.5`,`group-data-[variant=outline]/tool-group-root:w-full group-data-[variant=outline]/tool-group-root:px-4`,`group-data-[variant=muted]/tool-group-root:w-full group-data-[variant=muted]/tool-group-root:px-4`,r)},i),{},{children:[n&&(0,X.jsx)(II,{"data-slot":`tool-group-trigger-loader`,className:`aui-tool-group-trigger-loader size-3 shrink-0 animate-spin [animation-duration:0.6s]`}),(0,X.jsx)(`span`,{"data-slot":`tool-group-trigger-label`,className:Q(`aui-tool-group-trigger-label-wrapper inline-block text-start text-xs leading-none font-medium`,`group-data-[variant=ghost]/tool-group-root:font-normal`,`group-data-[variant=outline]/tool-group-root:grow`,`group-data-[variant=muted]/tool-group-root:grow`,n&&`shimmer motion-reduce:animate-none`),children:a}),(0,X.jsx)(oI,{"data-slot":`tool-group-trigger-chevron`,className:Q(`aui-tool-group-trigger-chevron size-3 shrink-0`,`transition-transform duration-(--animation-duration) ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none`,`-rotate-90`,`group-data-open/trigger:rotate-0`,`group-data-panel-open/trigger:rotate-0`)})]}))}function K5(e){let{className:t,children:n}=e,r=G(e,V5);return(0,X.jsx)(j8,A(A({"data-slot":`tool-group-content`,className:Q(`aui-tool-group-content relative overflow-hidden text-sm outline-none`,`group/collapsible-content ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:animate-none`,`data-closed:animate-collapsible-up`,`data-open:animate-collapsible-down`,`data-closed:fill-mode-forwards`,`data-closed:pointer-events-none`,`[--tw-duration:var(--animation-duration)]`,t)},r),{},{children:(0,X.jsx)(`div`,{className:Q(`mt-2 flex flex-col gap-2`,`group-data-[variant=ghost]/tool-group-root:mt-1 group-data-[variant=ghost]/tool-group-root:gap-1`,`group-data-[variant=outline]/tool-group-root:mt-3 group-data-[variant=outline]/tool-group-root:border-t group-data-[variant=outline]/tool-group-root:px-4 group-data-[variant=outline]/tool-group-root:pt-3`,`group-data-[variant=muted]/tool-group-root:mt-3 group-data-[variant=muted]/tool-group-root:border-t group-data-[variant=muted]/tool-group-root:px-4 group-data-[variant=muted]/tool-group-root:pt-3`,`[&>*]:animate-in [&>*]:fade-in-0 [&>*]:blur-in-[2px] [&>*]:slide-in-from-top-1 [&>*]:animation-duration-(--animation-duration) [&>*]:ease-[cubic-bezier(0.32,0.72,0,1)]`,`[&>*]:motion-reduce:animate-none`,`[&>*:nth-child(2)]:[animation-delay:40ms]`,`[&>*:nth-child(3)]:[animation-delay:80ms]`,`[&>*:nth-child(4)]:[animation-delay:120ms]`,`[&>*:nth-child(n+5)]:[animation-delay:160ms]`),children:n})}))}var q5=(0,h.memo)(({children:e,startIndex:t,endIndex:n})=>{let r=n-t+1;return(0,X.jsxs)(W5,{children:[(0,X.jsx)(G5,{count:r}),(0,X.jsx)(K5,{children:e})]})});q5.displayName=`ToolGroup`,q5.Root=W5,q5.Trigger=G5,q5.Content=K5,j();var J5=[`className`];function Y5(e){let{className:t}=e,n=G(e,J5);return(0,X.jsx)(`div`,A({"data-slot":`skeleton`,className:Q(`animate-pulse rounded-md bg-muted`,t)},n))}j();var X5=[`className`],Z5=({group:e,children:t})=>{let[n,r]=(0,h.useState)(!1);return(0,X.jsxs)(W5,{variant:`ghost`,open:n||e.counts.requiresAction>0,onOpenChange:r,children:[(0,X.jsx)(G5,{count:e.indices.length,active:e.status.type===`running`}),(0,X.jsx)(K5,{children:t})]})},Q5=e=>!!e.thread.canResume&&e.composer.type===`thread`&&e.composer.isEmpty,$5=e=>(e==null?void 0:e.completedAt)===void 0?void 0:Number(((e.completedAt-e.startedAt)/1e3).toFixed(1)),e7=__({reasoning:[`group-chainOfThought`,`group-reasoning`],"tool-call":[`group-chainOfThought`,`group-reasoning`],"standalone-tool-call":[]}),t7=[`group-chainOfThought`,`group-task`],n7=(e,t)=>{var n;let r=e7(e,t);return e.type===`tool-call`&&e.messages!==void 0&&r.length>0&&!(t!=null&&(n=t.toolUIs)!=null&&(n=n[e.toolName])!=null&&n.length)?t7:r},r7={},i7=(0,h.createContext)(r7),a7=e=>e.thread.messages.length===0&&(!e.thread.isLoading||e.threads.isLoading),o7=e=>e.thread.messages.length===0&&e.thread.isLoading&&!e.thread.isDisabled&&!e.threads.isLoading,s7=()=>(0,X.jsxs)(`div`,{"data-slot":`aui_thread-history-skeleton`,role:`status`,className:`animate-in fade-in fill-mode-both flex flex-col gap-y-6 [animation-delay:150ms] [animation-duration:200ms]`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`正在加载对话`}),(0,X.jsx)(Y5,{className:`ml-auto h-9 w-2/5 rounded-xl motion-reduce:animate-none`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,X.jsx)(Y5,{className:`h-4 w-11/12 motion-reduce:animate-none`}),(0,X.jsx)(Y5,{className:`h-4 w-4/5 motion-reduce:animate-none`}),(0,X.jsx)(Y5,{className:`h-4 w-3/5 motion-reduce:animate-none`})]}),(0,X.jsx)(Y5,{className:`ml-auto h-9 w-1/3 rounded-xl motion-reduce:animate-none`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-2`,children:[(0,X.jsx)(Y5,{className:`h-4 w-10/12 motion-reduce:animate-none`}),(0,X.jsx)(Y5,{className:`h-4 w-2/3 motion-reduce:animate-none`})]})]}),c7=({components:e=r7,autoFocus:t=!0})=>{let n=Y(a7);return(0,X.jsx)(i7.Provider,{value:e,children:(0,X.jsx)(l7,{isEmpty:n,autoFocus:t})})},l7=({isEmpty:e,autoFocus:t})=>{let{Welcome:n=y7}=(0,h.useContext)(i7);return(0,X.jsx)(CP.Root,{className:`aui-root aui-thread-root bg-background @container flex h-full flex-col`,style:{"--thread-max-width":`704px`,"--composer-bg":`color-mix(in oklab, var(--color-muted) 30%, transparent)`,"--composer-radius":`16px`,"--composer-padding":`8px`},children:(0,X.jsx)(CP.Viewport,{turnAnchor:`top`,"data-slot":`aui_thread-viewport`,className:`relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth`,children:(0,X.jsxs)(`div`,{className:Q(`mx-auto flex w-full max-w-(--thread-max-width) flex-1 flex-col px-4 pt-4 select-text`,e&&`justify-center`),children:[(0,X.jsx)(Td,{condition:a7,children:(0,X.jsx)(n,{})}),(0,X.jsx)(Td,{condition:o7,children:(0,X.jsx)(s7,{})}),(0,X.jsx)(_7,{}),(0,X.jsx)(`div`,{"data-slot":`aui_message-group`,className:`mb-14 flex flex-col gap-y-6 empty:hidden`,children:(0,X.jsx)(CP.Messages,{children:()=>(0,X.jsx)(u7,{})})}),(0,X.jsxs)(CP.ViewportFooter,{className:Q(`aui-thread-viewport-footer bg-background flex flex-col gap-2 overflow-visible pb-4 md:pb-6`,!e&&`sticky bottom-0 mt-auto rounded-t-(--composer-radius)`),children:[(0,X.jsx)(v7,{}),(0,X.jsx)(xq,{}),!e&&(0,X.jsx)(`div`,{className:`mx-auto flex w-full max-w-(--thread-max-width) justify-start`,children:(0,X.jsxs)(HP.New,{render:(0,X.jsx)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-1 px-1.5 rounded text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`}),children:[(0,X.jsx)(QI,{className:`size-3`}),`新建对话`]})}),(0,X.jsx)(S7,{autoFocus:t}),(0,X.jsx)(Td,{condition:e=>a7(e)&&e.composer.isEmpty,children:(0,X.jsx)(b7,{})})]})]})})})},u7=()=>{let{AssistantMessage:e=T7}=(0,h.useContext)(i7),t=Y(e=>e.message.role),n=Y(e=>e.message.composer.isEditing),r=Y(e=>e.message.metadata.modality===`voice`);return n?(0,X.jsx)(M7,{}):r?(0,X.jsx)(p7,{}):t===`user`?(0,X.jsx)(A7,{}):(0,X.jsx)(e,{})},d7=()=>Y(e=>{var t,n;let r=((t=e.thread.messages[e.message.index-1])==null?void 0:t.metadata.modality)===`voice`,i=((n=e.thread.messages[e.message.index+1])==null?void 0:n.metadata.modality)===`voice`;return r?i?`middle`:`end`:i?`start`:`single`}),f7=({text:e})=>(0,X.jsx)(`p`,{className:`aui-spoken-message-text m-0`,children:e}),p7=()=>{let e=Y(e=>e.message.role),t=d7(),n=Y(e=>{var t;return e.message.role===`assistant`&&((t=e.message.status)==null?void 0:t.type)===`running`}),r=t===`start`||t===`single`;return(0,X.jsxs)(MN.Root,{"data-slot":`aui_spoken-message-root`,"data-role":e,"data-voice-run":t,className:Q(`aui-spoken-message bg-muted/40 mx-2 px-3 py-1.5 [contain-intrinsic-size:auto_48px] [content-visibility:auto]`,t===`single`&&`rounded-xl py-2`,t===`start`&&`rounded-t-xl pt-2`,t===`middle`&&`-mt-6`,t===`end`&&`-mt-6 rounded-b-xl pb-2`),children:[r&&(0,X.jsxs)(`div`,{"data-slot":`aui_spoken-exchange-header`,className:`text-muted-foreground mb-1.5 flex items-center gap-1.5 text-xs`,children:[(0,X.jsx)(JI,{className:`size-3`,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:`语音对话`})]}),(0,X.jsxs)(`div`,{"data-slot":`aui_spoken-message-content`,className:`text-foreground flex items-start gap-2 text-sm leading-relaxed`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground mt-1 shrink-0`,"aria-hidden":!0,children:e===`user`?(0,X.jsx)(HI,{className:`size-3.5`}):(0,X.jsx)(QF,{className:`size-3.5`})}),(0,X.jsx)(`span`,{className:`sr-only`,children:e===`user`?`你说`:`助手说`}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 wrap-break-word`,children:[(0,X.jsx)(MN.Parts,{components:{Text:f7}}),n&&(0,X.jsx)(`span`,{"data-slot":`aui_spoken-message-indicator`,role:`status`,className:`text-muted-foreground ms-1 animate-pulse font-sans`,"aria-label":`助手正在说话`,children:`●`})]}),(0,X.jsx)(m7,{})]})]})},m7=()=>(0,X.jsx)(xk.Root,{hideWhenRunning:!0,autohide:`always`,className:`aui-spoken-action-bar text-muted-foreground flex shrink-0 gap-1`,children:(0,X.jsxs)(xk.Copy,{render:(0,X.jsx)(SK,{tooltip:`复制`,className:`size-6`}),children:[(0,X.jsx)(Td,{condition:e=>e.message.isCopied,children:(0,X.jsx)(iI,{className:`animate-in zoom-in-50 fade-in duration-200 ease-out`})}),(0,X.jsx)(Td,{condition:e=>!e.message.isCopied,children:(0,X.jsx)(vI,{className:`animate-in zoom-in-75 fade-in duration-150`})})]})}),h7=`a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1']):not([disabled])`,g7=e=>{for(let t=e.nextElementSibling;t;t=t.nextElementSibling){let e=t.matches(h7)?t:t.querySelector(h7);if(e instanceof HTMLElement)return e}return null},_7=()=>{let e=Xa(),t=Y(e=>e.thread.hasEarlier),n=Y(e=>e.thread.isLoadingEarlier),r=t||n,i=(0,h.useRef)(null),a=(0,h.useRef)(null),o=(0,h.useRef)(null),s=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{if(!t||n){n||(s.current=!1);return}let r=a.current;if(!r)return;let i=r.closest(`[data-slot="aui_thread-viewport"]`);if(!i)return;let o=new IntersectionObserver(t=>{let n=t[0];n!=null&&n.isIntersecting&&!s.current&&(s.current=!0,e.thread.loadEarlier().catch(e=>{console.error(`加载更早的消息失败:`,e),s.current=!1}))},{root:i,rootMargin:`120px 0px 0px 0px`,threshold:0});return o.observe(r),()=>{o.disconnect()}},[e,t,n]),(0,h.useLayoutEffect)(()=>{var e;let t=o.current,n=i.current;if(r||!t||t.isConnected||!n)return;o.current=null;let a=document.activeElement;a&&a!==document.body||(e=g7(n))==null||e.focus()},[r]),(0,X.jsxs)(`div`,{ref:i,className:`contents`,onFocus:e=>{o.current=e.target},children:[(0,X.jsx)(`div`,{ref:a,"aria-hidden":`true`,className:`h-px w-full shrink-0`}),(0,X.jsx)(`span`,{role:`status`,className:`sr-only`,children:n?`正在加载更早的消息`:``}),r&&(0,X.jsx)(CP.LoadEarlier,{render:(0,X.jsx)(JG,{variant:`ghost`,size:`sm`,"data-slot":`aui_thread-load-earlier`,className:`aui-thread-load-earlier text-muted-foreground mb-6 self-center rounded-full`}),children:(0,X.jsx)(`span`,{className:Q(n&&`shimmer motion-reduce:animate-none`),children:n?`正在加载更早的消息...`:`加载更早的消息`})})]})},v7=()=>(0,X.jsx)(CP.ScrollToBottom,{render:(0,X.jsx)(SK,{tooltip:`滚动到底部`,variant:`outline`,className:`aui-thread-scroll-to-bottom dark:border-border dark:bg-background dark:hover:bg-accent absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible`}),children:(0,X.jsx)(JF,{})}),y7=()=>(0,X.jsx)(`div`,{className:`aui-thread-welcome-root mb-6 flex flex-col px-2`,children:(0,X.jsx)(`p`,{className:`aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-2xl font-medium tracking-tight text-foreground duration-200 text-center`,children:`今天有什么可以帮你?`})}),b7=()=>(0,X.jsx)(`div`,{className:`aui-thread-welcome-suggestions flex w-full flex-col`,children:(0,X.jsx)(CP.Suggestions,{children:()=>(0,X.jsx)(x7,{})})}),x7=()=>(0,X.jsx)(`div`,{className:`aui-thread-welcome-suggestion-display fade-in slide-in-from-bottom-2 animate-in fill-mode-both duration-200`,children:(0,X.jsxs)(AP.Trigger,{send:!0,render:(0,X.jsx)(`button`,{type:`button`,className:`aui-thread-welcome-suggestion group hover:bg-foreground/[0.03] focus-visible:ring-ring/50 flex w-full items-baseline gap-2.5 rounded-md px-2 py-2 text-start text-sm transition-colors outline-none focus-visible:ring-1 motion-reduce:transition-none`}),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/60 group-hover:text-foreground font-mono text-xs transition-colors motion-reduce:transition-none`,children:`>`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,X.jsx)(AP.Title,{className:`aui-thread-welcome-suggestion-text-1 text-foreground`}),` `,(0,X.jsx)(AP.Description,{className:`aui-thread-welcome-suggestion-text-2 text-muted-foreground empty:hidden`})]})]})}),S7=({autoFocus:e})=>(0,X.jsx)(_M.Root,{className:`aui-composer-root relative flex w-full flex-col`,children:(0,X.jsxs)(_M.AttachmentDropzone,{render:(0,X.jsx)(`div`,{"data-slot":`aui_composer-shell`,className:Q(`flex w-full cursor-text flex-col gap-2 rounded-[20px] p-(--composer-padding)`,`bg-[#FFFFFF] dark:bg-[#212121]`,`border border-solid border-[#F0F0F0] dark:border-[#303030]`,`hover:border-[#E8E8E8] dark:hover:border-[#383838]`,`focus-within:border-[#DCDCDC] dark:focus-within:border-[#404040]`,`data-[dragging=true]:border-dashed data-[dragging=true]:border-ring`,`transition-colors duration-200`)}),children:[(0,X.jsx)(RK,{}),(0,X.jsx)(_M.Input,{placeholder:`请输入你的问题...`,"data-shortkey-ignore":!0,className:Q(`aui-composer-input w-full resize-none bg-transparent px-2.5 py-1`,`max-h-48 min-h-10 text-base leading-6 outline-none`,`text-[#0D0D0D] dark:text-[#ECECEC]`,`caret-[#0D0D0D] dark:caret-[#ECECEC]`,`placeholder:text-[#999999] dark:placeholder:text-[#8E8E8E]`),rows:1,autoFocus:e,enterKeyHint:`send`,"aria-label":`消息输入框`}),(0,X.jsx)(C7,{})]})}),C7=()=>{let{ComposerExtra:e}=(0,h.useContext)(i7),t=Y(e=>e.composer.submission!==void 0&&!(e.thread.isRunning&&e.thread.capabilities.cancel));return(0,X.jsxs)(`div`,{className:`aui-composer-action-wrapper relative flex items-center justify-between`,children:[e?(0,X.jsxs)(`div`,{className:`aui-composer-action-start flex items-center gap-1.5`,children:[(0,X.jsx)(zK,{}),(0,X.jsx)(e,{})]}):(0,X.jsx)(zK,{}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsxs)(Td,{condition:e=>e.thread.capabilities.dictation,children:[(0,X.jsx)(Td,{condition:e=>e.composer.dictation==null,children:(0,X.jsx)(_M.Dictate,{render:(0,X.jsx)(SK,{tooltip:`语音输入`,side:`bottom`,type:`button`,variant:`ghost`,size:`icon`,className:`aui-composer-dictate text-muted-foreground hover:text-foreground size-7 rounded-full`,"aria-label":`开始语音输入`}),children:(0,X.jsx)(HI,{className:`aui-composer-dictate-icon size-4`})})}),(0,X.jsx)(Td,{condition:e=>e.composer.dictation!=null,children:(0,X.jsx)(_M.StopDictation,{render:(0,X.jsx)(SK,{tooltip:`停止语音输入`,side:`bottom`,type:`button`,variant:`ghost`,size:`icon`,className:`aui-composer-stop-dictation text-destructive size-7 rounded-full`,"aria-label":`停止语音输入`}),children:(0,X.jsx)(iL,{className:`aui-composer-stop-dictation-icon size-3.5 animate-pulse fill-current`})})})]}),(0,X.jsx)(Td,{condition:e=>(!e.composer.canCancel||e.thread.voice!==void 0&&e.composer.submission===void 0)&&!Q5(e),children:(0,X.jsx)(_M.Send,{render:(0,X.jsx)(SK,{tooltip:`发送消息`,side:`bottom`,type:`button`,variant:`default`,size:`icon`,className:`aui-composer-send size-7 rounded-full`,"aria-label":`发送消息`}),children:(0,X.jsx)(XF,{className:`aui-composer-send-icon size-4`})})}),(0,X.jsx)(Td,{condition:Q5,children:(0,X.jsx)(_M.Resume,{render:(0,X.jsx)(SK,{tooltip:`继续生成`,side:`bottom`,type:`button`,variant:`default`,size:`icon`,className:`aui-composer-resume size-7 rounded-full`,"aria-label":`继续生成`}),children:(0,X.jsx)(XI,{className:`aui-composer-resume-icon size-4`})})}),(0,X.jsx)(Td,{condition:e=>e.composer.canCancel&&(e.thread.voice===void 0||e.composer.submission!==void 0),children:(0,X.jsx)(_M.Cancel,{render:(0,X.jsx)(JG,{type:`button`,variant:`default`,size:`icon`,className:`aui-composer-cancel size-7 rounded-full`,"aria-label":t?`取消发送`:`停止生成`}),children:(0,X.jsx)(iL,{className:`aui-composer-cancel-icon size-3.5 fill-current`})})})]})]})},w7=()=>(0,X.jsx)(MN.Error,{children:(0,X.jsx)(GM.Root,{className:`aui-message-error-root border-destructive bg-destructive/10 text-destructive dark:bg-destructive/5 mt-2 rounded-md border p-3 text-sm dark:text-red-200`,children:(0,X.jsx)(GM.Message,{className:`aui-message-error-message line-clamp-2`})})}),T7=()=>{let{ToolFallback:e=R5,ToolGroup:t,ReasoningGroup:n,TaskGroup:r}=(0,h.useContext)(i7),i=r?n7:e7;return(0,X.jsxs)(MN.Root,{"data-slot":`aui_assistant-message-root`,"data-role":`assistant`,className:`fade-in slide-in-from-bottom-1 animate-in relative -mb-7.5 pb-7.5 duration-150 [contain-intrinsic-size:auto_200px] [content-visibility:auto]`,children:[(0,X.jsxs)(`div`,{"data-slot":`aui_assistant-message-content`,className:`text-foreground px-2 text-left leading-relaxed wrap-break-word`,children:[(0,X.jsx)(MN.GroupedParts,{groupBy:i,children:({part:i,children:a})=>{switch(i.type){case`group-chainOfThought`:return(0,X.jsx)(`div`,{"data-slot":`aui_chain-of-thought`,children:a});case`group-task`:return r?(0,X.jsx)(r,{group:i}):null;case`group-tool`:return t?(0,X.jsx)(t,{group:i,children:a}):(0,X.jsx)(Z5,{group:i,children:a});case`group-reasoning`:{if(n)return(0,X.jsx)(n,{group:i,children:a});let e=i.status.type===`running`;return(0,X.jsxs)(G8,{streaming:e,children:[(0,X.jsx)(V8,{active:e,duration:$5(i.timing)}),(0,X.jsx)(H8,{"aria-busy":e,children:(0,X.jsx)(U8,{children:a})})]})}case`text`:return(0,X.jsx)(Z6,{});case`reasoning`:return(0,X.jsx)(J8,A({},i));case`tool-call`:var o;return(o=i.toolUI)==null?(0,X.jsx)(e,A({},i)):o;case`data`:return i.dataRendererUI;case`file`:return(0,X.jsx)(`div`,{"data-slot":`aui_assistant-message-file`,className:`py-1`,children:(0,X.jsx)(D7,A({},i))});case`image`:return(0,X.jsx)(`div`,{"data-slot":`aui_assistant-message-image`,className:`py-1`,children:(0,X.jsx)(Jq,A({},i))});case`indicator`:return(0,X.jsx)(`span`,{"data-slot":`aui_assistant-message-indicator`,className:`animate-pulse font-sans`,"aria-label":`助手正在处理`,children:`●`});default:return null}}}),(0,X.jsx)(w7,{})]}),(0,X.jsxs)(`div`,{"data-slot":`aui_assistant-message-footer`,className:Q(`ms-2 flex items-center`,`min-h-7.5 pt-1.5`),children:[(0,X.jsx)(N7,{}),(0,X.jsx)(E7,{})]})]})},E7=()=>(0,X.jsxs)(xk.Root,{hideWhenRunning:!0,autohide:`not-last`,className:`aui-assistant-action-bar-root text-muted-foreground animate-in fade-in col-start-3 row-start-2 -ms-1 flex gap-1 duration-200`,children:[(0,X.jsxs)(xk.Copy,{render:(0,X.jsx)(SK,{tooltip:`复制`}),children:[(0,X.jsx)(Td,{condition:e=>e.message.isCopied,children:(0,X.jsx)(iI,{className:`animate-in zoom-in-50 fade-in duration-200 ease-out`})}),(0,X.jsx)(Td,{condition:e=>!e.message.isCopied,children:(0,X.jsx)(vI,{className:`animate-in zoom-in-75 fade-in duration-150`})})]}),(0,X.jsxs)(Td,{condition:e=>e.thread.capabilities.feedback,children:[(0,X.jsx)(xk.FeedbackPositive,{render:(0,X.jsx)(SK,{tooltip:`有帮助`,className:`data-[submitted=true]:bg-accent data-[submitted=true]:text-accent-foreground`}),children:(0,X.jsx)(oL,{})}),(0,X.jsx)(xk.FeedbackNegative,{render:(0,X.jsx)(SK,{tooltip:`没有帮助`,className:`data-[submitted=true]:bg-accent data-[submitted=true]:text-accent-foreground`}),children:(0,X.jsx)(cL,{})})]}),(0,X.jsx)(xk.Reload,{render:(0,X.jsx)(SK,{tooltip:`重新生成`}),children:(0,X.jsx)(eL,{})}),(0,X.jsxs)(Lk.Root,{children:[(0,X.jsx)(Lk.Trigger,{render:(0,X.jsx)(SK,{tooltip:`更多`,className:`data-[state=open]:bg-accent`}),children:(0,X.jsx)(wI,{})}),(0,X.jsx)(Lk.Content,{side:`bottom`,align:`start`,sideOffset:6,className:`aui-action-bar-more-content bg-popover text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out 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 z-50 min-w-[128px] overflow-hidden rounded-xl border p-1.5`,children:(0,X.jsxs)(xk.ExportMarkdown,{render:(0,X.jsx)(Lk.Item,{className:`aui-action-bar-more-item hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none`}),children:[(0,X.jsx)(bI,{className:`size-4`}),`导出为 Markdown`]})})]})]}),D7=e=>{let t=e.mimeType.toLowerCase().startsWith(`image/`)?sq(e.data,e.mimeType,e.sourceType):null;return t?(0,X.jsx)(Jq,A({type:`image`,image:t,status:e.status},e.filename!==void 0&&{filename:e.filename})):(0,X.jsx)(yq,A({},e))},O7=e=>(0,X.jsx)(`div`,{"data-slot":`aui_user-message-file`,className:`py-1`,children:(0,X.jsx)(D7,A({},e))}),k7=e=>(0,X.jsx)(`div`,{"data-slot":`aui_user-message-image`,className:`py-1`,children:(0,X.jsx)(Jq,A({},e))}),A7=()=>(0,X.jsxs)(MN.Root,{"data-slot":`aui_user-message-root`,className:`fade-in slide-in-from-bottom-1 animate-in grid auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 duration-150 [contain-intrinsic-size:auto_200px] [content-visibility:auto] [&:where(>*)]:col-start-2`,"data-role":`user`,children:[(0,X.jsx)(LK,{}),(0,X.jsx)(`div`,{className:`aui-user-message-content-wrapper relative col-start-2 min-w-0`,children:(0,X.jsx)(`div`,{className:`aui-user-message-content peer rounded-(--composer-radius) bg-muted px-4 py-2 text-foreground wrap-break-word empty:hidden`,children:(0,X.jsx)(MN.Parts,{components:{File:O7,Image:k7}})})}),(0,X.jsx)(`div`,{className:`col-start-2 -mt-1 flex justify-end min-h-8`,children:(0,X.jsx)(j7,{})}),(0,X.jsx)(N7,{"data-slot":`aui_user-branch-picker`,className:`col-span-full col-start-1 -me-1 justify-end`})]}),j7=()=>(0,X.jsxs)(xk.Root,{hideWhenRunning:!0,autohide:`not-last`,className:`aui-user-action-bar-root flex flex-row items-center gap-1`,children:[(0,X.jsxs)(xk.Copy,{render:(0,X.jsx)(SK,{tooltip:`复制`,className:`aui-user-action-copy size-8 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`}),children:[(0,X.jsx)(Td,{condition:e=>e.message.isCopied,children:(0,X.jsx)(iI,{className:`animate-in zoom-in-50 fade-in duration-200 ease-out`})}),(0,X.jsx)(Td,{condition:e=>!e.message.isCopied,children:(0,X.jsx)(vI,{className:`animate-in zoom-in-75 fade-in duration-150`})})]}),(0,X.jsx)(xk.Edit,{render:(0,X.jsx)(SK,{tooltip:`编辑`,className:`aui-user-action-edit size-8 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`}),children:(0,X.jsx)(KI,{className:`size-4`})})]}),M7=()=>(0,X.jsx)(MN.Root,{"data-slot":`aui_edit-composer-wrapper`,className:`flex flex-col px-2 [contain-intrinsic-size:auto_200px] [content-visibility:auto]`,children:(0,X.jsxs)(_M.Root,{className:Q(`aui-edit-composer-root ms-auto flex w-full max-w-[85%] cursor-text flex-col`,`rounded-[20px] p-2.5`,`bg-white dark:bg-[#212121]`,`border border-solid border-[#F0F0F0] dark:border-[#303030]`,`hover:border-[#E8E8E8] dark:hover:border-[#383838]`,`focus-within:border-[#DCDCDC] dark:focus-within:border-[#404040]`,`transition-colors duration-200`),children:[(0,X.jsx)(_M.Input,{"data-shortkey-ignore":!0,className:Q(`aui-edit-composer-input min-h-14 w-full resize-none bg-transparent`,`px-2.5 pt-1 pb-2 text-base leading-6 outline-none`,`text-[#0D0D0D] dark:text-[#ECECEC]`,`caret-[#0D0D0D] dark:caret-[#ECECEC]`,`placeholder:text-[#999999] dark:placeholder:text-[#8E8E8E]`),autoFocus:!0}),(0,X.jsxs)(`div`,{className:`aui-edit-composer-footer mx-1 mb-0.5 flex items-center gap-2 self-end`,children:[(0,X.jsx)(_M.Cancel,{render:(0,X.jsx)(JG,{variant:`ghost`,size:`sm`,className:`h-8 rounded-full px-3 text-muted-foreground hover:bg-muted`}),children:`取消`}),(0,X.jsx)(_M.Send,{render:(0,X.jsx)(JG,{size:`sm`,className:`h-8 rounded-full px-4`}),children:`更新`})]})]})}),N7=e=>{let{className:t}=e,n=G(e,X5);return(0,X.jsxs)(tA.Root,A(A({hideWhenSingleBranch:!0,className:Q(`aui-branch-picker-root text-muted-foreground -ms-2 me-2 inline-flex items-center text-xs`,t)},n),{},{children:[(0,X.jsx)(tA.Previous,{render:(0,X.jsx)(SK,{tooltip:`上一条回复`}),children:(0,X.jsx)(cI,{})}),(0,X.jsxs)(`span`,{className:`aui-branch-picker-state font-medium`,children:[(0,X.jsx)(tA.Number,{}),` /`,` `,(0,X.jsx)(tA.Count,{})]}),(0,X.jsx)(tA.Next,{render:(0,X.jsx)(SK,{tooltip:`下一条回复`}),children:(0,X.jsx)(uI,{})})]}))};function P7({onSelect:e}){return(0,X.jsxs)(`div`,{className:`flex h-full flex-col bg-background text-foreground`,children:[(0,X.jsx)(`div`,{className:`p-4`,children:(0,X.jsxs)(HP.New,{render:(0,X.jsx)(`button`,{type:`button`,onClick:e,className:`\r
95
95
  flex w-full items-center justify-center gap-2\r
96
96
  rounded-lg border border-border\r
97
97
  bg-background px-4 py-3\r
98
98
  text-sm font-medium text-foreground\r
99
99
  transition-colors\r
100
100
  hover:bg-accent hover:text-accent-foreground\r
101
- `}),children:[(0,X.jsx)(XI,{className:`size-4`}),`新建对话`]})}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-4`,children:[(0,X.jsx)(`div`,{className:`mb-3 px-2 text-xs font-medium text-muted-foreground`,children:`历史对话`}),(0,X.jsx)(HP.Items,{children:({threadListItem:t})=>(0,X.jsxs)(YP.Root,{className:`\r
101
+ `}),children:[(0,X.jsx)(QI,{className:`size-4`}),`新建对话`]})}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-4`,children:[(0,X.jsx)(`div`,{className:`mb-3 px-2 text-xs font-medium text-muted-foreground`,children:`历史对话`}),(0,X.jsx)(HP.Items,{children:({threadListItem:t})=>(0,X.jsxs)(YP.Root,{className:`\r
102
102
  group mb-1 flex items-center rounded-lg\r
103
103
  text-foreground transition-colors\r
104
104
  hover:bg-accent hover:text-accent-foreground\r
@@ -107,7 +107,7 @@ Check the top-level render call using <`+n+`>.`)}return t}function Ne(e,t){if(e.
107
107
  `,children:[(0,X.jsxs)(YP.Trigger,{render:(0,X.jsx)(`button`,{type:`button`,onClick:e,className:`\r
108
108
  flex min-w-0 flex-1 items-center gap-3\r
109
109
  px-3 py-3 text-left text-sm\r
110
- `}),children:[(0,X.jsx)(II,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,X.jsx)(YP.Title,{fallback:`新对话`})})]}),(0,X.jsx)(YP.Delete,{render:(0,X.jsx)(`button`,{type:`button`,className:`\r
110
+ `}),children:[(0,X.jsx)(RI,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,X.jsx)(YP.Title,{fallback:`新对话`})})]}),(0,X.jsx)(YP.Delete,{render:(0,X.jsx)(`button`,{type:`button`,className:`\r
111
111
  mr-2 rounded-md p-2\r
112
112
  text-muted-foreground\r
113
113
  opacity-0 transition-colors\r
@@ -115,4 +115,4 @@ Check the top-level render call using <`+n+`>.`)}return t}function Ne(e,t){if(e.
115
115
  hover:text-destructive\r
116
116
  group-hover:opacity-100\r
117
117
  focus-visible:opacity-100\r
118
- `,title:`删除对话`}),children:(0,X.jsx)(cL,{className:`size-4`})})]},t.id)})]})]})}function j7(){let[e,t]=(0,h.useState)(`chat`),n=()=>{t(`chat`)};return(0,X.jsxs)(HP.Root,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center border-b bg-background px-2`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-9 flex-1 items-center justify-center gap-2 rounded-md text-sm transition-colors ${e===`chat`?`bg-accent font-medium text-foreground`:`text-muted-foreground hover:bg-accent/50`}`,children:[(0,X.jsx)(II,{className:`size-4`}),`对话`]}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>t(`conversations`),className:`flex h-9 flex-1 items-center justify-center gap-2 rounded-md text-sm transition-colors ${e===`conversations`?`bg-accent font-medium text-foreground`:`text-muted-foreground hover:bg-accent/50`}`,children:[(0,X.jsx)(RI,{className:`size-4`}),`所有对话`]})]}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 flex-col overflow-hidden ${e===`chat`?`flex`:`hidden`}`,children:(0,X.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,X.jsx)(i7,{})})}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden ${e===`conversations`?`block`:`hidden`}`,children:(0,X.jsx)(A7,{onSelect:n})})]})}e.ChatApp=j7,e.ChatRuntimeProvider=OF});
118
+ `,title:`删除对话`}),children:(0,X.jsx)(uL,{className:`size-4`})})]},t.id)})]})]})}function F7(){let[e,t]=(0,h.useState)(`chat`),n=Y(e=>e.threadListItem.title),r=()=>{t(`chat`)};return(0,X.jsxs)(HP.Root,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center border-b bg-background px-2`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:r,className:`flex h-9 min-w-0 overflow-hidden flex-1 items-center justify-center gap-2 rounded-md text-sm transition-colors ${e===`chat`?`bg-accent font-medium text-foreground`:`text-muted-foreground hover:bg-accent/50`}`,children:[(0,X.jsx)(RI,{className:`size-4 shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate text-center`,children:n||`对话`})]}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>t(`conversations`),className:`flex h-9 flex-1 items-center justify-center gap-2 rounded-md text-sm transition-colors ${e===`conversations`?`bg-accent font-medium text-foreground`:`text-muted-foreground hover:bg-accent/50`}`,children:[(0,X.jsx)(BI,{className:`size-4`}),`所有对话`]})]}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 flex-col overflow-hidden ${e===`chat`?`flex`:`hidden`}`,children:(0,X.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,X.jsx)(c7,{})})}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden ${e===`conversations`?`block`:`hidden`}`,children:(0,X.jsx)(P7,{onSelect:r})})]})}e.ChatApp=F7,e.ChatRuntimeProvider=AF});