@north-light/crouter 0.3.169 → 0.3.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-root.d.ts +1 -16
- package/dist/build-root.js +1 -25
- package/dist/builtin-memory/insights/capture.md +66 -0
- package/dist/builtin-memory/insights/init.md +45 -0
- package/dist/builtin-memory/internal/plugins.md +12 -11
- package/dist/cli.js +2 -6
- package/dist/clients/attach/__tests__/attach-keybindings.test.js +7 -1
- package/dist/clients/attach/__tests__/context-message.test.js +50 -3
- package/dist/clients/attach/__tests__/diagram.test.js +1 -1
- package/dist/clients/attach/chrome/header.d.ts +10 -0
- package/dist/clients/attach/chrome/header.js +35 -0
- package/dist/clients/attach/chrome/status-line.d.ts +3 -0
- package/dist/clients/attach/chrome/status-line.js +5 -0
- package/dist/clients/attach/chrome/widgets.js +7 -18
- package/dist/clients/attach/input/controller.d.ts +10 -0
- package/dist/clients/attach/input/controller.js +3 -0
- package/dist/clients/attach/overlays/help.d.ts +33 -0
- package/dist/clients/attach/overlays/help.js +204 -0
- package/dist/clients/attach/render/chat-view.d.ts +81 -9
- package/dist/clients/attach/render/chat-view.js +434 -90
- package/dist/clients/attach/render/context-message.js +3 -3
- package/dist/clients/attach/render/diagram.js +2 -2
- package/dist/clients/attach/render/measured-container.d.ts +94 -0
- package/dist/clients/attach/render/measured-container.js +307 -0
- package/dist/clients/attach/render/transcript-copy.d.ts +9 -0
- package/dist/clients/attach/render/transcript-copy.js +81 -0
- package/dist/clients/attach/render/viewport.d.ts +29 -0
- package/dist/clients/attach/render/viewport.js +160 -0
- package/dist/clients/attach/session/bindings.d.ts +5 -1
- package/dist/clients/attach/session/bindings.js +16 -0
- package/dist/clients/attach/session/context.d.ts +5 -3
- package/dist/clients/attach/session/frame.d.ts +34 -0
- package/dist/clients/attach/session/frame.js +173 -0
- package/dist/clients/attach/session/frames.d.ts +2 -0
- package/dist/clients/attach/session/frames.js +3 -0
- package/dist/clients/attach/session/input-wiring.d.ts +10 -4
- package/dist/clients/attach/session/input-wiring.js +13 -13
- package/dist/clients/attach/session/keys.d.ts +4 -1
- package/dist/clients/attach/session/keys.js +9 -4
- package/dist/clients/attach/session/layout.d.ts +10 -8
- package/dist/clients/attach/session/layout.js +32 -31
- package/dist/clients/attach/session/mouse.d.ts +15 -0
- package/dist/clients/attach/session/mouse.js +61 -0
- package/dist/clients/attach/slash/dispatch.d.ts +10 -0
- package/dist/clients/attach/slash/dispatch.js +35 -2
- package/dist/clients/attach/viewer.js +605 -581
- package/dist/clients/web/dev-server.d.ts +4 -1
- package/dist/clients/web/dev-server.js +8 -19
- package/dist/clients/web/web-cmd.js +1 -1
- package/dist/commands/human/prompts.js +16 -6
- package/dist/commands/pkg/plugin-manage.js +143 -68
- package/dist/commands/sys/__tests__/setup-core.test.js +4 -2
- package/dist/commands/sys/setup-core.js +21 -16
- package/dist/core/__tests__/human-deliver.test.js +62 -2
- package/dist/core/clipboard-text.d.ts +8 -0
- package/dist/core/clipboard-text.js +18 -0
- package/dist/core/command-manifests/registry.d.ts +1 -3
- package/dist/core/command-plugins/bundle.d.ts +29 -0
- package/dist/core/command-plugins/bundle.js +198 -0
- package/dist/core/command-plugins/discovery.d.ts +0 -8
- package/dist/core/command-plugins/discovery.js +2 -39
- package/dist/core/command-plugins/transport/http-fetch.d.ts +4 -30
- package/dist/core/command-plugins/transport/http-fetch.js +17 -95
- package/dist/core/command.d.ts +9 -13
- package/dist/core/command.js +12 -17
- package/dist/core/config.js +2 -1
- package/dist/core/keybindings/__tests__/resolve.test.js +4 -0
- package/dist/core/keybindings/attach-control.d.ts +3 -0
- package/dist/core/keybindings/attach-control.js +1 -0
- package/dist/core/keybindings/catalog.d.ts +2 -2
- package/dist/core/keybindings/catalog.js +8 -0
- package/dist/core/runtime/broker-protocol.d.ts +13 -1
- package/dist/core/runtime/broker.js +213 -5
- package/dist/core/runtime/canvas-extensions.d.ts +3 -0
- package/dist/core/runtime/canvas-extensions.js +3 -0
- package/dist/core/runtime/front-door.js +4 -4
- package/dist/core/runtime/kickoff.d.ts +1 -5
- package/dist/core/runtime/kickoff.js +1 -5
- package/dist/core/runtime/naming.d.ts +7 -0
- package/dist/core/runtime/naming.js +5 -2
- package/dist/core/runtime/node-read.js +15 -0
- package/dist/core/runtime/package-health.d.ts +6 -21
- package/dist/core/runtime/package-health.js +12 -123
- package/dist/core/runtime/stop-guard.d.ts +1 -1
- package/dist/core/runtime/stop-guard.js +3 -3
- package/dist/core/runtime/tool-group-summary.d.ts +19 -0
- package/dist/core/runtime/tool-group-summary.js +117 -0
- package/dist/core/termrender/code-doc.d.ts +12 -0
- package/dist/core/termrender/code-doc.js +91 -0
- package/dist/core/termrender/display.d.ts +12 -0
- package/dist/core/termrender/display.js +19 -0
- package/dist/core/termrender/termrender.d.ts +73 -0
- package/dist/core/termrender/termrender.js +795 -0
- package/dist/core/termrender/version.d.ts +1 -0
- package/dist/core/termrender/version.js +1 -0
- package/dist/core/user-settings.d.ts +14 -0
- package/dist/core/user-settings.js +20 -0
- package/dist/daemon/crtrd.js +5 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/pi-extensions/__tests__/canvas-structured-output.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-structured-output.test.js +63 -0
- package/dist/pi-extensions/canvas-stophook.js +2 -2
- package/dist/pi-extensions/canvas-structured-output.js +52 -8
- package/dist/pi-extensions/summary-tool.d.ts +33 -0
- package/dist/pi-extensions/summary-tool.js +62 -0
- package/dist/shared/generated-context.d.ts +19 -4
- package/dist/shared/generated-context.js +98 -7
- package/dist/shared/tool-groups.d.ts +23 -0
- package/dist/shared/tool-groups.js +60 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.js +1 -0
- package/dist/web-client/assets/{index-U_NZ66VE.js → index-D7I3gHCL.js} +26 -19
- package/dist/web-client/index.html +1 -1
- package/dist/web-client/sw.js +1 -1
- package/package.json +3 -1
- package/runtime.lock.json +62 -3
- package/scripts/postinstall.mjs +14 -1
- package/dist/core/command-plugins/store.d.ts +0 -16
- package/dist/core/command-plugins/store.js +0 -64
- package/dist/core/runtime/fault-recovery-nudge.d.ts +0 -3
- package/dist/core/runtime/fault-recovery-nudge.js +0 -3
|
@@ -48,32 +48,39 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
48
48
|
`},ro=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},io=function(){v.useEffect(function(){return document.body.setAttribute(to,(ro()+1).toString()),function(){var e=ro()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,e.toString())}},[])},ao=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;io();var a=v.useMemo(function(){return $a(i)},[i]);return v.createElement(eo,{styles:no(a,!t,i,n?``:`!important`)})},oo=!1;if(typeof window<`u`)try{var so=Object.defineProperty({},"passive",{get:function(){return oo=!0,!0}});window.addEventListener(`test`,so,so),window.removeEventListener(`test`,so,so)}catch{oo=!1}var co=oo?{passive:!1}:!1,lo=function(e){return e.tagName===`TEXTAREA`},uo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!lo(e)&&n[t]===`visible`)},fo=function(e){return uo(e,`overflowY`)},V=function(e){return uo(e,`overflowX`)},po=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),go(e,r)){var i=_o(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mo=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ho=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},go=function(e,t){return e===`v`?fo(t):V(t)},_o=function(e,t){return e===`v`?mo(t):ho(t)},vo=function(e,t){return e===`h`&&t===`rtl`?-1:1},yo=function(e,t,n,r,i){var a=vo(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=_o(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&go(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},bo=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xo=function(e){return[e.deltaX,e.deltaY]},So=function(e){return e&&`current`in e?e.current:e},Co=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wo=function(e){return`
|
|
49
49
|
.block-interactivity-${e} {pointer-events: none;}
|
|
50
50
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
51
|
-
`},To=0,Eo=[];function Do(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(To++)[0],a=v.useState(Ya)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=wa([e.lockRef.current],(e.shards||[]).map(So),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=bo(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>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=po(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=po(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return yo(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!Eo.length||Eo[Eo.length-1]!==a)){var r=`deltaY`in n?xo(n):bo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Co(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(So).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Oo(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=bo(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,xo(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,bo(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Eo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,co),document.addEventListener(`touchmove`,c,co),document.addEventListener(`touchstart`,u,co),function(){Eo=Eo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,co),document.removeEventListener(`touchmove`,c,co),document.removeEventListener(`touchstart`,u,co)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:wo(i)}):null,p?v.createElement(ao,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Oo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ko=Ra(za,Do),Ao=v.forwardRef(function(e,t){return v.createElement(Va,Sa({},e,{ref:t,sideCar:ko}))});Ao.classNames=Va.classNames;var jo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Mo=new WeakMap,No=new WeakMap,Po={},Fo=0,Io=function(e){return e&&(e.host||Io(e.parentNode))},Lo=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Io(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ro=function(e,t,n,r){var i=Lo(t,Array.isArray(e)?e:[e]);Po[n]||(Po[n]=new WeakMap);var a=Po[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Mo.get(e)||0)+1,l=(a.get(e)||0)+1;Mo.set(e,c),a.set(e,l),o.push(e),c===1&&i&&No.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Fo++,function(){o.forEach(function(e){var t=Mo.get(e)-1,i=a.get(e)-1;Mo.set(e,t),a.set(e,i),t||(No.has(e)||e.removeAttribute(r),No.delete(e)),i||e.removeAttribute(n)}),Fo--,Fo||(Mo=new WeakMap,Mo=new WeakMap,No=new WeakMap,Po={})}},zo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||jo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ro(r,i,n,`aria-hidden`)):function(){return null}},Bo=Object.defineProperty,Vo=(e,t)=>Bo(e,`name`,{value:t,configurable:!0}),Ho=`Dialog`,[Uo,Wo]=kr(Ho),[Go,Ko]=Uo(Ho),qo=Vo(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),{nodes:l,registry:u}=ea(),[d,f]=si({prop:r,defaultProp:i??!1,onChange:a,caller:Ho}),[p,m]=v.useState(0),[h,g]=v.useState(0);return(0,z.jsx)(Go,{scope:t,triggerRef:s,contentRef:c,contentId:Ti(),titleId:Ti(),descriptionId:Ti(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Jo=`DialogPortal`,[Yo,Xo]=Uo(Jo,{forceMount:void 0}),Zo=Vo(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ko(Jo,t);return(0,z.jsx)(Yo,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(ma,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Qo=`DialogOverlay`,$o=v.forwardRef(Vo(function(e,t){let n=Xo(Qo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ko(Qo,e.__scopeDialog);return a.modal?(0,z.jsx)(hi,{present:r||a.open,children:(0,z.jsx)(ts,{...i,ref:t})}):null},`DialogOverlay`)),es=cr(`DialogOverlay.RemoveScroll`),ts=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(Qo,n),a=tr(t,Bi());return(0,z.jsx)(Ao,{as:es,allowPinchZoom:!0,shards:v.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,z.jsx)(Cr.div,{"data-state":fs(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ns=`DialogContent`,rs=v.forwardRef(Vo(function(e,t){let n=Xo(ns,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ko(ns,e.__scopeDialog);return(0,z.jsx)(hi,{present:r||a.open,children:a.modal?(0,z.jsx)(is,{...i,ref:t}):(0,z.jsx)(as,{...i,ref:t})})},`DialogContent`)),is=v.forwardRef(Vo(function(e,t){let n=Ko(ns,e.__scopeDialog),r=v.useRef(null),i=tr(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return zo(e)},[]),(0,z.jsx)(os,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:qr(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:qr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:qr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),as=v.forwardRef(Vo(function(e,t){let n=Ko(ns,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,z.jsx)(os,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),os=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,...s}=e,{children:c,...l}=s,u=Ko(ns,n);return ba(),(0,z.jsx)(z.Fragment,{children:(0,z.jsx)(Zi,{asChild:!0,loop:!0,trapped:r,branches:u.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(zi,{role:`dialog`,id:u.contentId,"aria-labelledby":u.titlePresent?u.titleId:void 0,"aria-describedby":u.descriptionPresent?ds(o,u.descriptionId):o,"data-state":fs(u.open),...l,ref:t,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:(0,z.jsx)($i,{value:u.branchRegistry,children:c})})})})},`DialogContentImpl`)),ss=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(`DialogTitle`,n),{setTitleCount:a}=i;return Qr(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,z.jsx)(Cr.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),cs=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(`DialogDescription`,n),{setDescriptionCount:a}=i;return Qr(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,z.jsx)(Cr.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ls=`DialogClose`,us=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(ls,n);return(0,z.jsx)(Cr.button,{type:`button`,...r,ref:t,onClick:qr(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function ds(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Vo(ds,`concatAriaDescribedby`);function fs(e){return e?`open`:`closed`}Vo(fs,`getState`);var ps=Object.defineProperty,ms=(e,t)=>ps(e,`name`,{value:t,configurable:!0});function hs(e){let[t,n]=v.useState(void 0);return Qr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}ms(hs,`useSize`);var gs=[`top`,`right`,`bottom`,`left`],_s=Math.min,vs=Math.max,ys=Math.round,bs=Math.floor,xs=e=>({x:e,y:e}),Ss={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Cs(e,t,n){return vs(e,_s(t,n))}function ws(e,t){return typeof e==`function`?e(t):e}function Ts(e){return e.split(`-`)[0]}function Es(e){return e.split(`-`)[1]}function Ds(e){return e===`x`?`y`:`x`}function Os(e){return e===`y`?`height`:`width`}function ks(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function As(e){return Ds(ks(e))}function js(e,t,n){n===void 0&&(n=!1);let r=Es(e),i=As(e),a=Os(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Bs(o)),[o,Bs(o)]}function Ms(e){let t=Bs(e);return[Ns(e),t,Ns(t)]}function Ns(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ps=[`left`,`right`],Fs=[`right`,`left`],Is=[`top`,`bottom`],Ls=[`bottom`,`top`];function Rs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fs:Ps:t?Ps:Fs;case`left`:case`right`:return t?Is:Ls;default:return[]}}function zs(e,t,n,r){let i=Es(e),a=Rs(Ts(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ns)))),a}function Bs(e){let t=Ts(e);return Ss[t]+e.slice(t.length)}function Vs(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Hs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Vs(e)}function Us(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ws(e,t,n){let{reference:r,floating:i}=e,a=ks(t),o=As(t),s=Os(o),c=Ts(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Es(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Gs(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ws(t,e),p=Hs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Us(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Us(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ks=50,qs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Gs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ws(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ks&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ws(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Js=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ws(e,t)||{};if(l==null)return{};let d=Hs(u),f={x:n,y:r},p=As(i),m=Os(p),h=await 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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=_s(d[_],T),D=_s(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Cs(E,k,O),j=!c.arrow&&Es(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Ys=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ws(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ts(r),_=ks(o),v=Ts(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Bs(o)]:Ms(o)),x=p!==`none`;!d&&x&&b.push(...zs(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=js(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ks(t))||T.every(e=>ks(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ks(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Xs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zs(e){return gs.some(t=>e[t]>=0)}var Qs=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ws(e,t);switch(i){case`referenceHidden`:{let e=Xs(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Zs(e)}}}case`escaped`:{let e=Xs(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Zs(e)}}}default:return{}}}}},$s=new Set([`left`,`top`]);async function ec(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ts(n),s=Es(n),c=ks(n)===`y`,l=$s.has(o)?-1:1,u=a&&c?-1:1,d=ws(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var tc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ec(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},nc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ws(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ks(i),p=Ds(f),m=u[p],h=u[f],g=(e,t)=>Cs(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},rc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ws(e,t),u={x:n,y:r},d=ks(i),f=Ds(d),p=u[f],m=u[d],h=ws(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$s.has(Ts(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ic=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ws(e,t),c=await i.detectOverflow(t,s),l=Ts(n),u=Es(n),d=ks(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=_s(p-c[m],g),y=_s(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*vs(c.left,c.right):S=p-2*vs(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ac(){return typeof window<`u`}function oc(e){return lc(e)?(e.nodeName||``).toLowerCase():`#document`}function sc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cc(e){return((lc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function lc(e){return ac()?e instanceof Node||e instanceof sc(e).Node:!1}function uc(e){return ac()?e instanceof Element||e instanceof sc(e).Element:!1}function dc(e){return ac()?e instanceof HTMLElement||e instanceof sc(e).HTMLElement:!1}function fc(e){return!ac()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof sc(e).ShadowRoot}function pc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=wc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function mc(e){return/^(table|td|th)$/.test(oc(e))}function hc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gc=/transform|translate|scale|rotate|perspective|filter/,_c=/paint|layout|strict|content/,vc=e=>!!e&&e!==`none`,yc;function bc(e){let t=uc(e)?wc(e):e;return vc(t.transform)||vc(t.translate)||vc(t.scale)||vc(t.rotate)||vc(t.perspective)||!Sc()&&(vc(t.backdropFilter)||vc(t.filter))||gc.test(t.willChange||``)||_c.test(t.contain||``)}function xc(e){let t=Ec(e);for(;dc(t)&&!Cc(t);){if(bc(t))return t;if(hc(t))return null;t=Ec(t)}return null}function Sc(){return yc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),yc}function Cc(e){return/^(html|body|#document)$/.test(oc(e))}function wc(e){return sc(e).getComputedStyle(e)}function Tc(e){return uc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ec(e){if(oc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fc(e)&&e.host||cc(e);return fc(t)?t.host:t}function Dc(e){let t=Ec(e);return Cc(t)?(e.ownerDocument||e).body:dc(t)&&pc(t)?t:Dc(t)}function Oc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Dc(e),i=r===e.ownerDocument?.body,a=sc(r);if(i){let e=kc(a);return t.concat(a,a.visualViewport||[],pc(r)?r:[],e&&n?Oc(e):[])}else return t.concat(r,Oc(r,[],n))}function kc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ac(e){let t=wc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=dc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ys(n)!==a||ys(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function jc(e){return uc(e)?e:e.contextElement}function Mc(e){let t=jc(e);if(!dc(t))return xs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ac(t),o=(a?ys(n.width):n.width)/r,s=(a?ys(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Nc=xs(0);function Pc(e){let t=sc(e);return!Sc()||!t.visualViewport?Nc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===sc(e)}function Ic(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=jc(e),o=xs(1);t&&(r?uc(r)&&(o=Mc(r)):o=Mc(e));let s=Fc(a,n,r)?Pc(a):xs(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=sc(a),t=uc(r)?sc(r):r,n=e,i=kc(n);for(;i&&t!==n;){let e=Mc(i),t=i.getBoundingClientRect(),r=wc(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=sc(i),i=kc(n)}}return Us({width:u,height:d,x:c,y:l})}function Lc(e,t){let n=Tc(e).scrollLeft;return t?t.left+n:Ic(cc(e)).left+n}function Rc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lc(e,n),y:n.top+t.scrollTop}}function zc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cc(r),s=t?hc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=xs(1),u=xs(0),d=dc(r);if((d||!a)&&((oc(r)!==`body`||pc(o))&&(c=Tc(r)),d)){let e=Ic(r);l=Mc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rc(o,c):xs(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Vc(e){let t=Tc(e),n=e.ownerDocument.body,r=vs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=vs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Lc(e),o=-t.scrollTop;return wc(n).direction===`rtl`&&(a+=vs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Hc=25;function Uc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=sc(e),a=cc(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Sc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Lc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Hc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Wc(e,t){let n=Ic(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Mc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Uc(e,n,t);else if(t===`document`)r=Vc(cc(e));else if(uc(t))r=Wc(t,n);else{let n=Pc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Us(r)}function Kc(e,t){let n=t.get(e);if(n)return n;let r=Oc(e,[],!1).filter(e=>uc(e)&&oc(e)!==`body`),i=null,a=wc(e).position===`fixed`,o=a?Ec(e):e;for(;uc(o)&&!Cc(o);){let e=wc(o),t=bc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ec(o)}return t.set(e,r),r}function qc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hc(t)?[]:Kc(t,this._c):[].concat(n),r],o=Gc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Gc(t,a[e],i);s=vs(n.top,s),c=_s(n.right,c),l=_s(n.bottom,l),u=vs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Jc(e){let{width:t,height:n}=Ac(e);return{width:t,height:n}}function Yc(e,t,n){let r=dc(t),i=cc(t),a=n===`fixed`,o=Ic(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=xs(0);if((r||!a)&&((oc(t)!==`body`||pc(i))&&(s=Tc(t)),r)){let e=Ic(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Lc(i));let l=i&&!r&&!a?Rc(i,s):xs(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Xc(e){return wc(e).position===`static`}function Zc(e,t){if(!dc(e)||wc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cc(e)===n&&(n=n.ownerDocument.body),n}function Qc(e,t){let n=sc(e);if(hc(e))return n;if(!dc(e)){let t=Ec(e);for(;t&&!Cc(t);){if(uc(t)&&!Xc(t))return t;t=Ec(t)}return n}let r=Zc(e,t);for(;r&&mc(r)&&Xc(r);)r=Zc(r,t);return r&&Cc(r)&&Xc(r)&&!bc(r)?n:r||xc(e)||n}var $c=async function(e){let t=this.getOffsetParent||Qc,n=this.getDimensions,r=await n(e.floating);return{reference:Yc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function el(e){return wc(e).direction===`rtl`}var tl={convertOffsetParentRelativeRectToViewportRelativeRect:zc,getDocumentElement:cc,getClippingRect:qc,getOffsetParent:Qc,getElementRects:$c,getClientRects:Bc,getDimensions:Jc,getScale:Mc,isElement:uc,isRTL:el};function nl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rl(e,t,n){let r=null,i,a=cc(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=bs(d),h=bs(a.clientWidth-(u+f)),g=bs(a.clientHeight-(d+p)),_=bs(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:vs(0,_s(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!nl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=sc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function il(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=jc(e),u=i||a?[...l?Oc(l):[],...t?Oc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?rl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ic(e):null;c&&g();function g(){let t=Ic(e);h&&!nl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var al=tc,ol=nc,sl=Ys,cl=ic,ll=Qs,ul=Js,dl=rc,fl=(e,t,n)=>{let r=new Map,i=n??{},a={...tl,...i.platform,_c:r};return qs(e,t,{...i,platform:a})},pl=typeof document<`u`?v.useLayoutEffect:function(){};function ml(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ml(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ml(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function hl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gl(e,t){let n=hl(e);return Math.round(t*n)/n}function _l(e){let t=v.useRef(e);return pl(()=>{t.current=e}),t}function vl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);ml(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),b=v.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=v.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=v.useRef(null),T=v.useRef(null),E=v.useRef(u),D=c!=null,O=_l(c),k=_l(i),A=_l(l),j=v.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),fl(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!ml(E.current,t)&&(E.current=t,y.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);pl(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=v.useRef(!1);pl(()=>(M.current=!0,()=>{M.current=!1}),[]),pl(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let ee=v.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),N=v.useMemo(()=>({reference:S,floating:C}),[S,C]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=gl(N.floating,u.x),r=gl(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...hl(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:j,refs:ee,elements:N,floatingStyles:P}),[u,j,ee,N,P])}var yl=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ul({element:r.current,padding:i}).fn(n):r?ul({element:r,padding:i}).fn(n):{}}}},bl=(e,t)=>{let n=al(e);return{name:n.name,fn:n.fn,options:[e,t]}},xl=(e,t)=>{let n=ol(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sl=(e,t)=>({fn:dl(e).fn,options:[e,t]}),Cl=(e,t)=>{let n=sl(e);return{name:n.name,fn:n.fn,options:[e,t]}},wl=(e,t)=>{let n=cl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tl=(e,t)=>{let n=ll(e);return{name:n.name,fn:n.fn,options:[e,t]}},El=(e,t)=>{let n=yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dl=Object.defineProperty,Ol=(e,t)=>Dl(e,`name`,{value:t,configurable:!0}),kl={Partial:`partial`,Always:`always`},Al={Optimized:`optimized`,Always:`always`},jl=`Popper`,[Ml,Nl]=kr(jl),[Pl,Fl]=Ml(jl),Il=Ol(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,z.jsx)(Pl,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ll=`PopperAnchor`,Rl=v.forwardRef(Ol(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Fl(Ll,n),o=v.useRef(null),s=a.onAnchorChange,c=tr(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&U(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(Cr.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),zl=`PopperContent`,[Bl,Vl]=Ml(zl),Hl=v.forwardRef(Ol(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=kl.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=Al.Optimized,onPlaced:m,...h}=e,g=Fl(zl,n),[_,y]=v.useState(null),b=tr(t,y),[x,S]=v.useState(null),C=hs(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(H),altBoundary:k},{refs:j,floatingStyles:M,placement:ee,isPositioned:N,middlewareData:P}=vl({strategy:`fixed`,placement:E,whileElementsMounted:Ol((...e)=>il(...e,{animationFrame:p===Al.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[bl({mainAxis:i+T,alignmentAxis:o}),c&&xl({mainAxis:!0,crossAxis:!1,limiter:d===kl.Partial?Sl():void 0,...A}),c&&Cl({...A}),wl({...A,apply:Ol(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&El({element:x,padding:s}),Ul({arrowWidth:w,arrowHeight:T}),f&&Tl({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),F=g.setPlacementState;Qr(()=>(F(ee),()=>{F(void 0)}),[ee,F]);let[I,te]=U(ee),ne=Mi(m);Qr(()=>{N&&ne?.()},[N,ne]);let re=P.arrow?.x,ie=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[L,oe]=v.useState();return Qr(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:N?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:L,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(Bl,{scope:n,placedSide:I,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,z.jsx)(Cr.div,{"data-side":I,"data-align":te,...h,ref:b,style:{...h.style,animation:N?h.style?.animation:`none`}})})})},`PopperContent`));function H(e){return e!==null}Ol(H,`isNotNull`);var Ul=Ol(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=U(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function U(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ol(U,`getSideAndAlignFromPlacement`);var W=Object.defineProperty,Wl=v.forwardRef(((e,t)=>W(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,z.jsx)(Cr.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Gl=Object.defineProperty,Kl=(e,t)=>Gl(e,`name`,{value:t,configurable:!0});function ql(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Kl(ql,`usePrevious`);var Jl=Object.defineProperty,Yl=(e,t)=>Jl(e,`name`,{value:t,configurable:!0});function Xl(e,[t,n]){return Math.min(n,Math.max(t,e))}Yl(Xl,`clamp`);var Zl=Object.defineProperty,G=(e,t)=>Zl(e,`name`,{value:t,configurable:!0}),Ql={ItemAligned:`item-aligned`,Popper:`popper`},$l={LTR:`ltr`,RTL:`rtl`},eu=[` `,`Enter`,`ArrowUp`,`ArrowDown`],tu=[` `,`Enter`],nu=`Select`,[ru,iu,au]=Nr(nu),[ou,su]=kr(nu,[au,Nl]),cu=Nl(),[lu,uu]=ou(nu),[du,fu]=ou(nu);function pu(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=cu(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=ki(l),[T,E]=si({prop:r,defaultProp:i??!1,onChange:a,caller:nu}),[D,O]=si({prop:o,defaultProp:s,onChange:c,caller:nu}),k=v.useRef(null),A=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=G(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=!_||!!m||!!_.closest(`form`),[M,ee]=v.useState(new Set),N=Ti(),P=Array.from(M).map(e=>e.props.value).join(`;`),F=v.useCallback(e=>{ee(t=>new Set(t).add(e))},[]),I=v.useCallback(e=>{ee(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:N,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:P,isFormControl:j};return(0,z.jsx)(Il,{...g,children:(0,z.jsx)(lu,{scope:t,...te,children:(0,z.jsx)(ru.Provider,{scope:t,children:(0,z.jsx)(du,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:I,children:ed(h)?h(te):n})})})})}G(pu,`SelectProvider`);var mu=G(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,z.jsx)(pu,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[n,e?(0,z.jsx)($u,{__scopeSelect:t}):null]})})},`Select`),hu=`SelectTrigger`,gu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=cu(n),o=uu(hu,n),s=o.disabled||r,c=tr(t,o.onTriggerChange),l=iu(n),u=v.useRef(`touch`),[d,f,p]=nd(e=>{let t=l().filter(e=>!e.disabled),n=rd(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=G(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,z.jsx)(Rl,{asChild:!0,...a,children:(0,z.jsx)(Cr.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":td(o.value)?``:void 0,...i,ref:c,onClick:qr(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:qr(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:qr(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&eu.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),_u=`SelectValue`,vu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=uu(_u,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=tr(t,c.onValueNodeChange);Qr(()=>{l(u)},[l,u]);let f=td(c.value);return(0,z.jsx)(Cr.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,z.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),yu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,z.jsx)(Cr.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[bu,xu]=ou(`SelectPortal`,{forceMount:void 0}),Su=G(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,z.jsx)(bu,{scope:e.__scopeSelect,forceMount:n,children:(0,z.jsx)(ma,{asChild:!0,...r})})},`SelectPortal`),Cu=`SelectContent`,wu=v.forwardRef(G(function(e,t){let n=xu(Cu,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=uu(Cu,e.__scopeSelect),[o,s]=v.useState();return Qr(()=>{s(new DocumentFragment)},[]),(0,z.jsx)(hi,{present:r||a.open,children:({present:e})=>e?(0,z.jsx)(Au,{...i,ref:t}):(0,z.jsx)(Tu,{...i,fragment:o})})},`SelectContent`)),Tu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?y.createPortal((0,z.jsx)(Du,{scope:n,children:(0,z.jsx)(ru.Slot,{scope:n,children:(0,z.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Eu=10,[Du,Ou]=ou(Cu),ku=cr(`SelectContent.RemoveScroll`),Au=v.forwardRef(G(function(e,t){let{__scopeSelect:n}=e,{position:r=Ql.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=uu(Cu,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=tr(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=iu(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return zo(b)},[b]),ba();let ee=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),N=v.useCallback(()=>ee([T,b]),[ee,T,b]);v.useEffect(()=>{A&&N()},[A,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=G(t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},`handlePointerMove`),n=G(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null},`handlePointerUp`);return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,P,F]),v.useEffect(()=>{let e=G(()=>P(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[I,te]=nd(e=>{let t=k().filter(e=>!e.disabled),n=rd(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),re=v.useCallback(()=>b?.focus(),[b]),ie=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ae=r===Ql.Popper?Mu:ju,L=ae===Mu?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,z.jsx)(Du,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ne,selectedItem:T,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:N,selectedItemText:D,position:r,isPositioned:A,searchRef:I,children:(0,z.jsx)(Ao,{as:ku,allowPinchZoom:!0,children:(0,z.jsx)(Zi,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:qr(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,z.jsx)(zi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,z.jsx)(ae,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...L,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:qr(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ju=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=uu(Cu,n),o=Ou(Cu,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=tr(t,u),f=iu(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==$l.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Eu,d=Xl(a,[Eu,Math.max(Eu,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Eu,d=Xl(a,[Eu,Math.max(Eu,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Eu*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Eu,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Eu}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Qr(()=>b(),[b]);let[x,S]=v.useState();return Qr(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,z.jsx)(Nu,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,z.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,z.jsx)(Cr.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Mu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Eu,...a}=e,o=cu(n);return(0,z.jsx)(Hl,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Nu,Pu]=ou(Cu,{}),Fu=`SelectViewport`,Iu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Ou(Fu,n),o=Pu(Fu,n),s=tr(t,a.onViewportChange),c=v.useRef(0);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,z.jsx)(ru.Slot,{scope:n,children:(0,z.jsx)(Cr.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:qr(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Eu*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Lu,Ru]=ou(`SelectGroup`),zu=`SelectItem`,[Bu,Vu]=ou(zu),Hu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=uu(zu,n),c=Ou(zu,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=tr(t,Mi(e=>c.itemRefCallback?.(e,r,i))),h=Ti(),g=v.useRef(`touch`),_=G(()=>{s.onValueChange(r),s.onOpenChange(!1)},`handleSelect`);return(0,z.jsx)(Bu,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,z.jsx)(ru.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,z.jsx)(Cr.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:qr(o.onFocus,()=>p(!0)),onBlur:qr(o.onBlur,()=>p(!1)),onClick:qr(o.onClick,()=>{i||g.current!==`mouse`&&_()}),onPointerUp:qr(o.onPointerUp,()=>{i||g.current===`mouse`&&_()}),onPointerDown:qr(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:qr(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qr(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:qr(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(tu.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Uu=`SelectItemText`,Wu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=uu(Uu,n),s=Ou(Uu,n),c=Vu(Uu,n),l=fu(Uu,n),[u,d]=v.useState(null),f=Mi(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=tr(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,z.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Qr(()=>(g(h),()=>_(h)),[g,_,h]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Cr.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!td(o.value)?y.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Gu=`SelectItemIndicator`,Ku=v.forwardRef(G(function(e,t){let{__scopeSelect:n,...r}=e;return Vu(Gu,n).isSelected?(0,z.jsx)(Cr.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),qu=`SelectScrollUpButton`,Ju=v.forwardRef(G(function(e,t){let n=Ou(qu,e.__scopeSelect),r=Pu(qu,e.__scopeSelect),[i,a]=v.useState(!1),o=tr(t,r.onScrollButtonChange);return Qr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};G(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(Zu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Yu=`SelectScrollDownButton`,Xu=v.forwardRef(G(function(e,t){let n=Ou(Yu,e.__scopeSelect),r=Pu(Yu,e.__scopeSelect),[i,a]=v.useState(!1),o=tr(t,r.onScrollButtonChange);return Qr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};G(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(Zu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Zu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ou(`SelectScrollButton`,n),o=v.useRef(null),s=iu(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Qr(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,z.jsx)(Cr.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qr(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:qr(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:qr(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Qu=`SelectBubbleInput`,$u=v.forwardRef(G(function({__scopeSelect:e,...t},n){let r=uu(Qu,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=tr(n,p),h=i??``,g=ql(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,z.jsxs)(Cr.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Tr,...t.style},ref:m,defaultValue:h,children:[td(i)&&!_?(0,z.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function ed(e){return typeof e==`function`}G(ed,`isFunction`);function td(e){return e===``||e===void 0}G(td,`shouldShowPlaceholder`);function nd(e){let t=Mi(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),G((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}G(nd,`useTypeaheadSearch`);function rd(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=id(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}G(rd,`findNextItem`);function id(e,t){return e.map((n,r)=>e[(t+r)%e.length])}G(id,`wrapArray`);var ad=Object.defineProperty,od=(e,t)=>ad(e,`name`,{value:t,configurable:!0}),[sd,cd]=kr(`Tooltip`,[Nl]);Nl();var ld=`TooltipProvider`,ud=700,[dd,fd]=sd(ld),pd=od(e=>{let{__scopeTooltip:t,delayDuration:n=ud,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(dd,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),[md,hd]=sd(`Tooltip`),[gd,_d]=sd(`TooltipPortal`,{forceMount:void 0});function vd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}od(vd,`getExitSideFromRect`);function yd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}od(yd,`getPaddedExitPoints`);function bd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}od(bd,`getPointsFromRect`);function xd(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}od(xd,`isPointInPolygon`);function Sd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Cd(t)}od(Sd,`getHull`);function Cd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}od(Cd,`getHullPresorted`);function wd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}od(wd,`concatAriaDescribedby`);function Td(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=Td(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function K(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Td(e))&&(r&&(r+=` `),r+=t);return r}var Ed=`-`,Dd=e=>{let t=jd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(Ed);return n[0]===``&&n.length!==1&&n.shift(),Od(n,t)||Ad(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},Od=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?Od(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(Ed);return t.validators.find(({validator:e})=>e(a))?.classGroupId},kd=/^\[(.+)\]$/,Ad=e=>{if(kd.test(e)){let t=kd.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},jd=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Fd(Object.entries(e.classGroups),n).forEach(([e,n])=>{Md(n,r,e,t)}),r},Md=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:Nd(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(Pd(e)){Md(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{Md(i,Nd(t,e),n,r)})})},Nd=(e,t)=>{let n=e;return t.split(Ed).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Pd=e=>e.isThemeGetter,Fd=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Id=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},Ld=`!`,Rd=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(Ld);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},zd=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Bd=e=>({cache:Id(e.cacheSize),parseClassName:Rd(e),...Dd(e)}),Vd=/\s+/,Hd=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(Vd),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=zd(c).join(`:`),h=l?m+Ld:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function Ud(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=Wd(t))&&(r&&(r+=` `),r+=n);return r}var Wd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Wd(e[r]))&&(n&&(n+=` `),n+=t);return n};function Gd(e,...t){let n,r,i,a=o;function o(o){return n=Bd(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=Hd(e,n);return i(e,a),a}return function(){return a(Ud.apply(null,arguments))}}var Kd=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},qd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jd=/^\d+\/\d+$/,Yd=new Set([`px`,`full`,`screen`]),Xd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zd=/\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$/,Qd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$d=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ef=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tf=e=>rf(e)||Yd.has(e)||Jd.test(e),nf=e=>gf(e,`length`,_f),rf=e=>!!e&&!Number.isNaN(Number(e)),af=e=>gf(e,`number`,rf),of=e=>!!e&&Number.isInteger(Number(e)),sf=e=>e.endsWith(`%`)&&rf(e.slice(0,-1)),q=e=>qd.test(e),cf=e=>Xd.test(e),lf=new Set([`length`,`size`,`percentage`]),uf=e=>gf(e,lf,vf),df=e=>gf(e,`position`,vf),ff=new Set([`image`,`url`]),pf=e=>gf(e,ff,bf),mf=e=>gf(e,``,yf),hf=()=>!0,gf=(e,t,n)=>{let r=qd.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},_f=e=>Zd.test(e)&&!Qd.test(e),vf=()=>!1,yf=e=>$d.test(e),bf=e=>ef.test(e),xf=Gd(()=>{let e=Kd(`colors`),t=Kd(`spacing`),n=Kd(`blur`),r=Kd(`brightness`),i=Kd(`borderColor`),a=Kd(`borderRadius`),o=Kd(`borderSpacing`),s=Kd(`borderWidth`),c=Kd(`contrast`),l=Kd(`grayscale`),u=Kd(`hueRotate`),d=Kd(`invert`),f=Kd(`gap`),p=Kd(`gradientColorStops`),m=Kd(`gradientColorStopPositions`),h=Kd(`inset`),g=Kd(`margin`),_=Kd(`opacity`),v=Kd(`padding`),y=Kd(`saturate`),b=Kd(`scale`),x=Kd(`sepia`),S=Kd(`skew`),C=Kd(`space`),w=Kd(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,q,t],O=()=>[q,t],k=()=>[``,tf,nf],A=()=>[`auto`,rf,q],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],ee=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],N=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],P=()=>[``,`0`,q],F=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],I=()=>[rf,q];return{cacheSize:500,separator:`:`,theme:{colors:[hf],spacing:[tf,nf],blur:[`none`,``,cf,q],brightness:I(),borderColor:[e],borderRadius:[`none`,``,`full`,cf,q],borderSpacing:O(),borderWidth:k(),contrast:I(),grayscale:P(),hueRotate:I(),invert:P(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[sf,nf],inset:D(),margin:D(),opacity:I(),padding:O(),saturate:I(),scale:I(),sepia:P(),skew:I(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,q]}],container:[`container`],columns:[{columns:[cf]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),q]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,of,q]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,q]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:[`first`,`last`,`none`,of,q]}],"grid-cols":[{"grid-cols":[hf]}],"col-start-end":[{col:[`auto`,{span:[`full`,of,q]},q]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[hf]}],"row-start-end":[{row:[`auto`,{span:[of,q]},q]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,q]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...N()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...N(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...N(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,q,t]}],"min-w":[{"min-w":[q,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[q,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[cf]},cf]}],h:[{h:[q,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[q,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[q,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[q,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,cf,nf]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,af]}],"font-family":[{font:[hf]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,q]}],"line-clamp":[{"line-clamp":[`none`,rf,af]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,tf,q]}],"list-image":[{"list-image":[`none`,q]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,tf,nf]}],"underline-offset":[{"underline-offset":[`auto`,tf,q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),df]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,uf]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},pf]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[tf,q]}],"outline-w":[{outline:[tf,nf]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[tf,nf]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,cf,mf]}],"shadow-color":[{shadow:[hf]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...ee(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,cf,q]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,q]}],duration:[{duration:I()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,q]}],delay:[{delay:I()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,q]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[of,q]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,q]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[tf,nf,af]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function J(...e){return xf(K(e))}function Sf({delayDuration:e=0,...t}){return(0,z.jsx)(pd,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}var Cf=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),wf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Tf={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ef=(0,v.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,v.createElement)(`svg`,{ref:c,...Tf,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wf(`lucide`,i),...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Y=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(Ef,{ref:i,iconNode:t,className:wf(`lucide-${Cf(e)}`,n),...r}));return n.displayName=`${e}`,n},Df=Y(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Of=Y(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),kf=Y(`Bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Af=Y(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),jf=Y(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Mf=Y(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Nf=Y(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Pf=Y(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ff=Y(`CircleAlert`,[[`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`}]]),If=Y(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Lf=Y(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Rf=Y(`CircleSlash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),zf=Y(`CircleX`,[[`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`}]]),Bf=Y(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Vf=Y(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Hf=Y(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Uf=Y(`Flag`,[[`path`,{d:`M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z`,key:`i9b6wo`}],[`line`,{x1:`4`,x2:`4`,y1:`22`,y2:`15`,key:`1cm3nv`}]]),Wf=Y(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Gf=Y(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),Kf=Y(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),qf=Y(`Keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Jf=Y(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Yf=Y(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Xf=Y(`Loader`,[[`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`}]]),Zf=Y(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Qf=Y(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),$f=Y(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ep=Y(`RefreshCw`,[[`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`}]]),tp=Y(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),np=Y(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),rp=Y(`ShieldCheck`,[[`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:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ip=Y(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ap=Y(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),X=`/v1`,op={healthz:()=>`/healthz`,status:()=>`${X}/status`,daemonRestart:()=>`${X}/daemon/restart`,nodes:()=>`${X}/nodes`,reviveAll:()=>`${X}/nodes/revive-all`,node:e=>`${X}/nodes/${e}`,nodeSnapshot:e=>`${X}/nodes/${e}/snapshot`,nodeSession:e=>`${X}/nodes/${e}/session`,nodeTranscript:e=>`${X}/nodes/${e}/transcript`,nodeContext:e=>`${X}/nodes/${e}/context`,nodeArtifacts:e=>`${X}/nodes/${e}/artifacts`,nodeReports:e=>`${X}/nodes/${e}/reports`,nodeMessages:e=>`${X}/nodes/${e}/messages`,nodeInterrupt:e=>`${X}/nodes/${e}/interrupt`,nodeFork:e=>`${X}/nodes/${e}/fork`,nodeRevive:e=>`${X}/nodes/${e}/revive`,nodeRelaunchRoot:e=>`${X}/nodes/${e}/relaunch-root`,nodeClose:e=>`${X}/nodes/${e}/close`,nodeRecycle:e=>`${X}/nodes/${e}/recycle`,nodeDemote:e=>`${X}/nodes/${e}/demote`,nodePromote:e=>`${X}/nodes/${e}/promote`,nodeYield:e=>`${X}/nodes/${e}/yield`,nodeWait:e=>`${X}/nodes/${e}/wait`,nodeConfig:e=>`${X}/nodes/${e}/config`,nodeWorktreeClose:e=>`${X}/nodes/${e}/worktree/close`,nodeAttach:e=>`${X}/nodes/${e}/attach`,focuses:()=>`${X}/focuses`,focusByNode:()=>`${X}/focuses/by-node`,focusByPane:()=>`${X}/focuses/by-pane`,focus:e=>`${X}/focuses/${e}`,nodeSubscriptions:e=>`${X}/nodes/${e}/subscriptions`,nodeSubscription:(e,t)=>`${X}/nodes/${e}/subscriptions/${t}`,crons:()=>`${X}/crons`,cron:e=>`${X}/crons/${e}`,cronPause:e=>`${X}/crons/${e}/pause`,cronResume:e=>`${X}/crons/${e}/resume`,cronRun:e=>`${X}/crons/${e}/run`,canvasAttention:()=>`${X}/canvas/attention`,canvasAttentionCounts:()=>`${X}/canvas/attention/counts`,canvasHistorySearch:()=>`${X}/canvas/history/search`,canvasHistoryGrep:()=>`${X}/canvas/history/grep`,canvasHistoryRead:()=>`${X}/canvas/history/read`,canvasSnapshot:()=>`${X}/canvas/snapshot`,canvasRoster:()=>`${X}/canvas/roster`,canvasPrune:()=>`${X}/canvas/prune`,canvasRebuildIndex:()=>`${X}/canvas/rebuild-index`,canvasConsults:()=>`${X}/canvas/consults`,humanBridge:()=>`${X}/human/bridge`,humanDeliver:()=>`${X}/human/deliver`,humanConsult:()=>`${X}/human/consult`,humanVisual:()=>`${X}/human/visual`,humanInbox:()=>`${X}/human/inbox`,humanInboxTicket:e=>`${X}/human/inbox/${e}`,humanInboxRespond:e=>`${X}/human/inbox/${e}/respond`,humanInboxCancel:e=>`${X}/human/inbox/${e}/cancel`,profiles:()=>`${X}/profiles`,profile:e=>`${X}/profiles/${e}`,modelAuths:()=>`${X}/model-auth`,modelAuth:e=>`${X}/model-auth/${e}`,filePeek:()=>`${X}/files/peek`};function sp(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t)return!1;let{code:n,message:r}=t;return typeof n==`string`&&typeof r==`string`}function cp(){let e=new Map;return{run(t,n){let r=e.get(t);if(r!==void 0)return r;let i=n().finally(()=>{e.get(t)===i&&e.delete(t)});return e.set(t,i),i},get pending(){return e.size}}}var lp=cp(),up=`crtr:relay-token`;function dp(){try{let e=window.localStorage.getItem(up);return e!==null&&e!==``?e:void 0}catch{return}}function fp(){let e;try{let t=new URLSearchParams(window.location.search).get(`token`);e=t!==null&&t!==``?t:void 0}catch{e=void 0}if(e!==void 0){try{window.localStorage.setItem(up,e)}catch{}return e}return dp()}var pp=fp(),mp=class extends Error{code;constructor(e,t){super(t),this.name=`CommandError`,this.code=e}};async function hp(e,t){let n={};t?.body!==void 0&&(n[`content-type`]=`application/json`),pp!==void 0&&(n.authorization=`Bearer ${pp}`);let r;try{r=await fetch(e,{...t,headers:{...n,...t?.headers}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?new mp(`aborted`,`request aborted`):new mp(`network`,e instanceof Error?e.message:String(e))}let i=await r.text(),a;if(i!==``)try{a=JSON.parse(i)}catch{a=void 0}if(!r.ok)throw sp(a)?new mp(a.error.code,a.error.message):new mp(`bridge`,`HTTP ${r.status} ${r.statusText}`);return a}function gp(e){let t={node_id:e.node_id,name:e.name,kind:e.kind,mode:e.mode,lifecycle:e.lifecycle,status:e.status,cwd:e.cwd,parent:e.parent,created:e.created,host_kind:e.host_kind??`broker`,enterable:e.host_kind===`broker`,attention_count:0,branch:e.worktree?.branch??null,model:e.model_override??null,tokens:null,context:null,tool_calls:null,stats:null,presence:null,live:e.pi_pid!=null,git_status:null};return e.cycles!==void 0&&(t.cycles=e.cycles),t}function _p(){return lp.run(`canvas:roster`,async()=>{let e=await hp(op.canvasRoster()),t=e.nodes.map(e=>e.node_id),n=t.length>0?(await hp(op.canvasAttentionCounts(),{method:`POST`,body:JSON.stringify({node_ids:t})})).counts:{};return{nodes:e.nodes.map(e=>({...e,attention_count:n[e.node_id]??0})),generated_at:e.generated_at}})}function vp(e){return lp.run(`node:inspect:${e}`,()=>hp(op.node(e)).then(gp))}function yp(e){return lp.run(`node:snapshot:${e}`,()=>hp(op.nodeSnapshot(e)).then(e=>({node_id:e.node_id,snapshot:e.snapshot,commands:e.commands})))}function bp(e){let t={kind:e.kind,prompt:e.prompt,...e.mode===void 0?{}:{mode:e.mode},...e.root===void 0?{}:{root:e.root},...e.cwd?.trim()?{cwd:e.cwd.trim()}:{},...e.name?.trim()?{name:e.name.trim()}:{},...e.model?.trim()?{model:e.model.trim()}:{},...e.parent?.trim()?{parent:e.parent.trim()}:{}};return hp(op.nodes(),{method:`POST`,body:JSON.stringify(t)}).then(e=>({node_id:e.node_id,name:e.name,status:e.status,follow_up:``}))}function xp(e,t){let n={body:t.body,...t.tier?.trim()?{tier:t.tier.trim()}:{}};return hp(op.nodeMessages(e),{method:`POST`,body:JSON.stringify(n)}).then(e=>({mode:e.armed===!0?`armed`:`delivered`,armed:e.armed??!1,target:e.node_id,delivered:e.delivered,revived:e.revived,guidance:``}))}function Sp(e,t={}){return hp(op.nodeRevive(e),{method:`POST`,body:JSON.stringify({resume:t.fresh!==!0})}).then(e=>({window:null,session:null,resumed:e.resumed,ready:e.revived}))}function Cp(e){return hp(op.nodeClose(e),{method:`POST`,body:JSON.stringify({})}).then(e=>({closed:!0,node_id:e.root,count:e.closed.length,closed_ids:e.closed,spared:e.spared}))}function wp(e,t){return hp(`${op.filePeek()}?path=${encodeURIComponent(t)}`).then(e=>({path:e.path,content:e.content,truncated:e.truncated}))}async function Tp(e,t){try{let n={"content-type":`application/json`};pp!==void 0&&(n.authorization=`Bearer ${pp}`);let r=await fetch(`/__crtr/source`,{method:`POST`,headers:n,body:JSON.stringify(e),...t===void 0?{}:{signal:t}});return r.ok?await r.json():{ok:!1,stdout:``,stderr:`bridge ${r.status} ${r.statusText}`}}catch(e){return t?.aborted===!0||e instanceof DOMException&&e.name===`AbortError`?{ok:!1,stdout:``,stderr:`aborted`}:{ok:!1,stdout:``,stderr:e instanceof Error?e.message:String(e)}}}async function Ep(e,t,n){return Tp({kind:`exec`,bin:`crtr`,args:e,...t===void 0?{}:{stdin:t}},n)}function Dp(e){let t=e.stdout.trim();if(t===``)return null;try{let e=JSON.parse(t);if(e&&typeof e==`object`&&typeof e.error==`string`&&typeof e.message==`string`)return{code:e.error,message:e.message}}catch{}return null}async function Op(e,t,n){let r=await Ep(e,t,n);if(!r.ok)throw new mp(`bridge`,r.stderr||`bridge request failed`);let i=Dp(r);if(i!==null)throw new mp(i.code,i.message);if(r.exitCode!==void 0&&r.exitCode!==0){let t=r.stderr.trim()===``?r.stdout.trim():r.stderr;throw new mp(`bridge`,t===``?`crtr ${e.join(` `)} failed (${r.exitCode})`:t)}if(r.stdout.trim()!==``)try{return JSON.parse(r.stdout)}catch(e){throw new mp(`bridge`,e instanceof Error?e.message:String(e))}}var kp=new Set,Ap=!1;function jp(){if(Ap)return;Ap=!0;let e;try{let t=new URL(`/__crtr/events`,window.location.href);pp!==void 0&&t.searchParams.set(`token`,pp),e=new EventSource(t.toString())}catch{Ap=!1;return}e.onmessage=e=>{let t;try{t=JSON.parse(e.data).kind}catch{return}if(t!==void 0)for(let e of kp)e.kinds.includes(t)&&e.refresh()}}function Mp(e,t){let n=(0,v.useRef)(t);n.current=t,(0,v.useEffect)(()=>{jp();let t={kinds:e,refresh:()=>n.current()};return kp.add(t),()=>{kp.delete(t)}},[e.join(`,`)])}var Np=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Pp=(e=>e?Np(e):Np),Fp=e=>e;function Ip(e,t=Fp){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var Lp=e=>{let t=Pp(e),n=e=>Ip(t,e);return Object.assign(n,t),n},Rp=(e=>e?Lp(e):Lp),zp=Rp(e=>({reachable:!0,setReachable:t=>e({reachable:t})})),Bp=1,Vp=`crtr.web.roster.v1`;function Hp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Up(e){return typeof e==`string`}function Wp(e){return typeof e==`number`}function Gp(e){return Hp(e)?Up(e.node_id)&&Up(e.name)&&Up(e.kind)&&(e.mode===`base`||e.mode===`orchestrator`)&&(e.lifecycle===`terminal`||e.lifecycle===`resident`)&&(e.status===`active`||e.status===`idle`||e.status===`done`||e.status===`dead`||e.status===`canceled`)&&Up(e.cwd)&&(e.parent===null||Up(e.parent))&&Up(e.created)&&(e.host_kind===`broker`||e.host_kind===`tmux`)&&typeof e.enterable==`boolean`&&Wp(e.attention_count)&&(e.cycles===void 0||Wp(e.cycles))&&(e.last_activity===void 0||Up(e.last_activity)):!1}function Kp(e){return Hp(e)?e.schemaVersion===Bp&&Up(e.generatedAt)&&Wp(e.cachedAt)&&Array.isArray(e.nodes)&&e.nodes.every(Gp):!1}function qp(){try{let e=globalThis.localStorage?.getItem(Vp);if(e==null)return null;let t=JSON.parse(e);return Kp(t)?t:null}catch{return null}}function Jp(e,t){let n={schemaVersion:Bp,nodes:e,generatedAt:t,cachedAt:Date.now()};try{globalThis.localStorage?.setItem(Vp,JSON.stringify(n))}catch{}}var Yp=3e4,Xp=new class{state;listeners=new Set;started=!1;timer=null;constructor(){let e=qp();this.state=e?{nodes:e.nodes,generatedAt:e.generatedAt,loading:!1}:{nodes:[],generatedAt:null,loading:!0}}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;refetch=()=>{this.load()};ensureStarted(){if(this.started)return;this.started=!0,this.load(),this.timer=setInterval(()=>void this.load(),Yp);let e=()=>{document.visibilityState===`visible`&&this.load()};document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e)}setState(e){this.state=e;for(let e of this.listeners)e()}async load(){try{let e=await _p();this.setState({nodes:e.nodes,generatedAt:e.generated_at,loading:!1}),Jp(e.nodes,e.generated_at),zp.getState().setReachable(!0)}catch{this.state.loading&&this.setState({...this.state,loading:!1}),zp.getState().setReachable(!1)}}};function Zp(){let e=(0,v.useSyncExternalStore)(Xp.subscribe,Xp.getState);return Mp([`nodes`,`inbox`],Xp.refetch),e}var Qp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,$p=K,em=(e,t)=>n=>{if(t?.variants==null)return $p(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Qp(t)||Qp(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return $p(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},tm=em(`btn justify-center transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`primary`,destructive:`danger`,outline:``,secondary:``,ghost:`border-transparent`,link:`border-transparent bg-transparent text-primary underline-offset-4 hover:underline hover:bg-transparent`},size:{default:``,xs:`sm gap-1 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`sm`,lg:`px-6 py-2.5`,icon:`p-0 size-9`,"icon-xs":`p-0 size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`p-0 size-8`,"icon-lg":`p-0 size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Z({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,z.jsx)(r?lr:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:J(tm({variant:t,size:n,className:e})),...i})}function nm({...e}){return(0,z.jsx)(qo,{"data-slot":`dialog`,...e})}function rm({...e}){return(0,z.jsx)(Zo,{"data-slot":`dialog-portal`,...e})}function im({className:e,...t}){return(0,z.jsx)($o,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function am({className:e,children:t,showCloseButton:n=!0,...r}){return(0,z.jsxs)(rm,{"data-slot":`dialog-portal`,children:[(0,z.jsx)(im,{}),(0,z.jsxs)(rs,{"data-slot":`dialog-content`,className:J(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,z.jsxs)(us,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,z.jsx)(ap,{}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function om({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function sm({className:e,showCloseButton:t=!1,children:n,...r}){return(0,z.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,z.jsx)(us,{asChild:!0,children:(0,z.jsx)(Z,{variant:`outline`,children:`Close`})})]})}function cm({className:e,...t}){return(0,z.jsx)(ss,{"data-slot":`dialog-title`,className:J(`text-lg leading-none font-semibold`,e),...t})}function lm({className:e,...t}){return(0,z.jsx)(cs,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground`,e),...t})}function um({className:e,type:t,...n}){return(0,z.jsx)(`input`,{type:t,"data-slot":`input`,className:J(`h-9 w-full min-w-0 rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.25)] px-3 py-1 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-[var(--dim)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...n})}function dm({className:e,...t}){return(0,z.jsx)(Wl,{"data-slot":`label`,className:J(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function fm({...e}){return(0,z.jsx)(mu,{"data-slot":`select`,...e})}function pm({...e}){return(0,z.jsx)(vu,{"data-slot":`select-value`,...e})}function mm({className:e,size:t=`default`,children:n,...r}){return(0,z.jsxs)(gu,{"data-slot":`select-trigger`,"data-size":t,className:J(`flex w-fit items-center justify-between gap-2 rounded-md border border-[var(--line)] bg-[oklch(0.92_0.008_80/0.02)] px-3 py-2 font-mono text-sm text-[var(--ink2)] whitespace-nowrap transition-[color,box-shadow] outline-none cursor-pointer focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-[var(--mut)] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-[var(--mut)]`,e),...r,children:[n,(0,z.jsx)(yu,{asChild:!0,children:(0,z.jsx)(jf,{className:`size-4 opacity-50`})})]})}function hm({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,z.jsx)(Su,{children:(0,z.jsxs)(wu,{"data-slot":`select-content`,className:J(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,z.jsx)(_m,{}),(0,z.jsx)(Iu,{className:J(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,z.jsx)(vm,{})]})})}function gm({className:e,children:t,...n}){return(0,z.jsxs)(Hu,{"data-slot":`select-item`,className:J(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,z.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(Ku,{children:(0,z.jsx)(Af,{className:`size-4`})})}),(0,z.jsx)(Wu,{children:t})]})}function _m({className:e,...t}){return(0,z.jsx)(Ju,{"data-slot":`select-scroll-up-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,z.jsx)(Pf,{className:`size-4`})})}function vm({className:e,...t}){return(0,z.jsx)(Xu,{"data-slot":`select-scroll-down-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,z.jsx)(jf,{className:`size-4`})})}function ym({className:e,...t}){return(0,z.jsx)(`textarea`,{"data-slot":`textarea`,className:J(`flex field-sizing-content min-h-16 w-full rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.3)] px-3 py-2 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none placeholder:text-[var(--dim)] focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...t})}var bm=em(`badge w-fit max-w-full overflow-hidden text-[var(--ink2)] whitespace-nowrap [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:``,secondary:`dead`,destructive:`blocked`,outline:``,ghost:`border-transparent`,link:`border-transparent underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function xm({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,z.jsx)(n?lr:`span`,{"data-slot":`badge`,"data-variant":t,className:J(bm({variant:t}),e),...r})}function Sm(e){return e instanceof mp&&(e.code===`not_found`||e.code===`already_resolved`||e.code===`claimed`)}function Cm(e){switch(e){case`notify`:case`validation`:case`decision`:case`context`:case`error`:return e}throw Error(`Unknown deck kind: ${e}`)}function wm(e){return{id:e.id,title:e.title,subtitle:e.subtitle,...e.body===void 0?{}:{body:e.body},kind:Cm(e.kind),options:e.options.map(e=>({id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description}})),multiSelect:e.multiSelect,allowFreetext:e.allow_freetext}}function Tm(e){return{id:e.id,job_id:e.job_id,kind:Cm(e.kind),title:e.title,subtitle:e.subtitle,blocked_since:e.blocked_since,...e.claim_owner===void 0?{}:{claim_owner:e.claim_owner},...e.source_label===void 0?{}:{source_label:e.source_label},conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:e.cwd,interaction_count:e.interaction_count}}function Em(e,t){return{id:e.id,job_id:e.job_id??e.id,kind:Cm(e.kind),title:e.title,subtitle:e.subtitle,blocked_since:e.blocked_since,...e.source_label===void 0?{}:{source_label:e.source_label},conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:t,interaction_count:e.interaction_count,interactions:e.interactions.map(wm)}}function Dm(){return lp.run(`human:list`,async()=>(await Op([`human`,`list`,`--json`])).items.map(Tm))}async function Om(e){let t=await Op([`human`,`deck`,e,`--json`]),n=(await vp(t.asking_node_id)).cwd;return Em(t,n)}async function km(e,t){let n=JSON.stringify({responses:t.responses}),r=await Op([`human`,`resolve`,e,`--json`],n);if(r.resolved!==!0)throw new mp(r.reason===`claimed`?`claimed`:`already_resolved`,r.reason===`claimed`?`That request is already being handled.`:`That request was already handled.`);return{resolved:!0,job_id:r.job_id??e,delivered:r.delivered??!0}}function Am(e){let t=0;for(let n of e)t+=Math.max(0,n.attention_count);return t}function jm(){let{nodes:e}=Zp();return Am(e)}function Mm(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(0),o=(0,v.useCallback)(()=>a(e=>e+1),[]);return Mp([`inbox`,`nodes`],o),(0,v.useEffect)(()=>{let e=!1;return Dm().then(n=>{e||(t(n),r(!1))}).catch(()=>{e||r(!1)}),()=>{e=!0}},[i]),{decks:e,loading:n,refetch:o}}function Nm(e){let{decks:t}=Mm();return t.filter(t=>t.conversation_id===e)}var Pm={notify:{icon:kf,label:`Update`},validation:{icon:rp,label:`Approval`},decision:{icon:Wf,label:`Decision`},context:{icon:Lf,label:`Question`},error:{icon:ip,label:`Problem`}};function Fm(e){switch(e){case`notify`:return Pm.notify;case`validation`:return Pm.validation;case`decision`:return Pm.decision;case`context`:return Pm.context;case`error`:return Pm.error;default:return Pm.context}}function Im(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}var Lm=1,Rm=Rp(e=>({toasts:[],push:(t,n=`info`)=>{let r=Lm++;e(e=>({toasts:[...e.toasts,{id:r,message:t,tone:n}]})),setTimeout(()=>e(e=>({toasts:e.toasts.filter(e=>e.id!==r)})),4e3)},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function zm(e,t=`info`){Rm.getState().push(e,t)}var Bm=e=>({"--i":e});async function Vm(e,t){let n=(await Om(e)).interactions[0];await km(e,{responses:[t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]}]})}function Hm(){let{decks:e,loading:t}=Mm(),n=(0,v.useMemo)(()=>[...e].sort((e,t)=>new Date(t.blocked_since).getTime()-new Date(e.blocked_since).getTime()),[e]);return t||n.length===0?null:(0,z.jsxs)(`section`,{className:`needs rv`,style:Bm(3),children:[(0,z.jsxs)(`div`,{className:`needs-head`,children:[(0,z.jsx)(Uf,{size:14,className:`flag`,"aria-hidden":!0}),(0,z.jsxs)(`span`,{className:`instlabel`,children:[`Needs you — `,n.length,` blocked`]}),(0,z.jsx)(`div`,{className:`rule`})]}),(0,z.jsx)(`div`,{className:`needs-grid`,children:n.map(e=>(0,z.jsx)(Um,{deck:e},e.id))})]})}function Um({deck:e}){let t=dt(),{refetch:n}=Mm(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=Fm(e.kind).label,u=Im(e.blocked_since);e.kind===`decision`&&a===null&&!s&&(async()=>{if(!(e.kind!==`decision`||s||a!==null)){c(!0);try{let t=(await Om(e.job_id)).interactions[0]?.options??[];o(t.length<=3?t:[])}catch(e){Sm(e)?(o([]),n()):(console.error(`[needs-you] failed to load decision options:`,e),o([]))}finally{c(!1)}}})();let d=async t=>{if(!r){i(!0);try{await Vm(e.job_id,t),zm(`Done — thanks!`,`success`),n()}catch(e){if(Sm(e)){zm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] resolve failed:`,e),zm(`Something went wrong — try again.`)}finally{i(!1)}}},f=async t=>{if(!r){i(!0);try{let r=(await Om(e.job_id)).interactions[0];await km(e.job_id,{responses:[{id:r.id,selectedOptionIds:[t]}]}),zm(`Done — thanks!`,`success`),n()}catch(e){if(Sm(e)){zm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] decision option resolve failed:`,e),zm(`Something went wrong — try again.`)}finally{i(!1)}}},p=e.kind===`decision`&&a!==null&&a.length>0;return(0,z.jsxs)(`div`,{className:`deck`,children:[(0,z.jsxs)(`div`,{className:`deck-meta`,children:[(0,z.jsx)(`span`,{className:`deck-kind`,children:l}),(0,z.jsx)(`span`,{className:`from`,children:e.asking_node_name}),(0,z.jsxs)(`span`,{className:`age`,children:[`blocked `,u]})]}),(0,z.jsx)(`p`,{className:`deck-q line-clamp-2`,children:e.title}),(0,z.jsxs)(`div`,{className:`deck-actions`,children:[e.kind===`notify`&&(0,z.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`ack`),children:`Got it`}),e.kind===`validation`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{type:`button`,size:`sm`,disabled:r,onClick:()=>void d(`yes`),children:`Approve`}),(0,z.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`no`),children:`Reject`})]}),p&&a.map(e=>(0,z.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void f(e.id),children:e.label},e.id)),(0,z.jsxs)(Z,{type:`button`,variant:`ghost`,size:`sm`,disabled:r,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),style:{marginLeft:`auto`,color:`var(--dim)`},children:[`open thread `,(0,z.jsx)(Of,{"aria-hidden":!0})]})]})]})}var Wm=e=>({"--i":e}),Gm=`hosted in a tmux pane — open it in your terminal`;function Km(e){let t=new Map;for(let n of e)t.set(n.node_id,{node:n,children:[]});let n=[];for(let e of t.values()){let r=e.node.parent,i=r?t.get(r):void 0;i?i.children.push(e):n.push(e)}return n}var qm=[`active`,`idle`,`done`,`dead`,`canceled`],Jm={query:``,status:`all`,blockedOnly:!1};function Ym(e){return e.query.trim()!==``||e.status!==`all`||e.blockedOnly}function Xm(e,t){if(t.status!==`all`&&e.status!==t.status||t.blockedOnly&&e.attention_count<=0)return!1;let n=t.query.trim().toLowerCase();return!(n&&!`${e.name} ${e.kind} ${e.mode} ${e.cwd} ${e.node_id} ${e.status}`.toLowerCase().includes(n))}function Zm(e,t){if(!Ym(t))return e;let n=new Map(e.map(e=>[e.node_id,e])),r=new Set;for(let i of e){if(!Xm(i,t))continue;let e=i;for(;e&&!r.has(e.node_id);)r.add(e.node_id),e=e.parent?n.get(e.parent):void 0}return e.filter(e=>r.has(e.node_id))}var Qm=new Set([`dead`,`canceled`]);function $m(e){return Qm.has(e.node.status)&&e.children.every($m)}function eh(e){return 1+e.children.reduce((e,t)=>e+eh(t),0)}var th=3,nh={active:Bf,idle:Bf,done:If,dead:Rf,canceled:zf};function rh(e,t){return t?Ff:nh[e]??Bf}function ih(e){return e.toLocaleTimeString(`en-GB`,{hour12:!1})}function ah(){let[e,t]=(0,v.useState)(()=>ih(new Date));return(0,v.useEffect)(()=>{let e=setInterval(()=>t(ih(new Date)),1e3);return()=>clearInterval(e)},[]),e}function oh(){let{nodes:e}=Zp(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(Jm),s=(0,v.useRef)(null),c=ah(),l=e.filter(e=>e.status===`active`).length,u=(0,v.useMemo)(()=>Km(Zm(e,a)),[e,a]);return(0,v.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=document.activeElement;t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable||(e.preventDefault(),s.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,z.jsxs)(`div`,{className:`in relative z-[1] h-full min-h-0 overflow-auto`,style:{padding:`34px 44px 44px`},children:[(0,z.jsxs)(`div`,{className:`rv flex items-baseline gap-4`,style:Wm(1),children:[(0,z.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:420,letterSpacing:`-0.01em`,fontVariationSettings:`"opsz" 60`,color:`var(--ink)`},children:`Canvas`}),(0,z.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e.length,` `,e.length===1?`node`:`nodes`,l>0&&` · ${l} active`]}),(0,z.jsxs)(`div`,{className:`font-inst text-xs flex items-center gap-2`,style:{marginLeft:`auto`,color:`var(--ink2)`,letterSpacing:`0.1em`},children:[(0,z.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:`var(--act)`,animation:`pulse 2.4s ease-out infinite`}}),(0,z.jsx)(`span`,{children:c})]})]}),(0,z.jsxs)(`div`,{className:`rv flex items-center gap-2.5`,style:{margin:`20px 0 22px`,...Wm(2)},children:[(0,z.jsxs)(`div`,{className:`search`,children:[(0,z.jsx)(tp,{size:14,className:`opacity-70`,"aria-hidden":!0}),(0,z.jsx)(`input`,{ref:s,value:a.query,onChange:e=>o(t=>({...t,query:e.currentTarget.value})),onKeyDown:e=>{e.key===`Escape`&&(o(e=>({...e,query:``})),e.currentTarget.blur())},placeholder:`Search name, kind, mode, cwd, id…`,"aria-label":`Search nodes`,className:`min-w-0 flex-1 border-0 bg-transparent p-0 text-sm outline-none`,style:{color:`var(--ink)`}}),(0,z.jsx)(`span`,{className:`kbd`,children:`/`})]}),(0,z.jsxs)(`label`,{className:`selectish`,children:[(0,z.jsxs)(`select`,{value:a.status,onChange:e=>o(t=>({...t,status:e.currentTarget.value})),"aria-label":`Filter by status`,className:`cursor-pointer appearance-none border-0 bg-transparent text-sm outline-none`,style:{color:`var(--ink2)`},children:[(0,z.jsx)(`option`,{value:`all`,children:`all statuses`}),qm.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]}),(0,z.jsx)(`span`,{className:`car`,children:`▾`})]}),(0,z.jsxs)(`label`,{className:`checkish select-none`,children:[(0,z.jsx)(`span`,{className:`box`,style:a.blockedOnly?{background:`var(--blk)`,borderColor:`var(--blk)`}:void 0}),`blocked`,(0,z.jsx)(`input`,{type:`checkbox`,checked:a.blockedOnly,onChange:e=>o(t=>({...t,blockedOnly:e.currentTarget.checked})),className:`sr-only`})]}),(0,z.jsx)(`button`,{type:`button`,className:`btn primary`,style:{marginLeft:`auto`},onClick:()=>{i(e=>e+1),n(!0)},children:`+ Spawn a node`})]}),(0,z.jsx)(Hm,{}),(0,z.jsxs)(`div`,{className:`panel rv`,style:{padding:`6px 0`,...Wm(4)},children:[(0,z.jsxs)(`div`,{className:`flex items-center`,style:{padding:`10px 18px 9px`,borderBottom:`1px solid var(--line)`},children:[(0,z.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Node forest`}),(0,z.jsx)(`span`,{className:`font-inst text-xs`,style:{marginLeft:`auto`,color:`var(--dim)`,letterSpacing:`0.1em`},children:`sorted · activity`})]}),(0,z.jsx)(`div`,{className:`tree`,children:e.length===0?(0,z.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No nodes on the canvas yet.`}):u.length===0?(0,z.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No matching nodes.`}):u.map(e=>(0,z.jsx)(sh,{node:e},e.node.node_id))})]}),(0,z.jsx)(lh,{open:t,onClose:()=>n(!1)},r)]})}function sh({node:e}){let t=dt(),[n,r]=(0,v.useState)(!1),i=e.node,a=i.attention_count>0,o=Qm.has(i.status),s=a?`blocked`:i.status,c=e.children.filter(e=>!$m(e)),l=e.children.filter(e=>$m(e)),u=l.reduce((e,t)=>e+eh(t),0),d=u>=th,f=d?c:e.children,p=()=>{i.enterable&&t(`/nodes/${encodeURIComponent(i.node_id)}`)};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:J(`node-row s-${s}`,o&&`dimmed`),onClick:p,role:i.enterable?`button`:void 0,tabIndex:i.enterable?0:void 0,style:i.enterable?void 0:{cursor:`default`},onKeyDown:e=>{i.enterable&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p())},children:[(0,z.jsxs)(`div`,{className:`node-id`,children:[(0,z.jsxs)(`div`,{className:`node-l1`,children:[(0,z.jsx)(`span`,{className:`node-name`,children:i.name}),(0,z.jsxs)(`span`,{className:`node-kind`,children:[i.kind,` · `,i.mode]})]}),(0,z.jsxs)(`div`,{className:`node-l2`,children:[(0,z.jsx)(`span`,{className:`node-cwd`,title:i.cwd,children:i.cwd}),i.lifecycle&&(0,z.jsx)(`span`,{className:`node-life`,children:i.lifecycle}),!i.enterable&&(0,z.jsx)(`span`,{className:`node-note`,children:Gm})]})]}),(0,z.jsxs)(`div`,{className:`node-right`,children:[a&&(0,z.jsxs)(`span`,{className:`waitflag`,children:[(0,z.jsx)(Uf,{size:14,"aria-hidden":!0}),` `,i.attention_count,` waiting on human`]}),(0,z.jsx)(ch,{status:i.status,blocked:a})]})]}),(f.length>0||d&&u>0)&&(0,z.jsxs)(`div`,{className:`kids`,children:[f.map(e=>(0,z.jsx)(sh,{node:e},e.node.node_id)),d&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex items-center gap-1.5 px-4 py-2 text-xs transition-colors`,style:{color:`var(--dim)`},children:[(0,z.jsx)(Nf,{size:14,"aria-hidden":!0,style:{transform:n?`rotate(90deg)`:`none`,transition:`transform 0.15s ease`}}),n?`Hide ${u} closed`:`Show ${u} closed`]}),n&&l.map(e=>(0,z.jsx)(sh,{node:e},e.node.node_id))]})]})]})}function ch({status:e,blocked:t}){let n=rh(e,t);return(0,z.jsxs)(xm,{variant:`outline`,className:t?`blocked`:e,children:[(0,z.jsx)(n,{"aria-hidden":!0}),e]})}function lh({open:e,onClose:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`developer`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(null);return(0,z.jsx)(nm,{open:e,onOpenChange:e=>!e&&t(),children:(0,z.jsxs)(am,{className:`max-w-md overflow-y-auto max-h-[90dvh]`,children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:`Spawn a node`})}),(0,z.jsxs)(`form`,{id:`spawn-form`,onSubmit:async e=>{if(e.preventDefault(),!n.trim()||!i.trim()){S(`prompt and kind are required`);return}b(!0),S(null);let r={prompt:n.trim(),kind:i.trim(),...o?{mode:o}:{},...c?{root:!0}:{},...u.trim()?{cwd:u.trim()}:{},...f.trim()?{name:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...g.trim()?{parent:g.trim()}:{}};try{await bp(r),t()}catch(e){console.error(`[spawn] failed:`,e),S(e instanceof mp?`${e.code}: ${e.message}`:String(e))}finally{b(!1)}},className:`flex flex-col gap-3.5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-prompt`,children:`Prompt`}),(0,z.jsx)(ym,{id:`spawn-prompt`,value:n,onChange:e=>r(e.currentTarget.value),rows:4,required:!0,className:`resize-none`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-kind`,children:`Kind`}),(0,z.jsx)(um,{id:`spawn-kind`,value:i,onChange:e=>a(e.currentTarget.value),required:!0})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-mode`,children:`Mode`}),(0,z.jsxs)(fm,{value:o===``?`__none__`:o,onValueChange:e=>s(e===`__none__`?``:e),children:[(0,z.jsx)(mm,{id:`spawn-mode`,className:`w-full`,children:(0,z.jsx)(pm,{})}),(0,z.jsxs)(hm,{children:[(0,z.jsx)(gm,{value:`__none__`,children:`(default)`}),(0,z.jsx)(gm,{value:`base`,children:`base`}),(0,z.jsx)(gm,{value:`orchestrator`,children:`orchestrator`})]})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`input`,{type:`checkbox`,id:`spawn-root`,checked:c,onChange:e=>l(e.currentTarget.checked),className:`size-4 rounded-none border border-input accent-primary`}),(0,z.jsx)(dm,{htmlFor:`spawn-root`,className:`cursor-pointer`,children:`Resident root node`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-cwd`,children:`cwd`}),(0,z.jsx)(um,{id:`spawn-cwd`,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`(inherit)`,className:`font-mono text-sm`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-name`,children:`Name`}),(0,z.jsx)(um,{id:`spawn-name`,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`(auto)`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-model`,children:`Model`}),(0,z.jsx)(um,{id:`spawn-model`,value:m,onChange:e=>h(e.currentTarget.value),placeholder:`(default)`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-parent`,children:`Parent node id`}),(0,z.jsx)(um,{id:`spawn-parent`,value:g,onChange:e=>_(e.currentTarget.value),placeholder:`(this canvas root)`,className:`font-mono text-sm`})]}),x&&(0,z.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,disabled:y,children:`Cancel`}),(0,z.jsx)(Z,{type:`submit`,form:`spawn-form`,disabled:y,children:y?`Spawning…`:`Spawn`})]})]})})}function uh(e){if(!e)return``;let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]??``}function dh(e){let t=e.name?.trim();if(t&&t!==e.kind)return t;let n=uh(e.cwd);return n?`${e.kind} · ${n}`:e.kind}function fh(e){return e.parent===null&&e.host_kind===`broker`}function ph(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function mh(e,t){let n=[],r=new Set,i=[e];for(;i.length>0;){let e=i.pop();if(r.has(e.node_id))continue;r.add(e.node_id),n.push(e);let a=t.get(e.node_id);if(a)for(let e of a)i.push(e)}return n}function hh(e){return e===`done`||e===`dead`||e===`canceled`}function gh(e){return e.attention_count>0?`blocked`:e.status}function _h(e,t,n){return t>0?`needs-you`:e.status===`active`||n>0?`active`:hh(e.status)?`done`:`idle`}function vh(e){switch(e){case`needs-you`:return 0;case`active`:return 1;case`idle`:return 2;case`done`:return 3}}function yh(e){let t=ph(e),n=[];for(let r of e){if(!fh(r))continue;let e=mh(r,t),i=0,a=0;for(let t of e)i+=Math.max(0,t.attention_count),t.node_id!==r.node_id&&t.status===`active`&&(a+=1);n.push({id:r.node_id,title:dh(r),state:_h(r,i,a),attention:i,activeChildren:a,nodeCount:e.length,...r.cycles===void 0?{}:{cycles:r.cycles},lastActivity:r.last_activity??r.created})}return n.sort((e,t)=>{let n=vh(e.state)-vh(t.state);return n===0?t.lastActivity.localeCompare(e.lastActivity):n}),n}function bh(e){switch(e.state){case`needs-you`:return e.attention>1?`${e.attention} things need your input`:`Needs your input`;case`active`:return e.activeChildren>0?`Working — ${e.activeChildren} ${e.activeChildren===1?`task`:`tasks`} in progress`:`Working…`;case`done`:return`Finished`;case`idle`:return`Idle`}}function xh(e,t,n){if(e.key===`Enter`&&!e.shiftKey){if(e.altKey){e.preventDefault();let n=e.currentTarget,r=n.selectionStart??n.value.length,i=n.selectionEnd??r,a=`${n.value.slice(0,r)}\n${n.value.slice(i)}`,o=r+1;t(a),requestAnimationFrame(()=>{n.selectionStart=o,n.selectionEnd=o});return}e.metaKey||e.ctrlKey||(e.preventDefault(),n())}}var Sh=[`Research a topic for me`,`Help me write something`,`Review my code`,`Plan a project`];function Ch(){let{nodes:e,loading:t}=Zp(),n=zp(e=>e.reachable),r=(0,v.useMemo)(()=>yh(e),[e]),[i,a]=(0,v.useState)(!1),[o]=Bn();(0,v.useEffect)(()=>{o.get(`new`)!==null&&a(!0)},[o]);let s=!t&&r.length===0;return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,z.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-3`,children:[(0,z.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Conversations`}),!s&&!i&&(0,z.jsx)(Z,{size:`lg`,onClick:()=>a(!0),children:`+ New chat`})]}),!n&&(0,z.jsx)(`div`,{className:`mb-4 rounded-lg border px-4 py-2.5 text-sm`,style:{borderColor:`rgba(255,94,54,.3)`,background:`var(--blk-dim)`,color:`var(--ink2)`},children:`Couldn't reach your agents — retrying…`}),(i||s)&&(0,z.jsx)(wh,{firstRun:s,onCancel:s?void 0:()=>a(!1)}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,z.jsx)(Oh,{}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>(0,z.jsx)(Th,{conversation:e},e.id))})})]})}function wh({firstRun:e,onCancel:t}){let n=dt(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=async()=>{let e=r.trim();if(!(!e||a)){o(!0),c(null);try{let t=await bp({prompt:e,kind:`general`,mode:`base`,root:!0});n(`/c/${encodeURIComponent(t.node_id)}`)}catch(e){c(e instanceof mp?e.message:String(e)),o(!1)}}};return(0,z.jsxs)(`div`,{className:`panel mb-6 p-5`,children:[e&&(0,z.jsx)(`p`,{className:`mb-3 text-base`,style:{fontStyle:`italic`,color:`var(--ink2)`},children:`Start a conversation with an agent.`}),(0,z.jsx)(ym,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{xh(e,i,()=>void l())},rows:3,disabled:a,placeholder:`What do you want help with?`,className:`resize-none border-0 bg-transparent px-0 text-base shadow-none focus-visible:ring-0`}),(0,z.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Sh.map(e=>(0,z.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>i(e),className:`rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:border-[color:var(--line2)] hover:text-foreground`,children:e},e))}),s&&(0,z.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:s}),(0,z.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-2`,children:[t&&(0,z.jsx)(Z,{variant:`ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,z.jsx)(Z,{onClick:()=>void l(),disabled:a||!r.trim(),children:a?`Starting…`:`Start chat`})]})]})}function Th({conversation:e}){let t=dt();return(0,z.jsx)(`li`,{className:`list-none`,children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/c/${encodeURIComponent(e.id)}`),className:`panel flex w-full items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(Dh,{state:e.state}),(0,z.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title})]}),(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:bh(e)})]}),(0,z.jsxs)(`div`,{className:`font-inst flex shrink-0 items-center gap-3 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:[e.cycles!==void 0&&(0,z.jsxs)(`span`,{title:`cycles`,children:[`⟳ `,e.cycles]}),(0,z.jsxs)(`span`,{title:`nodes in this conversation`,children:[`◦ `,e.nodeCount,` `,e.nodeCount===1?`node`:`nodes`]}),(0,z.jsx)(`span`,{title:`time since last work`,children:kh(e.lastActivity)})]})]})})}var Eh={"needs-you":`needs you`,active:`active`,idle:`idle`,done:`done`};function Dh({state:e}){let t=e===`needs-you`?`blocked`:e,n=Eh[e];return(0,z.jsx)(`span`,{className:J(`dot shrink-0`,t),title:n,"aria-label":n})}function Oh(){return(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2,3].map(e=>(0,z.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,z.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded bg-muted`}),(0,z.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded bg-muted/70`})]}),(0,z.jsx)(`div`,{className:`h-6 w-16 animate-pulse rounded-full bg-muted`})]},e))})}function kh(e){let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}var Ah={active:Xf,idle:Bf,done:If,dead:Rf,canceled:zf,blocked:Ff};function jh({status:e}){return(0,z.jsx)(Ah[e]??Bf,{className:J(`!size-3.5`,e===`active`&&`animate-spin`)})}function Mh(e,t,n,r){return t===`static`?e.status:n===`down`?`dead`:n===`reconnecting`?`idle`:r?`active`:`idle`}function Nh(e){let t=e.store.source===`static`,n=e.store.state?.isStreaming??!1,r=e.detail,i=r?Mh(r,e.store.source,e.store.brokerStatus,n):null;return r?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`h2`,{className:J(Ph,`min-w-0 truncate`),title:r.name,children:r.name}),i&&(0,z.jsxs)(xm,{className:J(`gap-1.5`,i),children:[(0,z.jsx)(jh,{status:i}),i]}),t&&(0,z.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--idle)`},title:`dormant node — last-known values, not live`,children:`last-known`})]}):(0,z.jsx)(`h2`,{className:Ph,children:`…`})}var Ph=`con-title text-xl font-medium`;function Fh(e){let t=e.store.chrome,n=e.store.source===`static`,r=e.store.state?.isStreaming??!1,i=t.context,a=t.stats,o=t.tokens,s=i&&!n?i.percent:null,c=!n&&a?.cost!==void 0?a.cost:null;return!i&&c===null&&!a&&!o?null:(0,z.jsxs)(`div`,{className:`cluster`,children:[i&&(0,z.jsxs)(`div`,{className:`gauge`,children:[(0,z.jsxs)(`div`,{className:`glabel`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Context`}),(0,z.jsxs)(`span`,{className:`gval`,children:[s===null?`—`:Rh(s),s!==null&&(0,z.jsx)(`span`,{className:`u`,children:`%`})]})]}),(0,z.jsx)(`div`,{className:`gbar`,children:(0,z.jsx)(`i`,{style:{width:s===null?`0%`:`${Math.min(100,s)}%`}})}),(0,z.jsxs)(`div`,{className:`gsub`,children:[i.tokens.toLocaleString(),!n&&(0,z.jsxs)(z.Fragment,{children:[` / `,i.window.toLocaleString()]})]})]}),c!==null&&(0,z.jsxs)(`div`,{className:`gauge`,children:[(0,z.jsxs)(`div`,{className:`glabel`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Cost`}),(0,z.jsxs)(`span`,{className:`gval`,children:[(0,z.jsx)(`span`,{className:`u`,style:{marginLeft:0,marginRight:2},children:`$`}),c.toFixed(2)]})]}),(0,z.jsx)(`div`,{className:`gbar`,children:(0,z.jsx)(`i`,{style:{width:`${Math.min(100,c/5*100)}%`}})}),a&&(0,z.jsxs)(`div`,{className:`gsub`,children:[a.turns,` turns`]})]}),(0,z.jsxs)(`div`,{className:`dials`,children:[!n&&a&&c===null&&(0,z.jsx)(Ih,{value:String(a.turns),unit:`turns`}),!n&&a&&(0,z.jsx)(Ih,{value:`${a.user_messages}/${a.assistant_messages}`,unit:`msgs`}),o&&(0,z.jsx)(Ih,{value:`${Lh(o.input)} → ${Lh(o.output)}`,unit:`tokens`}),!n&&t.tool_calls!==null&&(0,z.jsx)(Ih,{value:String(t.tool_calls),unit:`tools`,hot:r})]})]})}function Ih({value:e,unit:t,hot:n}){return(0,z.jsx)(`div`,{className:`dial`,children:(0,z.jsxs)(`span`,{className:`dval`,style:n?{color:`var(--act)`}:void 0,children:[e,` `,(0,z.jsx)(`em`,{children:t})]})})}function Lh(e){return e>=1e6?`${Math.round(e/1e5)/10}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Rh(e){return(Math.round(e*10)/10).toFixed(1)}function zh({store:e,detail:t}){let n=e.chrome,r=[],i=n.branch??t?.branch??null;if(i!==null){let e=n.git_status??t?.git_status??null,a=e?.added??0,o=e?.modified??0;r.push((0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,z.jsx)(Wf,{className:`size-3.5 shrink-0 opacity-70`}),(0,z.jsx)(`b`,{style:Bh,children:i}),a>0&&(0,z.jsxs)(`span`,{style:{color:`var(--act)`,opacity:.8},children:[` +`,a]}),o>0&&(0,z.jsxs)(`span`,{style:{color:`var(--idle)`,opacity:.8},children:[` ~`,o]})]},`branch`))}let a=t?.cwd??null;a!==null&&r.push((0,z.jsx)(`span`,{children:Vh(a)},`cwd`));let o=n.model??t?.model??null;o!==null&&r.push((0,z.jsx)(`span`,{children:(0,z.jsx)(`b`,{style:Bh,children:o})},`model`));let s=n.context??null;return s!==null&&r.push((0,z.jsxs)(`span`,{children:[`ctx `,(0,z.jsx)(`b`,{style:Bh,children:Hh(s.tokens)}),` / `,Hh(s.window)]},`ctx`)),r.length===0?null:(0,z.jsx)(`div`,{className:`flex min-w-0 items-center gap-5 whitespace-nowrap border-b px-6 py-2 text-xs`,style:{borderColor:`var(--line)`,background:`rgba(0,0,0,.18)`,color:`var(--mut)`},children:r.map((e,t)=>(0,z.jsxs)(v.Fragment,{children:[t>0&&(0,z.jsx)(`span`,{style:{color:`var(--dim)`,opacity:.5},className:`select-none`,children:`·`}),e]},t))})}var Bh={color:`var(--ink2)`,fontWeight:400};function Vh(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}function Hh(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Uh(e){let[t,n]=(0,v.useState)(!1),r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){n(!1);return}if(e.altKey&&e.code===`KeyI`){if(document.activeElement instanceof HTMLTextAreaElement)return;e.preventDefault(),n(e=>!e)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),t?(0,z.jsx)(`div`,{className:`in fixed inset-0 z-50 flex items-start justify-center pt-22`,style:{background:`rgba(0,0,0,.42)`,backdropFilter:`blur(2px)`},onMouseDown:e=>{r.current?.contains(e.target)||n(!1)},children:(0,z.jsxs)(`div`,{ref:r,className:`panel rv`,style:Wh,children:[(0,z.jsxs)(`div`,{style:Gh,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Instruments`}),(0,z.jsx)(`div`,{style:{flex:1}}),(0,z.jsx)(`span`,{className:`kbd`,children:`⌥i`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`transition-colors`,style:{color:`var(--mut)`},"aria-label":`Close instruments`,children:(0,z.jsx)(ap,{className:`size-3.5`})})]}),(0,z.jsx)(Fh,{store:e.store,detail:e.detail})]})}):null}var Wh={minWidth:`min(680px, 92vw)`,overflow:`hidden`,"--i":0},Gh={display:`flex`,alignItems:`center`,gap:`10px`,padding:`11px 30px`,borderBottom:`1px solid var(--line)`};function Kh(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function qh(e,t){let n=[],r=new Set,i=[{node:e,depth:0}];for(;i.length>0;){let e=i.pop();if(r.has(e.node.node_id))continue;r.add(e.node.node_id),n.push({node:e.node,depth:e.depth});let a=t.get(e.node.node_id)??[];for(let t=a.length-1;t>=0;t--)i.push({node:a[t],depth:e.depth+1})}return n}function Jh(e,t){let n=t.get(e),r=new Set;for(;n&&n.parent!==null;){if(r.has(n.node_id))return null;r.add(n.node_id),n=t.get(n.parent)}return n??null}function Yh(e,t){let n=new Map(e.map(e=>[e.node_id,e])),r=Kh(e),i=Jh(t,n),a=i?.node_id??null;return{thisGraph:i===null?[]:qh(i,r),otherGraphs:e.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==a&&(e.status===`active`||e.attention_count>0))}}var Xh=new Set([`done`,`dead`,`canceled`]),Zh=`crtr:graphrail-collapsed`;function Qh(e){return e.attention_count>0||e.status===`active`}function $h(e,t){let n=new Map(e.map(e=>[e.node.node_id,e.node])),r=new Map;for(let{node:t}of e){if(t.parent===null||!n.has(t.parent))continue;let e=r.get(t.parent);e?e.push(t.node_id):r.set(t.parent,[t.node_id])}let i=new Map,a=e=>{let o=i.get(e);if(o!==void 0)return o;i.set(e,!1);let s=n.get(e),c=e===t||s!==void 0&&Qh(s);if(!c){for(let t of r.get(e)??[])if(a(t)){c=!0;break}}return i.set(e,c),c},o=new Set;for(let{node:t}of e)(r.get(t.node_id)?.length??0)>0&&!a(t.node_id)&&o.add(t.node_id);return{children:r,collapsedByDefault:o}}function eg({currentId:e,onNavigate:t}){let{nodes:n}=Zp(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(Zh)===`1`}catch{return!1}}),[s,c]=(0,v.useState)({}),{thisGraph:l}=Yh(n,e),u=l[0]?.node.node_id??null,{children:d,collapsedByDefault:f}=(0,v.useMemo)(()=>$h(l,e),[l,e]),p=e=>s[e]===void 0?f.has(e):!s[e],m=e=>c(t=>({...t,[e]:p(e)})),h=()=>{o(e=>{let t=!e;try{localStorage.setItem(Zh,t?`1`:`0`)}catch{}return t})},{liveRoots:g,deadRoots:_}=(0,v.useMemo)(()=>{let e=n.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==u),t=[],r=[];for(let n of e)(Xh.has(n.status)&&n.attention_count===0?r:t).push(n);let i=(e,t)=>Date.parse(t.created)-Date.parse(e.created),a=e=>e.attention_count>0?0:e.status===`active`?1:2;return t.sort((e,t)=>a(e)-a(t)||i(e,t)),r.sort(i),{liveRoots:t,deadRoots:r}},[n,u]);if((0,v.useEffect)(()=>{let n=n=>{if(!n.altKey||n.key!==`ArrowUp`&&n.key!==`ArrowDown`)return;let r=l.findIndex(t=>t.node.node_id===e);if(r===-1)return;n.preventDefault();let i=n.key===`ArrowUp`?l[r-1]:l[r+1];i&&t(i.node.node_id)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[l,e,t]),a)return(0,z.jsx)(`aside`,{className:`graphrail rv`,style:ng,children:(0,z.jsx)(`button`,{type:`button`,onClick:h,title:`Expand graph sidebar`,"aria-label":`Expand graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,z.jsx)(Nf,{className:`size-4`})})});let y=[],b=null;for(let{node:n,depth:r}of l){if(b!==null){if(r>b)continue;b=null}let i=d.get(n.node_id)??[],a=i.length>0&&p(n.node_id);y.push((0,z.jsx)(lg,{node:n,depth:r,current:n.node_id===e,hasChildren:i.length>0,collapsed:a,onToggleCollapse:()=>m(n.node_id),onClick:()=>t(n.node_id)},n.node_id)),a&&(b=r)}return(0,z.jsxs)(`aside`,{className:`graphrail rv`,style:tg,children:[(0,z.jsx)(`div`,{className:`flex items-center justify-end pb-1`,children:(0,z.jsx)(`button`,{type:`button`,onClick:h,title:`Collapse graph sidebar`,"aria-label":`Collapse graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,z.jsx)(Nf,{className:`size-4 rotate-180`})})}),(0,z.jsx)(rg,{label:`This graph`,chord:`⌥↑↓ to cycle`}),y,l.length===0&&(0,z.jsx)(ig,{}),(g.length>0||_.length>0)&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`gr-gap`}),(0,z.jsx)(rg,{label:`Elsewhere`}),g.map(e=>(0,z.jsx)(lg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id)),_.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`mt-1 flex items-center gap-1.5 rounded-md px-3 py-2 text-left text-xs text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:[(0,z.jsx)(Nf,{className:J(`size-3.5 transition-transform`,r&&`rotate-90`)}),r?`Hide`:`Show`,` `,_.length,` finished`]}),r&&_.map(e=>(0,z.jsx)(lg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id))]})]})]})}var tg={width:`228px`,flex:`none`,display:`flex`,flexDirection:`column`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 9px`,overflowY:`auto`,zIndex:1,"--i":2},ng={width:`36px`,flex:`none`,display:`flex`,flexDirection:`column`,alignItems:`center`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 6px`,zIndex:1,"--i":2};function rg({label:e,chord:t}){return(0,z.jsxs)(`div`,{className:`gr-sec`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:e}),(0,z.jsx)(`div`,{className:`rule`}),t&&(0,z.jsx)(`span`,{title:t,"aria-label":t,className:`flex items-center text-[var(--dim)]`,children:(0,z.jsx)(qf,{className:`size-3.5`})})]})}function ig(){return(0,z.jsx)(`span`,{className:`px-3 py-1 font-mono text-xs`,style:{color:`var(--dim)`},children:`—`})}function ag(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return``;let n=Math.floor(t/1e3);if(n<60)return`${n}s`;let r=Math.floor(n/60);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function og(e){return e.split(`/`).filter(Boolean).at(-1)??e}function sg(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}var cg={active:`s-active`,idle:`s-idle`,done:`s-done`,dead:`s-dead`,canceled:`s-canceled`};function lg({node:e,depth:t,current:n,elsewhere:r=!1,hasChildren:i=!1,collapsed:a=!1,onToggleCollapse:o,onClick:s}){let c=Xh.has(e.status),l=e.attention_count>0,u=l?`blocked`:e.status,d=ag(e.created),f=t>0?{marginLeft:`${t*12}px`}:void 0,p=(0,z.jsx)(`button`,{type:`button`,onClick:s,className:J(`node-row text-left`,r?`w-full`:`min-w-0 flex-1`,l?`s-blocked`:cg[e.status],c&&!l&&`dimmed`,n&&`rounded-md border border-[var(--line2)] bg-[oklch(0.92_0.013_80_/_8%)] shadow-[inset_0_1px_0_var(--raise)]`),children:(0,z.jsxs)(`span`,{className:`node-id`,children:[(0,z.jsxs)(`span`,{className:`node-l1`,children:[(0,z.jsx)(`span`,{className:J(`node-name truncate`,n&&`font-semibold`),children:r?og(e.cwd):e.name}),r?(0,z.jsxs)(`span`,{className:`node-kind truncate`,children:[e.name,` · `,e.kind]}):(0,z.jsx)(`span`,{className:`node-kind`,children:e.kind}),l&&(0,z.jsxs)(xm,{variant:`destructive`,className:`ml-auto gap-1 text-xs`,children:[(0,z.jsx)(Uf,{className:`size-3.5`}),e.attention_count]})]}),(0,z.jsxs)(`span`,{className:`node-l2`,children:[r&&(0,z.jsx)(`span`,{className:`node-cwd`,children:sg(e.cwd)}),(0,z.jsx)(`span`,{className:J(`dot`,u),title:u,"aria-label":u}),d&&(0,z.jsx)(`span`,{className:`text-[var(--dim)]`,children:d})]})]})});return r?(0,z.jsx)(`div`,{style:f,children:p}):(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,style:f,children:[i?(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o?.()},title:a?`Expand branch`:`Collapse branch`,"aria-label":a?`Expand branch`:`Collapse branch`,className:`flex size-4 flex-none items-center justify-center rounded-sm text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,z.jsx)(Nf,{className:J(`size-3.5 transition-transform`,!a&&`rotate-90`)})}):(0,z.jsx)(`span`,{className:`size-4 flex-none`,"aria-hidden":`true`}),p]})}function ug(e){let t=e?.diagnostics;return Array.isArray(t)&&t.some(e=>e?.type===`crtr:managed-provider-cooling`)}function dg(e){return typeof e==`object`&&!!e}function fg(e){return typeof e==`string`?e:``}function pg(e){let t=e??``;return/rate.?limit|\b429\b|too many requests|quota/i.test(t)?`rate-limit`:/invalid_grant|refresh token|unauthori[sz]ed|invalid.?api.?key|authentication failed|\b401\b|\b403\b/i.test(t)?`auth`:/context overflow recovery failed/i.test(t)?`context-overflow`:/websocket.*(?:closed.*\b(?:1002|1003|1007|1008|1009|1010)\b|protocol error|policy violation|unsupported data|invalid (?:frame|payload)|message too big|mandatory extension)/i.test(t)?`protocol`:/overloaded|\b5\d\d\b|internal server error|api.?error|capacity|server.{0,3}busy|temporarily unavailable/i.test(t)?`overloaded`:/connection|econnreset|etimedout|enotfound|econnrefused|network|fetch failed|socket hang|timed? out|timeout|\bterminated\b|other side closed|premature close|websocket\s+(?:was\s+)?closed|websocket stream closed before response\.completed|websocket\s+error|websocket.*interrupt/i.test(t)?`connection`:`other`}function mg(e){let t=fg(e.code)||fg(e.errno);return t===``?null:/^(ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOENT|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH)$/i.test(t)?`connection`:null}function hg(e){let t=typeof e.status==`number`?e.status:null;return t===null?null:t===401||t===403?`auth`:t===429?`rate-limit`:t===503||t===529||t>=500&&t<=599?`overloaded`:t>=400&&t<=499?`protocol`:null}function gg(e){let t=typeof e.code==`number`?e.code:null;if(t===null)return null;if(t===1008)return`protocol`;if(t===1006)return`connection`;if(t===1011){let t=fg(e.reason);return/no running broker/i.test(t)||pg(t)===`connection`?`connection`:`other`}return null}function _g(e,t){return t===`auth`||t===`protocol`||t===`context-overflow`?`fatal`:e===`pi→provider`?t===`connection`||t===`rate-limit`||t===`overloaded`?`auto`:`fatal`:`manual`}function vg(e){if(typeof e==`string`)return e;if(!dg(e))return``;let t=[e.message,e.errorMessage,e.reason,e.body,e.statusText];for(let e of t)if(typeof e==`string`&&e!==``)return e;let n=e.error;if(dg(n)){let e=n.message;if(typeof e==`string`&&e!==``)return e;let t=n.reason;if(typeof t==`string`&&t!==``)return t}return``}function yg(e,t){if(e===`pi→provider`&&ug(t))return{kind:`rate-limit`,disposition:`auto`};if(dg(t)){let n=mg(t);if(n!==null)return{kind:n,disposition:_g(e,n)};let r=hg(t);if(r!==null)return{kind:r,disposition:_g(e,r)};let i=gg(t);if(i!==null)return{kind:i,disposition:_g(e,i)}}let n=pg(vg(t));return{kind:n,disposition:_g(e,n)}}var bg=class{nodeId;handlers;ws;closedReported=!1;constructor(e,t){this.nodeId=e,this.handlers=t}get url(){let e=location.protocol===`https:`?`wss:`:`ws:`,t=new URL(`/node/${encodeURIComponent(this.nodeId)}`,window.location.href);return t.protocol=e,pp!==void 0&&t.searchParams.set(`token`,pp),t.toString()}connect(){let e;try{e=new WebSocket(this.url)}catch(e){this.reportClose(`transient`,`failed to open ws: ${String(e)}`);return}this.ws=e,e.onopen=()=>this.handlers.onOpen?.(),e.onmessage=e=>this.onMessage(e),e.onclose=e=>{let t=yg(`browser↔relay`,{code:e.code,reason:e.reason}),n=e.code===1008||t.kind===`protocol`?`invalid`:e.code===1011&&/^no node /.test(e.reason)?`no-node`:e.code===1011&&/^no running broker/.test(e.reason)?`no-broker`:`transient`;this.reportClose(n,e.reason||`closed (${e.code})`)},e.onerror=()=>{}}onMessage(e){if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.handlers.onFrame?.(t)}send(e){let t=this.ws;if(!(t===void 0||t.readyState!==WebSocket.OPEN))try{t.send(JSON.stringify(e))}catch{}}close(){let e=this.ws;if(e!==void 0&&e.readyState<=WebSocket.OPEN)try{e.close()}catch{}}reportClose(e,t){this.closedReported||(this.closedReported=!0,this.ws=void 0,this.handlers.onClose?.(e,t))}};function xg(e){return typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.filter(e=>typeof e==`object`&&!!e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``):``}function Sg(e){let t=e.match(/^\[crtr\]\s+Context\s+(~\d+k)\b/)?.[1];return t===void 0?`context-window guidance`:`Context ${t}`}var Cg=/^From ([a-z0-9]+(?:-[a-z0-9]+)+|system|human) — (\d+) update/m;function wg(e){return Cg.test(e)}function Tg(e){return Cg.exec(e)?.[1]??null}function Eg(e){let t=[...e.matchAll(/^From ([a-z0-9]+(?:-[a-z0-9]+)+|system|human) — (\d+) update/gm)];if(t.length===0)return`node update`;let n=t.reduce((e,t)=>e+Number(t[2]??0),0);if(t.length===1){let e=t[0]?.[1]??`system`;return`${n} update${n===1?``:`s`} from ${e}`}return`${n} updates from ${t.length} senders`}function Dg(e){let t=xg(e);return e.role===`custom`?e.customType===`crtr-context`?{kind:`bearings`,label:`crtr context`,summary:`orienting bearings`,body:t}:e.customType===`crtr-situational-context`?{kind:`situational`,label:`situational context`,summary:`ambient context update`,body:t}:e.customType===`crtr-context-nudge`?{kind:`context-nudge`,label:`crtr`,summary:Sg(t),body:t}:null:e.role===`user`?t.startsWith(`You have been revived fresh after a context refresh`)?{kind:`revive`,label:`crtr revive`,summary:`fresh context kickoff`,body:t}:t.startsWith(`[crtr] Context ~`)?{kind:`context-nudge`,label:`crtr`,summary:Sg(t),body:t}:wg(t)?{kind:`inbox`,label:`crtr inbox`,summary:Eg(t),body:t}:null:null}function Og(){return{messages:[],streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]}}function kg(e){let t=e.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>!!e&&e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``):``}function Ag(e){return Ng(e)!==`user`||e.origin||!wg(kg(e))?e:{...e,origin:`inbox`}}function jg(){return{role:`assistant`,content:[]}}function Mg(e,t){let n=e.messages.map(Ag);if(e.state?.isStreaming!==!0)return{messages:n,streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]};let r=n.length-1;if(r>=0&&Ng(n[r])===`assistant`)return{messages:n,streamingIndex:r,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]};let i=t&&t.streamingIndex!==null?t.messages[t.streamingIndex]:void 0,a=i&&Ng(i)===`assistant`?i:jg(),o=[...n,a];return{messages:o,streamingIndex:o.length-1,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]}}function Ng(e){return e.role??``}function Pg(e){for(let t=e.messages.length-1;t>=0;t--)if(Ng(e.messages[t])===`bashExecution`)return t;return null}function Fg(e,t,n){let r={role:`bashExecution`,command:t,output:``,exitCode:void 0,cancelled:!1,truncated:!1,excludeFromContext:n,timestamp:Date.now()};return{...e,messages:[...e.messages,r]}}function Ig(e,t){let n=Pg(e);if(n===null)return e;let r=[...e.messages],i=r[n];return r[n]={...i,output:`${i.output??``}${t}`},{...e,messages:r}}function Lg(e,t){let n=Pg(e);if(n===null)return e;let r=[...e.messages];return r[n]={...r[n],exitCode:t.exitCode,cancelled:t.cancelled,truncated:t.truncated,fullOutputPath:t.fullOutputPath},{...e,messages:r}}function Rg(e,t){switch(t.type){case`agent_start`:return{...e,isStreaming:!0,activity:`Working…`};case`agent_end`:return{...e,isStreaming:!1,activity:null,streamingIndex:null,executingToolIds:e.executingToolIds.size?new Set:e.executingToolIds};case`message_start`:{let n=Ag(t.message),r=[...e.messages,n],i=Ng(n)===`assistant`,a=e.partialToolResults;if(Ng(n)===`toolResult`){let e=n.toolCallId;if(typeof e==`string`&&a.has(e)){let t=new Map(a);t.delete(e),a=t}}return{...e,messages:r,partialToolResults:a,streamingIndex:i?r.length-1:e.streamingIndex}}case`message_update`:{let n=e.streamingIndex;if(n===null){let t=e.messages.length-1;t>=0&&Ng(e.messages[t])===`assistant`&&(n=t)}if(n===null)return e;let r=[...e.messages];return r[n]=t.message,{...e,messages:r,streamingIndex:n}}case`message_end`:{if(e.streamingIndex===null)return e;let n=[...e.messages];return n[e.streamingIndex]=t.message,{...e,messages:n,streamingIndex:null}}case`tool_execution_start`:{let n=new Set(e.executingToolIds);return n.add(t.toolCallId),{...e,executingToolIds:n}}case`tool_execution_update`:{let n=new Map(e.partialToolResults);return n.set(t.toolCallId,zg(t.toolCallId,t.toolName,t.partialResult,!1)),{...e,partialToolResults:n}}case`tool_execution_end`:{let n=new Set(e.executingToolIds);n.delete(t.toolCallId);let r=new Map(e.partialToolResults);return r.set(t.toolCallId,zg(t.toolCallId,t.toolName,t.result,t.isError)),{...e,executingToolIds:n,partialToolResults:r}}case`compaction_start`:return{...e,activity:`Compacting context…`};case`compaction_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`auto_retry_start`:return{...e,activity:`Retrying (${t.attempt}/${t.maxAttempts}) in ${Math.ceil(t.delayMs/1e3)}s…`};case`auto_retry_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`queue_update`:return{...e,queued:[...t.steering,...t.followUp]};default:return e}}function zg(e,t,n,r){let i=typeof n==`object`&&n?n:{};return{role:`toolResult`,toolCallId:e,toolName:t,...i,content:Array.isArray(i.content)?i.content:[],isError:r}}var Bg=4,Vg=new Set([`knowledge`,`preference`]),Hg=new Set([`node`,`project`,`profile`,`user`,`builtin`]),Ug=new Set([`name`,`kind`,`scope`,`shortForm`]),Wg=new Set([`stop`,`length`,`toolUse`,`error`,`aborted`]),Gg=new Set([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),Kg=200,qg=256*1024,Jg=20,Yg=8*1024*1024;function Xg(e){return{schemaVersion:Bg,...e}}function Zg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e){return typeof e==`string`}function Qg(e){return typeof e==`number`}function $g(e){return typeof e==`boolean`}function e_(e){return Array.isArray(e)&&e.every(Q)}function t_(e){return!Zg(e)||e.type!==`text`||!Q(e.text)?!1:e.textSignature===void 0||Q(e.textSignature)}function n_(e){return Zg(e)&&e.type===`image`&&Q(e.data)&&Q(e.mimeType)}function r_(e){return Zg(e)&&e.type===`toolCall`&&Q(e.id)&&Q(e.name)&&Zg(e.arguments)&&(e.thoughtSignature===void 0||Q(e.thoughtSignature))}function i_(e){return Zg(e)&&Qg(e.input)&&Qg(e.output)&&Qg(e.cacheRead)&&Qg(e.cacheWrite)&&Qg(e.total)}function a_(e){return Zg(e)&&Qg(e.input)&&Qg(e.output)&&Qg(e.cacheRead)&&Qg(e.cacheWrite)&&(e.cacheWrite1h===void 0||Qg(e.cacheWrite1h))&&(e.reasoning===void 0||Qg(e.reasoning))&&Qg(e.totalTokens)&&i_(e.cost)}function o_(e){return typeof e==`string`&&Wg.has(e)}function s_(e){return typeof e==`string`&&Gg.has(e)}function c_(e){return!Zg(e)||!Q(e.message)?!1:(e.name===void 0||Q(e.name))&&(e.stack===void 0||Q(e.stack))&&(e.code===void 0||Q(e.code)||Qg(e.code))}function l_(e){return!Zg(e)||!Q(e.type)||!Qg(e.timestamp)?!1:(e.error===void 0||c_(e.error))&&(e.details===void 0||Zg(e.details))}function u_(e){return!Zg(e)||e.role!==`user`||!Qg(e.timestamp)?!1:typeof e.content==`string`||Array.isArray(e.content)&&e.content.every(e=>t_(e)||n_(e))}function d_(e){return!Zg(e)||e.role!==`assistant`||!Qg(e.timestamp)||!Array.isArray(e.content)||!e.content.every(e=>t_(e)||Zg(e)&&e.type===`thinking`&&Q(e.thinking)&&(e.thinkingSignature===void 0||Q(e.thinkingSignature))&&(e.redacted===void 0||$g(e.redacted))||r_(e))?!1:Q(e.api)&&Q(e.provider)&&Q(e.model)&&(e.responseModel===void 0||Q(e.responseModel))&&(e.responseId===void 0||Q(e.responseId))&&(e.diagnostics===void 0||Array.isArray(e.diagnostics)&&e.diagnostics.every(l_))&&a_(e.usage)&&o_(e.stopReason)&&(e.errorMessage===void 0||Q(e.errorMessage))}function f_(e){return!Zg(e)||e.role!==`toolResult`||!Qg(e.timestamp)?!1:Q(e.toolCallId)&&Q(e.toolName)&&Array.isArray(e.content)&&e.content.every(e=>t_(e)||n_(e))&&$g(e.isError)}function p_(e){return Zg(e)&&e.role===`bashExecution`&&Q(e.command)&&Q(e.output)&&Qg(e.timestamp)&&(e.exitCode===void 0||Qg(e.exitCode))&&$g(e.cancelled)&&$g(e.truncated)&&(e.fullOutputPath===void 0||Q(e.fullOutputPath))&&(e.excludeFromContext===void 0||$g(e.excludeFromContext))}function m_(e){return u_(e)||d_(e)||f_(e)||p_(e)}function h_(e){return!Zg(e)||!Q(e.role)?!1:e.role!==`user`&&e.role!==`assistant`&&e.role!==`toolResult`&&e.role!==`bashExecution`}function g_(e){return m_(e)||h_(e)}function __(e){if(!Zg(e))return!1;let t=Object.keys(e);return t.length!==Ug.size||!t.every(e=>Ug.has(e))?!1:Q(e.name)&&Vg.has(e.kind)&&Hg.has(e.scope)&&Q(e.shortForm)}function v_(e){return e_(e)}function y_(e){return!Zg(e)||!Q(e.name)||!Q(e.description)||e.source!==`builtin`&&e.source!==`command`&&e.source!==`template`?!1:e.template===void 0&&e.expansion===void 0&&(e.location===void 0||e.location===`user`||e.location===`project`||e.location===`path`)&&(e.path===void 0||Q(e.path))&&(e.argument_hint===void 0||Q(e.argument_hint))}function b_(e){return e===null?!0:Zg(e)?Q(e.sessionId)&&(e.sessionFile===void 0||Q(e.sessionFile))&&(e.model===void 0||Zg(e.model)&&Q(e.model.id))&&$g(e.isStreaming)&&$g(e.isCompacting)&&s_(e.thinkingLevel)&&(e.steeringMode===`all`||e.steeringMode===`one-at-a-time`)&&(e.followUpMode===`all`||e.followUpMode===`one-at-a-time`)&&(e.sessionName===void 0||Q(e.sessionName))&&$g(e.autoCompactionEnabled)&&Qg(e.messageCount)&&Qg(e.pendingMessageCount):!1}function x_(e,t){return Zg(t)?t.schemaVersion===Bg&&t.nodeId===e&&Array.isArray(t.messages)&&t.messages.every(g_)&&b_(t.sessionState)&&Array.isArray(t.commands)&&t.commands.every(y_)&&Array.isArray(t.refs)&&t.refs.every(__)&&v_(t.engineLeadingCommandNames)&&$g(t.isStreaming)&&(t.activity===null||Q(t.activity))&&Qg(t.updatedAt)&&(t.source===`broker`||t.source===`static`):!1}function S_(e){return new TextEncoder().encode(JSON.stringify(e)).length}function C_(e){return{...e,commands:e.commands.map(({template:e,expansion:t,...n})=>n),refs:e.refs.map(({name:e,kind:t,scope:n,shortForm:r})=>({name:e,kind:t,scope:n,shortForm:r}))}}function w_(e,t,n){let r=e.messages.slice(-t),i={...e,messages:r};for(;r.length>1&&S_(i)>n;)r=r.slice(1),i={...e,messages:r};return i}function T_(e){return`crtr.web.transcript.tail.${e}`}function E_(e){try{let t=globalThis.localStorage?.getItem(T_(e));if(t==null)return null;let n=JSON.parse(t);return x_(e,n)?n:(globalThis.localStorage?.removeItem(T_(e)),null)}catch{try{globalThis.localStorage?.removeItem(T_(e))}catch{}return null}}function D_(e){let t=w_(C_(e),Jg,qg);try{globalThis.localStorage?.setItem(T_(e.nodeId),JSON.stringify(t))}catch{}}var O_=`crtr-web-transcript-cache`,k_=1,A_=`entries`;function j_(){return new Promise((e,t)=>{if(typeof indexedDB>`u`){t(Error(`indexedDB unavailable`));return}let n=indexedDB.open(O_,k_);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(A_)||e.createObjectStore(A_,{keyPath:`nodeId`}).createIndex(`updatedAt`,`updatedAt`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))})}async function M_(e,t){await new Promise((n,r)=>{let i=e.transaction(A_,`readwrite`);i.objectStore(A_).delete(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB delete failed`))})}async function N_(e){try{let t=await j_(),n=await new Promise((n,r)=>{let i=t.transaction(A_,`readonly`).objectStore(A_).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error??Error(`indexedDB read failed`))});return x_(e,n)?(t.close(),n):(n!=null&&await M_(t,e),t.close(),null)}catch{return null}}async function P_(e){let t=[];await new Promise((n,r)=>{let i=e.transaction(A_,`readonly`).objectStore(A_).index(`updatedAt`).openCursor();i.onsuccess=()=>{let e=i.result;if(!e){n();return}let r=e.value;t.push({nodeId:r.nodeId,updatedAt:r.updatedAt,size:S_(r)}),e.continue()},i.onerror=()=>r(i.error??Error(`indexedDB cursor failed`))});let n=t.reduce((e,t)=>e+t.size,0);n<=Yg||await new Promise((r,i)=>{let a=e.transaction(A_,`readwrite`),o=a.objectStore(A_),s=0;for(;n>Yg&&s<t.length;){let e=t[s];o.delete(e.nodeId),n-=e.size,s+=1}a.oncomplete=()=>r(),a.onerror=()=>i(a.error??Error(`indexedDB prune failed`))})}async function F_(e){let t=w_(C_(e),Kg,qg);try{let e=await j_();await new Promise((n,r)=>{let i=e.transaction(A_,`readwrite`);i.objectStore(A_).put(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB write failed`))}),await P_(e),e.close()}catch{}}function I_(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;try{let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null||Object.getOwnPropertySymbols(e).length!==0)return!1;let n=Object.getOwnPropertyNames(e).sort();if(n.length!==3||n[0]!==`body`||n[1]!==`commandName`||n[2]!==`kind`)return!1;let r=Object.getOwnPropertyDescriptors(e);if(Object.values(r).some(e=>!(`value`in e)))return!1;let i=e;return i.kind!==`memory-slash`||typeof i.commandName!=`string`||typeof i.body!=`string`?!1:(JSON.stringify(e),!0)}catch{return!1}}function L_(e){return{clientId:e,conn:`connecting`,conv:Og(),role:`observer`,session:null,model:void 0,sessionName:void 0,contextTokens:void 0,dialog:null,commands:[],refs:[],engineLeadingCommandNames:[],pendingRefsRequestId:null,statuses:{},widgets:{},title:void 0,notice:null}}var R_={"no-broker":`no-broker`,"no-node":`no-node`,invalid:`invalid`,transient:`closed`};function z_(e){return e===`welcome`||e===`model_changed`||e===`error`||e===`ack`||e===`data`||e===`bash_start`||e===`bash_output`||e===`bash_end`||e===`extension_ui_request`||e===`extension_ui_dismiss`}function B_(e,t){switch(t.kind){case`connecting`:return e.conn===`connecting`?e:{...e,conn:`connecting`};case`closed`:{let n=R_[t.closeKind];return e.conn===n?e:{...e,conn:n}}case`notice`:return e.notice===t.text?e:{...e,notice:t.text};case`dismiss-dialog`:return e.dialog===null?e:{...e,dialog:null};case`request-refs`:return{...e,refs:[],engineLeadingCommandNames:[],pendingRefsRequestId:t.id};case`frame`:return Y_(e,t.frame)}}function V_(e,t){let n=e.expansion===t.expansion||e.expansion!==void 0&&t.expansion!==void 0&&e.expansion.kind===t.expansion.kind&&e.expansion.commandName===t.expansion.commandName&&e.expansion.body===t.expansion.body;return e.name===t.name&&e.description===t.description&&e.source===t.source&&e.location===t.location&&e.path===t.path&&e.argument_hint===t.argument_hint&&e.template===t.template&&n}function H_(e,t){return e.length===t.length&&e.every((e,n)=>V_(e,t[n]))}function U_(e,t){return e.name===t.name&&e.kind===t.kind&&e.scope===t.scope&&e.shortForm===t.shortForm}function W_(e,t){return e.length===t.length&&e.every((e,n)=>U_(e,t[n]))}function G_(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function K_(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.placement===t.placement&&e.lines.length===t.lines.length&&e.lines.every((e,n)=>e===t.lines[n])}function q_(e){if(e===void 0||e.trim()===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.description==`string`&&(t.source===`builtin`||t.source===`command`||t.source===`template`)&&(t.template===void 0||typeof t.template==`string`)&&(t.expansion===void 0||I_(t.expansion))}):[]}catch{return[]}}function J_(e){let t=e.messages.length-1,n=e.isStreaming&&t>=0?t:null;return{messages:e.messages,streamingIndex:n,executingToolIds:new Set,partialToolResults:new Map,isStreaming:e.isStreaming,activity:e.activity,queued:[]}}function Y_(e,t){if(!z_(t.type))return{...e,conv:Rg(e.conv,t)};switch(t.type){case`welcome`:{let n=Mg(t.snapshot,e.conv),r=t.snapshot.state;return{...e,conn:`open`,conv:n,role:t.role,session:r,model:r.model?.id,sessionName:r.sessionName,contextTokens:t.snapshot.stats?.tokens?.total,dialog:t.pending_dialog??null,commands:[],statuses:t.snapshot.display?.statuses??{},widgets:t.snapshot.display?.widgets??{},title:t.snapshot.display?.title??e.title,refs:[],engineLeadingCommandNames:[],pendingRefsRequestId:null}}case`model_changed`:return e.model===t.model?.id&&(e.session===null||e.session.model?.id===t.model?.id)?e:{...e,model:t.model?.id,session:e.session?{...e.session,model:t.model}:e.session};case`error`:{let n=t.message||`error: ${t.code}`;return e.notice===n?e:{...e,notice:n}}case`extension_ui_request`:switch(t.method){case`setStatus`:{let n=e.statuses[t.statusKey];if(t.statusText===void 0?n===void 0:n===t.statusText)return e;let r={...e.statuses};return t.statusText===void 0?delete r[t.statusKey]:r[t.statusKey]=t.statusText,{...e,statuses:r}}case`setWidget`:{let n=e.widgets[t.widgetKey],r=t.widgetLines===void 0?void 0:{lines:t.widgetLines,placement:t.widgetPlacement??`aboveEditor`};if(K_(n,r))return e;let i={...e.widgets};return r===void 0?delete i[t.widgetKey]:i[t.widgetKey]=r,{...e,widgets:i}}case`setTitle`:return e.title===t.title?e:{...e,title:t.title};default:return{...e,dialog:t}}case`extension_ui_dismiss`:return e.dialog&&e.dialog.id===t.id?{...e,dialog:null}:e;case`ack`:{if(t.for!==`get_commands`)return e;let n=t.ok?q_(t.detail):[];return H_(e.commands,n)?e:{...e,commands:n}}case`bash_start`:return{...e,conv:Fg(e.conv,t.command,t.excludeFromContext)};case`bash_output`:return{...e,conv:Ig(e.conv,t.chunk)};case`bash_end`:return{...e,conv:Lg(e.conv,t)};case`data`:return t.kind!==`list_memory_refs`||t.id!==e.pendingRefsRequestId||!Array.isArray(t.refs)||!t.refs.every(__)||!v_(t.engineLeadingCommandNames)||W_(e.refs,t.refs)&&G_(e.engineLeadingCommandNames,t.engineLeadingCommandNames)?e:{...e,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames};default:return e}}var X_=1500,Z_=800,Q_=5e3,$_=10;function ev(e){return Math.min(Q_,Z_*2**e)}var tv=class e{nodeId;static CACHE_WRITE_DEBOUNCE_MS=500;clientId;actions;pinned=!1;state;listeners=new Set;client=null;gen=0;timer=null;cacheWriteTimer=null;role=`observer`;streaming=!1;cachedUpdatedAt=0;liveAttached=!1;started=!1;noBrokerAttempts=0;constructor(e){this.nodeId=e,this.clientId=crypto.randomUUID(),this.state=L_(this.clientId);let t=E_(e);t&&(this.state={...this.state,conv:J_(t),session:t.sessionState,commands:t.commands,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames,model:t.sessionState?.model?.id,sessionName:t.sessionState?.sessionName},this.cachedUpdatedAt=t.updatedAt),this.actions=this.buildActions()}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;ensureStarted(){this.started||(this.started=!0,this.hydrateFromFullMirror(),this.dial())}hydrateFromFullMirror(){let e=this.gen;N_(this.nodeId).then(t=>{if(e===this.gen&&!this.liveAttached&&!(t===null||t.updatedAt<=this.cachedUpdatedAt)){this.state={...this.state,conv:J_(t),session:t.sessionState,commands:t.commands,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames,model:t.sessionState?.model?.id,sessionName:t.sessionState?.sessionName},this.cachedUpdatedAt=t.updatedAt;for(let e of this.listeners)e()}})}focus(){this.ensureStarted(),this.pinned=!0}background(){this.pinned=!1}dispose(){this.gen+=1,this.timer&&clearTimeout(this.timer),this.cacheWriteTimer&&(clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=null,this.flushCacheWrite()),this.client?.close(),this.client=null}dispatch(e){let t=this.state,n=B_(t,e);if(e.kind===`frame`&&e.frame.type===`ack`&&e.frame.for===`reload`&&e.frame.ok&&this.requestRefs(),n!==t){this.state=n,this.role=n.role,this.streaming=n.conv.isStreaming,e.kind===`frame`&&e.frame.type===`welcome`&&(this.liveAttached=!0),(n.conv!==t.conv||n.refs!==t.refs||n.engineLeadingCommandNames!==t.engineLeadingCommandNames)&&this.scheduleCacheWrite();for(let e of this.listeners)e()}}requestRefs(){let e=crypto.randomUUID();this.dispatch({kind:`request-refs`,id:e}),this.send({type:`list_memory_refs`,id:e})}scheduleCacheWrite(){this.cacheWriteTimer&&clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=setTimeout(()=>{this.cacheWriteTimer=null,this.flushCacheWrite()},e.CACHE_WRITE_DEBOUNCE_MS)}flushCacheWrite(){let e=Xg({nodeId:this.nodeId,messages:this.state.conv.messages,sessionState:this.state.session,commands:this.state.commands.map(({template:e,expansion:t,...n})=>n),refs:this.state.refs,engineLeadingCommandNames:this.state.engineLeadingCommandNames,isStreaming:this.state.conv.isStreaming,activity:this.state.conv.activity,updatedAt:Date.now(),source:`broker`});D_(e),F_(e),this.cachedUpdatedAt=e.updatedAt}send(e){this.client?.send(e)}dial(){let e=this.gen,t=new bg(this.nodeId,{onOpen:()=>{e===this.gen&&t.send({type:`hello`,role:`controller`,client_id:this.clientId})},onFrame:n=>{e===this.gen&&(this.dispatch({kind:`frame`,frame:n}),n.type===`welcome`&&(t.send({type:`get_commands`}),this.requestRefs(),this.noBrokerAttempts=0))},onClose:t=>{if(e===this.gen){if(this.dispatch({kind:`closed`,closeKind:t}),t===`transient`)this.timer=setTimeout(()=>{e===this.gen&&(this.dispatch({kind:`connecting`}),this.dial())},X_);else if(t===`no-broker`&&this.noBrokerAttempts<$_){let t=this.noBrokerAttempts;this.noBrokerAttempts+=1,this.timer=setTimeout(()=>{e===this.gen&&this.dial()},ev(t))}}}});this.client=t,t.connect()}buildActions(){return{sendText:e=>{let t=e.trim();if(t!==``){if(this.role!==`controller`){this.dispatch({kind:`notice`,text:`read-only — this view cannot send`});return}if(t===`/reload`){this.send({type:`reload`});return}if(t.startsWith(`!`)){let e=t.startsWith(`!!`),n=t.slice(e?2:1).trim();if(n===``)return;this.send({type:`bash`,command:n,excludeFromContext:e});return}this.send(this.streaming?{type:`steer`,text:e}:{type:`prompt`,text:e})}},abort:()=>{this.role===`controller`&&this.send({type:`abort`})},setModel:e=>this.send({type:`set_model`,model:e}),cycleModel:()=>this.send({type:`cycle_model`}),setThinkingLevel:e=>this.send({type:`set_thinking_level`,level:e}),compact:e=>this.send({type:`compact`,...e?{instructions:e}:{}}),answerDialog:e=>{this.send(e),this.dispatch({kind:`dismiss-dialog`})},cancelDialog:()=>{let e=this.state.dialog?.id;e!==void 0&&this.send({type:`extension_ui_response`,id:e,cancelled:!0}),this.dispatch({kind:`dismiss-dialog`})},reconnect:()=>{this.timer&&clearTimeout(this.timer),this.gen+=1,this.noBrokerAttempts=0,this.client?.close(),this.dispatch({kind:`connecting`}),this.dial()},clearNotice:()=>this.dispatch({kind:`notice`,text:null})}}},nv=4,rv=new class{handles=new Map;mru=[];poolListeners=new Set;warmIdsSnapshot=[];acquire(e){let t=this.handles.get(e);return t||(t=new tv(e),this.handles.set(e,t)),this.touch(e),this.notifyPool(),this.evictExcess(),t}focus(e){this.handles.get(e)?.focus()}background(e){this.handles.get(e)?.background()}subscribe=e=>(this.poolListeners.add(e),()=>{this.poolListeners.delete(e)});getWarmIds=()=>this.warmIdsSnapshot;evict(e){let t=this.handles.get(e);if(!t)return;t.pinned=!1,t.dispose(),this.handles.delete(e);let n=this.mru.indexOf(e);n!==-1&&this.mru.splice(n,1),this.notifyPool()}touch(e){let t=this.mru.indexOf(e);t!==-1&&this.mru.splice(t,1),this.mru.push(e)}evictExcess(){for(let e=0;e<this.mru.length&&this.mru.length>nv;){let t=this.mru[e],n=this.handles.get(t);if(n?.pinned){e+=1;continue}n?.dispose(),this.handles.delete(t),this.mru.splice(e,1),this.notifyPool()}}notifyPool(){this.warmIdsSnapshot=[...this.mru];for(let e of this.poolListeners)e()}};function iv(e){let t=rv.acquire(e);return{state:(0,v.useSyncExternalStore)(t.subscribe,t.getState),actions:t.actions}}var av={branch:null,model:null,tokens:null,context:null,tool_calls:null,stats:null,git_status:null};function ov(e,t){return{...sv,...t.state,sessionId:t.state?.sessionId??e,isStreaming:!1}}var sv={sessionId:``,isStreaming:!1,isCompacting:!1,thinkingLevel:`off`,steeringMode:`all`,followUpMode:`all`,autoCompactionEnabled:!1,messageCount:0,pendingMessageCount:0};function cv(e){let{state:t,actions:n}=iv(e),r=zp(e=>e.reachable),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let n=!1;if(t.conn!==`no-broker`){a(null);return}return yp(e).then(t=>{if(n)return;a(t);let r=Xg({nodeId:e,messages:Mg(t.snapshot).messages,sessionState:ov(e,t.snapshot),commands:t.commands,refs:[],engineLeadingCommandNames:[],isStreaming:!1,activity:null,updatedAt:Date.now(),source:`static`});D_(r),F_(r)}).catch(()=>{n||a(null)}),()=>{n=!0}},[e,t.conn]);let o=t.conn===`no-broker`&&i?.node_id===e?i:null,s=(0,v.useMemo)(()=>o===null?null:Mg(o.snapshot),[o]),c=(0,v.useMemo)(()=>t.session===null?null:{...t.session,isStreaming:t.conv.isStreaming},[t.session,t.conv.isStreaming]),l=(0,v.useMemo)(()=>t.conn===`connecting`||t.conn===`closed`?null:o===null?c:ov(e,o.snapshot),[e,o,t.conn,c]),u=(0,v.useMemo)(()=>o===null?{...av,model:t.model??null}:{...av,model:o.snapshot.state?.model?.id??null},[o,t.model]),d=s?.messages??t.conv.messages,f=s?.partialToolResults??t.conv.partialToolResults,p=s?.executingToolIds??t.conv.executingToolIds,m=s?.queued??t.conv.queued,h=o?.commands??t.commands,g=t.conn===`no-broker`?[]:t.refs,_=t.conn===`no-broker`?[]:t.engineLeadingCommandNames;return{messages:d,partialToolResults:f,executingToolIds:p,queued:m,state:l,role:t.role,chrome:u,dialog:t.dialog,commands:h,refs:g,engineLeadingCommandNames:_,brokerStatus:t.conn===`open`?`connected`:t.conn===`closed`||t.conn===`connecting`?`reconnecting`:`down`,source:t.conn===`no-broker`?`static`:`broker`,serverConnected:r,socketReady:t.conn===`open`,error:t.notice?{code:`broker_unavailable`,message:t.notice}:null,reconnect:n.reconnect,prompt:e=>n.sendText(e),steer:e=>n.sendText(e),abort:n.abort,setModel:n.setModel,cycleModel:n.cycleModel,setThinkingLevel:n.setThinkingLevel,compact:n.compact,dialogResponse:(e,t)=>n.answerDialog({type:`extension_ui_response`,id:e,...t})}}var lv=400,uv=4e3;function dv(e){return e.dormant&&e.status===`active`&&e.socketReady&&e.attempt<8}function fv(e){return Math.min(uv,lv*2**Math.max(0,e))}var pv=1,mv=400;function hv(e){return`crtr.web.draft.${e}`}function gv(e,t){if(typeof t!=`object`||!t)return!1;let n=t;return n.schemaVersion===pv&&n.nodeId===e&&typeof n.text==`string`&&typeof n.updatedAt==`number`}function _v(e){try{let t=globalThis.localStorage?.getItem(hv(e));if(t==null)return``;let n=JSON.parse(t);return gv(e,n)?n.text:``}catch{return``}}function vv(e,t){let n={schemaVersion:pv,nodeId:e,text:t,updatedAt:Date.now()};try{globalThis.localStorage?.setItem(hv(e),JSON.stringify(n))}catch{}}function yv(e){try{globalThis.localStorage?.removeItem(hv(e))}catch{}}var bv=new Map;function xv(e,t){let n=bv.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{bv.delete(e),t===``?yv(e):vv(e,t)},mv);bv.set(e,r)}function Sv(e){let t=bv.get(e);t&&(clearTimeout(t),bv.delete(e))}var Cv=new Set([`reload`]);function wv(e){let t=cv(e),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>(rv.focus(e),()=>{rv.background(e)}),[e]);let[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{a(_v(e))},[e]),(0,v.useEffect)(()=>{xv(e,i)},[e,i]);let[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),f=t.source===`static`,p=t.brokerStatus===`connected`,m=t.role===`controller`,h=t.state?.isStreaming??!1,g=m&&!f&&p&&t.serverConnected,_=t.commands,y=(0,v.useMemo)(()=>new Set([...Cv,...t.engineLeadingCommandNames]),[t.engineLeadingCommandNames]);(0,v.useEffect)(()=>{let t=!1;return vp(e).then(e=>{t||r(e)}).catch(e=>{t||l(Tv(e))}),()=>{t=!0}},[e]);let b=(0,v.useRef)(0);(0,v.useEffect)(()=>{b.current=0},[e]),(0,v.useEffect)(()=>{if(!dv({dormant:f,status:n?.status,socketReady:t.socketReady,attempt:b.current}))return;let e=b.current;b.current+=1;let r=setTimeout(()=>t.reconnect(),fv(e));return()=>clearTimeout(r)},[f,n?.status,t.socketReady,t.reconnect]);let x=()=>{!i.trim()||!g||(h?t.steer(i):t.prompt(i),Sv(e),yv(e),a(``))};return{store:t,detail:n,input:i,setInput:a,reviving:o,actionError:c,peekedPath:u,setPeekedPath:d,dormant:f,brokerUp:p,writable:m,streaming:h,canDrive:g,commands:_,refs:t.refs,commandNames:y,onReplaceToken:e=>{a(e.text)},sendPrimary:x,onInputKeyDown:e=>{xh(e,a,x)},selectCommand:e=>{a(`/${e.name} `)},doRevive:async()=>{s(!0),l(null);try{await Sp(e),t.reconnect()}catch(e){l(Tv(e))}finally{s(!1)}},doClose:async()=>{l(null);try{await Cp(e)}catch(e){l(Tv(e))}}}}function Tv(e){return e instanceof mp?`${e.code}: ${e.message}`:String(e)}function Ev(e){let t=(0,v.useMemo)(()=>{let t=e.query;return t.startsWith(`/`)?t.slice(1).trimStart().toLowerCase():``},[e.query]),n=(0,v.useMemo)(()=>{let n=e.commands;return t?n.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.source.toLowerCase().includes(t)):n},[t,e.commands]);return e.visible?(0,z.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 z-20 mb-1 max-h-72 overflow-auto border border-border bg-popover`,children:n.length>0?(0,z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:n.map(t=>(0,z.jsxs)(`li`,{className:`flex cursor-pointer flex-wrap items-baseline gap-x-2 gap-y-0.5 px-3 py-2 hover:bg-accent/50`,onClick:()=>e.onSelect(t),children:[(0,z.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-primary`,children:[`/`,t.name]}),t.argument_hint&&(0,z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground/70`,children:t.argument_hint}),(0,z.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground/50`,children:[t.source,t.location&&(0,z.jsxs)(z.Fragment,{children:[` · `,t.location]})]}),(0,z.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:t.description})]},t.name))}):(0,z.jsx)(`div`,{className:`px-3 py-2 text-xs italic text-muted-foreground`,children:`no matching commands`})}):null}var Dv=new Set([`select`,`confirm`,`input`,`editor`,`notify`]);function Ov(e){return Dv.has(e.method)}function kv(e){let t=e.store.dialog,n=t&&Ov(t)?t:null;return(0,z.jsx)(nm,{open:n!==null,children:(0,z.jsx)(am,{showCloseButton:!1,children:n&&(0,z.jsx)(Mv,{req:n,store:e.store},n.id)})})}function Av(e){switch(e){case`error`:return`border-destructive/40 text-destructive`;case`warning`:return`border-warning/40 text-warning`;case`success`:return`border-success/40 text-success`;default:return`border-border text-foreground`}}function jv(e){let t=/https?:\/\/[^\s]+/g;return e.split(`
|
|
52
|
-
`).map((e,n)=>{let r=[],i=0,a;for(;a=t.exec(e);)a.index>i&&r.push(e.slice(i,a.index)),r.push((0,z.jsx)(`a`,{href:a[0],target:`_blank`,rel:`noopener noreferrer`,className:`underline break-all`,children:a[0]},a.index)),i=a.index+a[0].length;return i<e.length&&r.push(e.slice(i)),(0,z.jsxs)(`span`,{children:[n>0&&(0,z.jsx)(`br`,{}),r]},n)})}function Mv(e){let t=()=>e.store.dialogResponse(e.req.id,{cancelled:!0});return e.req.method===`select`?(0,z.jsx)(Nv,{req:e.req,store:e.store,cancel:t}):(0,z.jsx)(Pv,{req:e.req,store:e.store,cancel:t})}function Nv(e){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:e.req.title})}),(0,z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.req.options.map(t=>(0,z.jsx)(`li`,{children:(0,z.jsx)(Z,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>e.store.dialogResponse(e.req.id,{value:t}),children:t})},t))}),(0,z.jsx)(sm,{children:(0,z.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`})})]})}function Pv(e){let[t,n]=(0,v.useState)(e.req.method===`editor`?e.req.prefill??``:``);if(e.req.method===`confirm`){let t=e.req;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:t.title})}),(0,z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{variant:`secondary`,onClick:()=>e.store.dialogResponse(t.id,{confirmed:!1}),children:`No`}),(0,z.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`Yes`})]})]})}if(e.req.method===`input`||e.req.method===`editor`){let r=e.req;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:jv(r.title)})}),r.method===`editor`?(0,z.jsx)(ym,{className:`resize-none font-mono text-sm`,rows:8,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}):(0,z.jsx)(um,{placeholder:r.placeholder??``,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`}),(0,z.jsx)(Z,{onClick:()=>e.store.dialogResponse(r.id,{value:t}),children:`Submit`})]})]})}if(e.req.method===`notify`){let t=e.req;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:J(`rounded-none border px-3 py-2 text-sm`,Av(t.notifyType)),children:jv(t.message)}),(0,z.jsx)(sm,{children:(0,z.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`OK`})})]})}return null}function Fv(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function Iv(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Lv(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Rv=(e,t)=>Math.abs(e-t)<1.01,zv=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Bv,Vv=()=>{if(Bv!==void 0)return Bv;if(typeof navigator>`u`)return Bv=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Bv=!0;let e=navigator.maxTouchPoints;return Bv=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Hv=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Uv=e=>e,Wv=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Gv=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Hv(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Hv(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Kv={passive:!0},qv=typeof window>`u`||`onscrollend`in window,Jv=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&qv,o=0,s=a?null:zv(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Kv),a&&r.addEventListener(`scrollend`,u,Kv),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},Yv=(e,t)=>Jv(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Xv=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Zv=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},Qv=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Uv,rangeExtractor:Wv,onChange:()=>{},measureElement:Xv,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Iv(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!Vv()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Kv),e.addEventListener(`touchend`,n,Kv),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(Vv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Iv(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=Iv(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=Fv(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Iv(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=ty(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Iv(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-c):d&&this.applyScrollAdjustment(s),this.notify(!1)}},this.getVirtualItems=Iv(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return Lv(t[$v(0,t.length-1,r?e=>n[e*2]:e=>Lv(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(Vv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Rv(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},$v=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function ey(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function ty(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=ey(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=$v(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var ny=typeof document<`u`?v.useLayoutEffect:v.useEffect;function ry({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,y.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=v.useState(()=>{let e=new Qv(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),ny(()=>l._didMount(),[]),ny(()=>(o(l),l._willUpdate())),ny(()=>{s(l)}),l}function iy(e){return ry({observeElementRect:Gv,observeElementOffset:Yv,scrollToFn:Zv,...e})}var ay={};function oy(e){let t=ay[e];if(t)return t;t=ay[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function sy(e,t){typeof t!=`string`&&(t=sy.defaultChars);let n=oy(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}sy.defaultChars=`;/?:@&=+$,#`,sy.componentChars=``;var cy={};function ly(e){let t=cy[e];if(t)return t;t=cy[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function uy(e,t,n){typeof t!=`string`&&(n=t,t=uy.defaultChars),n===void 0&&(n=!0);let r=ly(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}uy.defaultChars=`;/?:@&=+$,-_.!~*'()#`,uy.componentChars=`-_.!~*'()`;function dy(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function fy(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var py=/^([a-z0-9.+-]+:)/i,my=/:[0-9]*$/,hy=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,gy=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
53
|
-
`,` `],_y=[`/`,`?`,`#`],vy=255,yy=/^[+a-z0-9A-Z_-]{0,63}$/,by=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,xy={javascript:!0,"javascript:":!0},Sy={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Cy(e,t){if(e&&e instanceof fy)return e;let n=new fy;return n.parse(e,t),n}fy.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=hy.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=py.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&xy[o])&&(a=a.substr(2),this.slashes=!0)),!xy[o]&&(i||o&&!Sy[o])){let e=-1;for(let t=0;t<_y.length;t++)r=a.indexOf(_y[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<gy.length;t++)r=a.indexOf(gy[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(yy)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(yy)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(by);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>vy&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Sy[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},fy.prototype.parseHost=function(e){let t=my.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var wy=s({decode:()=>sy,encode:()=>uy,format:()=>dy,parse:()=>Cy}),Ty=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ey=/[\0-\x1F\x7F-\x9F]/,Dy=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Oy=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ky=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Ay=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,jy=s({Any:()=>Ty,Cc:()=>Ey,Cf:()=>Dy,P:()=>Oy,S:()=>ky,Z:()=>Ay}),My=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Ny=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Py=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Fy=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Iy(e){return e>=55296&&e<=57343||e>1114111?65533:Py.get(e)??e}var Ly;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Ly||={});var Ry=32,zy;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(zy||={});function By(e){return e>=Ly.ZERO&&e<=Ly.NINE}function Vy(e){return e>=Ly.UPPER_A&&e<=Ly.UPPER_F||e>=Ly.LOWER_A&&e<=Ly.LOWER_F}function Hy(e){return e>=Ly.UPPER_A&&e<=Ly.UPPER_Z||e>=Ly.LOWER_A&&e<=Ly.LOWER_Z||By(e)}function Uy(e){return e===Ly.EQUALS||Hy(e)}var Wy;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(Wy||={});var Gy;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Gy||={});var Ky=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Wy.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Gy.Strict}startEntity(e){this.decodeMode=e,this.state=Wy.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Wy.EntityStart:return e.charCodeAt(t)===Ly.NUM?(this.state=Wy.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Wy.NamedEntity,this.stateNamedEntity(e,t));case Wy.NumericStart:return this.stateNumericStart(e,t);case Wy.NumericDecimal:return this.stateNumericDecimal(e,t);case Wy.NumericHex:return this.stateNumericHex(e,t);case Wy.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Ry)===Ly.LOWER_X?(this.state=Wy.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Wy.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(By(r)||Vy(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(By(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ly.SEMI)this.consumed+=1;else if(this.decodeMode===Gy.Strict)return 0;return this.emitCodePoint(Iy(this.result),this.consumed),this.errors&&(e!==Ly.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&zy.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Jy(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Gy.Attribute&&(i===0||Uy(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&zy.VALUE_LENGTH)>>14,i!==0){if(a===Ly.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Gy.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&zy.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~zy.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Wy.NamedEntity:return this.result!==0&&(this.decodeMode!==Gy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Wy.NumericDecimal:return this.emitNumericEntity(0,2);case Wy.NumericHex:return this.emitNumericEntity(0,3);case Wy.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wy.EntityStart:return 0}}};function qy(e){let t=``,n=new Ky(e,e=>t+=Fy(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function Jy(e,t,n,r){let i=(t&zy.BRANCH_LENGTH)>>7,a=t&zy.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var Yy=qy(My);qy(Ny);function Xy(e,t=Gy.Legacy){return Yy(e,t)}function Zy(e){return Yy(e,Gy.Strict)}var Qy=s({arrayReplaceAt:()=>ib,asciiTrim:()=>Db,assign:()=>rb,escapeHtml:()=>_b,escapeRE:()=>yb,fromCodePoint:()=>ob,has:()=>nb,isMdAsciiPunct:()=>wb,isPunctChar:()=>Sb,isPunctCharCode:()=>Cb,isSpace:()=>bb,isString:()=>eb,isValidEntityCode:()=>ab,isWhiteSpace:()=>xb,lib:()=>Ob,normalizeReference:()=>Tb,unescapeAll:()=>fb,unescapeMd:()=>db});function $y(e){return Object.prototype.toString.call(e)}function eb(e){return $y(e)===`[object String]`}var tb=Object.prototype.hasOwnProperty;function nb(e,t){return tb.call(e,t)}function rb(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function ib(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function ab(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function ob(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var sb=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,cb=RegExp(sb.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),lb=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function ub(e,t){if(t.charCodeAt(0)===35&&lb.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return ab(n)?ob(n):e}let n=Xy(e);return n===e?e:n}function db(e){return e.indexOf(`\\`)<0?e:e.replace(sb,`$1`)}function fb(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(cb,function(e,t,n){return t||ub(e,n)})}var pb=/[&<>"]/,mb=/[&<>"]/g,hb={"&":`&`,"<":`<`,">":`>`,'"':`"`};function gb(e){return hb[e]}function _b(e){return pb.test(e)?e.replace(mb,gb):e}var vb=/[.?*+^$[\]\\(){}|-]/g;function yb(e){return e.replace(vb,`\\$&`)}function bb(e){switch(e){case 9:case 32:return!0}return!1}function xb(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Sb(e){return Oy.test(e)||ky.test(e)}function Cb(e){return Sb(ob(e))}function wb(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Tb(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Eb(e){return e===32||e===9||e===10||e===13}function Db(e){let t=0;for(;t<e.length&&Eb(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Eb(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Ob={mdurl:wy,ucmicro:jy};function kb(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Ab(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=fb(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=fb(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function jb(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=fb(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=fb(e.slice(t,a)),o}var Mb=s({parseLinkDestination:()=>Ab,parseLinkLabel:()=>kb,parseLinkTitle:()=>jb}),Nb={};Nb.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+_b(a.content)+`</code>`},Nb.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+_b(e[t].content)+`</code></pre>
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
`},To=0,Eo=[];function Do(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(To++)[0],a=v.useState(Ya)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=wa([e.lockRef.current],(e.shards||[]).map(So),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=bo(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>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=po(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=po(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return yo(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!Eo.length||Eo[Eo.length-1]!==a)){var r=`deltaY`in n?xo(n):bo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Co(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(So).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Oo(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=bo(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,xo(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,bo(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Eo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,co),document.addEventListener(`touchmove`,c,co),document.addEventListener(`touchstart`,u,co),function(){Eo=Eo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,co),document.removeEventListener(`touchmove`,c,co),document.removeEventListener(`touchstart`,u,co)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:wo(i)}):null,p?v.createElement(ao,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Oo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ko=Ra(za,Do),Ao=v.forwardRef(function(e,t){return v.createElement(Va,Sa({},e,{ref:t,sideCar:ko}))});Ao.classNames=Va.classNames;var jo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Mo=new WeakMap,No=new WeakMap,Po={},Fo=0,Io=function(e){return e&&(e.host||Io(e.parentNode))},Lo=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Io(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ro=function(e,t,n,r){var i=Lo(t,Array.isArray(e)?e:[e]);Po[n]||(Po[n]=new WeakMap);var a=Po[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Mo.get(e)||0)+1,l=(a.get(e)||0)+1;Mo.set(e,c),a.set(e,l),o.push(e),c===1&&i&&No.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Fo++,function(){o.forEach(function(e){var t=Mo.get(e)-1,i=a.get(e)-1;Mo.set(e,t),a.set(e,i),t||(No.has(e)||e.removeAttribute(r),No.delete(e)),i||e.removeAttribute(n)}),Fo--,Fo||(Mo=new WeakMap,Mo=new WeakMap,No=new WeakMap,Po={})}},zo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||jo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ro(r,i,n,`aria-hidden`)):function(){return null}},Bo=Object.defineProperty,Vo=(e,t)=>Bo(e,`name`,{value:t,configurable:!0}),Ho=`Dialog`,[Uo,Wo]=kr(Ho),[Go,Ko]=Uo(Ho),qo=Vo(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),{nodes:l,registry:u}=ea(),[d,f]=si({prop:r,defaultProp:i??!1,onChange:a,caller:Ho}),[p,m]=v.useState(0),[h,g]=v.useState(0);return(0,z.jsx)(Go,{scope:t,triggerRef:s,contentRef:c,contentId:Ti(),titleId:Ti(),descriptionId:Ti(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Jo=`DialogPortal`,[Yo,Xo]=Uo(Jo,{forceMount:void 0}),Zo=Vo(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ko(Jo,t);return(0,z.jsx)(Yo,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,z.jsx)(hi,{present:n||a.open,children:(0,z.jsx)(ma,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Qo=`DialogOverlay`,$o=v.forwardRef(Vo(function(e,t){let n=Xo(Qo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ko(Qo,e.__scopeDialog);return a.modal?(0,z.jsx)(hi,{present:r||a.open,children:(0,z.jsx)(ts,{...i,ref:t})}):null},`DialogOverlay`)),es=cr(`DialogOverlay.RemoveScroll`),ts=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(Qo,n),a=tr(t,Bi());return(0,z.jsx)(Ao,{as:es,allowPinchZoom:!0,shards:v.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,z.jsx)(Cr.div,{"data-state":fs(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ns=`DialogContent`,rs=v.forwardRef(Vo(function(e,t){let n=Xo(ns,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ko(ns,e.__scopeDialog);return(0,z.jsx)(hi,{present:r||a.open,children:a.modal?(0,z.jsx)(is,{...i,ref:t}):(0,z.jsx)(as,{...i,ref:t})})},`DialogContent`)),is=v.forwardRef(Vo(function(e,t){let n=Ko(ns,e.__scopeDialog),r=v.useRef(null),i=tr(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return zo(e)},[]),(0,z.jsx)(os,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:qr(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:qr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:qr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),as=v.forwardRef(Vo(function(e,t){let n=Ko(ns,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,z.jsx)(os,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),os=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,...s}=e,{children:c,...l}=s,u=Ko(ns,n);return ba(),(0,z.jsx)(z.Fragment,{children:(0,z.jsx)(Zi,{asChild:!0,loop:!0,trapped:r,branches:u.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(zi,{role:`dialog`,id:u.contentId,"aria-labelledby":u.titlePresent?u.titleId:void 0,"aria-describedby":u.descriptionPresent?ds(o,u.descriptionId):o,"data-state":fs(u.open),...l,ref:t,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:(0,z.jsx)($i,{value:u.branchRegistry,children:c})})})})},`DialogContentImpl`)),ss=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(`DialogTitle`,n),{setTitleCount:a}=i;return Qr(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,z.jsx)(Cr.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),cs=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(`DialogDescription`,n),{setDescriptionCount:a}=i;return Qr(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,z.jsx)(Cr.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ls=`DialogClose`,us=v.forwardRef(Vo(function(e,t){let{__scopeDialog:n,...r}=e,i=Ko(ls,n);return(0,z.jsx)(Cr.button,{type:`button`,...r,ref:t,onClick:qr(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function ds(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Vo(ds,`concatAriaDescribedby`);function fs(e){return e?`open`:`closed`}Vo(fs,`getState`);var ps=Object.defineProperty,ms=(e,t)=>ps(e,`name`,{value:t,configurable:!0});function hs(e){let[t,n]=v.useState(void 0);return Qr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}ms(hs,`useSize`);var gs=[`top`,`right`,`bottom`,`left`],_s=Math.min,vs=Math.max,ys=Math.round,bs=Math.floor,xs=e=>({x:e,y:e}),Ss={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Cs(e,t,n){return vs(e,_s(t,n))}function ws(e,t){return typeof e==`function`?e(t):e}function Ts(e){return e.split(`-`)[0]}function Es(e){return e.split(`-`)[1]}function Ds(e){return e===`x`?`y`:`x`}function Os(e){return e===`y`?`height`:`width`}function ks(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function As(e){return Ds(ks(e))}function js(e,t,n){n===void 0&&(n=!1);let r=Es(e),i=As(e),a=Os(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Bs(o)),[o,Bs(o)]}function Ms(e){let t=Bs(e);return[Ns(e),t,Ns(t)]}function Ns(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ps=[`left`,`right`],Fs=[`right`,`left`],Is=[`top`,`bottom`],Ls=[`bottom`,`top`];function Rs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fs:Ps:t?Ps:Fs;case`left`:case`right`:return t?Is:Ls;default:return[]}}function zs(e,t,n,r){let i=Es(e),a=Rs(Ts(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ns)))),a}function Bs(e){let t=Ts(e);return Ss[t]+e.slice(t.length)}function Vs(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Hs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Vs(e)}function Us(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ws(e,t,n){let{reference:r,floating:i}=e,a=ks(t),o=As(t),s=Os(o),c=Ts(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Es(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Gs(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ws(t,e),p=Hs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Us(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Us(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ks=50,qs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Gs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ws(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ks&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ws(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Js=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ws(e,t)||{};if(l==null)return{};let d=Hs(u),f={x:n,y:r},p=As(i),m=Os(p),h=await 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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=_s(d[_],T),D=_s(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Cs(E,k,O),j=!c.arrow&&Es(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Ys=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ws(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ts(r),_=ks(o),v=Ts(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Bs(o)]:Ms(o)),x=p!==`none`;!d&&x&&b.push(...zs(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=js(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ks(t))||T.every(e=>ks(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ks(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Xs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zs(e){return gs.some(t=>e[t]>=0)}var Qs=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ws(e,t);switch(i){case`referenceHidden`:{let e=Xs(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Zs(e)}}}case`escaped`:{let e=Xs(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Zs(e)}}}default:return{}}}}},$s=new Set([`left`,`top`]);async function ec(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ts(n),s=Es(n),c=ks(n)===`y`,l=$s.has(o)?-1:1,u=a&&c?-1:1,d=ws(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var tc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ec(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},nc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ws(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ks(i),p=Ds(f),m=u[p],h=u[f],g=(e,t)=>Cs(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},rc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ws(e,t),u={x:n,y:r},d=ks(i),f=Ds(d),p=u[f],m=u[d],h=ws(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$s.has(Ts(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ic=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ws(e,t),c=await i.detectOverflow(t,s),l=Ts(n),u=Es(n),d=ks(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=_s(p-c[m],g),y=_s(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*vs(c.left,c.right):S=p-2*vs(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ac(){return typeof window<`u`}function oc(e){return lc(e)?(e.nodeName||``).toLowerCase():`#document`}function sc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cc(e){return((lc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function lc(e){return ac()?e instanceof Node||e instanceof sc(e).Node:!1}function uc(e){return ac()?e instanceof Element||e instanceof sc(e).Element:!1}function dc(e){return ac()?e instanceof HTMLElement||e instanceof sc(e).HTMLElement:!1}function fc(e){return!ac()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof sc(e).ShadowRoot}function pc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=wc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function mc(e){return/^(table|td|th)$/.test(oc(e))}function hc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gc=/transform|translate|scale|rotate|perspective|filter/,_c=/paint|layout|strict|content/,vc=e=>!!e&&e!==`none`,yc;function bc(e){let t=uc(e)?wc(e):e;return vc(t.transform)||vc(t.translate)||vc(t.scale)||vc(t.rotate)||vc(t.perspective)||!Sc()&&(vc(t.backdropFilter)||vc(t.filter))||gc.test(t.willChange||``)||_c.test(t.contain||``)}function xc(e){let t=Ec(e);for(;dc(t)&&!Cc(t);){if(bc(t))return t;if(hc(t))return null;t=Ec(t)}return null}function Sc(){return yc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),yc}function Cc(e){return/^(html|body|#document)$/.test(oc(e))}function wc(e){return sc(e).getComputedStyle(e)}function Tc(e){return uc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ec(e){if(oc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fc(e)&&e.host||cc(e);return fc(t)?t.host:t}function Dc(e){let t=Ec(e);return Cc(t)?(e.ownerDocument||e).body:dc(t)&&pc(t)?t:Dc(t)}function Oc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Dc(e),i=r===e.ownerDocument?.body,a=sc(r);if(i){let e=kc(a);return t.concat(a,a.visualViewport||[],pc(r)?r:[],e&&n?Oc(e):[])}else return t.concat(r,Oc(r,[],n))}function kc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ac(e){let t=wc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=dc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ys(n)!==a||ys(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function jc(e){return uc(e)?e:e.contextElement}function Mc(e){let t=jc(e);if(!dc(t))return xs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ac(t),o=(a?ys(n.width):n.width)/r,s=(a?ys(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Nc=xs(0);function Pc(e){let t=sc(e);return!Sc()||!t.visualViewport?Nc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===sc(e)}function Ic(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=jc(e),o=xs(1);t&&(r?uc(r)&&(o=Mc(r)):o=Mc(e));let s=Fc(a,n,r)?Pc(a):xs(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=sc(a),t=uc(r)?sc(r):r,n=e,i=kc(n);for(;i&&t!==n;){let e=Mc(i),t=i.getBoundingClientRect(),r=wc(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=sc(i),i=kc(n)}}return Us({width:u,height:d,x:c,y:l})}function Lc(e,t){let n=Tc(e).scrollLeft;return t?t.left+n:Ic(cc(e)).left+n}function Rc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lc(e,n),y:n.top+t.scrollTop}}function zc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cc(r),s=t?hc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=xs(1),u=xs(0),d=dc(r);if((d||!a)&&((oc(r)!==`body`||pc(o))&&(c=Tc(r)),d)){let e=Ic(r);l=Mc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rc(o,c):xs(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Vc(e){let t=Tc(e),n=e.ownerDocument.body,r=vs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=vs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Lc(e),o=-t.scrollTop;return wc(n).direction===`rtl`&&(a+=vs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Hc=25;function Uc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=sc(e),a=cc(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Sc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Lc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Hc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Wc(e,t){let n=Ic(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Mc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Uc(e,n,t);else if(t===`document`)r=Vc(cc(e));else if(uc(t))r=Wc(t,n);else{let n=Pc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Us(r)}function Kc(e,t){let n=t.get(e);if(n)return n;let r=Oc(e,[],!1).filter(e=>uc(e)&&oc(e)!==`body`),i=null,a=wc(e).position===`fixed`,o=a?Ec(e):e;for(;uc(o)&&!Cc(o);){let e=wc(o),t=bc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ec(o)}return t.set(e,r),r}function qc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hc(t)?[]:Kc(t,this._c):[].concat(n),r],o=Gc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Gc(t,a[e],i);s=vs(n.top,s),c=_s(n.right,c),l=_s(n.bottom,l),u=vs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Jc(e){let{width:t,height:n}=Ac(e);return{width:t,height:n}}function Yc(e,t,n){let r=dc(t),i=cc(t),a=n===`fixed`,o=Ic(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=xs(0);if((r||!a)&&((oc(t)!==`body`||pc(i))&&(s=Tc(t)),r)){let e=Ic(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Lc(i));let l=i&&!r&&!a?Rc(i,s):xs(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Xc(e){return wc(e).position===`static`}function Zc(e,t){if(!dc(e)||wc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cc(e)===n&&(n=n.ownerDocument.body),n}function Qc(e,t){let n=sc(e);if(hc(e))return n;if(!dc(e)){let t=Ec(e);for(;t&&!Cc(t);){if(uc(t)&&!Xc(t))return t;t=Ec(t)}return n}let r=Zc(e,t);for(;r&&mc(r)&&Xc(r);)r=Zc(r,t);return r&&Cc(r)&&Xc(r)&&!bc(r)?n:r||xc(e)||n}var $c=async function(e){let t=this.getOffsetParent||Qc,n=this.getDimensions,r=await n(e.floating);return{reference:Yc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function el(e){return wc(e).direction===`rtl`}var tl={convertOffsetParentRelativeRectToViewportRelativeRect:zc,getDocumentElement:cc,getClippingRect:qc,getOffsetParent:Qc,getElementRects:$c,getClientRects:Bc,getDimensions:Jc,getScale:Mc,isElement:uc,isRTL:el};function nl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rl(e,t,n){let r=null,i,a=cc(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=bs(d),h=bs(a.clientWidth-(u+f)),g=bs(a.clientHeight-(d+p)),_=bs(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:vs(0,_s(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!nl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=sc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function il(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=jc(e),u=i||a?[...l?Oc(l):[],...t?Oc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?rl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ic(e):null;c&&g();function g(){let t=Ic(e);h&&!nl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var al=tc,ol=nc,sl=Ys,cl=ic,ll=Qs,ul=Js,dl=rc,fl=(e,t,n)=>{let r=new Map,i=n??{},a={...tl,...i.platform,_c:r};return qs(e,t,{...i,platform:a})},pl=typeof document<`u`?v.useLayoutEffect:function(){};function ml(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ml(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ml(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function hl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gl(e,t){let n=hl(e);return Math.round(t*n)/n}function _l(e){let t=v.useRef(e);return pl(()=>{t.current=e}),t}function vl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);ml(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),b=v.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=v.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),S=a||m,C=o||g,w=v.useRef(null),T=v.useRef(null),E=v.useRef(u),D=c!=null,O=_l(c),k=_l(i),A=_l(l),j=v.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),fl(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!ml(E.current,t)&&(E.current=t,y.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);pl(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=v.useRef(!1);pl(()=>(M.current=!0,()=>{M.current=!1}),[]),pl(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let ee=v.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),N=v.useMemo(()=>({reference:S,floating:C}),[S,C]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=gl(N.floating,u.x),r=gl(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...hl(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:j,refs:ee,elements:N,floatingStyles:P}),[u,j,ee,N,P])}var yl=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ul({element:r.current,padding:i}).fn(n):r?ul({element:r,padding:i}).fn(n):{}}}},bl=(e,t)=>{let n=al(e);return{name:n.name,fn:n.fn,options:[e,t]}},xl=(e,t)=>{let n=ol(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sl=(e,t)=>({fn:dl(e).fn,options:[e,t]}),Cl=(e,t)=>{let n=sl(e);return{name:n.name,fn:n.fn,options:[e,t]}},wl=(e,t)=>{let n=cl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tl=(e,t)=>{let n=ll(e);return{name:n.name,fn:n.fn,options:[e,t]}},El=(e,t)=>{let n=yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dl=Object.defineProperty,Ol=(e,t)=>Dl(e,`name`,{value:t,configurable:!0}),kl={Partial:`partial`,Always:`always`},Al={Optimized:`optimized`,Always:`always`},jl=`Popper`,[Ml,Nl]=kr(jl),[Pl,Fl]=Ml(jl),Il=Ol(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,z.jsx)(Pl,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ll=`PopperAnchor`,Rl=v.forwardRef(Ol(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Fl(Ll,n),o=v.useRef(null),s=a.onAnchorChange,c=tr(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&U(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,z.jsx)(Cr.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),zl=`PopperContent`,[Bl,Vl]=Ml(zl),Hl=v.forwardRef(Ol(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=kl.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=Al.Optimized,onPlaced:m,...h}=e,g=Fl(zl,n),[_,y]=v.useState(null),b=tr(t,y),[x,S]=v.useState(null),C=hs(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(H),altBoundary:k},{refs:j,floatingStyles:M,placement:ee,isPositioned:N,middlewareData:P}=vl({strategy:`fixed`,placement:E,whileElementsMounted:Ol((...e)=>il(...e,{animationFrame:p===Al.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[bl({mainAxis:i+T,alignmentAxis:o}),c&&xl({mainAxis:!0,crossAxis:!1,limiter:d===kl.Partial?Sl():void 0,...A}),c&&Cl({...A}),wl({...A,apply:Ol(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&El({element:x,padding:s}),Ul({arrowWidth:w,arrowHeight:T}),f&&Tl({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),F=g.setPlacementState;Qr(()=>(F(ee),()=>{F(void 0)}),[ee,F]);let[I,te]=U(ee),ne=Mi(m);Qr(()=>{N&&ne?.()},[N,ne]);let re=P.arrow?.x,ie=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[L,oe]=v.useState();return Qr(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:N?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:L,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(Bl,{scope:n,placedSide:I,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,z.jsx)(Cr.div,{"data-side":I,"data-align":te,...h,ref:b,style:{...h.style,animation:N?h.style?.animation:`none`}})})})},`PopperContent`));function H(e){return e!==null}Ol(H,`isNotNull`);var Ul=Ol(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=U(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function U(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ol(U,`getSideAndAlignFromPlacement`);var W=Object.defineProperty,Wl=v.forwardRef(((e,t)=>W(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,z.jsx)(Cr.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Gl=Object.defineProperty,Kl=(e,t)=>Gl(e,`name`,{value:t,configurable:!0});function ql(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Kl(ql,`usePrevious`);var Jl=Object.defineProperty,Yl=(e,t)=>Jl(e,`name`,{value:t,configurable:!0});function Xl(e,[t,n]){return Math.min(n,Math.max(t,e))}Yl(Xl,`clamp`);var Zl=Object.defineProperty,G=(e,t)=>Zl(e,`name`,{value:t,configurable:!0}),Ql={ItemAligned:`item-aligned`,Popper:`popper`},$l={LTR:`ltr`,RTL:`rtl`},eu=[` `,`Enter`,`ArrowUp`,`ArrowDown`],tu=[` `,`Enter`],nu=`Select`,[ru,iu,au]=Nr(nu),[ou,su]=kr(nu,[au,Nl]),cu=Nl(),[lu,uu]=ou(nu),[du,fu]=ou(nu);function pu(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=cu(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=ki(l),[T,E]=si({prop:r,defaultProp:i??!1,onChange:a,caller:nu}),[D,O]=si({prop:o,defaultProp:s,onChange:c,caller:nu}),k=v.useRef(null),A=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=G(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=!_||!!m||!!_.closest(`form`),[M,ee]=v.useState(new Set),N=Ti(),P=Array.from(M).map(e=>e.props.value).join(`;`),F=v.useCallback(e=>{ee(t=>new Set(t).add(e))},[]),I=v.useCallback(e=>{ee(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:N,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:P,isFormControl:j};return(0,z.jsx)(Il,{...g,children:(0,z.jsx)(lu,{scope:t,...te,children:(0,z.jsx)(ru.Provider,{scope:t,children:(0,z.jsx)(du,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:I,children:ed(h)?h(te):n})})})})}G(pu,`SelectProvider`);var mu=G(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,z.jsx)(pu,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[n,e?(0,z.jsx)($u,{__scopeSelect:t}):null]})})},`Select`),hu=`SelectTrigger`,gu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=cu(n),o=uu(hu,n),s=o.disabled||r,c=tr(t,o.onTriggerChange),l=iu(n),u=v.useRef(`touch`),[d,f,p]=nd(e=>{let t=l().filter(e=>!e.disabled),n=rd(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=G(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,z.jsx)(Rl,{asChild:!0,...a,children:(0,z.jsx)(Cr.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":td(o.value)?``:void 0,...i,ref:c,onClick:qr(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:qr(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:qr(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&eu.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),_u=`SelectValue`,vu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=uu(_u,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=tr(t,c.onValueNodeChange);Qr(()=>{l(u)},[l,u]);let f=td(c.value);return(0,z.jsx)(Cr.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,z.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),yu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,z.jsx)(Cr.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[bu,xu]=ou(`SelectPortal`,{forceMount:void 0}),Su=G(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,z.jsx)(bu,{scope:e.__scopeSelect,forceMount:n,children:(0,z.jsx)(ma,{asChild:!0,...r})})},`SelectPortal`),Cu=`SelectContent`,wu=v.forwardRef(G(function(e,t){let n=xu(Cu,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=uu(Cu,e.__scopeSelect),[o,s]=v.useState();return Qr(()=>{s(new DocumentFragment)},[]),(0,z.jsx)(hi,{present:r||a.open,children:({present:e})=>e?(0,z.jsx)(Au,{...i,ref:t}):(0,z.jsx)(Tu,{...i,fragment:o})})},`SelectContent`)),Tu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?y.createPortal((0,z.jsx)(Du,{scope:n,children:(0,z.jsx)(ru.Slot,{scope:n,children:(0,z.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Eu=10,[Du,Ou]=ou(Cu),ku=cr(`SelectContent.RemoveScroll`),Au=v.forwardRef(G(function(e,t){let{__scopeSelect:n}=e,{position:r=Ql.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=uu(Cu,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=tr(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=iu(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return zo(b)},[b]),ba();let ee=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),N=v.useCallback(()=>ee([T,b]),[ee,T,b]);v.useEffect(()=>{A&&N()},[A,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=G(t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},`handlePointerMove`),n=G(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null},`handlePointerUp`);return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,P,F]),v.useEffect(()=>{let e=G(()=>P(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[I,te]=nd(e=>{let t=k().filter(e=>!e.disabled),n=rd(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),re=v.useCallback(()=>b?.focus(),[b]),ie=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ae=r===Ql.Popper?Mu:ju,L=ae===Mu?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,z.jsx)(Du,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ne,selectedItem:T,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:N,selectedItemText:D,position:r,isPositioned:A,searchRef:I,children:(0,z.jsx)(Ao,{as:ku,allowPinchZoom:!0,children:(0,z.jsx)(Zi,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:qr(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,z.jsx)(zi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,z.jsx)(ae,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...L,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:qr(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ju=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=uu(Cu,n),o=Ou(Cu,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=tr(t,u),f=iu(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==$l.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Eu,d=Xl(a,[Eu,Math.max(Eu,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Eu,d=Xl(a,[Eu,Math.max(Eu,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Eu*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Eu,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Eu}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Qr(()=>b(),[b]);let[x,S]=v.useState();return Qr(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,z.jsx)(Nu,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,z.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,z.jsx)(Cr.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Mu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Eu,...a}=e,o=cu(n);return(0,z.jsx)(Hl,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Nu,Pu]=ou(Cu,{}),Fu=`SelectViewport`,Iu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Ou(Fu,n),o=Pu(Fu,n),s=tr(t,a.onViewportChange),c=v.useRef(0);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,z.jsx)(ru.Slot,{scope:n,children:(0,z.jsx)(Cr.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:qr(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Eu*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Lu,Ru]=ou(`SelectGroup`),zu=`SelectItem`,[Bu,Vu]=ou(zu),Hu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=uu(zu,n),c=Ou(zu,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=tr(t,Mi(e=>c.itemRefCallback?.(e,r,i))),h=Ti(),g=v.useRef(`touch`),_=G(()=>{s.onValueChange(r),s.onOpenChange(!1)},`handleSelect`);return(0,z.jsx)(Bu,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,z.jsx)(ru.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,z.jsx)(Cr.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:qr(o.onFocus,()=>p(!0)),onBlur:qr(o.onBlur,()=>p(!1)),onClick:qr(o.onClick,()=>{i||g.current!==`mouse`&&_()}),onPointerUp:qr(o.onPointerUp,()=>{i||g.current===`mouse`&&_()}),onPointerDown:qr(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:qr(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qr(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:qr(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(tu.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Uu=`SelectItemText`,Wu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=uu(Uu,n),s=Ou(Uu,n),c=Vu(Uu,n),l=fu(Uu,n),[u,d]=v.useState(null),f=Mi(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=tr(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,z.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Qr(()=>(g(h),()=>_(h)),[g,_,h]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Cr.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!td(o.value)?y.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Gu=`SelectItemIndicator`,Ku=v.forwardRef(G(function(e,t){let{__scopeSelect:n,...r}=e;return Vu(Gu,n).isSelected?(0,z.jsx)(Cr.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),qu=`SelectScrollUpButton`,Ju=v.forwardRef(G(function(e,t){let n=Ou(qu,e.__scopeSelect),r=Pu(qu,e.__scopeSelect),[i,a]=v.useState(!1),o=tr(t,r.onScrollButtonChange);return Qr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};G(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(Zu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Yu=`SelectScrollDownButton`,Xu=v.forwardRef(G(function(e,t){let n=Ou(Yu,e.__scopeSelect),r=Pu(Yu,e.__scopeSelect),[i,a]=v.useState(!1),o=tr(t,r.onScrollButtonChange);return Qr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};G(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,z.jsx)(Zu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Zu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ou(`SelectScrollButton`,n),o=v.useRef(null),s=iu(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Qr(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,z.jsx)(Cr.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qr(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:qr(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:qr(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Qu=`SelectBubbleInput`,$u=v.forwardRef(G(function({__scopeSelect:e,...t},n){let r=uu(Qu,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=tr(n,p),h=i??``,g=ql(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,z.jsxs)(Cr.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Tr,...t.style},ref:m,defaultValue:h,children:[td(i)&&!_?(0,z.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function ed(e){return typeof e==`function`}G(ed,`isFunction`);function td(e){return e===``||e===void 0}G(td,`shouldShowPlaceholder`);function nd(e){let t=Mi(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),G((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}G(nd,`useTypeaheadSearch`);function rd(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=id(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}G(rd,`findNextItem`);function id(e,t){return e.map((n,r)=>e[(t+r)%e.length])}G(id,`wrapArray`);var ad=Object.defineProperty,od=(e,t)=>ad(e,`name`,{value:t,configurable:!0}),[sd,cd]=kr(`Tooltip`,[Nl]);Nl();var ld=`TooltipProvider`,ud=700,[dd,fd]=sd(ld),pd=od(e=>{let{__scopeTooltip:t,delayDuration:n=ud,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,z.jsx)(dd,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),[md,hd]=sd(`Tooltip`),[gd,_d]=sd(`TooltipPortal`,{forceMount:void 0});function vd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}od(vd,`getExitSideFromRect`);function yd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}od(yd,`getPaddedExitPoints`);function bd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}od(bd,`getPointsFromRect`);function xd(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}od(xd,`isPointInPolygon`);function Sd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Cd(t)}od(Sd,`getHull`);function Cd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}od(Cd,`getHullPresorted`);function wd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}od(wd,`concatAriaDescribedby`);function Td(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=Td(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function K(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Td(e))&&(r&&(r+=` `),r+=t);return r}var Ed=`-`,Dd=e=>{let t=jd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(Ed);return n[0]===``&&n.length!==1&&n.shift(),Od(n,t)||Ad(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},Od=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?Od(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(Ed);return t.validators.find(({validator:e})=>e(a))?.classGroupId},kd=/^\[(.+)\]$/,Ad=e=>{if(kd.test(e)){let t=kd.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},jd=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Fd(Object.entries(e.classGroups),n).forEach(([e,n])=>{Md(n,r,e,t)}),r},Md=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:Nd(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(Pd(e)){Md(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{Md(i,Nd(t,e),n,r)})})},Nd=(e,t)=>{let n=e;return t.split(Ed).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Pd=e=>e.isThemeGetter,Fd=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Id=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},Ld=`!`,Rd=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(Ld);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},zd=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Bd=e=>({cache:Id(e.cacheSize),parseClassName:Rd(e),...Dd(e)}),Vd=/\s+/,Hd=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(Vd),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=zd(c).join(`:`),h=l?m+Ld:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function Ud(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=Wd(t))&&(r&&(r+=` `),r+=n);return r}var Wd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Wd(e[r]))&&(n&&(n+=` `),n+=t);return n};function Gd(e,...t){let n,r,i,a=o;function o(o){return n=Bd(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=Hd(e,n);return i(e,a),a}return function(){return a(Ud.apply(null,arguments))}}var Kd=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},qd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jd=/^\d+\/\d+$/,Yd=new Set([`px`,`full`,`screen`]),Xd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zd=/\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$/,Qd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$d=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ef=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tf=e=>rf(e)||Yd.has(e)||Jd.test(e),nf=e=>gf(e,`length`,_f),rf=e=>!!e&&!Number.isNaN(Number(e)),af=e=>gf(e,`number`,rf),of=e=>!!e&&Number.isInteger(Number(e)),sf=e=>e.endsWith(`%`)&&rf(e.slice(0,-1)),q=e=>qd.test(e),cf=e=>Xd.test(e),lf=new Set([`length`,`size`,`percentage`]),uf=e=>gf(e,lf,vf),df=e=>gf(e,`position`,vf),ff=new Set([`image`,`url`]),pf=e=>gf(e,ff,bf),mf=e=>gf(e,``,yf),hf=()=>!0,gf=(e,t,n)=>{let r=qd.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},_f=e=>Zd.test(e)&&!Qd.test(e),vf=()=>!1,yf=e=>$d.test(e),bf=e=>ef.test(e),xf=Gd(()=>{let e=Kd(`colors`),t=Kd(`spacing`),n=Kd(`blur`),r=Kd(`brightness`),i=Kd(`borderColor`),a=Kd(`borderRadius`),o=Kd(`borderSpacing`),s=Kd(`borderWidth`),c=Kd(`contrast`),l=Kd(`grayscale`),u=Kd(`hueRotate`),d=Kd(`invert`),f=Kd(`gap`),p=Kd(`gradientColorStops`),m=Kd(`gradientColorStopPositions`),h=Kd(`inset`),g=Kd(`margin`),_=Kd(`opacity`),v=Kd(`padding`),y=Kd(`saturate`),b=Kd(`scale`),x=Kd(`sepia`),S=Kd(`skew`),C=Kd(`space`),w=Kd(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,q,t],O=()=>[q,t],k=()=>[``,tf,nf],A=()=>[`auto`,rf,q],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],ee=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],N=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],P=()=>[``,`0`,q],F=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],I=()=>[rf,q];return{cacheSize:500,separator:`:`,theme:{colors:[hf],spacing:[tf,nf],blur:[`none`,``,cf,q],brightness:I(),borderColor:[e],borderRadius:[`none`,``,`full`,cf,q],borderSpacing:O(),borderWidth:k(),contrast:I(),grayscale:P(),hueRotate:I(),invert:P(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[sf,nf],inset:D(),margin:D(),opacity:I(),padding:O(),saturate:I(),scale:I(),sepia:P(),skew:I(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,q]}],container:[`container`],columns:[{columns:[cf]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),q]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,of,q]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,q]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:[`first`,`last`,`none`,of,q]}],"grid-cols":[{"grid-cols":[hf]}],"col-start-end":[{col:[`auto`,{span:[`full`,of,q]},q]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[hf]}],"row-start-end":[{row:[`auto`,{span:[of,q]},q]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,q]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...N()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...N(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...N(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,q,t]}],"min-w":[{"min-w":[q,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[q,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[cf]},cf]}],h:[{h:[q,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[q,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[q,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[q,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,cf,nf]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,af]}],"font-family":[{font:[hf]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,q]}],"line-clamp":[{"line-clamp":[`none`,rf,af]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,tf,q]}],"list-image":[{"list-image":[`none`,q]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,tf,nf]}],"underline-offset":[{"underline-offset":[`auto`,tf,q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),df]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,uf]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},pf]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[tf,q]}],"outline-w":[{outline:[tf,nf]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[tf,nf]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,cf,mf]}],"shadow-color":[{shadow:[hf]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...ee(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,cf,q]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,q]}],duration:[{duration:I()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,q]}],delay:[{delay:I()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,q]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[of,q]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,q]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[tf,nf,af]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function J(...e){return xf(K(e))}function Sf({delayDuration:e=0,...t}){return(0,z.jsx)(pd,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}var Cf=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),wf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Tf={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ef=(0,v.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,v.createElement)(`svg`,{ref:c,...Tf,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wf(`lucide`,i),...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Y=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(Ef,{ref:i,iconNode:t,className:wf(`lucide-${Cf(e)}`,n),...r}));return n.displayName=`${e}`,n},Df=Y(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Of=Y(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),kf=Y(`Bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Af=Y(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),jf=Y(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Mf=Y(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Nf=Y(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Pf=Y(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ff=Y(`CircleAlert`,[[`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`}]]),If=Y(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Lf=Y(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Rf=Y(`CircleSlash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),zf=Y(`CircleX`,[[`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`}]]),Bf=Y(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Vf=Y(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Hf=Y(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Uf=Y(`Flag`,[[`path`,{d:`M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z`,key:`i9b6wo`}],[`line`,{x1:`4`,x2:`4`,y1:`22`,y2:`15`,key:`1cm3nv`}]]),Wf=Y(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Gf=Y(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),Kf=Y(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),qf=Y(`Keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Jf=Y(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Yf=Y(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Xf=Y(`Loader`,[[`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`}]]),Zf=Y(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Qf=Y(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),$f=Y(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ep=Y(`RefreshCw`,[[`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`}]]),tp=Y(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),np=Y(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),rp=Y(`ShieldCheck`,[[`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:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ip=Y(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ap=Y(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),X=`/v1`,op={healthz:()=>`/healthz`,status:()=>`${X}/status`,daemonRestart:()=>`${X}/daemon/restart`,nodes:()=>`${X}/nodes`,reviveAll:()=>`${X}/nodes/revive-all`,node:e=>`${X}/nodes/${e}`,nodeSnapshot:e=>`${X}/nodes/${e}/snapshot`,nodeSession:e=>`${X}/nodes/${e}/session`,nodeTranscript:e=>`${X}/nodes/${e}/transcript`,nodeContext:e=>`${X}/nodes/${e}/context`,nodeArtifacts:e=>`${X}/nodes/${e}/artifacts`,nodeReports:e=>`${X}/nodes/${e}/reports`,nodeMessages:e=>`${X}/nodes/${e}/messages`,nodeInterrupt:e=>`${X}/nodes/${e}/interrupt`,nodeFork:e=>`${X}/nodes/${e}/fork`,nodeRevive:e=>`${X}/nodes/${e}/revive`,nodeRelaunchRoot:e=>`${X}/nodes/${e}/relaunch-root`,nodeClose:e=>`${X}/nodes/${e}/close`,nodeRecycle:e=>`${X}/nodes/${e}/recycle`,nodeDemote:e=>`${X}/nodes/${e}/demote`,nodePromote:e=>`${X}/nodes/${e}/promote`,nodeYield:e=>`${X}/nodes/${e}/yield`,nodeWait:e=>`${X}/nodes/${e}/wait`,nodeConfig:e=>`${X}/nodes/${e}/config`,nodeWorktreeClose:e=>`${X}/nodes/${e}/worktree/close`,nodeAttach:e=>`${X}/nodes/${e}/attach`,focuses:()=>`${X}/focuses`,focusByNode:()=>`${X}/focuses/by-node`,focusByPane:()=>`${X}/focuses/by-pane`,focus:e=>`${X}/focuses/${e}`,nodeSubscriptions:e=>`${X}/nodes/${e}/subscriptions`,nodeSubscription:(e,t)=>`${X}/nodes/${e}/subscriptions/${t}`,crons:()=>`${X}/crons`,cron:e=>`${X}/crons/${e}`,cronPause:e=>`${X}/crons/${e}/pause`,cronResume:e=>`${X}/crons/${e}/resume`,cronRun:e=>`${X}/crons/${e}/run`,canvasAttention:()=>`${X}/canvas/attention`,canvasAttentionCounts:()=>`${X}/canvas/attention/counts`,canvasHistorySearch:()=>`${X}/canvas/history/search`,canvasHistoryGrep:()=>`${X}/canvas/history/grep`,canvasHistoryRead:()=>`${X}/canvas/history/read`,canvasSnapshot:()=>`${X}/canvas/snapshot`,canvasRoster:()=>`${X}/canvas/roster`,canvasPrune:()=>`${X}/canvas/prune`,canvasRebuildIndex:()=>`${X}/canvas/rebuild-index`,canvasConsults:()=>`${X}/canvas/consults`,humanBridge:()=>`${X}/human/bridge`,humanDeliver:()=>`${X}/human/deliver`,humanConsult:()=>`${X}/human/consult`,humanVisual:()=>`${X}/human/visual`,humanInbox:()=>`${X}/human/inbox`,humanInboxTicket:e=>`${X}/human/inbox/${e}`,humanInboxRespond:e=>`${X}/human/inbox/${e}/respond`,humanInboxCancel:e=>`${X}/human/inbox/${e}/cancel`,profiles:()=>`${X}/profiles`,profile:e=>`${X}/profiles/${e}`,modelAuths:()=>`${X}/model-auth`,modelAuth:e=>`${X}/model-auth/${e}`,filePeek:()=>`${X}/files/peek`};function sp(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t)return!1;let{code:n,message:r}=t;return typeof n==`string`&&typeof r==`string`}function cp(){let e=new Map;return{run(t,n){let r=e.get(t);if(r!==void 0)return r;let i=n().finally(()=>{e.get(t)===i&&e.delete(t)});return e.set(t,i),i},get pending(){return e.size}}}var lp=cp(),up=`crtr:relay-token`;function dp(){try{let e=window.localStorage.getItem(up);return e!==null&&e!==``?e:void 0}catch{return}}function fp(){let e;try{let t=new URLSearchParams(window.location.search).get(`token`);e=t!==null&&t!==``?t:void 0}catch{e=void 0}if(e!==void 0){try{window.localStorage.setItem(up,e)}catch{}return e}return dp()}var pp=fp(),mp=class extends Error{code;constructor(e,t){super(t),this.name=`CommandError`,this.code=e}};async function hp(e,t){let n={};t?.body!==void 0&&(n[`content-type`]=`application/json`),pp!==void 0&&(n.authorization=`Bearer ${pp}`);let r;try{r=await fetch(e,{...t,headers:{...n,...t?.headers}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?new mp(`aborted`,`request aborted`):new mp(`network`,e instanceof Error?e.message:String(e))}let i=await r.text(),a;if(i!==``)try{a=JSON.parse(i)}catch{a=void 0}if(!r.ok)throw sp(a)?new mp(a.error.code,a.error.message):new mp(`bridge`,`HTTP ${r.status} ${r.statusText}`);return a}function gp(e){let t={node_id:e.node_id,name:e.name,kind:e.kind,mode:e.mode,lifecycle:e.lifecycle,status:e.status,cwd:e.cwd,parent:e.parent,created:e.created,host_kind:e.host_kind??`broker`,enterable:e.host_kind===`broker`,attention_count:0,branch:e.worktree?.branch??null,model:e.model_override??null,tokens:null,context:null,tool_calls:null,stats:null,presence:null,live:e.pi_pid!=null,git_status:null};return e.cycles!==void 0&&(t.cycles=e.cycles),t}function _p(){return lp.run(`canvas:roster`,async()=>{let e=await hp(op.canvasRoster()),t=e.nodes.map(e=>e.node_id),n=t.length>0?(await hp(op.canvasAttentionCounts(),{method:`POST`,body:JSON.stringify({node_ids:t})})).counts:{};return{nodes:e.nodes.map(e=>({...e,attention_count:n[e.node_id]??0})),generated_at:e.generated_at}})}function vp(e){return lp.run(`node:inspect:${e}`,()=>hp(op.node(e)).then(gp))}function yp(e){return lp.run(`node:snapshot:${e}`,()=>hp(op.nodeSnapshot(e)).then(e=>({node_id:e.node_id,snapshot:e.snapshot,commands:e.commands})))}function bp(e){let t={kind:e.kind,prompt:e.prompt,...e.mode===void 0?{}:{mode:e.mode},...e.root===void 0?{}:{root:e.root},...e.cwd?.trim()?{cwd:e.cwd.trim()}:{},...e.name?.trim()?{name:e.name.trim()}:{},...e.model?.trim()?{model:e.model.trim()}:{},...e.parent?.trim()?{parent:e.parent.trim()}:{}};return hp(op.nodes(),{method:`POST`,body:JSON.stringify(t)}).then(e=>({node_id:e.node_id,name:e.name,status:e.status,follow_up:``}))}function xp(e,t){let n={body:t.body,...t.tier?.trim()?{tier:t.tier.trim()}:{}};return hp(op.nodeMessages(e),{method:`POST`,body:JSON.stringify(n)}).then(e=>({mode:e.armed===!0?`armed`:`delivered`,armed:e.armed??!1,target:e.node_id,delivered:e.delivered,revived:e.revived,guidance:``}))}function Sp(e,t={}){return hp(op.nodeRevive(e),{method:`POST`,body:JSON.stringify({resume:t.fresh!==!0})}).then(e=>({window:null,session:null,resumed:e.resumed,ready:e.revived}))}function Cp(e){return hp(op.nodeClose(e),{method:`POST`,body:JSON.stringify({})}).then(e=>({closed:!0,node_id:e.root,count:e.closed.length,closed_ids:e.closed,spared:e.spared}))}function wp(e,t){return hp(`${op.filePeek()}?path=${encodeURIComponent(t)}`).then(e=>({path:e.path,content:e.content,truncated:e.truncated}))}async function Tp(e,t){try{let n={"content-type":`application/json`};pp!==void 0&&(n.authorization=`Bearer ${pp}`);let r=await fetch(`/__crtr/source`,{method:`POST`,headers:n,body:JSON.stringify(e),...t===void 0?{}:{signal:t}});return r.ok?await r.json():{ok:!1,stdout:``,stderr:`bridge ${r.status} ${r.statusText}`}}catch(e){return t?.aborted===!0||e instanceof DOMException&&e.name===`AbortError`?{ok:!1,stdout:``,stderr:`aborted`}:{ok:!1,stdout:``,stderr:e instanceof Error?e.message:String(e)}}}async function Ep(e,t,n){return Tp({kind:`exec`,bin:`crtr`,args:e,...t===void 0?{}:{stdin:t}},n)}function Dp(e){let t=e.stdout.trim();if(t===``)return null;try{let e=JSON.parse(t);if(e&&typeof e==`object`&&typeof e.error==`string`&&typeof e.message==`string`)return{code:e.error,message:e.message}}catch{}return null}async function Op(e,t,n){let r=await Ep(e,t,n);if(!r.ok)throw new mp(`bridge`,r.stderr||`bridge request failed`);let i=Dp(r);if(i!==null)throw new mp(i.code,i.message);if(r.exitCode!==void 0&&r.exitCode!==0){let t=r.stderr.trim()===``?r.stdout.trim():r.stderr;throw new mp(`bridge`,t===``?`crtr ${e.join(` `)} failed (${r.exitCode})`:t)}if(r.stdout.trim()!==``)try{return JSON.parse(r.stdout)}catch(e){throw new mp(`bridge`,e instanceof Error?e.message:String(e))}}var kp=new Set,Ap=!1;function jp(){if(Ap)return;Ap=!0;let e;try{let t=new URL(`/__crtr/events`,window.location.href);pp!==void 0&&t.searchParams.set(`token`,pp),e=new EventSource(t.toString())}catch{Ap=!1;return}e.onmessage=e=>{let t;try{t=JSON.parse(e.data).kind}catch{return}if(t!==void 0)for(let e of kp)e.kinds.includes(t)&&e.refresh()}}function Mp(e,t){let n=(0,v.useRef)(t);n.current=t,(0,v.useEffect)(()=>{jp();let t={kinds:e,refresh:()=>n.current()};return kp.add(t),()=>{kp.delete(t)}},[e.join(`,`)])}var Np=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Pp=(e=>e?Np(e):Np),Fp=e=>e;function Ip(e,t=Fp){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var Lp=e=>{let t=Pp(e),n=e=>Ip(t,e);return Object.assign(n,t),n},Rp=(e=>e?Lp(e):Lp),zp=Rp(e=>({reachable:!0,setReachable:t=>e({reachable:t})})),Bp=1,Vp=`crtr.web.roster.v1`;function Hp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Up(e){return typeof e==`string`}function Wp(e){return typeof e==`number`}function Gp(e){return Hp(e)?Up(e.node_id)&&Up(e.name)&&Up(e.kind)&&(e.mode===`base`||e.mode===`orchestrator`)&&(e.lifecycle===`terminal`||e.lifecycle===`resident`)&&(e.status===`active`||e.status===`idle`||e.status===`done`||e.status===`dead`||e.status===`canceled`)&&Up(e.cwd)&&(e.parent===null||Up(e.parent))&&Up(e.created)&&(e.host_kind===`broker`||e.host_kind===`tmux`)&&typeof e.enterable==`boolean`&&Wp(e.attention_count)&&(e.cycles===void 0||Wp(e.cycles))&&(e.last_activity===void 0||Up(e.last_activity)):!1}function Kp(e){return Hp(e)?e.schemaVersion===Bp&&Up(e.generatedAt)&&Wp(e.cachedAt)&&Array.isArray(e.nodes)&&e.nodes.every(Gp):!1}function qp(){try{let e=globalThis.localStorage?.getItem(Vp);if(e==null)return null;let t=JSON.parse(e);return Kp(t)?t:null}catch{return null}}function Jp(e,t){let n={schemaVersion:Bp,nodes:e,generatedAt:t,cachedAt:Date.now()};try{globalThis.localStorage?.setItem(Vp,JSON.stringify(n))}catch{}}var Yp=3e4,Xp=new class{state;listeners=new Set;started=!1;timer=null;constructor(){let e=qp();this.state=e?{nodes:e.nodes,generatedAt:e.generatedAt,loading:!1}:{nodes:[],generatedAt:null,loading:!0}}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;refetch=()=>{this.load()};ensureStarted(){if(this.started)return;this.started=!0,this.load(),this.timer=setInterval(()=>void this.load(),Yp);let e=()=>{document.visibilityState===`visible`&&this.load()};document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e)}setState(e){this.state=e;for(let e of this.listeners)e()}async load(){try{let e=await _p();this.setState({nodes:e.nodes,generatedAt:e.generated_at,loading:!1}),Jp(e.nodes,e.generated_at),zp.getState().setReachable(!0)}catch{this.state.loading&&this.setState({...this.state,loading:!1}),zp.getState().setReachable(!1)}}};function Zp(){let e=(0,v.useSyncExternalStore)(Xp.subscribe,Xp.getState);return Mp([`nodes`,`inbox`],Xp.refetch),e}var Qp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,$p=K,em=(e,t)=>n=>{if(t?.variants==null)return $p(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Qp(t)||Qp(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return $p(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},tm=em(`btn justify-center transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`primary`,destructive:`danger`,outline:``,secondary:``,ghost:`border-transparent`,link:`border-transparent bg-transparent text-primary underline-offset-4 hover:underline hover:bg-transparent`},size:{default:``,xs:`sm gap-1 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`sm`,lg:`px-6 py-2.5`,icon:`p-0 size-9`,"icon-xs":`p-0 size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`p-0 size-8`,"icon-lg":`p-0 size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Z({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,z.jsx)(r?lr:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:J(tm({variant:t,size:n,className:e})),...i})}function nm({...e}){return(0,z.jsx)(qo,{"data-slot":`dialog`,...e})}function rm({...e}){return(0,z.jsx)(Zo,{"data-slot":`dialog-portal`,...e})}function im({className:e,...t}){return(0,z.jsx)($o,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function am({className:e,children:t,showCloseButton:n=!0,...r}){return(0,z.jsxs)(rm,{"data-slot":`dialog-portal`,children:[(0,z.jsx)(im,{}),(0,z.jsxs)(rs,{"data-slot":`dialog-content`,className:J(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,z.jsxs)(us,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,z.jsx)(ap,{}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function om({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function sm({className:e,showCloseButton:t=!1,children:n,...r}){return(0,z.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,z.jsx)(us,{asChild:!0,children:(0,z.jsx)(Z,{variant:`outline`,children:`Close`})})]})}function cm({className:e,...t}){return(0,z.jsx)(ss,{"data-slot":`dialog-title`,className:J(`text-lg leading-none font-semibold`,e),...t})}function lm({className:e,...t}){return(0,z.jsx)(cs,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground`,e),...t})}function um({className:e,type:t,...n}){return(0,z.jsx)(`input`,{type:t,"data-slot":`input`,className:J(`h-9 w-full min-w-0 rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.25)] px-3 py-1 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-[var(--dim)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...n})}function dm({className:e,...t}){return(0,z.jsx)(Wl,{"data-slot":`label`,className:J(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function fm({...e}){return(0,z.jsx)(mu,{"data-slot":`select`,...e})}function pm({...e}){return(0,z.jsx)(vu,{"data-slot":`select-value`,...e})}function mm({className:e,size:t=`default`,children:n,...r}){return(0,z.jsxs)(gu,{"data-slot":`select-trigger`,"data-size":t,className:J(`flex w-fit items-center justify-between gap-2 rounded-md border border-[var(--line)] bg-[oklch(0.92_0.008_80/0.02)] px-3 py-2 font-mono text-sm text-[var(--ink2)] whitespace-nowrap transition-[color,box-shadow] outline-none cursor-pointer focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-[var(--mut)] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-[var(--mut)]`,e),...r,children:[n,(0,z.jsx)(yu,{asChild:!0,children:(0,z.jsx)(jf,{className:`size-4 opacity-50`})})]})}function hm({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,z.jsx)(Su,{children:(0,z.jsxs)(wu,{"data-slot":`select-content`,className:J(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,z.jsx)(_m,{}),(0,z.jsx)(Iu,{className:J(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,z.jsx)(vm,{})]})})}function gm({className:e,children:t,...n}){return(0,z.jsxs)(Hu,{"data-slot":`select-item`,className:J(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,z.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(Ku,{children:(0,z.jsx)(Af,{className:`size-4`})})}),(0,z.jsx)(Wu,{children:t})]})}function _m({className:e,...t}){return(0,z.jsx)(Ju,{"data-slot":`select-scroll-up-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,z.jsx)(Pf,{className:`size-4`})})}function vm({className:e,...t}){return(0,z.jsx)(Xu,{"data-slot":`select-scroll-down-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,z.jsx)(jf,{className:`size-4`})})}function ym({className:e,...t}){return(0,z.jsx)(`textarea`,{"data-slot":`textarea`,className:J(`flex field-sizing-content min-h-16 w-full rounded-md border border-[var(--line)] bg-[oklch(0_0_0/0.3)] px-3 py-2 text-sm text-[var(--ink)] transition-[color,box-shadow] outline-none placeholder:text-[var(--dim)] focus-visible:border-[var(--line2)] focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...t})}var bm=em(`badge w-fit max-w-full overflow-hidden text-[var(--ink2)] whitespace-nowrap [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:``,secondary:`dead`,destructive:`blocked`,outline:``,ghost:`border-transparent`,link:`border-transparent underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function xm({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,z.jsx)(n?lr:`span`,{"data-slot":`badge`,"data-variant":t,className:J(bm({variant:t}),e),...r})}function Sm(e){return e instanceof mp&&(e.code===`not_found`||e.code===`already_resolved`||e.code===`claimed`)}function Cm(e){switch(e){case`notify`:case`validation`:case`decision`:case`context`:case`error`:return e}throw Error(`Unknown deck kind: ${e}`)}function wm(e){return{id:e.id,title:e.title,subtitle:e.subtitle,...e.body===void 0?{}:{body:e.body},kind:Cm(e.kind),options:e.options.map(e=>({id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description}})),multiSelect:e.multiSelect,allowFreetext:e.allow_freetext}}function Tm(e){return{id:e.id,job_id:e.job_id,kind:Cm(e.kind),title:e.title,subtitle:e.subtitle,blocked_since:e.blocked_since,...e.claim_owner===void 0?{}:{claim_owner:e.claim_owner},...e.source_label===void 0?{}:{source_label:e.source_label},conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:e.cwd,interaction_count:e.interaction_count}}function Em(e,t){return{id:e.id,job_id:e.job_id??e.id,kind:Cm(e.kind),title:e.title,subtitle:e.subtitle,blocked_since:e.blocked_since,...e.source_label===void 0?{}:{source_label:e.source_label},conversation_id:e.conversation_id,conversation_title:e.conversation_title,asking_node_id:e.asking_node_id,asking_node_name:e.asking_node_name,cwd:t,interaction_count:e.interaction_count,interactions:e.interactions.map(wm)}}function Dm(){return lp.run(`human:list`,async()=>(await Op([`human`,`list`,`--json`])).items.map(Tm))}async function Om(e){let t=await Op([`human`,`deck`,e,`--json`]),n=(await vp(t.asking_node_id)).cwd;return Em(t,n)}async function km(e,t){let n=JSON.stringify({responses:t.responses}),r=await Op([`human`,`resolve`,e,`--json`],n);if(r.resolved!==!0)throw new mp(r.reason===`claimed`?`claimed`:`already_resolved`,r.reason===`claimed`?`That request is already being handled.`:`That request was already handled.`);return{resolved:!0,job_id:r.job_id??e,delivered:r.delivered??!0}}function Am(e){let t=0;for(let n of e)t+=Math.max(0,n.attention_count);return t}function jm(){let{nodes:e}=Zp();return Am(e)}function Mm(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(0),o=(0,v.useCallback)(()=>a(e=>e+1),[]);return Mp([`inbox`,`nodes`],o),(0,v.useEffect)(()=>{let e=!1;return Dm().then(n=>{e||(t(n),r(!1))}).catch(()=>{e||r(!1)}),()=>{e=!0}},[i]),{decks:e,loading:n,refetch:o}}function Nm(e){let{decks:t}=Mm();return t.filter(t=>t.conversation_id===e)}var Pm={notify:{icon:kf,label:`Update`},validation:{icon:rp,label:`Approval`},decision:{icon:Wf,label:`Decision`},context:{icon:Lf,label:`Question`},error:{icon:ip,label:`Problem`}};function Fm(e){switch(e){case`notify`:return Pm.notify;case`validation`:return Pm.validation;case`decision`:return Pm.decision;case`context`:return Pm.context;case`error`:return Pm.error;default:return Pm.context}}function Im(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}var Lm=1,Rm=Rp(e=>({toasts:[],push:(t,n=`info`)=>{let r=Lm++;e(e=>({toasts:[...e.toasts,{id:r,message:t,tone:n}]})),setTimeout(()=>e(e=>({toasts:e.toasts.filter(e=>e.id!==r)})),4e3)},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))}));function zm(e,t=`info`){Rm.getState().push(e,t)}var Bm=e=>({"--i":e});async function Vm(e,t){let n=(await Om(e)).interactions[0];await km(e,{responses:[t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]}]})}function Hm(){let{decks:e,loading:t}=Mm(),n=(0,v.useMemo)(()=>[...e].sort((e,t)=>new Date(t.blocked_since).getTime()-new Date(e.blocked_since).getTime()),[e]);return t||n.length===0?null:(0,z.jsxs)(`section`,{className:`needs rv`,style:Bm(3),children:[(0,z.jsxs)(`div`,{className:`needs-head`,children:[(0,z.jsx)(Uf,{size:14,className:`flag`,"aria-hidden":!0}),(0,z.jsxs)(`span`,{className:`instlabel`,children:[`Needs you — `,n.length,` blocked`]}),(0,z.jsx)(`div`,{className:`rule`})]}),(0,z.jsx)(`div`,{className:`needs-grid`,children:n.map(e=>(0,z.jsx)(Um,{deck:e},e.id))})]})}function Um({deck:e}){let t=dt(),{refetch:n}=Mm(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=Fm(e.kind).label,u=Im(e.blocked_since);e.kind===`decision`&&a===null&&!s&&(async()=>{if(!(e.kind!==`decision`||s||a!==null)){c(!0);try{let t=(await Om(e.job_id)).interactions[0]?.options??[];o(t.length<=3?t:[])}catch(e){Sm(e)?(o([]),n()):(console.error(`[needs-you] failed to load decision options:`,e),o([]))}finally{c(!1)}}})();let d=async t=>{if(!r){i(!0);try{await Vm(e.job_id,t),zm(`Done — thanks!`,`success`),n()}catch(e){if(Sm(e)){zm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] resolve failed:`,e),zm(`Something went wrong — try again.`)}finally{i(!1)}}},f=async t=>{if(!r){i(!0);try{let r=(await Om(e.job_id)).interactions[0];await km(e.job_id,{responses:[{id:r.id,selectedOptionIds:[t]}]}),zm(`Done — thanks!`,`success`),n()}catch(e){if(Sm(e)){zm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] decision option resolve failed:`,e),zm(`Something went wrong — try again.`)}finally{i(!1)}}},p=e.kind===`decision`&&a!==null&&a.length>0;return(0,z.jsxs)(`div`,{className:`deck`,children:[(0,z.jsxs)(`div`,{className:`deck-meta`,children:[(0,z.jsx)(`span`,{className:`deck-kind`,children:l}),(0,z.jsx)(`span`,{className:`from`,children:e.asking_node_name}),(0,z.jsxs)(`span`,{className:`age`,children:[`blocked `,u]})]}),(0,z.jsx)(`p`,{className:`deck-q line-clamp-2`,children:e.title}),(0,z.jsxs)(`div`,{className:`deck-actions`,children:[e.kind===`notify`&&(0,z.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`ack`),children:`Got it`}),e.kind===`validation`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{type:`button`,size:`sm`,disabled:r,onClick:()=>void d(`yes`),children:`Approve`}),(0,z.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`no`),children:`Reject`})]}),p&&a.map(e=>(0,z.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void f(e.id),children:e.label},e.id)),(0,z.jsxs)(Z,{type:`button`,variant:`ghost`,size:`sm`,disabled:r,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),style:{marginLeft:`auto`,color:`var(--dim)`},children:[`open thread `,(0,z.jsx)(Of,{"aria-hidden":!0})]})]})]})}var Wm=e=>({"--i":e}),Gm=`hosted in a tmux pane — open it in your terminal`;function Km(e){let t=new Map;for(let n of e)t.set(n.node_id,{node:n,children:[]});let n=[];for(let e of t.values()){let r=e.node.parent,i=r?t.get(r):void 0;i?i.children.push(e):n.push(e)}return n}var qm=[`active`,`idle`,`done`,`dead`,`canceled`],Jm={query:``,status:`all`,blockedOnly:!1};function Ym(e){return e.query.trim()!==``||e.status!==`all`||e.blockedOnly}function Xm(e,t){if(t.status!==`all`&&e.status!==t.status||t.blockedOnly&&e.attention_count<=0)return!1;let n=t.query.trim().toLowerCase();return!(n&&!`${e.name} ${e.kind} ${e.mode} ${e.cwd} ${e.node_id} ${e.status}`.toLowerCase().includes(n))}function Zm(e,t){if(!Ym(t))return e;let n=new Map(e.map(e=>[e.node_id,e])),r=new Set;for(let i of e){if(!Xm(i,t))continue;let e=i;for(;e&&!r.has(e.node_id);)r.add(e.node_id),e=e.parent?n.get(e.parent):void 0}return e.filter(e=>r.has(e.node_id))}var Qm=new Set([`dead`,`canceled`]);function $m(e){return Qm.has(e.node.status)&&e.children.every($m)}function eh(e){return 1+e.children.reduce((e,t)=>e+eh(t),0)}var th=3,nh={active:Bf,idle:Bf,done:If,dead:Rf,canceled:zf};function rh(e,t){return t?Ff:nh[e]??Bf}function ih(e){return e.toLocaleTimeString(`en-GB`,{hour12:!1})}function ah(){let[e,t]=(0,v.useState)(()=>ih(new Date));return(0,v.useEffect)(()=>{let e=setInterval(()=>t(ih(new Date)),1e3);return()=>clearInterval(e)},[]),e}function oh(){let{nodes:e}=Zp(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(Jm),s=(0,v.useRef)(null),c=ah(),l=e.filter(e=>e.status===`active`).length,u=(0,v.useMemo)(()=>Km(Zm(e,a)),[e,a]);return(0,v.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=document.activeElement;t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable||(e.preventDefault(),s.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,z.jsxs)(`div`,{className:`in relative z-[1] h-full min-h-0 overflow-auto`,style:{padding:`34px 44px 44px`},children:[(0,z.jsxs)(`div`,{className:`rv flex items-baseline gap-4`,style:Wm(1),children:[(0,z.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:420,letterSpacing:`-0.01em`,fontVariationSettings:`"opsz" 60`,color:`var(--ink)`},children:`Canvas`}),(0,z.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e.length,` `,e.length===1?`node`:`nodes`,l>0&&` · ${l} active`]}),(0,z.jsxs)(`div`,{className:`font-inst text-xs flex items-center gap-2`,style:{marginLeft:`auto`,color:`var(--ink2)`,letterSpacing:`0.1em`},children:[(0,z.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:`var(--act)`,animation:`pulse 2.4s ease-out infinite`}}),(0,z.jsx)(`span`,{children:c})]})]}),(0,z.jsxs)(`div`,{className:`rv flex items-center gap-2.5`,style:{margin:`20px 0 22px`,...Wm(2)},children:[(0,z.jsxs)(`div`,{className:`search`,children:[(0,z.jsx)(tp,{size:14,className:`opacity-70`,"aria-hidden":!0}),(0,z.jsx)(`input`,{ref:s,value:a.query,onChange:e=>o(t=>({...t,query:e.currentTarget.value})),onKeyDown:e=>{e.key===`Escape`&&(o(e=>({...e,query:``})),e.currentTarget.blur())},placeholder:`Search name, kind, mode, cwd, id…`,"aria-label":`Search nodes`,className:`min-w-0 flex-1 border-0 bg-transparent p-0 text-sm outline-none`,style:{color:`var(--ink)`}}),(0,z.jsx)(`span`,{className:`kbd`,children:`/`})]}),(0,z.jsxs)(`label`,{className:`selectish`,children:[(0,z.jsxs)(`select`,{value:a.status,onChange:e=>o(t=>({...t,status:e.currentTarget.value})),"aria-label":`Filter by status`,className:`cursor-pointer appearance-none border-0 bg-transparent text-sm outline-none`,style:{color:`var(--ink2)`},children:[(0,z.jsx)(`option`,{value:`all`,children:`all statuses`}),qm.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]}),(0,z.jsx)(`span`,{className:`car`,children:`▾`})]}),(0,z.jsxs)(`label`,{className:`checkish select-none`,children:[(0,z.jsx)(`span`,{className:`box`,style:a.blockedOnly?{background:`var(--blk)`,borderColor:`var(--blk)`}:void 0}),`blocked`,(0,z.jsx)(`input`,{type:`checkbox`,checked:a.blockedOnly,onChange:e=>o(t=>({...t,blockedOnly:e.currentTarget.checked})),className:`sr-only`})]}),(0,z.jsx)(`button`,{type:`button`,className:`btn primary`,style:{marginLeft:`auto`},onClick:()=>{i(e=>e+1),n(!0)},children:`+ Spawn a node`})]}),(0,z.jsx)(Hm,{}),(0,z.jsxs)(`div`,{className:`panel rv`,style:{padding:`6px 0`,...Wm(4)},children:[(0,z.jsxs)(`div`,{className:`flex items-center`,style:{padding:`10px 18px 9px`,borderBottom:`1px solid var(--line)`},children:[(0,z.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Node forest`}),(0,z.jsx)(`span`,{className:`font-inst text-xs`,style:{marginLeft:`auto`,color:`var(--dim)`,letterSpacing:`0.1em`},children:`sorted · activity`})]}),(0,z.jsx)(`div`,{className:`tree`,children:e.length===0?(0,z.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No nodes on the canvas yet.`}):u.length===0?(0,z.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No matching nodes.`}):u.map(e=>(0,z.jsx)(sh,{node:e},e.node.node_id))})]}),(0,z.jsx)(lh,{open:t,onClose:()=>n(!1)},r)]})}function sh({node:e}){let t=dt(),[n,r]=(0,v.useState)(!1),i=e.node,a=i.attention_count>0,o=Qm.has(i.status),s=a?`blocked`:i.status,c=e.children.filter(e=>!$m(e)),l=e.children.filter(e=>$m(e)),u=l.reduce((e,t)=>e+eh(t),0),d=u>=th,f=d?c:e.children,p=()=>{i.enterable&&t(`/nodes/${encodeURIComponent(i.node_id)}`)};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:J(`node-row s-${s}`,o&&`dimmed`),onClick:p,role:i.enterable?`button`:void 0,tabIndex:i.enterable?0:void 0,style:i.enterable?void 0:{cursor:`default`},onKeyDown:e=>{i.enterable&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p())},children:[(0,z.jsxs)(`div`,{className:`node-id`,children:[(0,z.jsxs)(`div`,{className:`node-l1`,children:[(0,z.jsx)(`span`,{className:`node-name`,children:i.name}),(0,z.jsxs)(`span`,{className:`node-kind`,children:[i.kind,` · `,i.mode]})]}),(0,z.jsxs)(`div`,{className:`node-l2`,children:[(0,z.jsx)(`span`,{className:`node-cwd`,title:i.cwd,children:i.cwd}),i.lifecycle&&(0,z.jsx)(`span`,{className:`node-life`,children:i.lifecycle}),!i.enterable&&(0,z.jsx)(`span`,{className:`node-note`,children:Gm})]})]}),(0,z.jsxs)(`div`,{className:`node-right`,children:[a&&(0,z.jsxs)(`span`,{className:`waitflag`,children:[(0,z.jsx)(Uf,{size:14,"aria-hidden":!0}),` `,i.attention_count,` waiting on human`]}),(0,z.jsx)(ch,{status:i.status,blocked:a})]})]}),(f.length>0||d&&u>0)&&(0,z.jsxs)(`div`,{className:`kids`,children:[f.map(e=>(0,z.jsx)(sh,{node:e},e.node.node_id)),d&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex items-center gap-1.5 px-4 py-2 text-xs transition-colors`,style:{color:`var(--dim)`},children:[(0,z.jsx)(Nf,{size:14,"aria-hidden":!0,style:{transform:n?`rotate(90deg)`:`none`,transition:`transform 0.15s ease`}}),n?`Hide ${u} closed`:`Show ${u} closed`]}),n&&l.map(e=>(0,z.jsx)(sh,{node:e},e.node.node_id))]})]})]})}function ch({status:e,blocked:t}){let n=rh(e,t);return(0,z.jsxs)(xm,{variant:`outline`,className:t?`blocked`:e,children:[(0,z.jsx)(n,{"aria-hidden":!0}),e]})}function lh({open:e,onClose:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`developer`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(null);return(0,z.jsx)(nm,{open:e,onOpenChange:e=>!e&&t(),children:(0,z.jsxs)(am,{className:`max-w-md overflow-y-auto max-h-[90dvh]`,children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:`Spawn a node`})}),(0,z.jsxs)(`form`,{id:`spawn-form`,onSubmit:async e=>{if(e.preventDefault(),!n.trim()||!i.trim()){S(`prompt and kind are required`);return}b(!0),S(null);let r={prompt:n.trim(),kind:i.trim(),...o?{mode:o}:{},...c?{root:!0}:{},...u.trim()?{cwd:u.trim()}:{},...f.trim()?{name:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...g.trim()?{parent:g.trim()}:{}};try{await bp(r),t()}catch(e){console.error(`[spawn] failed:`,e),S(e instanceof mp?`${e.code}: ${e.message}`:String(e))}finally{b(!1)}},className:`flex flex-col gap-3.5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-prompt`,children:`Prompt`}),(0,z.jsx)(ym,{id:`spawn-prompt`,value:n,onChange:e=>r(e.currentTarget.value),rows:4,required:!0,className:`resize-none`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-kind`,children:`Kind`}),(0,z.jsx)(um,{id:`spawn-kind`,value:i,onChange:e=>a(e.currentTarget.value),required:!0})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-mode`,children:`Mode`}),(0,z.jsxs)(fm,{value:o===``?`__none__`:o,onValueChange:e=>s(e===`__none__`?``:e),children:[(0,z.jsx)(mm,{id:`spawn-mode`,className:`w-full`,children:(0,z.jsx)(pm,{})}),(0,z.jsxs)(hm,{children:[(0,z.jsx)(gm,{value:`__none__`,children:`(default)`}),(0,z.jsx)(gm,{value:`base`,children:`base`}),(0,z.jsx)(gm,{value:`orchestrator`,children:`orchestrator`})]})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`input`,{type:`checkbox`,id:`spawn-root`,checked:c,onChange:e=>l(e.currentTarget.checked),className:`size-4 rounded-none border border-input accent-primary`}),(0,z.jsx)(dm,{htmlFor:`spawn-root`,className:`cursor-pointer`,children:`Resident root node`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-cwd`,children:`cwd`}),(0,z.jsx)(um,{id:`spawn-cwd`,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`(inherit)`,className:`font-mono text-sm`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-name`,children:`Name`}),(0,z.jsx)(um,{id:`spawn-name`,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`(auto)`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-model`,children:`Model`}),(0,z.jsx)(um,{id:`spawn-model`,value:m,onChange:e=>h(e.currentTarget.value),placeholder:`(default)`})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(dm,{htmlFor:`spawn-parent`,children:`Parent node id`}),(0,z.jsx)(um,{id:`spawn-parent`,value:g,onChange:e=>_(e.currentTarget.value),placeholder:`(this canvas root)`,className:`font-mono text-sm`})]}),x&&(0,z.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,disabled:y,children:`Cancel`}),(0,z.jsx)(Z,{type:`submit`,form:`spawn-form`,disabled:y,children:y?`Spawning…`:`Spawn`})]})]})})}function uh(e){if(!e)return``;let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]??``}function dh(e){let t=e.name?.trim();if(t&&t!==e.kind)return t;let n=uh(e.cwd);return n?`${e.kind} · ${n}`:e.kind}function fh(e){return e.parent===null&&e.host_kind===`broker`}function ph(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function mh(e,t){let n=[],r=new Set,i=[e];for(;i.length>0;){let e=i.pop();if(r.has(e.node_id))continue;r.add(e.node_id),n.push(e);let a=t.get(e.node_id);if(a)for(let e of a)i.push(e)}return n}function hh(e){return e===`done`||e===`dead`||e===`canceled`}function gh(e){return e.attention_count>0?`blocked`:e.status}function _h(e,t,n){return t>0?`needs-you`:e.status===`active`||n>0?`active`:hh(e.status)?`done`:`idle`}function vh(e){switch(e){case`needs-you`:return 0;case`active`:return 1;case`idle`:return 2;case`done`:return 3}}function yh(e){let t=ph(e),n=[];for(let r of e){if(!fh(r))continue;let e=mh(r,t),i=0,a=0;for(let t of e)i+=Math.max(0,t.attention_count),t.node_id!==r.node_id&&t.status===`active`&&(a+=1);n.push({id:r.node_id,title:dh(r),state:_h(r,i,a),attention:i,activeChildren:a,nodeCount:e.length,...r.cycles===void 0?{}:{cycles:r.cycles},lastActivity:r.last_activity??r.created})}return n.sort((e,t)=>{let n=vh(e.state)-vh(t.state);return n===0?t.lastActivity.localeCompare(e.lastActivity):n}),n}function bh(e){switch(e.state){case`needs-you`:return e.attention>1?`${e.attention} things need your input`:`Needs your input`;case`active`:return e.activeChildren>0?`Working — ${e.activeChildren} ${e.activeChildren===1?`task`:`tasks`} in progress`:`Working…`;case`done`:return`Finished`;case`idle`:return`Idle`}}function xh(e,t,n){if(e.key===`Enter`&&!e.shiftKey){if(e.altKey){e.preventDefault();let n=e.currentTarget,r=n.selectionStart??n.value.length,i=n.selectionEnd??r,a=`${n.value.slice(0,r)}\n${n.value.slice(i)}`,o=r+1;t(a),requestAnimationFrame(()=>{n.selectionStart=o,n.selectionEnd=o});return}e.metaKey||e.ctrlKey||(e.preventDefault(),n())}}var Sh=[`Research a topic for me`,`Help me write something`,`Review my code`,`Plan a project`];function Ch(){let{nodes:e,loading:t}=Zp(),n=zp(e=>e.reachable),r=(0,v.useMemo)(()=>yh(e),[e]),[i,a]=(0,v.useState)(!1),[o]=Bn();(0,v.useEffect)(()=>{o.get(`new`)!==null&&a(!0)},[o]);let s=!t&&r.length===0;return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,z.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-3`,children:[(0,z.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Conversations`}),!s&&!i&&(0,z.jsx)(Z,{size:`lg`,onClick:()=>a(!0),children:`+ New chat`})]}),!n&&(0,z.jsx)(`div`,{className:`mb-4 rounded-lg border px-4 py-2.5 text-sm`,style:{borderColor:`rgba(255,94,54,.3)`,background:`var(--blk-dim)`,color:`var(--ink2)`},children:`Couldn't reach your agents — retrying…`}),(i||s)&&(0,z.jsx)(wh,{firstRun:s,onCancel:s?void 0:()=>a(!1)}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,z.jsx)(Oh,{}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>(0,z.jsx)(Th,{conversation:e},e.id))})})]})}function wh({firstRun:e,onCancel:t}){let n=dt(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=async()=>{let e=r.trim();if(!(!e||a)){o(!0),c(null);try{let t=await bp({prompt:e,kind:`general`,mode:`base`,root:!0});n(`/c/${encodeURIComponent(t.node_id)}`)}catch(e){c(e instanceof mp?e.message:String(e)),o(!1)}}};return(0,z.jsxs)(`div`,{className:`panel mb-6 p-5`,children:[e&&(0,z.jsx)(`p`,{className:`mb-3 text-base`,style:{fontStyle:`italic`,color:`var(--ink2)`},children:`Start a conversation with an agent.`}),(0,z.jsx)(ym,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{xh(e,i,()=>void l())},rows:3,disabled:a,placeholder:`What do you want help with?`,className:`resize-none border-0 bg-transparent px-0 text-base shadow-none focus-visible:ring-0`}),(0,z.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Sh.map(e=>(0,z.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>i(e),className:`rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:border-[color:var(--line2)] hover:text-foreground`,children:e},e))}),s&&(0,z.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:s}),(0,z.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-2`,children:[t&&(0,z.jsx)(Z,{variant:`ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,z.jsx)(Z,{onClick:()=>void l(),disabled:a||!r.trim(),children:a?`Starting…`:`Start chat`})]})]})}function Th({conversation:e}){let t=dt();return(0,z.jsx)(`li`,{className:`list-none`,children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/c/${encodeURIComponent(e.id)}`),className:`panel flex w-full items-center gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(Dh,{state:e.state}),(0,z.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title})]}),(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:bh(e)})]}),(0,z.jsxs)(`div`,{className:`font-inst flex shrink-0 items-center gap-3 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:[e.cycles!==void 0&&(0,z.jsxs)(`span`,{title:`cycles`,children:[`⟳ `,e.cycles]}),(0,z.jsxs)(`span`,{title:`nodes in this conversation`,children:[`◦ `,e.nodeCount,` `,e.nodeCount===1?`node`:`nodes`]}),(0,z.jsx)(`span`,{title:`time since last work`,children:kh(e.lastActivity)})]})]})})}var Eh={"needs-you":`needs you`,active:`active`,idle:`idle`,done:`done`};function Dh({state:e}){let t=e===`needs-you`?`blocked`:e,n=Eh[e];return(0,z.jsx)(`span`,{className:J(`dot shrink-0`,t),title:n,"aria-label":n})}function Oh(){return(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2,3].map(e=>(0,z.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,z.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded bg-muted`}),(0,z.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded bg-muted/70`})]}),(0,z.jsx)(`div`,{className:`h-6 w-16 animate-pulse rounded-full bg-muted`})]},e))})}function kh(e){let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}var Ah={active:Xf,idle:Bf,done:If,dead:Rf,canceled:zf,blocked:Ff};function jh({status:e}){return(0,z.jsx)(Ah[e]??Bf,{className:J(`!size-3.5`,e===`active`&&`animate-spin`)})}function Mh(e,t,n,r){return t===`static`?e.status:n===`down`?`dead`:n===`reconnecting`?`idle`:r?`active`:`idle`}function Nh(e){let t=e.store.source===`static`,n=e.store.state?.isStreaming??!1,r=e.detail,i=r?Mh(r,e.store.source,e.store.brokerStatus,n):null;return r?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`h2`,{className:J(Ph,`min-w-0 truncate`),title:r.name,children:r.name}),i&&(0,z.jsxs)(xm,{className:J(`gap-1.5`,i),children:[(0,z.jsx)(jh,{status:i}),i]}),t&&(0,z.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--idle)`},title:`dormant node — last-known values, not live`,children:`last-known`})]}):(0,z.jsx)(`h2`,{className:Ph,children:`…`})}var Ph=`con-title text-xl font-medium`;function Fh(e){let t=e.store.chrome,n=e.store.source===`static`,r=e.store.state?.isStreaming??!1,i=t.context,a=t.stats,o=t.tokens,s=i&&!n?i.percent:null,c=!n&&a?.cost!==void 0?a.cost:null;return!i&&c===null&&!a&&!o?null:(0,z.jsxs)(`div`,{className:`cluster`,children:[i&&(0,z.jsxs)(`div`,{className:`gauge`,children:[(0,z.jsxs)(`div`,{className:`glabel`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Context`}),(0,z.jsxs)(`span`,{className:`gval`,children:[s===null?`—`:Rh(s),s!==null&&(0,z.jsx)(`span`,{className:`u`,children:`%`})]})]}),(0,z.jsx)(`div`,{className:`gbar`,children:(0,z.jsx)(`i`,{style:{width:s===null?`0%`:`${Math.min(100,s)}%`}})}),(0,z.jsxs)(`div`,{className:`gsub`,children:[i.tokens.toLocaleString(),!n&&(0,z.jsxs)(z.Fragment,{children:[` / `,i.window.toLocaleString()]})]})]}),c!==null&&(0,z.jsxs)(`div`,{className:`gauge`,children:[(0,z.jsxs)(`div`,{className:`glabel`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Cost`}),(0,z.jsxs)(`span`,{className:`gval`,children:[(0,z.jsx)(`span`,{className:`u`,style:{marginLeft:0,marginRight:2},children:`$`}),c.toFixed(2)]})]}),(0,z.jsx)(`div`,{className:`gbar`,children:(0,z.jsx)(`i`,{style:{width:`${Math.min(100,c/5*100)}%`}})}),a&&(0,z.jsxs)(`div`,{className:`gsub`,children:[a.turns,` turns`]})]}),(0,z.jsxs)(`div`,{className:`dials`,children:[!n&&a&&c===null&&(0,z.jsx)(Ih,{value:String(a.turns),unit:`turns`}),!n&&a&&(0,z.jsx)(Ih,{value:`${a.user_messages}/${a.assistant_messages}`,unit:`msgs`}),o&&(0,z.jsx)(Ih,{value:`${Lh(o.input)} → ${Lh(o.output)}`,unit:`tokens`}),!n&&t.tool_calls!==null&&(0,z.jsx)(Ih,{value:String(t.tool_calls),unit:`tools`,hot:r})]})]})}function Ih({value:e,unit:t,hot:n}){return(0,z.jsx)(`div`,{className:`dial`,children:(0,z.jsxs)(`span`,{className:`dval`,style:n?{color:`var(--act)`}:void 0,children:[e,` `,(0,z.jsx)(`em`,{children:t})]})})}function Lh(e){return e>=1e6?`${Math.round(e/1e5)/10}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Rh(e){return(Math.round(e*10)/10).toFixed(1)}function zh({store:e,detail:t}){let n=e.chrome,r=[],i=n.branch??t?.branch??null;if(i!==null){let e=n.git_status??t?.git_status??null,a=e?.added??0,o=e?.modified??0;r.push((0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,z.jsx)(Wf,{className:`size-3.5 shrink-0 opacity-70`}),(0,z.jsx)(`b`,{style:Bh,children:i}),a>0&&(0,z.jsxs)(`span`,{style:{color:`var(--act)`,opacity:.8},children:[` +`,a]}),o>0&&(0,z.jsxs)(`span`,{style:{color:`var(--idle)`,opacity:.8},children:[` ~`,o]})]},`branch`))}let a=t?.cwd??null;a!==null&&r.push((0,z.jsx)(`span`,{children:Vh(a)},`cwd`));let o=n.model??t?.model??null;o!==null&&r.push((0,z.jsx)(`span`,{children:(0,z.jsx)(`b`,{style:Bh,children:o})},`model`));let s=n.context??null;return s!==null&&r.push((0,z.jsxs)(`span`,{children:[`ctx `,(0,z.jsx)(`b`,{style:Bh,children:Hh(s.tokens)}),` / `,Hh(s.window)]},`ctx`)),r.length===0?null:(0,z.jsx)(`div`,{className:`flex min-w-0 items-center gap-5 whitespace-nowrap border-b px-6 py-2 text-xs`,style:{borderColor:`var(--line)`,background:`rgba(0,0,0,.18)`,color:`var(--mut)`},children:r.map((e,t)=>(0,z.jsxs)(v.Fragment,{children:[t>0&&(0,z.jsx)(`span`,{style:{color:`var(--dim)`,opacity:.5},className:`select-none`,children:`·`}),e]},t))})}var Bh={color:`var(--ink2)`,fontWeight:400};function Vh(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}function Hh(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Uh(e){let[t,n]=(0,v.useState)(!1),r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){n(!1);return}if(e.altKey&&e.code===`KeyI`){if(document.activeElement instanceof HTMLTextAreaElement)return;e.preventDefault(),n(e=>!e)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),t?(0,z.jsx)(`div`,{className:`in fixed inset-0 z-50 flex items-start justify-center pt-22`,style:{background:`rgba(0,0,0,.42)`,backdropFilter:`blur(2px)`},onMouseDown:e=>{r.current?.contains(e.target)||n(!1)},children:(0,z.jsxs)(`div`,{ref:r,className:`panel rv`,style:Wh,children:[(0,z.jsxs)(`div`,{style:Gh,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Instruments`}),(0,z.jsx)(`div`,{style:{flex:1}}),(0,z.jsx)(`span`,{className:`kbd`,children:`⌥i`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`transition-colors`,style:{color:`var(--mut)`},"aria-label":`Close instruments`,children:(0,z.jsx)(ap,{className:`size-3.5`})})]}),(0,z.jsx)(Fh,{store:e.store,detail:e.detail})]})}):null}var Wh={minWidth:`min(680px, 92vw)`,overflow:`hidden`,"--i":0},Gh={display:`flex`,alignItems:`center`,gap:`10px`,padding:`11px 30px`,borderBottom:`1px solid var(--line)`};function Kh(e){let t=new Map;for(let n of e){if(n.parent===null)continue;let e=t.get(n.parent);e?e.push(n):t.set(n.parent,[n])}return t}function qh(e,t){let n=[],r=new Set,i=[{node:e,depth:0}];for(;i.length>0;){let e=i.pop();if(r.has(e.node.node_id))continue;r.add(e.node.node_id),n.push({node:e.node,depth:e.depth});let a=t.get(e.node.node_id)??[];for(let t=a.length-1;t>=0;t--)i.push({node:a[t],depth:e.depth+1})}return n}function Jh(e,t){let n=t.get(e),r=new Set;for(;n&&n.parent!==null;){if(r.has(n.node_id))return null;r.add(n.node_id),n=t.get(n.parent)}return n??null}function Yh(e,t){let n=new Map(e.map(e=>[e.node_id,e])),r=Kh(e),i=Jh(t,n),a=i?.node_id??null;return{thisGraph:i===null?[]:qh(i,r),otherGraphs:e.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==a&&(e.status===`active`||e.attention_count>0))}}var Xh=new Set([`done`,`dead`,`canceled`]),Zh=`crtr:graphrail-collapsed`;function Qh(e){return e.attention_count>0||e.status===`active`}function $h(e,t){let n=new Map(e.map(e=>[e.node.node_id,e.node])),r=new Map;for(let{node:t}of e){if(t.parent===null||!n.has(t.parent))continue;let e=r.get(t.parent);e?e.push(t.node_id):r.set(t.parent,[t.node_id])}let i=new Map,a=e=>{let o=i.get(e);if(o!==void 0)return o;i.set(e,!1);let s=n.get(e),c=e===t||s!==void 0&&Qh(s);if(!c){for(let t of r.get(e)??[])if(a(t)){c=!0;break}}return i.set(e,c),c},o=new Set;for(let{node:t}of e)(r.get(t.node_id)?.length??0)>0&&!a(t.node_id)&&o.add(t.node_id);return{children:r,collapsedByDefault:o}}function eg({currentId:e,onNavigate:t}){let{nodes:n}=Zp(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(Zh)===`1`}catch{return!1}}),[s,c]=(0,v.useState)({}),{thisGraph:l}=Yh(n,e),u=l[0]?.node.node_id??null,{children:d,collapsedByDefault:f}=(0,v.useMemo)(()=>$h(l,e),[l,e]),p=e=>s[e]===void 0?f.has(e):!s[e],m=e=>c(t=>({...t,[e]:p(e)})),h=()=>{o(e=>{let t=!e;try{localStorage.setItem(Zh,t?`1`:`0`)}catch{}return t})},{liveRoots:g,deadRoots:_}=(0,v.useMemo)(()=>{let e=n.filter(e=>e.parent===null&&e.host_kind===`broker`&&e.node_id!==u),t=[],r=[];for(let n of e)(Xh.has(n.status)&&n.attention_count===0?r:t).push(n);let i=(e,t)=>Date.parse(t.created)-Date.parse(e.created),a=e=>e.attention_count>0?0:e.status===`active`?1:2;return t.sort((e,t)=>a(e)-a(t)||i(e,t)),r.sort(i),{liveRoots:t,deadRoots:r}},[n,u]);if((0,v.useEffect)(()=>{let n=n=>{if(!n.altKey||n.key!==`ArrowUp`&&n.key!==`ArrowDown`)return;let r=l.findIndex(t=>t.node.node_id===e);if(r===-1)return;n.preventDefault();let i=n.key===`ArrowUp`?l[r-1]:l[r+1];i&&t(i.node.node_id)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[l,e,t]),a)return(0,z.jsx)(`aside`,{className:`graphrail rv`,style:ng,children:(0,z.jsx)(`button`,{type:`button`,onClick:h,title:`Expand graph sidebar`,"aria-label":`Expand graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,z.jsx)(Nf,{className:`size-4`})})});let y=[],b=null;for(let{node:n,depth:r}of l){if(b!==null){if(r>b)continue;b=null}let i=d.get(n.node_id)??[],a=i.length>0&&p(n.node_id);y.push((0,z.jsx)(lg,{node:n,depth:r,current:n.node_id===e,hasChildren:i.length>0,collapsed:a,onToggleCollapse:()=>m(n.node_id),onClick:()=>t(n.node_id)},n.node_id)),a&&(b=r)}return(0,z.jsxs)(`aside`,{className:`graphrail rv`,style:tg,children:[(0,z.jsx)(`div`,{className:`flex items-center justify-end pb-1`,children:(0,z.jsx)(`button`,{type:`button`,onClick:h,title:`Collapse graph sidebar`,"aria-label":`Collapse graph sidebar`,className:`flex size-6 items-center justify-center rounded-md text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,z.jsx)(Nf,{className:`size-4 rotate-180`})})}),(0,z.jsx)(rg,{label:`This graph`,chord:`⌥↑↓ to cycle`}),y,l.length===0&&(0,z.jsx)(ig,{}),(g.length>0||_.length>0)&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`gr-gap`}),(0,z.jsx)(rg,{label:`Elsewhere`}),g.map(e=>(0,z.jsx)(lg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id)),_.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`mt-1 flex items-center gap-1.5 rounded-md px-3 py-2 text-left text-xs text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:[(0,z.jsx)(Nf,{className:J(`size-3.5 transition-transform`,r&&`rotate-90`)}),r?`Hide`:`Show`,` `,_.length,` finished`]}),r&&_.map(e=>(0,z.jsx)(lg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id))]})]})]})}var tg={width:`228px`,flex:`none`,display:`flex`,flexDirection:`column`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 9px`,overflowY:`auto`,zIndex:1,"--i":2},ng={width:`36px`,flex:`none`,display:`flex`,flexDirection:`column`,alignItems:`center`,borderRight:`1px solid var(--line)`,background:`rgba(0,0,0,.16)`,padding:`14px 6px`,zIndex:1,"--i":2};function rg({label:e,chord:t}){return(0,z.jsxs)(`div`,{className:`gr-sec`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:e}),(0,z.jsx)(`div`,{className:`rule`}),t&&(0,z.jsx)(`span`,{title:t,"aria-label":t,className:`flex items-center text-[var(--dim)]`,children:(0,z.jsx)(qf,{className:`size-3.5`})})]})}function ig(){return(0,z.jsx)(`span`,{className:`px-3 py-1 font-mono text-xs`,style:{color:`var(--dim)`},children:`—`})}function ag(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return``;let n=Math.floor(t/1e3);if(n<60)return`${n}s`;let r=Math.floor(n/60);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function og(e){return e.split(`/`).filter(Boolean).at(-1)??e}function sg(e){let t=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)$/);if(t)return`~${t[1]}`;let n=e.split(`/`).filter(Boolean);return n.length<=2?e:`…/${n.slice(-2).join(`/`)}`}var cg={active:`s-active`,idle:`s-idle`,done:`s-done`,dead:`s-dead`,canceled:`s-canceled`};function lg({node:e,depth:t,current:n,elsewhere:r=!1,hasChildren:i=!1,collapsed:a=!1,onToggleCollapse:o,onClick:s}){let c=Xh.has(e.status),l=e.attention_count>0,u=l?`blocked`:e.status,d=ag(e.created),f=t>0?{marginLeft:`${t*12}px`}:void 0,p=(0,z.jsx)(`button`,{type:`button`,onClick:s,className:J(`node-row text-left`,r?`w-full`:`min-w-0 flex-1`,l?`s-blocked`:cg[e.status],c&&!l&&`dimmed`,n&&`rounded-md border border-[var(--line2)] bg-[oklch(0.92_0.013_80_/_8%)] shadow-[inset_0_1px_0_var(--raise)]`),children:(0,z.jsxs)(`span`,{className:`node-id`,children:[(0,z.jsxs)(`span`,{className:`node-l1`,children:[(0,z.jsx)(`span`,{className:J(`node-name truncate`,n&&`font-semibold`),children:r?og(e.cwd):e.name}),r?(0,z.jsxs)(`span`,{className:`node-kind truncate`,children:[e.name,` · `,e.kind]}):(0,z.jsx)(`span`,{className:`node-kind`,children:e.kind}),l&&(0,z.jsxs)(xm,{variant:`destructive`,className:`ml-auto gap-1 text-xs`,children:[(0,z.jsx)(Uf,{className:`size-3.5`}),e.attention_count]})]}),(0,z.jsxs)(`span`,{className:`node-l2`,children:[r&&(0,z.jsx)(`span`,{className:`node-cwd`,children:sg(e.cwd)}),(0,z.jsx)(`span`,{className:J(`dot`,u),title:u,"aria-label":u}),d&&(0,z.jsx)(`span`,{className:`text-[var(--dim)]`,children:d})]})]})});return r?(0,z.jsx)(`div`,{style:f,children:p}):(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,style:f,children:[i?(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o?.()},title:a?`Expand branch`:`Collapse branch`,"aria-label":a?`Expand branch`:`Collapse branch`,className:`flex size-4 flex-none items-center justify-center rounded-sm text-[var(--dim)] transition-colors hover:text-[var(--ink2)]`,children:(0,z.jsx)(Nf,{className:J(`size-3.5 transition-transform`,!a&&`rotate-90`)})}):(0,z.jsx)(`span`,{className:`size-4 flex-none`,"aria-hidden":`true`}),p]})}function ug(e){let t=e?.diagnostics;return Array.isArray(t)&&t.some(e=>e?.type===`crtr:managed-provider-cooling`)}function dg(e){return typeof e==`object`&&!!e}function fg(e){return typeof e==`string`?e:``}function pg(e){let t=e??``;return/rate.?limit|\b429\b|too many requests|quota/i.test(t)?`rate-limit`:/invalid_grant|refresh token|unauthori[sz]ed|invalid.?api.?key|authentication failed|\b401\b|\b403\b/i.test(t)?`auth`:/context overflow recovery failed/i.test(t)?`context-overflow`:/websocket.*(?:closed.*\b(?:1002|1003|1007|1008|1009|1010)\b|protocol error|policy violation|unsupported data|invalid (?:frame|payload)|message too big|mandatory extension)/i.test(t)?`protocol`:/overloaded|\b5\d\d\b|internal server error|api.?error|capacity|server.{0,3}busy|temporarily unavailable/i.test(t)?`overloaded`:/connection|econnreset|etimedout|enotfound|econnrefused|network|fetch failed|socket hang|timed? out|timeout|\bterminated\b|other side closed|premature close|websocket\s+(?:was\s+)?closed|websocket stream closed before response\.completed|websocket\s+error|websocket.*interrupt/i.test(t)?`connection`:`other`}function mg(e){let t=fg(e.code)||fg(e.errno);return t===``?null:/^(ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOENT|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH)$/i.test(t)?`connection`:null}function hg(e){let t=typeof e.status==`number`?e.status:null;return t===null?null:t===401||t===403?`auth`:t===429?`rate-limit`:t===503||t===529||t>=500&&t<=599?`overloaded`:t>=400&&t<=499?`protocol`:null}function gg(e){let t=typeof e.code==`number`?e.code:null;if(t===null)return null;if(t===1008)return`protocol`;if(t===1006)return`connection`;if(t===1011){let t=fg(e.reason);return/no running broker/i.test(t)||pg(t)===`connection`?`connection`:`other`}return null}function _g(e,t){return t===`auth`||t===`protocol`||t===`context-overflow`?`fatal`:e===`pi→provider`?t===`connection`||t===`rate-limit`||t===`overloaded`?`auto`:`fatal`:`manual`}function vg(e){if(typeof e==`string`)return e;if(!dg(e))return``;let t=[e.message,e.errorMessage,e.reason,e.body,e.statusText];for(let e of t)if(typeof e==`string`&&e!==``)return e;let n=e.error;if(dg(n)){let e=n.message;if(typeof e==`string`&&e!==``)return e;let t=n.reason;if(typeof t==`string`&&t!==``)return t}return``}function yg(e,t){if(e===`pi→provider`&&ug(t))return{kind:`rate-limit`,disposition:`auto`};if(dg(t)){let n=mg(t);if(n!==null)return{kind:n,disposition:_g(e,n)};let r=hg(t);if(r!==null)return{kind:r,disposition:_g(e,r)};let i=gg(t);if(i!==null)return{kind:i,disposition:_g(e,i)}}let n=pg(vg(t));return{kind:n,disposition:_g(e,n)}}var bg=class{nodeId;handlers;ws;closedReported=!1;constructor(e,t){this.nodeId=e,this.handlers=t}get url(){let e=location.protocol===`https:`?`wss:`:`ws:`,t=new URL(`/node/${encodeURIComponent(this.nodeId)}`,window.location.href);return t.protocol=e,pp!==void 0&&t.searchParams.set(`token`,pp),t.toString()}connect(){let e;try{e=new WebSocket(this.url)}catch(e){this.reportClose(`transient`,`failed to open ws: ${String(e)}`);return}this.ws=e,e.onopen=()=>this.handlers.onOpen?.(),e.onmessage=e=>this.onMessage(e),e.onclose=e=>{let t=yg(`browser↔relay`,{code:e.code,reason:e.reason}),n=e.code===1008||t.kind===`protocol`?`invalid`:e.code===1011&&/^no node /.test(e.reason)?`no-node`:e.code===1011&&/^no running broker/.test(e.reason)?`no-broker`:`transient`;this.reportClose(n,e.reason||`closed (${e.code})`)},e.onerror=()=>{}}onMessage(e){if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.handlers.onFrame?.(t)}send(e){let t=this.ws;if(!(t===void 0||t.readyState!==WebSocket.OPEN))try{t.send(JSON.stringify(e))}catch{}}close(){let e=this.ws;if(e!==void 0&&e.readyState<=WebSocket.OPEN)try{e.close()}catch{}}reportClose(e,t){this.closedReported||(this.closedReported=!0,this.ws=void 0,this.handlers.onClose?.(e,t))}},xg=`<persona-transition>`,Sg=`</persona-transition>`,Cg=`<model-fallback-recovery>`,wg=`</model-fallback-recovery>`,Tg=`You must call the \`submit\` tool with a result matching the required schema before you can stop. You cannot finish or go dormant any other way while this request is pending.
|
|
52
|
+
|
|
53
|
+
Required schema:
|
|
54
|
+
|
|
55
|
+
\`\`\`json
|
|
56
|
+
`,Eg="\n```";function Dg(e){return typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.filter(e=>typeof e==`object`&&!!e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``):``}function Og(e){let t=e.match(/^\[crtr\]\s+Context\s+(~\d+k)\b/)?.[1];return t===void 0?`context-window guidance`:`Context ${t}`}var kg=/^From ([a-z0-9]+(?:-[a-z0-9]+)+|system|human) — (\d+) update/m;function Ag(e){return kg.test(e)}function jg(e){return kg.exec(e)?.[1]??null}function Mg(e){let t=[...e.matchAll(/^From ([a-z0-9]+(?:-[a-z0-9]+)+|system|human) — (\d+) update/gm)];if(t.length===0)return`node update`;let n=t.reduce((e,t)=>e+Number(t[2]??0),0);if(t.length===1){let e=t[0]?.[1]??`system`;return`${n} update${n===1?``:`s`} from ${e}`}return`${n} updates from ${t.length} senders`}function Ng(e){return e.startsWith(`${xg}\n`)&&e.endsWith(`\n${Sg}`)}function Pg(e){if(!e.startsWith(Tg)||!e.endsWith(Eg))return!1;let t=e.slice(200,-4);try{return JSON.parse(t),!0}catch{return!1}}var Fg=/^The previous model \([^\n]+\) had no usable provider credential, so you were automatically switched to [^\n]+\. Continue the task from where the failed turn left off\.$/,Ig=/^The previous model \([^\n]+\) was unavailable \(provider 404 not_found\), so you were automatically switched to [^\n]+\. Continue the task from where the failed turn left off\.$/;function Lg(e){if(!e.startsWith(`${Cg}\n`)||!e.endsWith(`\n${wg}`))return!1;let t=e.slice(26,-27);return Fg.test(t)||Ig.test(t)}function Rg(e){return e===`Provider credentials were just updated (a new login landed). Your previous turn stopped on a provider authentication failure. Continue from where you left off and retry the work that failed.`?`provider credentials updated`:e===`The network connection is back online. Your previous turn stopped on a connection error (the network was down). Continue from where you left off and retry the work that failed.`?`network connection restored`:e===`Your previous turn stopped on a provider fault. Continue from where you left off and retry the work that failed.`?`provider retry`:e===`<runtime-restart-continuation>
|
|
57
|
+
continue
|
|
58
|
+
</runtime-restart-continuation>`?`runtime restarted`:Lg(e)?`model route changed`:null}function zg(e){let t=Dg(e);if(e.role===`custom`)return e.customType===`crtr-context`?{kind:`bearings`,label:`crtr context`,summary:`orienting bearings`,body:t}:e.customType===`crtr-situational-context`?{kind:`situational`,label:`situational context`,summary:`ambient context update`,body:t}:e.customType===`crtr-context-nudge`?{kind:`context-nudge`,label:`crtr`,summary:Og(t),body:t}:null;if(e.role!==`user`)return null;if(t.startsWith(`You have been revived fresh after a context refresh`))return{kind:`revive`,label:`crtr revive`,summary:`fresh context kickoff`,body:t};if(t.startsWith(`[crtr] Context ~`))return{kind:`context-nudge`,label:`crtr`,summary:Og(t),body:t};if(Ag(t))return{kind:`inbox`,label:`crtr inbox`,summary:Mg(t),body:t};if(Ng(t))return{kind:`persona-transition`,label:`crtr persona`,summary:`runtime role update`,body:t};if(t==="You've stopped but you're not waiting on anyone and haven't finished. Pipe the result to `crtr push final` through a single-quoted heredoc if the work is done, or use `crtr human ask` if you are blocked or need the user."||Pg(t))return{kind:`stop-guard`,label:`crtr stop guard`,summary:t==="You've stopped but you're not waiting on anyone and haven't finished. Pipe the result to `crtr push final` through a single-quoted heredoc if the work is done, or use `crtr human ask` if you are blocked or need the user."?`completion required`:`structured output required`,body:t};let n=Rg(t);return n===null?null:{kind:`recovery`,label:`crtr recovery`,summary:n,body:t}}function Bg(){return{messages:[],streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[],toolGroupSummaries:{}}}function Vg(e){let t=e.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>!!e&&e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``):``}function Hg(e){return qg(e)!==`user`||e.origin||!Ag(Vg(e))?e:{...e,origin:`inbox`}}function Ug(){return{role:`assistant`,content:[]}}function Wg(e,t){let n=e.messages.map(Hg),r=Gg(e);if(e.state?.isStreaming!==!0)return{messages:n,streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[],toolGroupSummaries:r};let i=n.length-1;if(i>=0&&qg(n[i])===`assistant`)return{messages:n,streamingIndex:i,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[],toolGroupSummaries:r};let a=t&&t.streamingIndex!==null?t.messages[t.streamingIndex]:void 0,o=a&&qg(a)===`assistant`?a:Ug(),s=[...n,o];return{messages:s,streamingIndex:s.length-1,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[],toolGroupSummaries:r}}function Gg(e){let t=e.toolGroupSummaries;if(typeof t!=`object`||!t||Array.isArray(t))return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&(n[e]=r);return n}function Kg(e,t,n){return e.toolGroupSummaries[t]===n?e:{...e,toolGroupSummaries:{...e.toolGroupSummaries,[t]:n}}}function qg(e){return e.role??``}function Jg(e){for(let t=e.messages.length-1;t>=0;t--)if(qg(e.messages[t])===`bashExecution`)return t;return null}function Yg(e,t,n){let r={role:`bashExecution`,command:t,output:``,exitCode:void 0,cancelled:!1,truncated:!1,excludeFromContext:n,timestamp:Date.now()};return{...e,messages:[...e.messages,r]}}function Xg(e,t){let n=Jg(e);if(n===null)return e;let r=[...e.messages],i=r[n];return r[n]={...i,output:`${i.output??``}${t}`},{...e,messages:r}}function Zg(e,t){let n=Jg(e);if(n===null)return e;let r=[...e.messages];return r[n]={...r[n],exitCode:t.exitCode,cancelled:t.cancelled,truncated:t.truncated,fullOutputPath:t.fullOutputPath},{...e,messages:r}}function Qg(e,t){switch(t.type){case`agent_start`:return{...e,isStreaming:!0,activity:`Working…`};case`agent_end`:return{...e,isStreaming:!1,activity:null,streamingIndex:null,executingToolIds:e.executingToolIds.size?new Set:e.executingToolIds};case`message_start`:{let n=Hg(t.message),r=[...e.messages,n],i=qg(n)===`assistant`,a=e.partialToolResults;if(qg(n)===`toolResult`){let e=n.toolCallId;if(typeof e==`string`&&a.has(e)){let t=new Map(a);t.delete(e),a=t}}return{...e,messages:r,partialToolResults:a,streamingIndex:i?r.length-1:e.streamingIndex}}case`message_update`:{let n=e.streamingIndex;if(n===null){let t=e.messages.length-1;t>=0&&qg(e.messages[t])===`assistant`&&(n=t)}if(n===null)return e;let r=[...e.messages];return r[n]=t.message,{...e,messages:r,streamingIndex:n}}case`message_end`:{if(e.streamingIndex===null)return e;let n=[...e.messages];return n[e.streamingIndex]=t.message,{...e,messages:n,streamingIndex:null}}case`tool_execution_start`:{let n=new Set(e.executingToolIds);return n.add(t.toolCallId),{...e,executingToolIds:n}}case`tool_execution_update`:{let n=new Map(e.partialToolResults);return n.set(t.toolCallId,$g(t.toolCallId,t.toolName,t.partialResult,!1)),{...e,partialToolResults:n}}case`tool_execution_end`:{let n=new Set(e.executingToolIds);n.delete(t.toolCallId);let r=new Map(e.partialToolResults);return r.set(t.toolCallId,$g(t.toolCallId,t.toolName,t.result,t.isError)),{...e,executingToolIds:n,partialToolResults:r}}case`compaction_start`:return{...e,activity:`Compacting context…`};case`compaction_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`auto_retry_start`:return{...e,activity:`Retrying (${t.attempt}/${t.maxAttempts}) in ${Math.ceil(t.delayMs/1e3)}s…`};case`auto_retry_end`:return{...e,activity:e.isStreaming?`Working…`:null};case`queue_update`:return{...e,queued:[...t.steering,...t.followUp]};default:return e}}function $g(e,t,n,r){let i=typeof n==`object`&&n?n:{};return{role:`toolResult`,toolCallId:e,toolName:t,...i,content:Array.isArray(i.content)?i.content:[],isError:r}}var e_=5,t_=new Set([`knowledge`,`preference`]),n_=new Set([`node`,`project`,`profile`,`user`,`builtin`]),r_=new Set([`name`,`kind`,`scope`,`shortForm`]),i_=new Set([`stop`,`length`,`toolUse`,`error`,`aborted`]),a_=new Set([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),o_=200,s_=256*1024,c_=20,l_=8*1024*1024;function u_(e){return{schemaVersion:e_,...e}}function d_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e){return typeof e==`string`}function f_(e){return typeof e==`number`}function p_(e){return typeof e==`boolean`}function m_(e){return Array.isArray(e)&&e.every(Q)}function h_(e){return d_(e)&&Object.values(e).every(Q)}function g_(e){return!d_(e)||e.type!==`text`||!Q(e.text)?!1:e.textSignature===void 0||Q(e.textSignature)}function __(e){return d_(e)&&e.type===`image`&&Q(e.data)&&Q(e.mimeType)}function v_(e){return d_(e)&&e.type===`toolCall`&&Q(e.id)&&Q(e.name)&&d_(e.arguments)&&(e.thoughtSignature===void 0||Q(e.thoughtSignature))}function y_(e){return d_(e)&&f_(e.input)&&f_(e.output)&&f_(e.cacheRead)&&f_(e.cacheWrite)&&f_(e.total)}function b_(e){return d_(e)&&f_(e.input)&&f_(e.output)&&f_(e.cacheRead)&&f_(e.cacheWrite)&&(e.cacheWrite1h===void 0||f_(e.cacheWrite1h))&&(e.reasoning===void 0||f_(e.reasoning))&&f_(e.totalTokens)&&y_(e.cost)}function x_(e){return typeof e==`string`&&i_.has(e)}function S_(e){return typeof e==`string`&&a_.has(e)}function C_(e){return!d_(e)||!Q(e.message)?!1:(e.name===void 0||Q(e.name))&&(e.stack===void 0||Q(e.stack))&&(e.code===void 0||Q(e.code)||f_(e.code))}function w_(e){return!d_(e)||!Q(e.type)||!f_(e.timestamp)?!1:(e.error===void 0||C_(e.error))&&(e.details===void 0||d_(e.details))}function T_(e){return!d_(e)||e.role!==`user`||!f_(e.timestamp)?!1:typeof e.content==`string`||Array.isArray(e.content)&&e.content.every(e=>g_(e)||__(e))}function E_(e){return!d_(e)||e.role!==`assistant`||!f_(e.timestamp)||!Array.isArray(e.content)||!e.content.every(e=>g_(e)||d_(e)&&e.type===`thinking`&&Q(e.thinking)&&(e.thinkingSignature===void 0||Q(e.thinkingSignature))&&(e.redacted===void 0||p_(e.redacted))||v_(e))?!1:Q(e.api)&&Q(e.provider)&&Q(e.model)&&(e.responseModel===void 0||Q(e.responseModel))&&(e.responseId===void 0||Q(e.responseId))&&(e.diagnostics===void 0||Array.isArray(e.diagnostics)&&e.diagnostics.every(w_))&&b_(e.usage)&&x_(e.stopReason)&&(e.errorMessage===void 0||Q(e.errorMessage))}function D_(e){return!d_(e)||e.role!==`toolResult`||!f_(e.timestamp)?!1:Q(e.toolCallId)&&Q(e.toolName)&&Array.isArray(e.content)&&e.content.every(e=>g_(e)||__(e))&&p_(e.isError)}function O_(e){return d_(e)&&e.role===`bashExecution`&&Q(e.command)&&Q(e.output)&&f_(e.timestamp)&&(e.exitCode===void 0||f_(e.exitCode))&&p_(e.cancelled)&&p_(e.truncated)&&(e.fullOutputPath===void 0||Q(e.fullOutputPath))&&(e.excludeFromContext===void 0||p_(e.excludeFromContext))}function k_(e){return T_(e)||E_(e)||D_(e)||O_(e)}function A_(e){return!d_(e)||!Q(e.role)?!1:e.role!==`user`&&e.role!==`assistant`&&e.role!==`toolResult`&&e.role!==`bashExecution`}function j_(e){return k_(e)||A_(e)}function M_(e){if(!d_(e))return!1;let t=Object.keys(e);return t.length!==r_.size||!t.every(e=>r_.has(e))?!1:Q(e.name)&&t_.has(e.kind)&&n_.has(e.scope)&&Q(e.shortForm)}function N_(e){return m_(e)}function P_(e){return!d_(e)||!Q(e.name)||!Q(e.description)||e.source!==`builtin`&&e.source!==`command`&&e.source!==`template`?!1:e.template===void 0&&e.expansion===void 0&&(e.location===void 0||e.location===`user`||e.location===`project`||e.location===`path`)&&(e.path===void 0||Q(e.path))&&(e.argument_hint===void 0||Q(e.argument_hint))}function F_(e){return e===null?!0:d_(e)?Q(e.sessionId)&&(e.sessionFile===void 0||Q(e.sessionFile))&&(e.model===void 0||d_(e.model)&&Q(e.model.id))&&p_(e.isStreaming)&&p_(e.isCompacting)&&S_(e.thinkingLevel)&&(e.steeringMode===`all`||e.steeringMode===`one-at-a-time`)&&(e.followUpMode===`all`||e.followUpMode===`one-at-a-time`)&&(e.sessionName===void 0||Q(e.sessionName))&&p_(e.autoCompactionEnabled)&&f_(e.messageCount)&&f_(e.pendingMessageCount):!1}function I_(e,t){return d_(t)?t.schemaVersion===e_&&t.nodeId===e&&Array.isArray(t.messages)&&t.messages.every(j_)&&F_(t.sessionState)&&Array.isArray(t.commands)&&t.commands.every(P_)&&Array.isArray(t.refs)&&t.refs.every(M_)&&N_(t.engineLeadingCommandNames)&&h_(t.toolGroupSummaries)&&p_(t.isStreaming)&&(t.activity===null||Q(t.activity))&&f_(t.updatedAt)&&(t.source===`broker`||t.source===`static`):!1}function L_(e){return new TextEncoder().encode(JSON.stringify(e)).length}function R_(e){return{...e,commands:e.commands.map(({template:e,expansion:t,...n})=>n),refs:e.refs.map(({name:e,kind:t,scope:n,shortForm:r})=>({name:e,kind:t,scope:n,shortForm:r}))}}function z_(e,t,n){let r=e.messages.slice(-t),i={...e,messages:r};for(;r.length>1&&L_(i)>n;)r=r.slice(1),i={...e,messages:r};return i}function B_(e){return`crtr.web.transcript.tail.${e}`}function V_(e){try{let t=globalThis.localStorage?.getItem(B_(e));if(t==null)return null;let n=JSON.parse(t);return I_(e,n)?n:(globalThis.localStorage?.removeItem(B_(e)),null)}catch{try{globalThis.localStorage?.removeItem(B_(e))}catch{}return null}}function H_(e){let t=z_(R_(e),c_,s_);try{globalThis.localStorage?.setItem(B_(e.nodeId),JSON.stringify(t))}catch{}}var U_=`crtr-web-transcript-cache`,W_=1,G_=`entries`;function K_(){return new Promise((e,t)=>{if(typeof indexedDB>`u`){t(Error(`indexedDB unavailable`));return}let n=indexedDB.open(U_,W_);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(G_)||e.createObjectStore(G_,{keyPath:`nodeId`}).createIndex(`updatedAt`,`updatedAt`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))})}async function q_(e,t){await new Promise((n,r)=>{let i=e.transaction(G_,`readwrite`);i.objectStore(G_).delete(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB delete failed`))})}async function J_(e){try{let t=await K_(),n=await new Promise((n,r)=>{let i=t.transaction(G_,`readonly`).objectStore(G_).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error??Error(`indexedDB read failed`))});return I_(e,n)?(t.close(),n):(n!=null&&await q_(t,e),t.close(),null)}catch{return null}}async function Y_(e){let t=[];await new Promise((n,r)=>{let i=e.transaction(G_,`readonly`).objectStore(G_).index(`updatedAt`).openCursor();i.onsuccess=()=>{let e=i.result;if(!e){n();return}let r=e.value;t.push({nodeId:r.nodeId,updatedAt:r.updatedAt,size:L_(r)}),e.continue()},i.onerror=()=>r(i.error??Error(`indexedDB cursor failed`))});let n=t.reduce((e,t)=>e+t.size,0);n<=l_||await new Promise((r,i)=>{let a=e.transaction(G_,`readwrite`),o=a.objectStore(G_),s=0;for(;n>l_&&s<t.length;){let e=t[s];o.delete(e.nodeId),n-=e.size,s+=1}a.oncomplete=()=>r(),a.onerror=()=>i(a.error??Error(`indexedDB prune failed`))})}async function X_(e){let t=z_(R_(e),o_,s_);try{let e=await K_();await new Promise((n,r)=>{let i=e.transaction(G_,`readwrite`);i.objectStore(G_).put(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB write failed`))}),await Y_(e),e.close()}catch{}}function Z_(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;try{let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null||Object.getOwnPropertySymbols(e).length!==0)return!1;let n=Object.getOwnPropertyNames(e).sort();if(n.length!==3||n[0]!==`body`||n[1]!==`commandName`||n[2]!==`kind`)return!1;let r=Object.getOwnPropertyDescriptors(e);if(Object.values(r).some(e=>!(`value`in e)))return!1;let i=e;return i.kind!==`memory-slash`||typeof i.commandName!=`string`||typeof i.body!=`string`?!1:(JSON.stringify(e),!0)}catch{return!1}}function Q_(e){return{clientId:e,conn:`connecting`,conv:Bg(),role:`observer`,session:null,model:void 0,sessionName:void 0,contextTokens:void 0,dialog:null,commands:[],refs:[],engineLeadingCommandNames:[],pendingRefsRequestId:null,statuses:{},widgets:{},title:void 0,notice:null}}var $_={"no-broker":`no-broker`,"no-node":`no-node`,invalid:`invalid`,transient:`closed`};function ev(e){return e===`welcome`||e===`model_changed`||e===`error`||e===`ack`||e===`data`||e===`bash_start`||e===`bash_output`||e===`bash_end`||e===`tool_group_summary`||e===`extension_ui_request`||e===`extension_ui_dismiss`}function tv(e,t){switch(t.kind){case`connecting`:return e.conn===`connecting`?e:{...e,conn:`connecting`};case`closed`:{let n=$_[t.closeKind];return e.conn===n?e:{...e,conn:n}}case`notice`:return e.notice===t.text?e:{...e,notice:t.text};case`dismiss-dialog`:return e.dialog===null?e:{...e,dialog:null};case`request-refs`:return{...e,refs:[],engineLeadingCommandNames:[],pendingRefsRequestId:t.id};case`frame`:return dv(e,t.frame)}}function nv(e,t){let n=e.expansion===t.expansion||e.expansion!==void 0&&t.expansion!==void 0&&e.expansion.kind===t.expansion.kind&&e.expansion.commandName===t.expansion.commandName&&e.expansion.body===t.expansion.body;return e.name===t.name&&e.description===t.description&&e.source===t.source&&e.location===t.location&&e.path===t.path&&e.argument_hint===t.argument_hint&&e.template===t.template&&n}function rv(e,t){return e.length===t.length&&e.every((e,n)=>nv(e,t[n]))}function iv(e,t){return e.name===t.name&&e.kind===t.kind&&e.scope===t.scope&&e.shortForm===t.shortForm}function av(e,t){return e.length===t.length&&e.every((e,n)=>iv(e,t[n]))}function ov(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function sv(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.placement===t.placement&&e.lines.length===t.lines.length&&e.lines.every((e,n)=>e===t.lines[n])}function cv(e){if(e===void 0||e.trim()===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.description==`string`&&(t.source===`builtin`||t.source===`command`||t.source===`template`)&&(t.template===void 0||typeof t.template==`string`)&&(t.expansion===void 0||Z_(t.expansion))}):[]}catch{return[]}}function lv(e){let t=e.messages.length-1,n=e.isStreaming&&t>=0?t:null;return{messages:e.messages,streamingIndex:n,executingToolIds:new Set,partialToolResults:new Map,isStreaming:e.isStreaming,activity:e.activity,queued:[],toolGroupSummaries:e.toolGroupSummaries}}function uv(e){let t=e;return t.type===`tool_group_summary`&&typeof t.key==`string`&&typeof t.text==`string`}function dv(e,t){if(uv(t))return{...e,conv:Kg(e.conv,t.key,t.text)};if(!ev(t.type))return{...e,conv:Qg(e.conv,t)};switch(t.type){case`welcome`:{let n=Wg(t.snapshot,e.conv),r=t.snapshot.state;return{...e,conn:`open`,conv:n,role:t.role,session:r,model:r.model?.id,sessionName:r.sessionName,contextTokens:t.snapshot.stats?.tokens?.total,dialog:t.pending_dialog??null,commands:[],statuses:t.snapshot.display?.statuses??{},widgets:t.snapshot.display?.widgets??{},title:t.snapshot.display?.title??e.title,refs:[],engineLeadingCommandNames:[],pendingRefsRequestId:null}}case`model_changed`:return e.model===t.model?.id&&(e.session===null||e.session.model?.id===t.model?.id)?e:{...e,model:t.model?.id,session:e.session?{...e.session,model:t.model}:e.session};case`error`:{let n=t.message||`error: ${t.code}`;return e.notice===n?e:{...e,notice:n}}case`extension_ui_request`:switch(t.method){case`setStatus`:{let n=e.statuses[t.statusKey];if(t.statusText===void 0?n===void 0:n===t.statusText)return e;let r={...e.statuses};return t.statusText===void 0?delete r[t.statusKey]:r[t.statusKey]=t.statusText,{...e,statuses:r}}case`setWidget`:{let n=e.widgets[t.widgetKey],r=t.widgetLines===void 0?void 0:{lines:t.widgetLines,placement:t.widgetPlacement??`aboveEditor`};if(sv(n,r))return e;let i={...e.widgets};return r===void 0?delete i[t.widgetKey]:i[t.widgetKey]=r,{...e,widgets:i}}case`setTitle`:return e.title===t.title?e:{...e,title:t.title};default:return{...e,dialog:t}}case`extension_ui_dismiss`:return e.dialog&&e.dialog.id===t.id?{...e,dialog:null}:e;case`ack`:{if(t.for!==`get_commands`)return e;let n=t.ok?cv(t.detail):[];return rv(e.commands,n)?e:{...e,commands:n}}case`bash_start`:return{...e,conv:Yg(e.conv,t.command,t.excludeFromContext)};case`bash_output`:return{...e,conv:Xg(e.conv,t.chunk)};case`bash_end`:return{...e,conv:Zg(e.conv,t)};case`data`:return t.kind!==`list_memory_refs`||t.id!==e.pendingRefsRequestId||!Array.isArray(t.refs)||!t.refs.every(M_)||!N_(t.engineLeadingCommandNames)||av(e.refs,t.refs)&&ov(e.engineLeadingCommandNames,t.engineLeadingCommandNames)?e:{...e,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames};default:return e}}var fv=1500,pv=800,mv=5e3,hv=10;function gv(e){return Math.min(mv,pv*2**e)}var _v=class e{nodeId;static CACHE_WRITE_DEBOUNCE_MS=500;clientId;actions;pinned=!1;state;listeners=new Set;client=null;gen=0;timer=null;cacheWriteTimer=null;role=`observer`;streaming=!1;cachedUpdatedAt=0;liveAttached=!1;started=!1;noBrokerAttempts=0;constructor(e){this.nodeId=e,this.clientId=crypto.randomUUID(),this.state=Q_(this.clientId);let t=V_(e);t&&(this.state={...this.state,conv:lv(t),session:t.sessionState,commands:t.commands,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames,model:t.sessionState?.model?.id,sessionName:t.sessionState?.sessionName},this.cachedUpdatedAt=t.updatedAt),this.actions=this.buildActions()}subscribe=e=>(this.ensureStarted(),this.listeners.add(e),()=>{this.listeners.delete(e)});getState=()=>this.state;ensureStarted(){this.started||(this.started=!0,this.hydrateFromFullMirror(),this.dial())}hydrateFromFullMirror(){let e=this.gen;J_(this.nodeId).then(t=>{if(e===this.gen&&!this.liveAttached&&!(t===null||t.updatedAt<=this.cachedUpdatedAt)){this.state={...this.state,conv:lv(t),session:t.sessionState,commands:t.commands,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames,model:t.sessionState?.model?.id,sessionName:t.sessionState?.sessionName},this.cachedUpdatedAt=t.updatedAt;for(let e of this.listeners)e()}})}focus(){this.ensureStarted(),this.pinned=!0}background(){this.pinned=!1}dispose(){this.gen+=1,this.timer&&clearTimeout(this.timer),this.cacheWriteTimer&&(clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=null,this.flushCacheWrite()),this.client?.close(),this.client=null}dispatch(e){let t=this.state,n=tv(t,e);if(e.kind===`frame`&&e.frame.type===`ack`&&e.frame.for===`reload`&&e.frame.ok&&this.requestRefs(),n!==t){this.state=n,this.role=n.role,this.streaming=n.conv.isStreaming,e.kind===`frame`&&e.frame.type===`welcome`&&(this.liveAttached=!0),(n.conv!==t.conv||n.refs!==t.refs||n.engineLeadingCommandNames!==t.engineLeadingCommandNames)&&this.scheduleCacheWrite();for(let e of this.listeners)e()}}requestRefs(){let e=crypto.randomUUID();this.dispatch({kind:`request-refs`,id:e}),this.send({type:`list_memory_refs`,id:e})}scheduleCacheWrite(){this.cacheWriteTimer&&clearTimeout(this.cacheWriteTimer),this.cacheWriteTimer=setTimeout(()=>{this.cacheWriteTimer=null,this.flushCacheWrite()},e.CACHE_WRITE_DEBOUNCE_MS)}flushCacheWrite(){let e=u_({nodeId:this.nodeId,messages:this.state.conv.messages,sessionState:this.state.session,commands:this.state.commands.map(({template:e,expansion:t,...n})=>n),refs:this.state.refs,engineLeadingCommandNames:this.state.engineLeadingCommandNames,toolGroupSummaries:{...this.state.conv.toolGroupSummaries},isStreaming:this.state.conv.isStreaming,activity:this.state.conv.activity,updatedAt:Date.now(),source:`broker`});H_(e),X_(e),this.cachedUpdatedAt=e.updatedAt}send(e){this.client?.send(e)}dial(){let e=this.gen,t=new bg(this.nodeId,{onOpen:()=>{e===this.gen&&t.send({type:`hello`,role:`controller`,client_id:this.clientId})},onFrame:n=>{e===this.gen&&(this.dispatch({kind:`frame`,frame:n}),n.type===`welcome`&&(t.send({type:`get_commands`}),this.requestRefs(),this.noBrokerAttempts=0))},onClose:t=>{if(e===this.gen){if(this.dispatch({kind:`closed`,closeKind:t}),t===`transient`)this.timer=setTimeout(()=>{e===this.gen&&(this.dispatch({kind:`connecting`}),this.dial())},fv);else if(t===`no-broker`&&this.noBrokerAttempts<hv){let t=this.noBrokerAttempts;this.noBrokerAttempts+=1,this.timer=setTimeout(()=>{e===this.gen&&this.dial()},gv(t))}}}});this.client=t,t.connect()}buildActions(){return{sendText:e=>{let t=e.trim();if(t!==``){if(this.role!==`controller`){this.dispatch({kind:`notice`,text:`read-only — this view cannot send`});return}if(t===`/reload`){this.send({type:`reload`});return}if(t.startsWith(`!`)){let e=t.startsWith(`!!`),n=t.slice(e?2:1).trim();if(n===``)return;this.send({type:`bash`,command:n,excludeFromContext:e});return}this.send(this.streaming?{type:`steer`,text:e}:{type:`prompt`,text:e})}},abort:()=>{this.role===`controller`&&this.send({type:`abort`})},setModel:e=>this.send({type:`set_model`,model:e}),cycleModel:()=>this.send({type:`cycle_model`}),setThinkingLevel:e=>this.send({type:`set_thinking_level`,level:e}),compact:e=>this.send({type:`compact`,...e?{instructions:e}:{}}),answerDialog:e=>{this.send(e),this.dispatch({kind:`dismiss-dialog`})},cancelDialog:()=>{let e=this.state.dialog?.id;e!==void 0&&this.send({type:`extension_ui_response`,id:e,cancelled:!0}),this.dispatch({kind:`dismiss-dialog`})},reconnect:()=>{this.timer&&clearTimeout(this.timer),this.gen+=1,this.noBrokerAttempts=0,this.client?.close(),this.dispatch({kind:`connecting`}),this.dial()},clearNotice:()=>this.dispatch({kind:`notice`,text:null})}}},vv=4,yv=new class{handles=new Map;mru=[];poolListeners=new Set;warmIdsSnapshot=[];acquire(e){let t=this.handles.get(e);return t||(t=new _v(e),this.handles.set(e,t)),this.touch(e),this.notifyPool(),this.evictExcess(),t}focus(e){this.handles.get(e)?.focus()}background(e){this.handles.get(e)?.background()}subscribe=e=>(this.poolListeners.add(e),()=>{this.poolListeners.delete(e)});getWarmIds=()=>this.warmIdsSnapshot;evict(e){let t=this.handles.get(e);if(!t)return;t.pinned=!1,t.dispose(),this.handles.delete(e);let n=this.mru.indexOf(e);n!==-1&&this.mru.splice(n,1),this.notifyPool()}touch(e){let t=this.mru.indexOf(e);t!==-1&&this.mru.splice(t,1),this.mru.push(e)}evictExcess(){for(let e=0;e<this.mru.length&&this.mru.length>vv;){let t=this.mru[e],n=this.handles.get(t);if(n?.pinned){e+=1;continue}n?.dispose(),this.handles.delete(t),this.mru.splice(e,1),this.notifyPool()}}notifyPool(){this.warmIdsSnapshot=[...this.mru];for(let e of this.poolListeners)e()}};function bv(e){let t=yv.acquire(e);return{state:(0,v.useSyncExternalStore)(t.subscribe,t.getState),actions:t.actions}}var xv={branch:null,model:null,tokens:null,context:null,tool_calls:null,stats:null,git_status:null};function Sv(e,t){return{...Cv,...t.state,sessionId:t.state?.sessionId??e,isStreaming:!1}}var Cv={sessionId:``,isStreaming:!1,isCompacting:!1,thinkingLevel:`off`,steeringMode:`all`,followUpMode:`all`,autoCompactionEnabled:!1,messageCount:0,pendingMessageCount:0};function wv(e){let{state:t,actions:n}=bv(e),r=zp(e=>e.reachable),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let n=!1;if(t.conn!==`no-broker`){a(null);return}return yp(e).then(t=>{if(n)return;a(t);let r=Wg(t.snapshot),i=u_({nodeId:e,messages:r.messages,sessionState:Sv(e,t.snapshot),commands:t.commands,refs:[],engineLeadingCommandNames:[],toolGroupSummaries:{...r.toolGroupSummaries},isStreaming:!1,activity:null,updatedAt:Date.now(),source:`static`});H_(i),X_(i)}).catch(()=>{n||a(null)}),()=>{n=!0}},[e,t.conn]);let o=t.conn===`no-broker`&&i?.node_id===e?i:null,s=(0,v.useMemo)(()=>o===null?null:Wg(o.snapshot),[o]),c=(0,v.useMemo)(()=>t.session===null?null:{...t.session,isStreaming:t.conv.isStreaming},[t.session,t.conv.isStreaming]),l=(0,v.useMemo)(()=>t.conn===`connecting`||t.conn===`closed`?null:o===null?c:Sv(e,o.snapshot),[e,o,t.conn,c]),u=(0,v.useMemo)(()=>o===null?{...xv,model:t.model??null}:{...xv,model:o.snapshot.state?.model?.id??null},[o,t.model]),d=s?.messages??t.conv.messages,f=s?.partialToolResults??t.conv.partialToolResults,p=s?.executingToolIds??t.conv.executingToolIds,m=s?.toolGroupSummaries??t.conv.toolGroupSummaries,h=s?.queued??t.conv.queued,g=o?.commands??t.commands,_=t.conn===`no-broker`?[]:t.refs,y=t.conn===`no-broker`?[]:t.engineLeadingCommandNames;return{messages:d,partialToolResults:f,executingToolIds:p,toolGroupSummaries:m,queued:h,state:l,role:t.role,chrome:u,dialog:t.dialog,commands:g,refs:_,engineLeadingCommandNames:y,brokerStatus:t.conn===`open`?`connected`:t.conn===`closed`||t.conn===`connecting`?`reconnecting`:`down`,source:t.conn===`no-broker`?`static`:`broker`,serverConnected:r,socketReady:t.conn===`open`,error:t.notice?{code:`broker_unavailable`,message:t.notice}:null,reconnect:n.reconnect,prompt:e=>n.sendText(e),steer:e=>n.sendText(e),abort:n.abort,setModel:n.setModel,cycleModel:n.cycleModel,setThinkingLevel:n.setThinkingLevel,compact:n.compact,dialogResponse:(e,t)=>n.answerDialog({type:`extension_ui_response`,id:e,...t})}}var Tv=400,Ev=4e3;function Dv(e){return e.dormant&&e.status===`active`&&e.socketReady&&e.attempt<8}function Ov(e){return Math.min(Ev,Tv*2**Math.max(0,e))}var kv=1,Av=400;function jv(e){return`crtr.web.draft.${e}`}function Mv(e,t){if(typeof t!=`object`||!t)return!1;let n=t;return n.schemaVersion===kv&&n.nodeId===e&&typeof n.text==`string`&&typeof n.updatedAt==`number`}function Nv(e){try{let t=globalThis.localStorage?.getItem(jv(e));if(t==null)return``;let n=JSON.parse(t);return Mv(e,n)?n.text:``}catch{return``}}function Pv(e,t){let n={schemaVersion:kv,nodeId:e,text:t,updatedAt:Date.now()};try{globalThis.localStorage?.setItem(jv(e),JSON.stringify(n))}catch{}}function Fv(e){try{globalThis.localStorage?.removeItem(jv(e))}catch{}}var Iv=new Map;function Lv(e,t){let n=Iv.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{Iv.delete(e),t===``?Fv(e):Pv(e,t)},Av);Iv.set(e,r)}function Rv(e){let t=Iv.get(e);t&&(clearTimeout(t),Iv.delete(e))}var zv=new Set([`reload`]);function Bv(e){let t=wv(e),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>(yv.focus(e),()=>{yv.background(e)}),[e]);let[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{a(Nv(e))},[e]),(0,v.useEffect)(()=>{Lv(e,i)},[e,i]);let[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),f=t.source===`static`,p=t.brokerStatus===`connected`,m=t.role===`controller`,h=t.state?.isStreaming??!1,g=m&&!f&&p&&t.serverConnected,_=t.commands,y=(0,v.useMemo)(()=>new Set([...zv,...t.engineLeadingCommandNames]),[t.engineLeadingCommandNames]);(0,v.useEffect)(()=>{let t=!1;return vp(e).then(e=>{t||r(e)}).catch(e=>{t||l(Vv(e))}),()=>{t=!0}},[e]);let b=(0,v.useRef)(0);(0,v.useEffect)(()=>{b.current=0},[e]),(0,v.useEffect)(()=>{if(!Dv({dormant:f,status:n?.status,socketReady:t.socketReady,attempt:b.current}))return;let e=b.current;b.current+=1;let r=setTimeout(()=>t.reconnect(),Ov(e));return()=>clearTimeout(r)},[f,n?.status,t.socketReady,t.reconnect]);let x=()=>{!i.trim()||!g||(h?t.steer(i):t.prompt(i),Rv(e),Fv(e),a(``))};return{store:t,detail:n,input:i,setInput:a,reviving:o,actionError:c,peekedPath:u,setPeekedPath:d,dormant:f,brokerUp:p,writable:m,streaming:h,canDrive:g,commands:_,refs:t.refs,commandNames:y,onReplaceToken:e=>{a(e.text)},sendPrimary:x,onInputKeyDown:e=>{xh(e,a,x)},selectCommand:e=>{a(`/${e.name} `)},doRevive:async()=>{s(!0),l(null);try{await Sp(e),t.reconnect()}catch(e){l(Vv(e))}finally{s(!1)}},doClose:async()=>{l(null);try{await Cp(e)}catch(e){l(Vv(e))}}}}function Vv(e){return e instanceof mp?`${e.code}: ${e.message}`:String(e)}function Hv(e){let t=(0,v.useMemo)(()=>{let t=e.query;return t.startsWith(`/`)?t.slice(1).trimStart().toLowerCase():``},[e.query]),n=(0,v.useMemo)(()=>{let n=e.commands;return t?n.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.source.toLowerCase().includes(t)):n},[t,e.commands]);return e.visible?(0,z.jsx)(`div`,{className:`absolute bottom-full left-0 right-0 z-20 mb-1 max-h-72 overflow-auto border border-border bg-popover`,children:n.length>0?(0,z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:n.map(t=>(0,z.jsxs)(`li`,{className:`flex cursor-pointer flex-wrap items-baseline gap-x-2 gap-y-0.5 px-3 py-2 hover:bg-accent/50`,onClick:()=>e.onSelect(t),children:[(0,z.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-primary`,children:[`/`,t.name]}),t.argument_hint&&(0,z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground/70`,children:t.argument_hint}),(0,z.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground/50`,children:[t.source,t.location&&(0,z.jsxs)(z.Fragment,{children:[` · `,t.location]})]}),(0,z.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:t.description})]},t.name))}):(0,z.jsx)(`div`,{className:`px-3 py-2 text-xs italic text-muted-foreground`,children:`no matching commands`})}):null}var Uv=new Set([`select`,`confirm`,`input`,`editor`,`notify`]);function Wv(e){return Uv.has(e.method)}function Gv(e){let t=e.store.dialog,n=t&&Wv(t)?t:null;return(0,z.jsx)(nm,{open:n!==null,children:(0,z.jsx)(am,{showCloseButton:!1,children:n&&(0,z.jsx)(Jv,{req:n,store:e.store},n.id)})})}function Kv(e){switch(e){case`error`:return`border-destructive/40 text-destructive`;case`warning`:return`border-warning/40 text-warning`;case`success`:return`border-success/40 text-success`;default:return`border-border text-foreground`}}function qv(e){let t=/https?:\/\/[^\s]+/g;return e.split(`
|
|
59
|
+
`).map((e,n)=>{let r=[],i=0,a;for(;a=t.exec(e);)a.index>i&&r.push(e.slice(i,a.index)),r.push((0,z.jsx)(`a`,{href:a[0],target:`_blank`,rel:`noopener noreferrer`,className:`underline break-all`,children:a[0]},a.index)),i=a.index+a[0].length;return i<e.length&&r.push(e.slice(i)),(0,z.jsxs)(`span`,{children:[n>0&&(0,z.jsx)(`br`,{}),r]},n)})}function Jv(e){let t=()=>e.store.dialogResponse(e.req.id,{cancelled:!0});return e.req.method===`select`?(0,z.jsx)(Yv,{req:e.req,store:e.store,cancel:t}):(0,z.jsx)(Xv,{req:e.req,store:e.store,cancel:t})}function Yv(e){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:e.req.title})}),(0,z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.req.options.map(t=>(0,z.jsx)(`li`,{children:(0,z.jsx)(Z,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>e.store.dialogResponse(e.req.id,{value:t}),children:t})},t))}),(0,z.jsx)(sm,{children:(0,z.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`})})]})}function Xv(e){let[t,n]=(0,v.useState)(e.req.method===`editor`?e.req.prefill??``:``);if(e.req.method===`confirm`){let t=e.req;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:t.title})}),(0,z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{variant:`secondary`,onClick:()=>e.store.dialogResponse(t.id,{confirmed:!1}),children:`No`}),(0,z.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`Yes`})]})]})}if(e.req.method===`input`||e.req.method===`editor`){let r=e.req;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(om,{children:(0,z.jsx)(cm,{children:qv(r.title)})}),r.method===`editor`?(0,z.jsx)(ym,{className:`resize-none font-mono text-sm`,rows:8,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}):(0,z.jsx)(um,{placeholder:r.placeholder??``,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`}),(0,z.jsx)(Z,{onClick:()=>e.store.dialogResponse(r.id,{value:t}),children:`Submit`})]})]})}if(e.req.method===`notify`){let t=e.req;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:J(`rounded-none border px-3 py-2 text-sm`,Kv(t.notifyType)),children:qv(t.message)}),(0,z.jsx)(sm,{children:(0,z.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`OK`})})]})}return null}function Zv(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function Qv(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function $v(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var ey=(e,t)=>Math.abs(e-t)<1.01,ty=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},ny,ry=()=>{if(ny!==void 0)return ny;if(typeof navigator>`u`)return ny=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return ny=!0;let e=navigator.maxTouchPoints;return ny=navigator.platform===`MacIntel`&&e!==void 0&&e>0},iy=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ay=e=>e,oy=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},sy=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(iy(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(iy(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},cy={passive:!0},ly=typeof window>`u`||`onscrollend`in window,uy=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&ly,o=0,s=a?null:ty(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,cy),a&&r.addEventListener(`scrollend`,u,cy),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},dy=(e,t)=>uy(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),fy=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},py=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},my=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ay,rangeExtractor:oy,onChange:()=>{},measureElement:fy,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Qv(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!ry()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,cy),e.addEventListener(`touchend`,n,cy),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(ry()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Qv(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=Qv(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=Zv(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Qv(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=_y(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Qv(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-c):d&&this.applyScrollAdjustment(s),this.notify(!1)}},this.getVirtualItems=Qv(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return $v(t[hy(0,t.length-1,r?e=>n[e*2]:e=>$v(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(ry()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&ey(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},hy=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function gy(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function _y(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=gy(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=hy(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var vy=typeof document<`u`?v.useLayoutEffect:v.useEffect;function yy({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,y.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=v.useState(()=>{let e=new my(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),vy(()=>l._didMount(),[]),vy(()=>(o(l),l._willUpdate())),vy(()=>{s(l)}),l}function by(e){return yy({observeElementRect:sy,observeElementOffset:dy,scrollToFn:py,...e})}var xy={};function Sy(e){let t=xy[e];if(t)return t;t=xy[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function Cy(e,t){typeof t!=`string`&&(t=Cy.defaultChars);let n=Sy(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}Cy.defaultChars=`;/?:@&=+$,#`,Cy.componentChars=``;var wy={};function Ty(e){let t=wy[e];if(t)return t;t=wy[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Ey(e,t,n){typeof t!=`string`&&(n=t,t=Ey.defaultChars),n===void 0&&(n=!0);let r=Ty(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}Ey.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Ey.componentChars=`-_.!~*'()`;function Dy(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function Oy(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var ky=/^([a-z0-9.+-]+:)/i,Ay=/:[0-9]*$/,jy=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,My=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
60
|
+
`,` `],Ny=[`/`,`?`,`#`],Py=255,Fy=/^[+a-z0-9A-Z_-]{0,63}$/,Iy=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ly={javascript:!0,"javascript:":!0},Ry={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function zy(e,t){if(e&&e instanceof Oy)return e;let n=new Oy;return n.parse(e,t),n}Oy.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=jy.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=ky.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Ly[o])&&(a=a.substr(2),this.slashes=!0)),!Ly[o]&&(i||o&&!Ry[o])){let e=-1;for(let t=0;t<Ny.length;t++)r=a.indexOf(Ny[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<My.length;t++)r=a.indexOf(My[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Fy)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Fy)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Iy);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Py&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Ry[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Oy.prototype.parseHost=function(e){let t=Ay.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var By=s({decode:()=>Cy,encode:()=>Ey,format:()=>Dy,parse:()=>zy}),Vy=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Hy=/[\0-\x1F\x7F-\x9F]/,Uy=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Wy=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Gy=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Ky=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,qy=s({Any:()=>Vy,Cc:()=>Hy,Cf:()=>Uy,P:()=>Wy,S:()=>Gy,Z:()=>Ky}),Jy=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Yy=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Xy=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Zy=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Qy(e){return e>=55296&&e<=57343||e>1114111?65533:Xy.get(e)??e}var $y;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})($y||={});var eb=32,tb;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(tb||={});function nb(e){return e>=$y.ZERO&&e<=$y.NINE}function rb(e){return e>=$y.UPPER_A&&e<=$y.UPPER_F||e>=$y.LOWER_A&&e<=$y.LOWER_F}function ib(e){return e>=$y.UPPER_A&&e<=$y.UPPER_Z||e>=$y.LOWER_A&&e<=$y.LOWER_Z||nb(e)}function ab(e){return e===$y.EQUALS||ib(e)}var ob;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ob||={});var sb;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(sb||={});var cb=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ob.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=sb.Strict}startEntity(e){this.decodeMode=e,this.state=ob.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ob.EntityStart:return e.charCodeAt(t)===$y.NUM?(this.state=ob.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ob.NamedEntity,this.stateNamedEntity(e,t));case ob.NumericStart:return this.stateNumericStart(e,t);case ob.NumericDecimal:return this.stateNumericDecimal(e,t);case ob.NumericHex:return this.stateNumericHex(e,t);case ob.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|eb)===$y.LOWER_X?(this.state=ob.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ob.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(nb(r)||rb(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(nb(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===$y.SEMI)this.consumed+=1;else if(this.decodeMode===sb.Strict)return 0;return this.emitCodePoint(Qy(this.result),this.consumed),this.errors&&(e!==$y.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&tb.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=ub(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===sb.Attribute&&(i===0||ab(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&tb.VALUE_LENGTH)>>14,i!==0){if(a===$y.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==sb.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&tb.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~tb.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ob.NamedEntity:return this.result!==0&&(this.decodeMode!==sb.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ob.NumericDecimal:return this.emitNumericEntity(0,2);case ob.NumericHex:return this.emitNumericEntity(0,3);case ob.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ob.EntityStart:return 0}}};function lb(e){let t=``,n=new cb(e,e=>t+=Zy(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function ub(e,t,n,r){let i=(t&tb.BRANCH_LENGTH)>>7,a=t&tb.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var db=lb(Jy);lb(Yy);function fb(e,t=sb.Legacy){return db(e,t)}function pb(e){return db(e,sb.Strict)}var mb=s({arrayReplaceAt:()=>bb,asciiTrim:()=>Ub,assign:()=>yb,escapeHtml:()=>Nb,escapeRE:()=>Fb,fromCodePoint:()=>Sb,has:()=>vb,isMdAsciiPunct:()=>Bb,isPunctChar:()=>Rb,isPunctCharCode:()=>zb,isSpace:()=>Ib,isString:()=>gb,isValidEntityCode:()=>xb,isWhiteSpace:()=>Lb,lib:()=>Wb,normalizeReference:()=>Vb,unescapeAll:()=>Ob,unescapeMd:()=>Db});function hb(e){return Object.prototype.toString.call(e)}function gb(e){return hb(e)===`[object String]`}var _b=Object.prototype.hasOwnProperty;function vb(e,t){return _b.call(e,t)}function yb(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function bb(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function xb(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Sb(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Cb=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,wb=RegExp(Cb.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),Tb=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Eb(e,t){if(t.charCodeAt(0)===35&&Tb.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return xb(n)?Sb(n):e}let n=fb(e);return n===e?e:n}function Db(e){return e.indexOf(`\\`)<0?e:e.replace(Cb,`$1`)}function Ob(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(wb,function(e,t,n){return t||Eb(e,n)})}var kb=/[&<>"]/,Ab=/[&<>"]/g,jb={"&":`&`,"<":`<`,">":`>`,'"':`"`};function Mb(e){return jb[e]}function Nb(e){return kb.test(e)?e.replace(Ab,Mb):e}var Pb=/[.?*+^$[\]\\(){}|-]/g;function Fb(e){return e.replace(Pb,`\\$&`)}function Ib(e){switch(e){case 9:case 32:return!0}return!1}function Lb(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Rb(e){return Wy.test(e)||Gy.test(e)}function zb(e){return Rb(Sb(e))}function Bb(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Vb(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Hb(e){return e===32||e===9||e===10||e===13}function Ub(e){let t=0;for(;t<e.length&&Hb(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Hb(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Wb={mdurl:By,ucmicro:qy};function Gb(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Kb(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=Ob(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=Ob(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function qb(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=Ob(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=Ob(e.slice(t,a)),o}var Jb=s({parseLinkDestination:()=>Kb,parseLinkLabel:()=>Gb,parseLinkTitle:()=>qb}),Yb={};Yb.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+Nb(a.content)+`</code>`},Yb.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+Nb(e[t].content)+`</code></pre>
|
|
61
|
+
`},Yb.fence=function(e,t,n,r,i){let a=e[t],o=a.info?Ob(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||Nb(a.content),l.indexOf(`<pre`)===0)return l+`
|
|
62
|
+
`;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},Yb.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},Yb.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
56
63
|
`:`<br>
|
|
57
|
-
`},
|
|
64
|
+
`},Yb.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
58
65
|
`:`<br>
|
|
59
66
|
`:`
|
|
60
|
-
`},
|
|
67
|
+
`},Yb.text=function(e,t){return Nb(e[t].content)},Yb.html_block=function(e,t){return e[t].content},Yb.html_inline=function(e,t){return e[t].content};function Xb(){this.rules=yb({},Yb)}Xb.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+Nb(e.attrs[t][0])+`="`+Nb(e.attrs[t][1])+`"`;return r},Xb.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=`
|
|
61
68
|
`),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`>
|
|
62
|
-
`:`>`,i},
|
|
63
|
-
`;break;default:}return r},
|
|
64
|
-
`),t=t.replace(zb,`�`),e.src=t}function Vb(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Hb(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function Ub(e){return/^<a[>\s]/i.test(e)}function Wb(e){return/^<\/a\s*>/i.test(e)}function Gb(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(Ub(o.content)&&i>0&&i--,Wb(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=ib(r,a,c)}}}}var Kb=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,qb=/\((c|tm|r)\)/i,Jb=/\((c|tm|r)\)/gi,Yb={c:`©`,r:`®`,tm:`™`};function Xb(e,t){return Yb[t.toLowerCase()]}function Zb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(Jb,Xb)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Qb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&Kb.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function $b(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(qb.test(e.tokens[t].content)&&Zb(e.tokens[t].children),Kb.test(e.tokens[t].content)&&Qb(e.tokens[t].children))}var ex=/['"]/,tx=/['"]/g,nx=`’`;function rx(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function ix(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function ax(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){tx.lastIndex=l;let o=tx.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=wb(m)||Cb(m),_=wb(h)||Cb(h),v=xb(m),y=xb(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&rx(i,a,o.index,nx);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),rx(i,a,o.index,c),rx(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&rx(i,a,o.index,nx)}}Object.keys(i).forEach(function(t){e[t].content=ix(e[t].content,i[t])})}function ox(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!ex.test(e.tokens[t].content)||ax(e.tokens[t].children,e)}function sx(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var cx=[[`normalize`,Bb],[`block`,Vb],[`inline`,Hb],[`linkify`,Gb],[`replacements`,$b],[`smartquotes`,ox],[`text_join`,sx]];function lx(){this.ruler=new Fb;for(let e=0;e<cx.length;e++)this.ruler.push(cx[e][0],cx[e][1])}lx.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},lx.prototype.State=Lb;function ux(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(bb(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ux.prototype.push=function(e,t,n){let r=new Ib(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},ux.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},ux.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},ux.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&bb(this.src.charCodeAt(e));e++);return e},ux.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!bb(this.src.charCodeAt(--e)))return e+1;return e},ux.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},ux.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},ux.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(bb(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},ux.prototype.Token=Ib;var dx=65536;function fx(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function px(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function mx(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!bb(s)||o===45&&bb(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!bb(t))return!1;a++}let c=fx(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=fx(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=px(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=fx(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=px(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>dx))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function hx(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
|
|
65
|
-
`,a.map=[t,e.line],!0}function gx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function _x(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(bb(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function vx(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!bb(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function yx(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!bb(e.src.charCodeAt(r))?-1:r}function bx(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!bb(a))?-1:i}function xx(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Sx(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=bx(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=yx(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=bx(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=yx(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&xx(e,h),!0}function Cx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!bb(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!bb(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&bb(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&bb(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Tb(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var wx=`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(`.`),Tx=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Ex=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),Dx=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+wx.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Ex.source+`\\s*$`),/^$/,!1]];function Ox(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Dx.length&&!Dx[s][0].test(o);s++);if(s===Dx.length)return!1;if(r)return Dx[s][2];let c=t+1,l=Dx[s][1].test(``);if(!Dx[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Dx[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function kx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!bb(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&bb(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=Db(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function Ax(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return e.parentType=i,!1;let c=Db(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function jx(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=Db(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var Mx=[[`table`,mx,[`paragraph`,`reference`]],[`code`,hx],[`fence`,gx,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,_x,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,vx,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Sx,[`paragraph`,`reference`,`blockquote`]],[`reference`,Cx],[`html_block`,Ox,[`paragraph`,`reference`,`blockquote`]],[`heading`,kx,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Ax],[`paragraph`,jx]];function Nx(){this.ruler=new Fb;for(let e=0;e<Mx.length;e++)this.ruler.push(Mx[e][0],Mx[e][1],{alt:(Mx[e][2]||[]).slice()})}Nx.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},Nx.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},Nx.prototype.State=ux;function Px(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Px.prototype.pushPending=function(){let e=new Ib(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},Px.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new Ib(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},Px.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)==55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)==56320){let t=this.src.charCodeAt(e-2);i=(t&64512)==55296?65536+(t-55296<<10)+(i-56320):65533}else(i&64512)==55296&&(i=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32;if((s&64512)==55296){let e=this.src.charCodeAt(a+1);s=(e&64512)==56320?65536+(s-55296<<10)+(e-56320):65533}else(s&64512)==56320&&(s=65533);let c=wb(i)||Cb(i),l=wb(s)||Cb(s),u=xb(i),d=xb(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},Px.prototype.Token=Ib;function Fx(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Ix(e,t){let n=e.pos;for(;n<e.posMax&&!Fx(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var Lx=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Rx(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(Lx);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function zx(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&bb(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Bx=[];for(let e=0;e<256;e++)Bx.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){Bx[e.charCodeAt(0)]=1});function Vx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),bb(i));)n++;return e.pos=n,!0}if(i===32){if(!t){let t=e.push(`text_special`,``,0);t.content=`\\`,t.markup=`\\`,t.info=`escape`}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&Bx[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function Hx(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function Ux(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function Wx(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function Gx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Wx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Wx(e,t[r].delimiters)}var Kx={tokenize:Ux,postProcess:Gx};function qx(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Jx(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function Yx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Jx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Jx(e,t[r].delimiters)}var Xx={tokenize:qx,postProcess:Yx};function Zx(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!bb(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!bb(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!bb(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Tb(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function Qx(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!bb(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!bb(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!bb(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Tb(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var $x=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,eS=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function tS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(eS.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if($x.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function nS(e){return/^<a[>\s]/i.test(e)}function rS(e){return/^<\/a\s*>/i.test(e)}function iS(e){let t=e|32;return t>=97&&t<=122}function aS(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!iS(i))return!1;let a=e.src.slice(r).match(Tx);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],nS(t.content)&&e.linkLevel++,rS(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var oS=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,sS=/^&([a-z][a-z0-9]{1,31});/i;function cS(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(oS);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=ab(t)?ob(t):ob(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(sS);if(r){let n=Zy(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function lS(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function uS(e){let t=e.tokens_meta,n=e.tokens_meta.length;lS(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&lS(t[e].delimiters)}function dS(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var fS=[[`text`,Ix],[`linkify`,Rx],[`newline`,zx],[`escape`,Vx],[`backticks`,Hx],[`strikethrough`,Kx.tokenize],[`emphasis`,Xx.tokenize],[`link`,Zx],[`image`,Qx],[`autolink`,tS],[`html_inline`,aS],[`entity`,cS]],pS=[[`balance_pairs`,uS],[`strikethrough`,Kx.postProcess],[`emphasis`,Xx.postProcess],[`fragments_join`,dS]];function mS(){this.ruler=new Fb;for(let e=0;e<fS.length;e++)this.ruler.push(fS[e][0],fS[e][1]);this.ruler2=new Fb;for(let e=0;e<pS.length;e++)this.ruler2.push(pS[e][0],pS[e][1])}mS.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},mS.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},mS.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},mS.prototype.State=Px;function hS(e){let t={};e||={},t.src_Any=Ty.source,t.src_Cc=Ey.source,t.src_Z=Ay.source,t.src_P=Oy.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function gS(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function _S(e){return Object.prototype.toString.call(e)}function vS(e){return _S(e)===`[object String]`}function yS(e){return _S(e)===`[object Object]`}function bS(e){return _S(e)===`[object RegExp]`}function xS(e){return _S(e)===`[object Function]`}function SS(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var CS={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function wS(e){return Object.keys(e||{}).reduce(function(e,t){return e||CS.hasOwnProperty(t)},!1)}var TS={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},ES=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,DS=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function OS(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function kS(){return function(e,t){t.normalize(e)}}function AS(e){let t=e.re=hS(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(ES),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,yS(n)){bS(n.validate)?r.validate=OS(n.validate):xS(n.validate)?r.validate=n.validate:a(t,n),xS(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=kS();return}if(vS(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:kS()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(SS).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function jS(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function MS(e,t){if(!(this instanceof MS))return new MS(e,t);t||wS(e)&&(t=e,e={}),this.__opts__=gS({},CS,t),this.__schemas__=gS({},TS,e),this.__compiled__={},this.__tlds__=DS,this.__tlds_replaced__=!1,this.re={},AS(this)}MS.prototype.add=function(e,t){return this.__schemas__[e]=t,AS(this),this},MS.prototype.set=function(e){return this.__opts__=gS(this.__opts__,e),this},MS.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},MS.prototype.pretest=function(e){return this.re.pretest.test(e)},MS.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},MS.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new jS(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},MS.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new jS(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},MS.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),AS(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,AS(this),this)},MS.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},MS.prototype.onCompile=function(){};var NS=2147483647,PS=36,FS=1,IS=26,LS=38,RS=700,zS=72,BS=128,VS=`-`,HS=/^xn--/,US=/[^\0-\x7F]/,WS=/[\x2E\u3002\uFF0E\uFF61]/g,GS={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},KS=PS-FS,qS=Math.floor,JS=String.fromCharCode;function YS(e){throw RangeError(GS[e])}function XS(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function ZS(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(WS,`.`);let i=XS(e.split(`.`),t).join(`.`);return r+i}function QS(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var $S=e=>String.fromCodePoint(...e),eC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:PS},tC=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},nC=function(e,t,n){let r=0;for(e=n?qS(e/RS):e>>1,e+=qS(e/t);e>455;r+=PS)e=qS(e/KS);return qS(r+36*e/(e+LS))},rC=function(e){let t=[],n=e.length,r=0,i=BS,a=zS,o=e.lastIndexOf(VS);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&YS(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=PS;;i+=PS){s>=n&&YS(`invalid-input`);let o=eC(e.charCodeAt(s++));o>=PS&&YS(`invalid-input`),o>qS((NS-r)/t)&&YS(`overflow`),r+=o*t;let c=i<=a?FS:i>=a+IS?IS:i-a;if(o<c)break;let l=PS-c;t>qS(NS/l)&&YS(`overflow`),t*=l}let c=t.length+1;a=nC(r-o,c,o==0),qS(r/c)>NS-i&&YS(`overflow`),i+=qS(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},iC=function(e){let t=[];e=QS(e);let n=e.length,r=BS,i=0,a=zS;for(let n of e)n<128&&t.push(JS(n));let o=t.length,s=o;for(o&&t.push(VS);s<n;){let n=NS;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>qS((NS-i)/c)&&YS(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>NS&&YS(`overflow`),n===r){let e=i;for(let n=PS;;n+=PS){let r=n<=a?FS:n>=a+IS?IS:n-a;if(e<r)break;let i=e-r,o=PS-r;t.push(JS(tC(r+i%o,0))),e=qS(i/o)}t.push(JS(tC(e,0))),a=nC(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},aC={version:`2.3.1`,ucs2:{decode:QS,encode:$S},decode:rC,encode:iC,toASCII:function(e){return ZS(e,function(e){return US.test(e)?`xn--`+iC(e):e})},toUnicode:function(e){return ZS(e,function(e){return HS.test(e)?rC(e.slice(4).toLowerCase()):e})}},oC={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},sC=/^(vbscript|javascript|file|data):/,cC=/^data:image\/(gif|png|jpeg|webp);/;function lC(e){let t=e.trim().toLowerCase();return!sC.test(t)||cC.test(t)}var uC=[`http:`,`https:`,`mailto:`];function dC(e){let t=Cy(e,!0);if(t.hostname&&(!t.protocol||uC.indexOf(t.protocol)>=0))try{t.hostname=aC.toASCII(t.hostname)}catch{}return uy(dy(t))}function fC(e){let t=Cy(e,!0);if(t.hostname&&(!t.protocol||uC.indexOf(t.protocol)>=0))try{t.hostname=aC.toUnicode(t.hostname)}catch{}return sy(dy(t),sy.defaultChars+`%`)}function pC(e,t){if(!(this instanceof pC))return new pC(e,t);t||eb(e)||(t=e||{},e=`default`),this.inline=new mS,this.block=new Nx,this.core=new lx,this.renderer=new Pb,this.linkify=new MS,this.validateLink=lC,this.normalizeLink=dC,this.normalizeLinkText=fC,this.utils=Qy,this.helpers=rb({},Mb),this.options={},this.configure(e),t&&this.set(t)}pC.prototype.set=function(e){return rb(this.options,e),this},pC.prototype.configure=function(e){let t=this;if(eb(e)){let t=e;if(e=oC[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},pC.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},pC.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},pC.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},pC.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},pC.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},pC.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},pC.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var mC=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},ee={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},N={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},P={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},F=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},I=F(`//`,`$`),te=F(`/\\*`,`\\*/`),ne=F(`#`,`$`),re=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:F,C_BLOCK_COMMENT_MODE:te,C_LINE_COMMENT_MODE:I,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ne,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:P,QUOTE_STRING_MODE:N,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function ie(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ae(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function L(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ie,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function R(e,t){e.relevance===void 0&&(e.relevance=1)}var ce=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},le=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function de(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,de(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return le.includes(e.toLowerCase())}var me={},he=e=>{console.error(e)},ge=(e,...t)=>{console.log(`WARN: ${e}`,...t)},_e=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},ve=Error();function ye(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function be(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw he(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ve;if(typeof e.beginScope!=`object`||e.beginScope===null)throw he(`beginScope must be object`),ve;ye(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function xe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw he(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ve;if(typeof e.endScope!=`object`||e.endScope===null)throw he(`endScope must be object`),ve;ye(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Se(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ce(e){Se(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),be(e),xe(e)}function we(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ae,se,Ce,ce].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[L,oe,R].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=de(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ee(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Te(e){return e?e.endsWithParent||Te(e.starts):!1}function Ee(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var De=`11.11.1`,Oe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ke=i,Ae=a,je=Symbol(`nomatch`),Me=7,Ne=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=ee(n[1]);return t||(ge(s.replace(`{}`,n[1])),ge(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||ee(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(_e(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),_e(`10.7.0`,`Please use highlight(code, options) instead.
|
|
69
|
+
`:`>`,i},Xb.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},Xb.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
|
|
70
|
+
`;break;default:}return r},Xb.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function Zb(){this.__rules__=[],this.__cache__=null}Zb.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Zb.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},Zb.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},Zb.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},Zb.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},Zb.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Zb.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},Zb.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Zb.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},Zb.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Qb(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}Qb.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},Qb.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Qb.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},Qb.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},Qb.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function $b(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}$b.prototype.Token=Qb;var ex=/\r\n?|\n/g,tx=/\0/g;function nx(e){let t;t=e.src.replace(ex,`
|
|
71
|
+
`),t=t.replace(tx,`�`),e.src=t}function rx(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function ix(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function ax(e){return/^<a[>\s]/i.test(e)}function ox(e){return/^<\/a\s*>/i.test(e)}function sx(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(ax(o.content)&&i>0&&i--,ox(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=bb(r,a,c)}}}}var cx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,lx=/\((c|tm|r)\)/i,ux=/\((c|tm|r)\)/gi,dx={c:`©`,r:`®`,tm:`™`};function fx(e,t){return dx[t.toLowerCase()]}function px(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(ux,fx)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function mx(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&cx.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function hx(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(lx.test(e.tokens[t].content)&&px(e.tokens[t].children),cx.test(e.tokens[t].content)&&mx(e.tokens[t].children))}var gx=/['"]/,_x=/['"]/g,vx=`’`;function yx(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function bx(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function xx(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){_x.lastIndex=l;let o=_x.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=Bb(m)||zb(m),_=Bb(h)||zb(h),v=Lb(m),y=Lb(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&yx(i,a,o.index,vx);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),yx(i,a,o.index,c),yx(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&yx(i,a,o.index,vx)}}Object.keys(i).forEach(function(t){e[t].content=bx(e[t].content,i[t])})}function Sx(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!gx.test(e.tokens[t].content)||xx(e.tokens[t].children,e)}function Cx(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var wx=[[`normalize`,nx],[`block`,rx],[`inline`,ix],[`linkify`,sx],[`replacements`,hx],[`smartquotes`,Sx],[`text_join`,Cx]];function Tx(){this.ruler=new Zb;for(let e=0;e<wx.length;e++)this.ruler.push(wx[e][0],wx[e][1])}Tx.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},Tx.prototype.State=$b;function Ex(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(Ib(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ex.prototype.push=function(e,t,n){let r=new Qb(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Ex.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},Ex.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},Ex.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&Ib(this.src.charCodeAt(e));e++);return e},Ex.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!Ib(this.src.charCodeAt(--e)))return e+1;return e},Ex.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},Ex.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},Ex.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(Ib(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},Ex.prototype.Token=Qb;var Dx=65536;function Ox(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function kx(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Ax(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!Ib(s)||o===45&&Ib(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!Ib(t))return!1;a++}let c=Ox(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=Ox(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=kx(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=Ox(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=kx(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>Dx))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function jx(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
|
|
72
|
+
`,a.map=[t,e.line],!0}function Mx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Nx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(Ib(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function Px(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!Ib(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function Fx(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!Ib(e.src.charCodeAt(r))?-1:r}function Ix(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!Ib(a))?-1:i}function Lx(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Rx(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=Ix(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=Fx(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=Ix(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Fx(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&Lx(e,h),!0}function zx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!Ib(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!Ib(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&Ib(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&Ib(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Vb(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var Bx=`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(`.`),Vx=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Hx=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),Ux=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+Bx.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Hx.source+`\\s*$`),/^$/,!1]];function Wx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Ux.length&&!Ux[s][0].test(o);s++);if(s===Ux.length)return!1;if(r)return Ux[s][2];let c=t+1,l=Ux[s][1].test(``);if(!Ux[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Ux[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function Gx(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!Ib(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&Ib(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=Ub(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function Kx(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return e.parentType=i,!1;let c=Ub(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function qx(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=Ub(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var Jx=[[`table`,Ax,[`paragraph`,`reference`]],[`code`,jx],[`fence`,Mx,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Nx,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Px,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Rx,[`paragraph`,`reference`,`blockquote`]],[`reference`,zx],[`html_block`,Wx,[`paragraph`,`reference`,`blockquote`]],[`heading`,Gx,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Kx],[`paragraph`,qx]];function Yx(){this.ruler=new Zb;for(let e=0;e<Jx.length;e++)this.ruler.push(Jx[e][0],Jx[e][1],{alt:(Jx[e][2]||[]).slice()})}Yx.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},Yx.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},Yx.prototype.State=Ex;function Xx(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Xx.prototype.pushPending=function(){let e=new Qb(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},Xx.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new Qb(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},Xx.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)==55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)==56320){let t=this.src.charCodeAt(e-2);i=(t&64512)==55296?65536+(t-55296<<10)+(i-56320):65533}else(i&64512)==55296&&(i=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32;if((s&64512)==55296){let e=this.src.charCodeAt(a+1);s=(e&64512)==56320?65536+(s-55296<<10)+(e-56320):65533}else(s&64512)==56320&&(s=65533);let c=Bb(i)||zb(i),l=Bb(s)||zb(s),u=Lb(i),d=Lb(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},Xx.prototype.Token=Qb;function Zx(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Qx(e,t){let n=e.pos;for(;n<e.posMax&&!Zx(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var $x=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function eS(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match($x);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function tS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&Ib(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var nS=[];for(let e=0;e<256;e++)nS.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){nS[e.charCodeAt(0)]=1});function rS(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),Ib(i));)n++;return e.pos=n,!0}if(i===32){if(!t){let t=e.push(`text_special`,``,0);t.content=`\\`,t.markup=`\\`,t.info=`escape`}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&nS[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function iS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function aS(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function oS(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function sS(e){let t=e.tokens_meta,n=e.tokens_meta.length;oS(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&oS(e,t[r].delimiters)}var cS={tokenize:aS,postProcess:sS};function lS(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function uS(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function dS(e){let t=e.tokens_meta,n=e.tokens_meta.length;uS(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&uS(e,t[r].delimiters)}var fS={tokenize:lS,postProcess:dS};function pS(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!Ib(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!Ib(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!Ib(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Vb(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function mS(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!Ib(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!Ib(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!Ib(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Vb(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var hS=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,gS=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function _S(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(gS.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(hS.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function vS(e){return/^<a[>\s]/i.test(e)}function yS(e){return/^<\/a\s*>/i.test(e)}function bS(e){let t=e|32;return t>=97&&t<=122}function xS(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!bS(i))return!1;let a=e.src.slice(r).match(Vx);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],vS(t.content)&&e.linkLevel++,yS(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var SS=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,CS=/^&([a-z][a-z0-9]{1,31});/i;function wS(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(SS);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=xb(t)?Sb(t):Sb(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(CS);if(r){let n=pb(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function TS(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function ES(e){let t=e.tokens_meta,n=e.tokens_meta.length;TS(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&TS(t[e].delimiters)}function DS(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var OS=[[`text`,Qx],[`linkify`,eS],[`newline`,tS],[`escape`,rS],[`backticks`,iS],[`strikethrough`,cS.tokenize],[`emphasis`,fS.tokenize],[`link`,pS],[`image`,mS],[`autolink`,_S],[`html_inline`,xS],[`entity`,wS]],kS=[[`balance_pairs`,ES],[`strikethrough`,cS.postProcess],[`emphasis`,fS.postProcess],[`fragments_join`,DS]];function AS(){this.ruler=new Zb;for(let e=0;e<OS.length;e++)this.ruler.push(OS[e][0],OS[e][1]);this.ruler2=new Zb;for(let e=0;e<kS.length;e++)this.ruler2.push(kS[e][0],kS[e][1])}AS.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},AS.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},AS.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},AS.prototype.State=Xx;function jS(e){let t={};e||={},t.src_Any=Vy.source,t.src_Cc=Hy.source,t.src_Z=Ky.source,t.src_P=Wy.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function MS(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function NS(e){return Object.prototype.toString.call(e)}function PS(e){return NS(e)===`[object String]`}function FS(e){return NS(e)===`[object Object]`}function IS(e){return NS(e)===`[object RegExp]`}function LS(e){return NS(e)===`[object Function]`}function RS(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var zS={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function BS(e){return Object.keys(e||{}).reduce(function(e,t){return e||zS.hasOwnProperty(t)},!1)}var VS={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},HS=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,US=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function WS(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function GS(){return function(e,t){t.normalize(e)}}function KS(e){let t=e.re=jS(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(HS),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,FS(n)){IS(n.validate)?r.validate=WS(n.validate):LS(n.validate)?r.validate=n.validate:a(t,n),LS(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=GS();return}if(PS(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:GS()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(RS).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function qS(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function JS(e,t){if(!(this instanceof JS))return new JS(e,t);t||BS(e)&&(t=e,e={}),this.__opts__=MS({},zS,t),this.__schemas__=MS({},VS,e),this.__compiled__={},this.__tlds__=US,this.__tlds_replaced__=!1,this.re={},KS(this)}JS.prototype.add=function(e,t){return this.__schemas__[e]=t,KS(this),this},JS.prototype.set=function(e){return this.__opts__=MS(this.__opts__,e),this},JS.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},JS.prototype.pretest=function(e){return this.re.pretest.test(e)},JS.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},JS.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new qS(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},JS.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new qS(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},JS.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),KS(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,KS(this),this)},JS.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},JS.prototype.onCompile=function(){};var YS=2147483647,XS=36,ZS=1,QS=26,$S=38,eC=700,tC=72,nC=128,rC=`-`,iC=/^xn--/,aC=/[^\0-\x7F]/,oC=/[\x2E\u3002\uFF0E\uFF61]/g,sC={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},cC=XS-ZS,lC=Math.floor,uC=String.fromCharCode;function dC(e){throw RangeError(sC[e])}function fC(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function pC(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(oC,`.`);let i=fC(e.split(`.`),t).join(`.`);return r+i}function mC(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var hC=e=>String.fromCodePoint(...e),gC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:XS},_C=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},vC=function(e,t,n){let r=0;for(e=n?lC(e/eC):e>>1,e+=lC(e/t);e>455;r+=XS)e=lC(e/cC);return lC(r+36*e/(e+$S))},yC=function(e){let t=[],n=e.length,r=0,i=nC,a=tC,o=e.lastIndexOf(rC);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&dC(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=XS;;i+=XS){s>=n&&dC(`invalid-input`);let o=gC(e.charCodeAt(s++));o>=XS&&dC(`invalid-input`),o>lC((YS-r)/t)&&dC(`overflow`),r+=o*t;let c=i<=a?ZS:i>=a+QS?QS:i-a;if(o<c)break;let l=XS-c;t>lC(YS/l)&&dC(`overflow`),t*=l}let c=t.length+1;a=vC(r-o,c,o==0),lC(r/c)>YS-i&&dC(`overflow`),i+=lC(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},bC=function(e){let t=[];e=mC(e);let n=e.length,r=nC,i=0,a=tC;for(let n of e)n<128&&t.push(uC(n));let o=t.length,s=o;for(o&&t.push(rC);s<n;){let n=YS;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>lC((YS-i)/c)&&dC(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>YS&&dC(`overflow`),n===r){let e=i;for(let n=XS;;n+=XS){let r=n<=a?ZS:n>=a+QS?QS:n-a;if(e<r)break;let i=e-r,o=XS-r;t.push(uC(_C(r+i%o,0))),e=lC(i/o)}t.push(uC(_C(e,0))),a=vC(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},xC={version:`2.3.1`,ucs2:{decode:mC,encode:hC},decode:yC,encode:bC,toASCII:function(e){return pC(e,function(e){return aC.test(e)?`xn--`+bC(e):e})},toUnicode:function(e){return pC(e,function(e){return iC.test(e)?yC(e.slice(4).toLowerCase()):e})}},SC={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},CC=/^(vbscript|javascript|file|data):/,wC=/^data:image\/(gif|png|jpeg|webp);/;function TC(e){let t=e.trim().toLowerCase();return!CC.test(t)||wC.test(t)}var EC=[`http:`,`https:`,`mailto:`];function DC(e){let t=zy(e,!0);if(t.hostname&&(!t.protocol||EC.indexOf(t.protocol)>=0))try{t.hostname=xC.toASCII(t.hostname)}catch{}return Ey(Dy(t))}function OC(e){let t=zy(e,!0);if(t.hostname&&(!t.protocol||EC.indexOf(t.protocol)>=0))try{t.hostname=xC.toUnicode(t.hostname)}catch{}return Cy(Dy(t),Cy.defaultChars+`%`)}function kC(e,t){if(!(this instanceof kC))return new kC(e,t);t||gb(e)||(t=e||{},e=`default`),this.inline=new AS,this.block=new Yx,this.core=new Tx,this.renderer=new Xb,this.linkify=new JS,this.validateLink=TC,this.normalizeLink=DC,this.normalizeLinkText=OC,this.utils=mb,this.helpers=yb({},Jb),this.options={},this.configure(e),t&&this.set(t)}kC.prototype.set=function(e){return yb(this.options,e),this},kC.prototype.configure=function(e){let t=this;if(gb(e)){let t=e;if(e=SC[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},kC.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},kC.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},kC.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},kC.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},kC.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},kC.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},kC.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var AC=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},ee={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},N={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},P={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},F=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},I=F(`//`,`$`),te=F(`/\\*`,`\\*/`),ne=F(`#`,`$`),re=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:F,C_BLOCK_COMMENT_MODE:te,C_LINE_COMMENT_MODE:I,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ne,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:P,QUOTE_STRING_MODE:N,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function ie(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ae(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function L(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ie,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function R(e,t){e.relevance===void 0&&(e.relevance=1)}var ce=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},le=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function de(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,de(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return le.includes(e.toLowerCase())}var me={},he=e=>{console.error(e)},ge=(e,...t)=>{console.log(`WARN: ${e}`,...t)},_e=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},ve=Error();function ye(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function be(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw he(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ve;if(typeof e.beginScope!=`object`||e.beginScope===null)throw he(`beginScope must be object`),ve;ye(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function xe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw he(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ve;if(typeof e.endScope!=`object`||e.endScope===null)throw he(`endScope must be object`),ve;ye(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Se(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ce(e){Se(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),be(e),xe(e)}function we(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ae,se,Ce,ce].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[L,oe,R].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=de(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ee(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Te(e){return e?e.endsWithParent||Te(e.starts):!1}function Ee(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var De=`11.11.1`,Oe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ke=i,Ae=a,je=Symbol(`nomatch`),Me=7,Ne=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=ee(n[1]);return t||(ge(s.replace(`{}`,n[1])),ge(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||ee(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(_e(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),_e(`10.7.0`,`Please use highlight(code, options) instead.
|
|
66
73
|
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ne(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ne(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(N);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(N),n=``;for(;t;){n+=N.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Me&&(P+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(N)}n+=N.substring(e),M.addText(n)}function f(){if(N===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(N);return}e=v(A.subLanguage,N,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(N,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(P+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),N=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(N=i,d(),N=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(N,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=``):e.beginScope._multi&&(h(e.beginScope,t),N=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(N+=e[0],1):(te=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),!n.returnBegin&&!n.excludeBegin&&(N=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return je;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(P+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(N+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(N+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==je)return e}if(r.type===`illegal`&&a===``)return N+=`
|
|
67
|
-
`,1;if(I>1e5&&I>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return N+=a,a.length}let D=ee(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=we(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let N=``,P=0,F=0,I=0,te=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){I++,te?te=!1:A.matcher.considerAll(),A.matcher.lastIndex=F;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(F,e.index),e);F=e.index+t}E(n.substring(F))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:P,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:ke(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:F,context:n.slice(F-100,F+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:ke(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(ee).filter(P).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(ee(e.language).supersetOf===t.language)return 1;if(ee(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ne(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Oe(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ne(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ae(l,e)}let E=()=>{k(),_e(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),_e(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function ee(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function N(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function P(e){let t=ee(e);return t&&!t.disableAutodetect}function F(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function I(e){F(e),a.push(e)}function te(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ne(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ie(e){return _e(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),_e(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ie,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:ee,registerAliases:N,autoDetection:P,inherit:Ae,addPlugin:I,removePlugin:te}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=De,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in re)typeof re[e]==`object`&&n(re[e]);return Object.assign(e,re),e},Pe=Ne({});Pe.newInstance=()=>Ne({}),t.exports=Pe,Pe.HighlightJS=Pe,Pe.default=Pe}))()).default,hC=`[A-Za-z$_][0-9A-Za-z$_]*`,gC=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),_C=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],vC=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),yC=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],bC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],xC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],SC=[].concat(bC,vC,yC);function CC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=hC,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:hC,keyword:gC,literal:_C,built_in:SC,"variable.language":xC},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...vC,...yC]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...bC,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function wC(e){let t=e.regex,n=CC(e),r=hC,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:hC,keyword:gC.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:_C,built_in:SC.concat(i),"variable.language":xC},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}var TC=`[A-Za-z$_][0-9A-Za-z$_]*`,EC=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),DC=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],OC=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),kC=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],AC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],jC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],MC=[].concat(AC,OC,kC);function NC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=TC,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:TC,keyword:EC,literal:DC,built_in:MC,"variable.language":jC},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...OC,...kC]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...AC,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function PC(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function FC(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function IC(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function LC(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function RC(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function zC(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var BC=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),VC=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),HC=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),UC=[...VC,...HC],WC=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),GC=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),KC=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),qC=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function JC(e){let t=e.regex,n=BC(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+GC.join(`|`)+`)`},{begin:`:(:)?(`+KC.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+qC.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:WC.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+UC.join(`|`)+`)\\b`}]}}function YC(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function XC(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}function ZC(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function QC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $C(e){if(Array.isArray(e))return e}function ew(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function tw(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nw(e,t){return $C(e)||ew(e,t)||rw(e,t)||tw()}function rw(e,t){if(e){if(typeof e==`string`)return QC(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QC(e,t):void 0}}var iw=Object.entries,aw=Object.setPrototypeOf,ow=Object.isFrozen,sw=Object.getPrototypeOf,cw=Object.getOwnPropertyDescriptor,lw=Object.freeze,uw=Object.seal,dw=Object.create,fw=typeof Reflect<`u`&&Reflect,pw=fw.apply,mw=fw.construct;lw||=function(e){return e},uw||=function(e){return e},pw||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},mw||=function(e){return new e(...[...arguments].slice(1))};var hw=Fw(Array.prototype.forEach),gw=Fw(Array.prototype.lastIndexOf),_w=Fw(Array.prototype.pop),vw=Fw(Array.prototype.push),yw=Fw(Array.prototype.splice),bw=Array.isArray,xw=Fw(String.prototype.toLowerCase),Sw=Fw(String.prototype.toString),Cw=Fw(String.prototype.match),ww=Fw(String.prototype.replace),Tw=Fw(String.prototype.indexOf),Ew=Fw(String.prototype.trim),Dw=Fw(Number.prototype.toString),Ow=Fw(Boolean.prototype.toString),kw=typeof BigInt>`u`?null:Fw(BigInt.prototype.toString),Aw=typeof Symbol>`u`?null:Fw(Symbol.prototype.toString),jw=Fw(Object.prototype.hasOwnProperty),Mw=Fw(Object.prototype.toString),Nw=Fw(RegExp.prototype.test),Pw=Iw(TypeError);function Fw(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return pw(e,t,n)}}function Iw(e){return function(){return mw(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xw;if(aw&&aw(e,null),!bw(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ow(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Lw(e){for(let t=0;t<e.length;t++)jw(e,t)||(e[t]=null);return e}function Rw(e){let t=dw(null);for(let r of iw(e)){var n=nw(r,2);let i=n[0],a=n[1];jw(e,i)&&(bw(a)?t[i]=Lw(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Rw(a):t[i]=a)}return t}function zw(e){switch(typeof e){case`string`:return e;case`number`:return Dw(e);case`boolean`:return Ow(e);case`bigint`:return kw?kw(e):`0`;case`symbol`:return Aw?Aw(e):`Symbol()`;case`undefined`:return Mw(e);case`function`:case`object`:{if(e===null)return Mw(e);let t=e,n=Bw(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Mw(e)}return Mw(e)}default:return Mw(e)}}function Bw(e,t){for(;e!==null;){let n=cw(e,t);if(n){if(n.get)return Fw(n.get);if(typeof n.value==`function`)return Fw(n.value)}e=sw(e)}function n(){return null}return n}function Vw(e){try{return Nw(e,``),!0}catch{return!1}}var Hw=lw(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Uw=lw(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ww=lw([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Gw=lw([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Kw=lw(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),qw=lw([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Jw=lw([`#text`]),Yw=lw(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Xw=lw(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Zw=lw(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Qw=lw([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),$w=uw(/{{[\w\W]*|^[\w\W]*}}/g),eT=uw(/<%[\w\W]*|^[\w\W]*%>/g),tT=uw(/\${[\w\W]*/g),nT=uw(/^data-[\-\w.\u00B7-\uFFFF]+$/),rT=uw(/^aria-[\-\w]+$/),iT=uw(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),aT=uw(/^(?:\w+script|data):/i),oT=uw(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sT=uw(/^html$/i),cT=uw(/^[a-z][.\w]*(-[.\w]+)+$/i),lT=uw(/<[/\w!]/g),uT=uw(/<[/\w]/g),dT=uw(/<\/no(script|embed|frames)/i),fT=uw(/\/>/i),pT={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mT=function(){return typeof window>`u`?null:window},hT=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},gT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_T=function(e,t,n,r){return jw(e,t)&&bw(e[t])?$(r.base?Rw(r.base):{},e[t],r.transform):n};function vT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mT(),t=e=>vT(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==pT.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Bw(d,`cloneNode`),p=Bw(d,`remove`),m=Bw(d,`nextSibling`),h=Bw(d,`childNodes`),g=Bw(d,`parentNode`),_=Bw(d,`shadowRoot`),v=Bw(d,`attributes`),y=o&&o.prototype?Bw(o.prototype,`nodeType`):null,b=o&&o.prototype?Bw(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw Pw(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=hT(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,ee=A.createDocumentFragment,N=A.getElementsByTagName,P=r.importNode,F=gT();t.isSupported=typeof iw==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let I=$w,te=eT,ne=tT,re=nT,ie=rT,ae=aT,L=oT,oe=cT,se=iT,R=null,ce=$({},[...Hw,...Uw,...Ww,...Kw,...Jw]),le=null,ue=$({},[...Yw,...Xw,...Zw,...Qw]),de=Object.seal(dw(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,pe=null,me=Object.seal(dw(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),he=!0,ge=!0,_e=!1,ve=!0,ye=!1,be=!0,xe=!1,Se=!1,Ce=null,we=null,Te=!1,Ee=!1,De=!1,Oe=!1,ke=!0,Ae=!1,je=`user-content-`,Me=!0,Ne=!1,Pe={},Fe=null,Ie=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Le=null,Re=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ze=null,Be=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ve=`http://www.w3.org/1998/Math/MathML`,He=`http://www.w3.org/2000/svg`,Ue=`http://www.w3.org/1999/xhtml`,We=Ue,Ge=!1,Ke=null,qe=$({},[Ve,He,Ue],Sw),Je=lw([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ye=$({},Je),Xe=lw([`annotation-xml`]),Ze=$({},Xe),Qe=$({},[`title`,`style`,`font`,`a`,`script`]),$e=null,et=[`application/xhtml+xml`,`text/html`],tt=null,nt=null,rt=n.createElement(`form`),it=function(e){return e instanceof RegExp||e instanceof Function},at=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nt&&nt===e)return;(!e||typeof e!=`object`)&&(e={}),e=Rw(e),$e=et.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,tt=$e===`application/xhtml+xml`?Sw:xw,R=_T(e,`ALLOWED_TAGS`,ce,{transform:tt}),le=_T(e,`ALLOWED_ATTR`,ue,{transform:tt}),Ke=_T(e,`ALLOWED_NAMESPACES`,qe,{transform:Sw}),ze=_T(e,`ADD_URI_SAFE_ATTR`,Be,{transform:tt,base:Be}),Le=_T(e,`ADD_DATA_URI_TAGS`,Re,{transform:tt,base:Re}),Fe=_T(e,`FORBID_CONTENTS`,Ie,{transform:tt}),fe=_T(e,`FORBID_TAGS`,Rw({}),{transform:tt}),pe=_T(e,`FORBID_ATTR`,Rw({}),{transform:tt}),Pe=jw(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Rw(e.USE_PROFILES):e.USE_PROFILES:!1,he=e.ALLOW_ARIA_ATTR!==!1,ge=e.ALLOW_DATA_ATTR!==!1,_e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=e.SAFE_FOR_TEMPLATES||!1,be=e.SAFE_FOR_XML!==!1,xe=e.WHOLE_DOCUMENT||!1,Ee=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Oe=e.RETURN_TRUSTED_TYPE||!1,Te=e.FORCE_BODY||!1,ke=e.SANITIZE_DOM!==!1,Ae=e.SANITIZE_NAMED_PROPS||!1,Me=e.KEEP_CONTENT!==!1,Ne=e.IN_PLACE||!1,se=Vw(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:iT,We=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ue,Ye=jw(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Rw(e.MATHML_TEXT_INTEGRATION_POINTS):$({},Je),Ze=jw(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Rw(e.HTML_INTEGRATION_POINTS):$({},Xe);let t=jw(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Rw(e.CUSTOM_ELEMENT_HANDLING):dw(null);if(de=dw(null),jw(t,`tagNameCheck`)&&it(t.tagNameCheck)&&(de.tagNameCheck=t.tagNameCheck),jw(t,`attributeNameCheck`)&&it(t.attributeNameCheck)&&(de.attributeNameCheck=t.attributeNameCheck),jw(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(de.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),uw(de),ye&&(ge=!1),De&&(Ee=!0),Pe&&(R=$({},Jw),le=dw(null),Pe.html===!0&&($(R,Hw),$(le,Yw)),Pe.svg===!0&&($(R,Uw),$(le,Xw),$(le,Qw)),Pe.svgFilters===!0&&($(R,Ww),$(le,Xw),$(le,Qw)),Pe.mathMl===!0&&($(R,Kw),$(le,Zw),$(le,Qw))),me.tagCheck=null,me.attributeCheck=null,jw(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?me.tagCheck=e.ADD_TAGS:bw(e.ADD_TAGS)&&(R===ce&&(R=Rw(R)),$(R,e.ADD_TAGS,tt))),jw(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?me.attributeCheck=e.ADD_ATTR:bw(e.ADD_ATTR)&&(le===ue&&(le=Rw(le)),$(le,e.ADD_ATTR,tt))),jw(e,`ADD_URI_SAFE_ATTR`)&&bw(e.ADD_URI_SAFE_ATTR)&&$(ze,e.ADD_URI_SAFE_ATTR,tt),jw(e,`FORBID_CONTENTS`)&&bw(e.FORBID_CONTENTS)&&(Fe===Ie&&(Fe=Rw(Fe)),$(Fe,e.FORBID_CONTENTS,tt)),jw(e,`ADD_FORBID_CONTENTS`)&&bw(e.ADD_FORBID_CONTENTS)&&(Fe===Ie&&(Fe=Rw(Fe)),$(Fe,e.ADD_FORBID_CONTENTS,tt)),Me&&(R[`#text`]=!0),xe&&$(R,[`html`,`head`,`body`]),R.table&&($(R,[`tbody`]),delete fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Pw(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Pw(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));lw&&lw(e),nt=e},ot=$({},[...Uw,...Ww,...Gw]),st=$({},[...Kw,...qw]),ct=function(e,t,n){return t.namespaceURI===Ue?e===`svg`:t.namespaceURI===Ve?e===`svg`&&(n===`annotation-xml`||Ye[n]):!!ot[e]},lt=function(e,t,n){return t.namespaceURI===Ue?e===`math`:t.namespaceURI===He?e===`math`&&Ze[n]:!!st[e]},ut=function(e,t,n){return t.namespaceURI===He&&!Ze[n]||t.namespaceURI===Ve&&!Ye[n]?!1:!st[e]&&(Qe[e]||!ot[e])},dt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:We,tagName:`template`});let n=xw(e.tagName),r=xw(t.tagName);return Ke[e.namespaceURI]?e.namespaceURI===He?ct(n,t,r):e.namespaceURI===Ve?lt(n,t,r):e.namespaceURI===Ue?ut(n,t,r):!!($e===`application/xhtml+xml`&&Ke[e.namespaceURI]):!1},ft=function(e){vw(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw Pw(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},pt=function(e){gt(e);let t=h(e);if(t){let e=[];hw(t,t=>{vw(e,t)}),hw(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},mt=function(e,n){try{vw(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{vw(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Ee||De)try{ft(n)}catch{}else try{n.setAttribute(e,``)}catch{}},ht=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||le[tt(i)]))try{e.removeAttribute(i)}catch{}}},gt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===pT.element&&ht(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},_t=function(e){if(!be)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===pT.processingInstruction||n===pT.comment&&Nw(uT,e.data)){try{p(e)}catch{}continue}if(n===pT.element){let t=e,n=tt(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},vt=function(e){let t=null,r=null;if(Te)e=`<remove></remove>`+e;else{let t=Cw(e,/^[\r\n\t ]+/);r=t&&t[0]}$e===`application/xhtml+xml`&&We===Ue&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(We===Ue)try{t=new l().parseFromString(i,$e)}catch{}if(!t||!t.documentElement){t=j.createDocument(We,`template`,null);try{t.documentElement.innerHTML=Ge?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),We===Ue?N.call(t,xe?`html`:`body`)[0]:xe?t.documentElement:a},yt=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bt=function(e){return e=ww(e,I,` `),e=ww(e,te,` `),e=ww(e,ne,` `),e},xt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=bt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&hw(r,e=>{Ct(e.content)&&xt(e.content)})},St=function(e){let t=b?b(e):null;return typeof t!=`string`||tt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Ct=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===pT.documentFragment}catch{return!1}},wt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Tt(e,n,r){e.length!==0&&hw(e,e=>{e.call(t,n,r,nt)})}let Et=function(e,t){return!!(be&&e.hasChildNodes()&&!wt(e.firstElementChild)&&Nw(lT,e.textContent)&&Nw(lT,e.innerHTML)||be&&e.namespaceURI===Ue&&t===`style`&&wt(e.firstElementChild)||e.nodeType===pT.processingInstruction||be&&e.nodeType===pT.comment&&Nw(uT,e.data))},Dt=function(e,t){if(!fe[t]&&jt(t)&&(de.tagNameCheck instanceof RegExp&&Nw(de.tagNameCheck,t)||de.tagNameCheck instanceof Function&&de.tagNameCheck(t)))return!1;if(Me&&!Fe[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Ne?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return ft(e),!0},Ot=function(e,n){if(Tt(F.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(St(e))return ft(e),!0;let r=tt(b?b(e):e.nodeName);if(Tt(F.uponSanitizeElement,e,{tagName:r,allowedTags:R}),e!==n&&g(e)===null)return!0;if(Et(e,r))return ft(e),!0;if(fe[r]||!(me.tagCheck instanceof Function&&me.tagCheck(r))&&!R[r]){let t=Dt(e,r);return t===!1&&Tt(F.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===pT.element&&!dt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Nw(dT,e.innerHTML))return ft(e),!0;if(ye&&e.nodeType===pT.text){let n=bt(e.textContent);e.textContent!==n&&(vw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Tt(F.afterSanitizeElements,e,null),!1},kt=function(e,t,r){if(pe[t]||be&&t===`patchsrc`||be&&t===`for`&&e!==`label`&&e!==`output`||ke&&(t===`id`||t===`name`)&&(r in n||r in rt))return!1;let i=le[t]||me.attributeCheck instanceof Function&&me.attributeCheck(t,e);if(!(ge&&Nw(re,t))&&!(he&&Nw(ie,t))){if(!i){if(!(jt(e)&&(de.tagNameCheck instanceof RegExp&&Nw(de.tagNameCheck,e)||de.tagNameCheck instanceof Function&&de.tagNameCheck(e))&&(de.attributeNameCheck instanceof RegExp&&Nw(de.attributeNameCheck,t)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(t,e))||t===`is`&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&Nw(de.tagNameCheck,r)||de.tagNameCheck instanceof Function&&de.tagNameCheck(r))))return!1}else if(!ze[t]&&!Nw(se,ww(r,L,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Tw(r,`data:`)===0&&Le[e])&&!(_e&&!Nw(ae,ww(r,L,``)))&&r)return!1}return!0},At=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),jt=function(e){return!At[xw(e)]&&Nw(oe,e)},Mt=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},Nt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),St(e)?ft(e):_w(t.removed)}catch{mt(n,e)}},Pt=function(e){Tt(F.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||St(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0},r=t.length,i=tt(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=tt(o),u=c,d=o===`value`?u:Ew(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Tt(F.uponSanitizeAttribute,e,n),d=n.attrValue,Ae&&(l===`id`||l===`name`)&&Tw(d,je)!==0&&(mt(o,e),d=je+d),be&&Nw(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){mt(o,e);continue}if(l===`attributename`&&Cw(d,`href`)){mt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){mt(o,e);continue}if(!ve&&Nw(fT,d)){mt(o,e);continue}if(ye&&(d=bt(d)),!kt(i,l,d)){mt(o,e);continue}d=Mt(i,l,s,d),d!==u&&Nt(e,o,s,d)}}Tt(F.afterSanitizeAttributes,e,null)},Ft=function(e){let t=null,n=yt(e);for(Tt(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Tt(F.uponSanitizeShadowNode,t,null),Ot(t,e),Pt(t),Ct(t.content)&&Ft(t.content),(y?y(t):t.nodeType)===pT.element){let e=_(t);Ct(e)&&(It(e),Ft(e))}Tt(F.afterSanitizeShadowDOM,e,null)},It=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ft(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===pT.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&tt(e)===`template`){let e=n.content;Ct(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Ct(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ge=!e,Ge&&(e=`<!-->`),typeof e!=`string`&&!wt(e)&&(e=zw(e),typeof e!=`string`))throw Pw(`dirty is not a string, aborting`);if(!t.isSupported)return e;Se?(R=Ce,le=we):at(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(R=Rw(R)),F.uponSanitizeAttribute.length>0&&(le=Rw(le)),t.removed=[];let c=Ne&&typeof e!=`string`&&wt(e);if(c){_t(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=tt(t);if(!R[n]||fe[n])throw pt(e),Pw(`root node is forbidden and cannot be sanitized in-place`)}if(St(e))throw pt(e),Pw(`root node is clobbered and cannot be sanitized in-place`);try{It(e)}catch(t){throw pt(e),t}}else if(wt(e))i=vt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===pT.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),It(a);else{if(!Ee&&!ye&&!xe&&e.indexOf(`<`)===-1)return x&&Oe?D(e):e;if(i=vt(e),!i)return Ee?null:Oe?S:``}i&&Te&&ft(i.firstChild);let l=c?e:i,u=yt(l);try{for(;o=u.nextNode();)Ot(o,l),Pt(o),Ct(o.content)&&Ft(o.content)}catch(n){throw c&&(pt(e),hw(t.removed,e=>{e.element&>(e.element)})),n}if(c)return hw(t.removed,e=>{e.element&>(e.element)}),ye&&xt(e),e;if(Ee){if(ye&&xt(i),De)for(s=ee.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(le.shadowroot||le.shadowrootmode)&&(s=P.call(r,s,!0)),s}let d=xe?i.outerHTML:i.innerHTML;return xe&&R[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Nw(sT,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
69
|
-
`+d),ye&&(d=bt(d)),x&&Oe?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at(e),Se=!0,Ce=R,we=le},t.clearConfig=function(){nt=null,Se=!1,Ce=null,we=null,x=C,S=``},t.isValidAttribute=function(e,t,n){nt||at({});let r=tt(e),i=tt(t);return kt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&
|
|
70
|
-
`]}),(0,z.jsx)(`span`,{dangerouslySetInnerHTML:{__html:
|
|
74
|
+
`,1;if(I>1e5&&I>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return N+=a,a.length}let D=ee(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=we(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let N=``,P=0,F=0,I=0,te=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){I++,te?te=!1:A.matcher.considerAll(),A.matcher.lastIndex=F;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(F,e.index),e);F=e.index+t}E(n.substring(F))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:P,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:ke(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:F,context:n.slice(F-100,F+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:ke(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(ee).filter(P).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(ee(e.language).supersetOf===t.language)return 1;if(ee(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ne(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Oe(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ne(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ae(l,e)}let E=()=>{k(),_e(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),_e(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function ee(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function N(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function P(e){let t=ee(e);return t&&!t.disableAutodetect}function F(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function I(e){F(e),a.push(e)}function te(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ne(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ie(e){return _e(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),_e(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ie,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:ee,registerAliases:N,autoDetection:P,inherit:Ae,addPlugin:I,removePlugin:te}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=De,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in re)typeof re[e]==`object`&&n(re[e]);return Object.assign(e,re),e},Pe=Ne({});Pe.newInstance=()=>Ne({}),t.exports=Pe,Pe.HighlightJS=Pe,Pe.default=Pe}))()).default,jC=`[A-Za-z$_][0-9A-Za-z$_]*`,MC=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),NC=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],PC=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),FC=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],IC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],LC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],RC=[].concat(IC,PC,FC);function zC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=jC,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:jC,keyword:MC,literal:NC,built_in:RC,"variable.language":LC},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...PC,...FC]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...IC,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function BC(e){let t=e.regex,n=zC(e),r=jC,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:jC,keyword:MC.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:NC,built_in:RC.concat(i),"variable.language":LC},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}var VC=`[A-Za-z$_][0-9A-Za-z$_]*`,HC=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),UC=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],WC=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),GC=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],KC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],qC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],JC=[].concat(KC,WC,GC);function YC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=VC,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:VC,keyword:HC,literal:UC,built_in:JC,"variable.language":qC},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...WC,...GC]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...KC,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function XC(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function ZC(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function QC(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function $C(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function ew(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function tw(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var nw=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),rw=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),iw=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),aw=[...rw,...iw],ow=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),sw=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),cw=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),lw=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function uw(e){let t=e.regex,n=nw(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+sw.join(`|`)+`)`},{begin:`:(:)?(`+cw.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+lw.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:ow.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+aw.join(`|`)+`)\\b`}]}}function dw(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function fw(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}function pw(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function mw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hw(e){if(Array.isArray(e))return e}function gw(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function _w(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
75
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vw(e,t){return hw(e)||gw(e,t)||yw(e,t)||_w()}function yw(e,t){if(e){if(typeof e==`string`)return mw(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mw(e,t):void 0}}var bw=Object.entries,xw=Object.setPrototypeOf,Sw=Object.isFrozen,Cw=Object.getPrototypeOf,ww=Object.getOwnPropertyDescriptor,Tw=Object.freeze,Ew=Object.seal,Dw=Object.create,Ow=typeof Reflect<`u`&&Reflect,kw=Ow.apply,Aw=Ow.construct;Tw||=function(e){return e},Ew||=function(e){return e},kw||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Aw||=function(e){return new e(...[...arguments].slice(1))};var jw=Zw(Array.prototype.forEach),Mw=Zw(Array.prototype.lastIndexOf),Nw=Zw(Array.prototype.pop),Pw=Zw(Array.prototype.push),Fw=Zw(Array.prototype.splice),Iw=Array.isArray,Lw=Zw(String.prototype.toLowerCase),Rw=Zw(String.prototype.toString),zw=Zw(String.prototype.match),Bw=Zw(String.prototype.replace),Vw=Zw(String.prototype.indexOf),Hw=Zw(String.prototype.trim),Uw=Zw(Number.prototype.toString),Ww=Zw(Boolean.prototype.toString),Gw=typeof BigInt>`u`?null:Zw(BigInt.prototype.toString),Kw=typeof Symbol>`u`?null:Zw(Symbol.prototype.toString),qw=Zw(Object.prototype.hasOwnProperty),Jw=Zw(Object.prototype.toString),Yw=Zw(RegExp.prototype.test),Xw=Qw(TypeError);function Zw(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return kw(e,t,n)}}function Qw(e){return function(){return Aw(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lw;if(xw&&xw(e,null),!Iw(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Sw(t)||(t[r]=e),i=e)}e[i]=!0}return e}function $w(e){for(let t=0;t<e.length;t++)qw(e,t)||(e[t]=null);return e}function eT(e){let t=Dw(null);for(let r of bw(e)){var n=vw(r,2);let i=n[0],a=n[1];qw(e,i)&&(Iw(a)?t[i]=$w(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=eT(a):t[i]=a)}return t}function tT(e){switch(typeof e){case`string`:return e;case`number`:return Uw(e);case`boolean`:return Ww(e);case`bigint`:return Gw?Gw(e):`0`;case`symbol`:return Kw?Kw(e):`Symbol()`;case`undefined`:return Jw(e);case`function`:case`object`:{if(e===null)return Jw(e);let t=e,n=nT(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Jw(e)}return Jw(e)}default:return Jw(e)}}function nT(e,t){for(;e!==null;){let n=ww(e,t);if(n){if(n.get)return Zw(n.get);if(typeof n.value==`function`)return Zw(n.value)}e=Cw(e)}function n(){return null}return n}function rT(e){try{return Yw(e,``),!0}catch{return!1}}var iT=Tw(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),aT=Tw(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),oT=Tw([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),sT=Tw([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),cT=Tw(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),lT=Tw([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),uT=Tw([`#text`]),dT=Tw(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),fT=Tw(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),pT=Tw(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),mT=Tw([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),hT=Ew(/{{[\w\W]*|^[\w\W]*}}/g),gT=Ew(/<%[\w\W]*|^[\w\W]*%>/g),_T=Ew(/\${[\w\W]*/g),vT=Ew(/^data-[\-\w.\u00B7-\uFFFF]+$/),yT=Ew(/^aria-[\-\w]+$/),bT=Ew(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xT=Ew(/^(?:\w+script|data):/i),ST=Ew(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),CT=Ew(/^html$/i),wT=Ew(/^[a-z][.\w]*(-[.\w]+)+$/i),TT=Ew(/<[/\w!]/g),ET=Ew(/<[/\w]/g),DT=Ew(/<\/no(script|embed|frames)/i),OT=Ew(/\/>/i),kT={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},AT=function(){return typeof window>`u`?null:window},jT=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},MT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},NT=function(e,t,n,r){return qw(e,t)&&Iw(e[t])?$(r.base?eT(r.base):{},e[t],r.transform):n};function PT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:AT(),t=e=>PT(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==kT.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=nT(d,`cloneNode`),p=nT(d,`remove`),m=nT(d,`nextSibling`),h=nT(d,`childNodes`),g=nT(d,`parentNode`),_=nT(d,`shadowRoot`),v=nT(d,`attributes`),y=o&&o.prototype?nT(o.prototype,`nodeType`):null,b=o&&o.prototype?nT(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw Xw(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=jT(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,ee=A.createDocumentFragment,N=A.getElementsByTagName,P=r.importNode,F=MT();t.isSupported=typeof bw==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let I=hT,te=gT,ne=_T,re=vT,ie=yT,ae=xT,L=ST,oe=wT,se=bT,R=null,ce=$({},[...iT,...aT,...oT,...cT,...uT]),le=null,ue=$({},[...dT,...fT,...pT,...mT]),de=Object.seal(Dw(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,pe=null,me=Object.seal(Dw(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),he=!0,ge=!0,_e=!1,ve=!0,ye=!1,be=!0,xe=!1,Se=!1,Ce=null,we=null,Te=!1,Ee=!1,De=!1,Oe=!1,ke=!0,Ae=!1,je=`user-content-`,Me=!0,Ne=!1,Pe={},Fe=null,Ie=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Le=null,Re=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ze=null,Be=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ve=`http://www.w3.org/1998/Math/MathML`,He=`http://www.w3.org/2000/svg`,Ue=`http://www.w3.org/1999/xhtml`,We=Ue,Ge=!1,Ke=null,qe=$({},[Ve,He,Ue],Rw),Je=Tw([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ye=$({},Je),Xe=Tw([`annotation-xml`]),Ze=$({},Xe),Qe=$({},[`title`,`style`,`font`,`a`,`script`]),$e=null,et=[`application/xhtml+xml`,`text/html`],tt=null,nt=null,rt=n.createElement(`form`),it=function(e){return e instanceof RegExp||e instanceof Function},at=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nt&&nt===e)return;(!e||typeof e!=`object`)&&(e={}),e=eT(e),$e=et.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,tt=$e===`application/xhtml+xml`?Rw:Lw,R=NT(e,`ALLOWED_TAGS`,ce,{transform:tt}),le=NT(e,`ALLOWED_ATTR`,ue,{transform:tt}),Ke=NT(e,`ALLOWED_NAMESPACES`,qe,{transform:Rw}),ze=NT(e,`ADD_URI_SAFE_ATTR`,Be,{transform:tt,base:Be}),Le=NT(e,`ADD_DATA_URI_TAGS`,Re,{transform:tt,base:Re}),Fe=NT(e,`FORBID_CONTENTS`,Ie,{transform:tt}),fe=NT(e,`FORBID_TAGS`,eT({}),{transform:tt}),pe=NT(e,`FORBID_ATTR`,eT({}),{transform:tt}),Pe=qw(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?eT(e.USE_PROFILES):e.USE_PROFILES:!1,he=e.ALLOW_ARIA_ATTR!==!1,ge=e.ALLOW_DATA_ATTR!==!1,_e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=e.SAFE_FOR_TEMPLATES||!1,be=e.SAFE_FOR_XML!==!1,xe=e.WHOLE_DOCUMENT||!1,Ee=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Oe=e.RETURN_TRUSTED_TYPE||!1,Te=e.FORCE_BODY||!1,ke=e.SANITIZE_DOM!==!1,Ae=e.SANITIZE_NAMED_PROPS||!1,Me=e.KEEP_CONTENT!==!1,Ne=e.IN_PLACE||!1,se=rT(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:bT,We=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ue,Ye=qw(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?eT(e.MATHML_TEXT_INTEGRATION_POINTS):$({},Je),Ze=qw(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?eT(e.HTML_INTEGRATION_POINTS):$({},Xe);let t=qw(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?eT(e.CUSTOM_ELEMENT_HANDLING):Dw(null);if(de=Dw(null),qw(t,`tagNameCheck`)&&it(t.tagNameCheck)&&(de.tagNameCheck=t.tagNameCheck),qw(t,`attributeNameCheck`)&&it(t.attributeNameCheck)&&(de.attributeNameCheck=t.attributeNameCheck),qw(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(de.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Ew(de),ye&&(ge=!1),De&&(Ee=!0),Pe&&(R=$({},uT),le=Dw(null),Pe.html===!0&&($(R,iT),$(le,dT)),Pe.svg===!0&&($(R,aT),$(le,fT),$(le,mT)),Pe.svgFilters===!0&&($(R,oT),$(le,fT),$(le,mT)),Pe.mathMl===!0&&($(R,cT),$(le,pT),$(le,mT))),me.tagCheck=null,me.attributeCheck=null,qw(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?me.tagCheck=e.ADD_TAGS:Iw(e.ADD_TAGS)&&(R===ce&&(R=eT(R)),$(R,e.ADD_TAGS,tt))),qw(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?me.attributeCheck=e.ADD_ATTR:Iw(e.ADD_ATTR)&&(le===ue&&(le=eT(le)),$(le,e.ADD_ATTR,tt))),qw(e,`ADD_URI_SAFE_ATTR`)&&Iw(e.ADD_URI_SAFE_ATTR)&&$(ze,e.ADD_URI_SAFE_ATTR,tt),qw(e,`FORBID_CONTENTS`)&&Iw(e.FORBID_CONTENTS)&&(Fe===Ie&&(Fe=eT(Fe)),$(Fe,e.FORBID_CONTENTS,tt)),qw(e,`ADD_FORBID_CONTENTS`)&&Iw(e.ADD_FORBID_CONTENTS)&&(Fe===Ie&&(Fe=eT(Fe)),$(Fe,e.ADD_FORBID_CONTENTS,tt)),Me&&(R[`#text`]=!0),xe&&$(R,[`html`,`head`,`body`]),R.table&&($(R,[`tbody`]),delete fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Xw(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Xw(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));Tw&&Tw(e),nt=e},ot=$({},[...aT,...oT,...sT]),st=$({},[...cT,...lT]),ct=function(e,t,n){return t.namespaceURI===Ue?e===`svg`:t.namespaceURI===Ve?e===`svg`&&(n===`annotation-xml`||Ye[n]):!!ot[e]},lt=function(e,t,n){return t.namespaceURI===Ue?e===`math`:t.namespaceURI===He?e===`math`&&Ze[n]:!!st[e]},ut=function(e,t,n){return t.namespaceURI===He&&!Ze[n]||t.namespaceURI===Ve&&!Ye[n]?!1:!st[e]&&(Qe[e]||!ot[e])},dt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:We,tagName:`template`});let n=Lw(e.tagName),r=Lw(t.tagName);return Ke[e.namespaceURI]?e.namespaceURI===He?ct(n,t,r):e.namespaceURI===Ve?lt(n,t,r):e.namespaceURI===Ue?ut(n,t,r):!!($e===`application/xhtml+xml`&&Ke[e.namespaceURI]):!1},ft=function(e){Pw(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw Xw(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},pt=function(e){gt(e);let t=h(e);if(t){let e=[];jw(t,t=>{Pw(e,t)}),jw(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},mt=function(e,n){try{Pw(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Pw(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Ee||De)try{ft(n)}catch{}else try{n.setAttribute(e,``)}catch{}},ht=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||le[tt(i)]))try{e.removeAttribute(i)}catch{}}},gt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===kT.element&&ht(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},_t=function(e){if(!be)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===kT.processingInstruction||n===kT.comment&&Yw(ET,e.data)){try{p(e)}catch{}continue}if(n===kT.element){let t=e,n=tt(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},vt=function(e){let t=null,r=null;if(Te)e=`<remove></remove>`+e;else{let t=zw(e,/^[\r\n\t ]+/);r=t&&t[0]}$e===`application/xhtml+xml`&&We===Ue&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(We===Ue)try{t=new l().parseFromString(i,$e)}catch{}if(!t||!t.documentElement){t=j.createDocument(We,`template`,null);try{t.documentElement.innerHTML=Ge?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),We===Ue?N.call(t,xe?`html`:`body`)[0]:xe?t.documentElement:a},yt=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bt=function(e){return e=Bw(e,I,` `),e=Bw(e,te,` `),e=Bw(e,ne,` `),e},xt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=bt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&jw(r,e=>{Ct(e.content)&&xt(e.content)})},St=function(e){let t=b?b(e):null;return typeof t!=`string`||tt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Ct=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===kT.documentFragment}catch{return!1}},wt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Tt(e,n,r){e.length!==0&&jw(e,e=>{e.call(t,n,r,nt)})}let Et=function(e,t){return!!(be&&e.hasChildNodes()&&!wt(e.firstElementChild)&&Yw(TT,e.textContent)&&Yw(TT,e.innerHTML)||be&&e.namespaceURI===Ue&&t===`style`&&wt(e.firstElementChild)||e.nodeType===kT.processingInstruction||be&&e.nodeType===kT.comment&&Yw(ET,e.data))},Dt=function(e,t){if(!fe[t]&&jt(t)&&(de.tagNameCheck instanceof RegExp&&Yw(de.tagNameCheck,t)||de.tagNameCheck instanceof Function&&de.tagNameCheck(t)))return!1;if(Me&&!Fe[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Ne?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return ft(e),!0},Ot=function(e,n){if(Tt(F.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(St(e))return ft(e),!0;let r=tt(b?b(e):e.nodeName);if(Tt(F.uponSanitizeElement,e,{tagName:r,allowedTags:R}),e!==n&&g(e)===null)return!0;if(Et(e,r))return ft(e),!0;if(fe[r]||!(me.tagCheck instanceof Function&&me.tagCheck(r))&&!R[r]){let t=Dt(e,r);return t===!1&&Tt(F.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===kT.element&&!dt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Yw(DT,e.innerHTML))return ft(e),!0;if(ye&&e.nodeType===kT.text){let n=bt(e.textContent);e.textContent!==n&&(Pw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Tt(F.afterSanitizeElements,e,null),!1},kt=function(e,t,r){if(pe[t]||be&&t===`patchsrc`||be&&t===`for`&&e!==`label`&&e!==`output`||ke&&(t===`id`||t===`name`)&&(r in n||r in rt))return!1;let i=le[t]||me.attributeCheck instanceof Function&&me.attributeCheck(t,e);if(!(ge&&Yw(re,t))&&!(he&&Yw(ie,t))){if(!i){if(!(jt(e)&&(de.tagNameCheck instanceof RegExp&&Yw(de.tagNameCheck,e)||de.tagNameCheck instanceof Function&&de.tagNameCheck(e))&&(de.attributeNameCheck instanceof RegExp&&Yw(de.attributeNameCheck,t)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(t,e))||t===`is`&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&Yw(de.tagNameCheck,r)||de.tagNameCheck instanceof Function&&de.tagNameCheck(r))))return!1}else if(!ze[t]&&!Yw(se,Bw(r,L,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Vw(r,`data:`)===0&&Le[e])&&!(_e&&!Yw(ae,Bw(r,L,``)))&&r)return!1}return!0},At=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),jt=function(e){return!At[Lw(e)]&&Yw(oe,e)},Mt=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},Nt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),St(e)?ft(e):Nw(t.removed)}catch{mt(n,e)}},Pt=function(e){Tt(F.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||St(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0},r=t.length,i=tt(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=tt(o),u=c,d=o===`value`?u:Hw(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Tt(F.uponSanitizeAttribute,e,n),d=n.attrValue,Ae&&(l===`id`||l===`name`)&&Vw(d,je)!==0&&(mt(o,e),d=je+d),be&&Yw(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){mt(o,e);continue}if(l===`attributename`&&zw(d,`href`)){mt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){mt(o,e);continue}if(!ve&&Yw(OT,d)){mt(o,e);continue}if(ye&&(d=bt(d)),!kt(i,l,d)){mt(o,e);continue}d=Mt(i,l,s,d),d!==u&&Nt(e,o,s,d)}}Tt(F.afterSanitizeAttributes,e,null)},Ft=function(e){let t=null,n=yt(e);for(Tt(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Tt(F.uponSanitizeShadowNode,t,null),Ot(t,e),Pt(t),Ct(t.content)&&Ft(t.content),(y?y(t):t.nodeType)===kT.element){let e=_(t);Ct(e)&&(It(e),Ft(e))}Tt(F.afterSanitizeShadowDOM,e,null)},It=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ft(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===kT.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&tt(e)===`template`){let e=n.content;Ct(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Ct(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ge=!e,Ge&&(e=`<!-->`),typeof e!=`string`&&!wt(e)&&(e=tT(e),typeof e!=`string`))throw Xw(`dirty is not a string, aborting`);if(!t.isSupported)return e;Se?(R=Ce,le=we):at(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(R=eT(R)),F.uponSanitizeAttribute.length>0&&(le=eT(le)),t.removed=[];let c=Ne&&typeof e!=`string`&&wt(e);if(c){_t(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=tt(t);if(!R[n]||fe[n])throw pt(e),Xw(`root node is forbidden and cannot be sanitized in-place`)}if(St(e))throw pt(e),Xw(`root node is clobbered and cannot be sanitized in-place`);try{It(e)}catch(t){throw pt(e),t}}else if(wt(e))i=vt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===kT.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),It(a);else{if(!Ee&&!ye&&!xe&&e.indexOf(`<`)===-1)return x&&Oe?D(e):e;if(i=vt(e),!i)return Ee?null:Oe?S:``}i&&Te&&ft(i.firstChild);let l=c?e:i,u=yt(l);try{for(;o=u.nextNode();)Ot(o,l),Pt(o),Ct(o.content)&&Ft(o.content)}catch(n){throw c&&(pt(e),jw(t.removed,e=>{e.element&>(e.element)})),n}if(c)return jw(t.removed,e=>{e.element&>(e.element)}),ye&&xt(e),e;if(Ee){if(ye&&xt(i),De)for(s=ee.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(le.shadowroot||le.shadowrootmode)&&(s=P.call(r,s,!0)),s}let d=xe?i.outerHTML:i.innerHTML;return xe&&R[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Yw(CT,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
76
|
+
`+d),ye&&(d=bt(d)),x&&Oe?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at(e),Se=!0,Ce=R,we=le},t.clearConfig=function(){nt=null,Se=!1,Ce=null,we=null,x=C,S=``},t.isValidAttribute=function(e,t,n){nt||at({});let r=tt(e),i=tt(t);return kt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&qw(F,e)&&Pw(F[e],t)},t.removeHook=function(e,t){if(qw(F,e)){if(t!==void 0){let n=Mw(F[e],t);return n===-1?void 0:Fw(F[e],n,1)[0]}return Nw(F[e])}},t.removeHooks=function(e){qw(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=MT()},t}var FT=PT(),IT=null;function LT(){return IT||(IT=FT(globalThis.window??globalThis),IT.addHook(`afterSanitizeAttributes`,e=>{let t=e;t.tagName===`A`&&t.getAttribute?.(`target`)&&t.setAttribute(`rel`,`noopener noreferrer`)}),IT)}function RT(e){return LT().sanitize(e,{FORBID_TAGS:[`style`,`form`,`input`,`button`,`textarea`,`object`,`embed`],FORBID_ATTR:[`style`],ALLOW_DATA_ATTR:!1,USE_PROFILES:{html:!0},ADD_DATA_URI_TAGS:[`img`]})}function zT(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}var BT=!1;function VT(){BT||(BT=!0,AC.registerLanguage(`typescript`,BC),AC.registerLanguage(`javascript`,YC),AC.registerLanguage(`json`,XC),AC.registerLanguage(`bash`,ZC),AC.registerLanguage(`shell`,QC),AC.registerLanguage(`python`,$C),AC.registerLanguage(`diff`,ew),AC.registerLanguage(`xml`,tw),AC.registerLanguage(`css`,uw),AC.registerLanguage(`markdown`,dw),AC.registerLanguage(`yaml`,fw),AC.registerLanguage(`plaintext`,pw),AC.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),AC.registerAliases([`js`,`jsx`,`mjs`,`cjs`],{languageName:`javascript`}),AC.registerAliases([`sh`,`zsh`,`console`],{languageName:`bash`}),AC.registerAliases([`py`],{languageName:`python`}),AC.registerAliases([`html`,`xhtml`,`svg`],{languageName:`xml`}),AC.registerAliases([`yml`],{languageName:`yaml`}),AC.registerAliases([`md`],{languageName:`markdown`}),AC.registerAliases([`text`,`txt`],{languageName:`plaintext`}))}function HT(e,t){if(VT(),t&&AC.getLanguage(t))try{return AC.highlight(e,{language:t,ignoreIllegals:!0}).value}catch{}return UT.utils.escapeHtml(e)}var UT=new kC({html:!1,linkify:!0,breaks:!1,highlight(e,t){let n=HT(e,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return`<pre class="hljs"><code class="${UT.utils.escapeHtml(r)}">${n}</code></pre>`}});function WT(e){return VT(),RT(UT.render(e??``))}function GT(e,t){VT();let n=HT(e??``,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return RT(`<pre class="hljs"><code class="${UT.utils.escapeHtml(r)}">${n}</code></pre>`)}var KT=`crtr:transcript-detail`,qT=[`focused`,`standard`,`verbose`];function JT(){try{let e=localStorage.getItem(KT);if(e===`focused`||e===`standard`||e===`verbose`)return e}catch{}return`standard`}var YT=JT(),XT=new Set;function ZT(){for(let e of XT)e()}function QT(e){if(e!==YT){YT=e;try{localStorage.setItem(KT,e)}catch{}ZT()}}function $T(){QT(qT[(qT.indexOf(YT)+1)%qT.length])}function eE(e){return XT.add(e),()=>{XT.delete(e)}}typeof window<`u`&&window.addEventListener(`storage`,e=>{if(e.key!==KT)return;let t=JT();t!==YT&&(YT=t,ZT())});function tE(){return(0,v.useSyncExternalStore)(eE,()=>YT,()=>YT)}var nE=[`[&_pre]:overflow-auto [&_pre]:p-[12px_14px] [&_pre]:rounded-none [&_pre]:border [&_pre]:border-[var(--line)] [&_pre]:bg-[var(--panel2)]`,`[&_pre_code]:text-[var(--ink2)]`,`[&_code]:font-mono [&_code]:text-xs`,`[&_:not(pre)>code]:bg-[var(--panel2)] [&_:not(pre)>code]:text-[var(--ink2)] [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded-none`,`[&_a]:text-[var(--bone)] [&_a]:underline [&_a]:decoration-dotted`].join(` `),rE={focused:`leading-relaxed`,standard:`leading-relaxed`,verbose:`leading-relaxed`};function iE({text:e,inProgress:t}){let n=(0,v.useMemo)(()=>t?``:WT(e??``),[t,e]),r=rE[tE()];return(0,z.jsx)(`div`,{className:J(`prose`,r),children:t?(0,z.jsx)(`div`,{className:`whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:zT(e??``)}}):(0,z.jsx)(`div`,{className:J(nE,r),dangerouslySetInnerHTML:{__html:n}})})}function aE({thinking:e,inProgress:t}){let n=tE(),[r,i]=(0,v.useState)(!1),a=t||r||n===`verbose`,o=n===`focused`?`Thought`:`Thinking`;return(0,z.jsxs)(`div`,{className:J(`thinking`,a&&`open`),children:[(0,z.jsxs)(`div`,{className:`think-toggle`,onClick:()=>i(e=>!e),children:[o,t?`…`:``]}),(0,z.jsx)(`div`,{className:`think-body whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:zT(e)}})]})}var oE=new Set([`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`,`image/svg+xml`,`image/avif`,`image/bmp`]);function sE({image:e}){let t=(e.mimeType||``).toLowerCase();return(0,z.jsx)(`img`,{className:`block max-w-[min(100%,520px)] max-h-[26rem] rounded-md my-1.5 object-contain`,src:`data:${oE.has(t)?t:`image/png`};base64,${e.data??``}`,alt:`image content`,loading:`lazy`,decoding:`async`})}var cE=new Set(`.md,.txt,.json,.ts,.tsx,.js,.mjs,.cjs,.css,.html,.htm,.yaml,.yml,.toml,.log,.sh,.py,.rb,.go,.rs,.java,.c,.cpp,.h,.env,.gitignore`.split(`,`));function lE(e){if(!e.startsWith(`/`))return!1;let t=e.split(`/`).filter(Boolean);if(t.length<2)return!1;let n=t[t.length-1],r=n.lastIndexOf(`.`);if(r<1)return!1;let i=n.slice(r).toLowerCase();return cE.has(i)}function uE(e){let t=/\/[a-zA-Z0-9_.\-/]+\.[a-zA-Z0-9]+/g,n=[],r;for(;(r=t.exec(e))!==null;)lE(r[0])&&n.push(r[0]);return[...new Set(n)]}var dE=(0,v.createContext)({peekedPath:null,onPeek:()=>{}});function fE(){return(0,v.useContext)(dE)}var pE=`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-muted [&_code]:font-mono [&_code]:text-xs [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_p]:my-[0.4em] [&_a]:text-primary`,mE=`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,hE=`px-3 py-2 opacity-50 text-xs italic`,gE={bash:`❯`,shell:`❯`,sh:`❯`,run:`❯`,terminal:`❯`,read:`≣`,read_file:`≣`,cat:`≣`,view:`≣`,edit:`✎`,str_replace:`✎`,apply_patch:`✎`,write:`✚`,write_file:`✚`,create:`✚`,grep:`⌕`,search:`⌕`,rg:`⌕`,web_search:`◎`,websearch:`◎`,web:`◎`,fetch:`⤓`,curl:`⤓`,http:`⤓`};function _E(e){return gE[(e||``).toLowerCase()]??`◆`}var vE={bash:`bash`,shell:`bash`,sh:`bash`,run:`bash`,terminal:`bash`,read:`read`,read_file:`read`,cat:`read`,view:`read`,grep:`read`,search:`read`,rg:`read`,edit:`write`,str_replace:`write`,apply_patch:`write`,write:`write`,write_file:`write`,create:`write`,web_search:`web`,websearch:`web`,web:`web`,fetch:`web`,curl:`web`,http:`web`};function yE(e){return vE[(e||``).toLowerCase()]??`other`}function bE(e){return e?e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``):``}function xE(e){return e?e.content.filter(e=>e.type===`image`):[]}function SE(e){if(!e||Object.keys(e).length===0)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function CE(e){let t=e.arguments??{},n=e=>typeof t[e]==`string`?t[e]:void 0;return n(`command`)??n(`cmd`)??n(`path`)??n(`file_path`)??n(`filename`)??n(`pattern`)??n(`query`)??``}function wE({call:e,subtitle:t,inProgress:n,isError:r,children:i}){let a=t??CE(e),o=e.name,s=tE(),{peekedPath:c,onPeek:l}=fE(),u=s===`verbose`||s===`standard`&&n,[d,f]=(0,v.useState)(null),p=d??u;return(0,z.jsxs)(`div`,{className:J(`tool`,p&&`open`,r&&`tool-error`),"data-fam":yE(e.name),children:[(0,z.jsxs)(`div`,{className:`tool-head`,onClick:()=>f(!p),children:[(0,z.jsx)(`span`,{className:`tool-glyph`,children:_E(e.name)}),(0,z.jsx)(`span`,{className:`tool-name`,children:o}),a&&(0,z.jsx)(`span`,{className:`tool-arg`,children:lE(a)?(0,z.jsx)(`span`,{className:J(`filelink`,c===a&&`peeked`),onClick:e=>{e.stopPropagation(),l(a)},children:a}):a}),(0,z.jsx)(`span`,{className:`ml-auto shrink-0 flex items-center`,children:(0,z.jsx)(`span`,{className:J(`dot`,n?`active`:r?`error`:`done`),title:n?`running`:r?`error`:`done`,"aria-label":n?`running`:r?`error`:`done`})}),(0,z.jsx)(jf,{className:J(`size-3.5 text-[var(--dim)] transition-transform`,!p&&`-rotate-90`)})]}),(0,z.jsx)(`div`,{className:`tool-body`,children:i})]})}function TE({result:e}){let t=xE(e);return t.length===0?null:(0,z.jsx)(z.Fragment,{children:t.map((e,t)=>(0,z.jsx)(`div`,{className:`px-3 py-1`,children:(0,z.jsx)(sE,{image:e})},t))})}function EE(e){let t=e.command??e.cmd??e.script;return typeof t==`string`?t:``}function DE(e){let t=EE(e.call.arguments??{}),n=bE(e.result),r=e.inProgress,i=e.isError;return(0,z.jsxs)(wE,{call:e.call,subtitle:``,inProgress:r,isError:i,children:[(0,z.jsxs)(`pre`,{className:J(mE,i&&`text-[#ff9b8a]`),children:[t&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{style:{opacity:.6},children:`$ `}),(0,z.jsx)(`span`,{dangerouslySetInnerHTML:{__html:zT(t)}}),`
|
|
77
|
+
`]}),(0,z.jsx)(`span`,{dangerouslySetInnerHTML:{__html:zT(n)}}),r&&(0,z.jsx)(`span`,{className:`inline-block size-2 rounded-full bg-[#7fb3ff] ml-1.5 animate-pulse`})]}),(0,z.jsx)(TE,{result:e.result})]})}var OE={ts:`ts`,tsx:`tsx`,js:`js`,jsx:`jsx`,mjs:`js`,cjs:`js`,json:`json`,sh:`bash`,bash:`bash`,zsh:`bash`,py:`python`,diff:`diff`,patch:`diff`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,css:`css`,scss:`css`,md:`markdown`,markdown:`markdown`,yml:`yaml`,yaml:`yaml`};function kE(e){let t=/\.([a-z0-9]+)$/i.exec(e||``);return t&&OE[t[1].toLowerCase()]||``}function AE(e){let t=CE(e.call),n=bE(e.result),r=n?GT(n,kE(t)):``,i=e.inProgress;return(0,z.jsxs)(wE,{call:e.call,inProgress:i,isError:e.isError,children:[n?(0,z.jsx)(`div`,{className:pE,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:r}}):!i&&(0,z.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no content`}),(0,z.jsx)(TE,{result:e.result})]})}var jE=1e6;function ME(e,t){let n=(e??``).split(`
|
|
71
78
|
`),r=(t??``).split(`
|
|
72
|
-
`),i=n.length,a=r.length;if((i+1)*(a+1)>
|
|
73
|
-
`).filter(e=>e.length>0):[],i=e.inProgress;return(0,z.jsxs)(cE,{call:e.call,subtitle:t,inProgress:i,isError:e.isError,children:[r.length>0?(0,z.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:r.map((e,t)=>(0,z.jsx)(`div`,{className:`px-3 py-1 font-mono text-xs opacity-85`,dangerouslySetInnerHTML:{__html:CT(e)}},t))}):!i&&(0,z.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no matches`}),(0,z.jsx)(lE,{result:e.result})]})}function wE(e){let t=oE(e.call.arguments),n=iE(e.result),r=e.isError,i=e.inProgress;return(0,z.jsxs)(cE,{call:e.call,inProgress:i,isError:r,children:[t&&(0,z.jsx)(`pre`,{className:`m-0 px-3 py-2 bg-[#11161c] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-60 border-b border-[#222b35]`,children:t}),n&&(0,z.jsx)(`div`,{className:J(`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-muted [&_code]:font-mono [&_code]:text-xs [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_p]:my-[0.4em] [&_a]:text-primary`,r&&`text-[#ff9b8a]`),style:{padding:`8px 11px`},dangerouslySetInnerHTML:{__html:OT(n)}}),(0,z.jsx)(lE,{result:e.result}),!t&&!n&&!i&&(0,z.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no output`})]})}var TE={bash:dE,shell:dE,sh:dE,run:dE,terminal:dE,read:mE,read_file:mE,cat:mE,view:mE,edit:vE,str_replace:vE,apply_patch:vE,write:xE,write_file:xE,create:xE,grep:CE,search:CE,rg:CE};function EE(e){return TE[(e||``).toLowerCase()]??wE}Object.keys(TE);function DE({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.role,o=Dg(e);return o!==null&&(a!==`custom`||e.display===!0)?(0,z.jsx)(kE,{presentation:o}):a===`user`?e.origin===`inbox`?(0,z.jsx)(RE,{message:e}):(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)(NE,{message:e})}):a===`assistant`?(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)(PE,{message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i})}):a===`toolResult`?(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)(LE,{message:e})}):a===`bashExecution`?(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)(jE,{message:e})}):a===`custom`&&e.customType===OE?(0,z.jsx)(AE,{message:e}):null}var OE=`crtr-cycle-divider`;function kE({presentation:e}){let t=zT(),[n,r]=(0,v.useState)(null),i=n??t===`verbose`;return(0,z.jsx)(`div`,{className:`text-xs ${i?`pb-2`:``}`,children:i?(0,z.jsx)(`button`,{type:`button`,className:`user block w-full text-left`,"aria-expanded":`true`,onClick:()=>r(!1),children:(0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:e.body})}):(0,z.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 text-left`,"aria-expanded":`false`,onClick:()=>r(!0),children:[(0,z.jsxs)(`span`,{className:`shrink-0 font-mono font-semibold text-[var(--bone)]`,children:[`[`,e.label,`]`]}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[var(--dim)]`,children:e.summary}),(0,z.jsx)(jf,{className:`size-3.5 shrink-0 -rotate-90 text-[var(--dim)] transition-transform`})]})})}function AE({message:e}){let t=typeof e.content==`string`?e.content:`yielded — new cycle begins`;return(0,z.jsxs)(`div`,{className:`flex items-center gap-3 my-1`,style:{opacity:.55},children:[(0,z.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}}),(0,z.jsx)(`span`,{className:`text-xs text-[var(--dim)] whitespace-nowrap`,children:t}),(0,z.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}})]})}function jE({message:e}){let t=e.excludeFromContext?`!!`:`!`,n=e.exitCode===void 0&&!e.cancelled;return(0,z.jsxs)(`div`,{className:`font-mono text-xs rounded border border-[var(--border,#333)] overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`px-2 py-1 bg-[var(--surface-raised,#1a1a1a)] flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`opacity-60 select-none`,children:t}),(0,z.jsx)(`span`,{className:`whitespace-pre-wrap break-all`,children:e.command}),n&&(0,z.jsx)(`span`,{className:`ml-auto opacity-50`,children:`running…`}),e.cancelled&&(0,z.jsx)(`span`,{className:`ml-auto opacity-70`,children:`cancelled`}),!n&&!e.cancelled&&e.exitCode!==0&&(0,z.jsxs)(`span`,{className:`ml-auto opacity-70`,children:[`exit `,e.exitCode]})]}),e.output!==``&&(0,z.jsx)(`pre`,{className:`px-2 py-1 whitespace-pre-wrap break-all m-0`,children:e.output}),e.truncated&&(0,z.jsx)(`div`,{className:`px-2 py-1 opacity-50`,children:`output truncated`})]})}function ME({text:e}){return(0,z.jsxs)(`div`,{className:`queued`,children:[(0,z.jsxs)(`div`,{className:`tag`,children:[(0,z.jsx)(`span`,{className:`select-none`,children:`⋯`}),(0,z.jsx)(`span`,{children:`queued`})]}),(0,z.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e})]})}function NE({message:e}){let t=e.content;return(0,z.jsx)(`div`,{className:`user`,children:typeof t==`string`?(0,z.jsx)(`div`,{className:`whitespace-pre-wrap`,children:t}):t.map((e,t)=>e.type===`text`?(0,z.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text},t):e.type===`image`?(0,z.jsx)(GT,{image:e},t):null)})}function PE({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.content,o=e=>t&&n&&e===a.length-1,s=a.some(e=>e.type===`toolCall`),c=e.stopReason,l=!s&&(c===`error`||c===`aborted`);return(0,z.jsxs)(z.Fragment,{children:[a.map((e,t)=>e.type===`text`?(0,z.jsx)(HT,{text:e.text,inProgress:o(t)},t):e.type===`thinking`?(0,z.jsx)(UT,{thinking:e.thinking,inProgress:o(t)},t):e.type===`toolCall`?(0,z.jsx)(IE,{call:e,streaming:n,resultFor:r,executingToolIds:i},t):null),l&&(0,z.jsx)(FE,{stopReason:c,errorMessage:e.errorMessage})]})}function FE({stopReason:e,errorMessage:t}){let n=e===`aborted`?t&&t!==`Request was aborted`?t:`Operation aborted`:`Error: ${t||`Unknown error`}`;return(0,z.jsxs)(`div`,{className:`msg-error`,children:[(0,z.jsx)(`span`,{className:`ic`,"aria-hidden":`true`,children:`⚠`}),(0,z.jsx)(`span`,{className:`txt`,children:n})]})}function IE({call:e,streaming:t,resultFor:n,executingToolIds:r}){let i=EE(e.name),a=n(e.id);return(0,z.jsx)(i,{call:e,result:a,inProgress:t&&r.has(e.id),isError:a?.isError??!1})}function LE({message:e}){return(0,z.jsx)(EE(e.toolName),{call:{type:`toolCall`,id:e.toolCallId,name:e.toolName,arguments:{}},result:e,inProgress:!1,isError:e.isError})}function RE({message:e}){let{onPeek:t,peekedPath:n}=XT(),r=typeof e.content==`string`?e.content:e.content.filter(e=>e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``),i=Tg(r),a=JT(r);function o(e){if(a.length===0)return(0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:e});let r=[],i=e,o=0;for(let e of a){let a=i.indexOf(e);if(a===-1)continue;a>0&&r.push((0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i.slice(0,a)},o++));let s=n===e;r.push((0,z.jsx)(`span`,{onClick:n=>{n.stopPropagation(),t(e)},className:[`filelink text-xs`,s&&`peeked`].filter(Boolean).join(` `),children:e},o++)),i=i.slice(a+e.length)}return i&&r.push((0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i},o++)),(0,z.jsx)(z.Fragment,{children:r})}return(0,z.jsxs)(`div`,{className:`inbound`,children:[(0,z.jsx)(`span`,{className:`ic select-none`,children:`◍`}),(0,z.jsxs)(`div`,{className:`body`,children:[(0,z.jsxs)(`div`,{className:`src`,children:[(0,z.jsx)(`span`,{children:`inbox`}),i&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{children:`·`}),(0,z.jsxs)(`span`,{children:[`from `,i]})]})]}),o(r)]})]})}function zE({messages:e,partialToolResults:t,executingToolIds:n,queued:r,streaming:i,bottomInsetPx:a=0,keyboardOpen:o=!1,composerHeightPx:s}){let c=zT(),l=(0,v.useMemo)(()=>{let n=new Map,r=new Set,i;for(let t of e)if(t.role===`assistant`){i=t;for(let e of t.content)e.type===`toolCall`&&r.add(e.id)}else t.role===`toolResult`&&n.set(t.toolCallId,t);for(let[e,r]of t)n.has(e)||n.set(e,r);let a=e.filter(e=>!(e.role===`toolResult`&&r.has(e.toolCallId))),o=0,s=a.map(e=>e.role===`user`&&e.origin!==`inbox`?(o+=1,`turn ${o}`):null);return{visible:a,resultMap:n,lastAssistant:i,turnLabels:s}},[e,t]),u=l.visible,d=e=>l.resultMap.get(e),f=(0,v.useRef)(null),p=(0,v.useRef)(!0),m=(0,v.useRef)(!1),h=iy({count:u.length,getScrollElement:()=>f.current,estimateSize:()=>96,overscan:10}),g=()=>{if(m.current)return;let e=f.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;p.current=t<48},_=(e=8)=>{let t=f.current;if(!t||!p.current){m.current=!1;return}m.current=!0,t.scrollTop=t.scrollHeight,requestAnimationFrame(e>0?()=>_(e-1):()=>{m.current=!1})};return(0,v.useEffect)(()=>{p.current&&(u.length>0||r.length>0)&&queueMicrotask(()=>_())},[u,i,r,a,o,s]),(0,z.jsxs)(`div`,{ref:f,className:`flex min-h-0 flex-1 flex-col overflow-auto py-2`,style:a>0?{paddingBottom:`${a}px`}:void 0,onScroll:g,children:[(0,z.jsx)(`div`,{className:`relative w-full`,style:{height:`${h.getTotalSize()}px`},children:h.getVirtualItems().map(e=>{let t=u[e.index];return t?(0,z.jsxs)(`div`,{"data-index":e.index,ref:h.measureElement,className:`px-3.5 py-1.5 box-border`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:[l.turnLabels[e.index]&&(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mt-2.5 mb-3.5`,children:[c!==`focused`&&(0,z.jsx)(`span`,{className:`font-inst text-xs tracking-[0.16em] uppercase text-[var(--dim)]`,children:l.turnLabels[e.index]}),(0,z.jsx)(`div`,{className:`flex-1 h-px bg-[var(--line2)]`})]}),(0,z.jsx)(DE,{executingToolIds:n,message:t,isLastAssistant:t===l.lastAssistant,streaming:i,resultFor:d})]},e.key):null})}),r.length>0&&(0,z.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map((e,t)=>(0,z.jsx)(`div`,{className:`px-3.5 py-1.5 box-border`,children:(0,z.jsx)(ME,{text:e})},t))})]})}var BE={notify:`Your agent has an update`,validation:`Your agent needs your approval`,decision:`Your agent needs a decision`,context:`Your agent needs more from you`,error:`Your agent hit a problem`};function VE({conversationId:e}){let t=Nm(e),[n]=Bn(),r=ct(),i=n.get(`ask`);return t.length===0?null:(0,z.jsx)(`div`,{className:`flex flex-col gap-2 border-b border-primary/20 bg-primary/5 px-4 py-3`,children:t.map(e=>(0,z.jsx)(HE,{deck:e,highlighted:i!==null&&e.job_id===i,navKey:r.key},e.id))})}function HE({deck:e,highlighted:t=!1,navKey:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{t&&r.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[t,n]);let i=dt(),{refetch:a}=Mm(),[o,s]=(0,v.useState)(!1),c=Fm(e.kind).icon,l=e.kind===`notify`||e.kind===`validation`,u=async t=>{if(!o){s(!0);try{let n=(await Om(e.job_id)).interactions[0],r=t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]};await km(e.job_id,{responses:[r]}),zm(`Done — thanks!`,`success`),a()}catch(e){if(Sm(e)){zm(e instanceof Error?e.message:`That request was already handled.`),a();return}zm(`Something went wrong — try again.`)}finally{s(!1)}}};return(0,z.jsxs)(`div`,{ref:r,className:`flex items-center gap-3 ${t?`rounded-md ring-2 ring-primary ring-offset-2 ring-offset-background`:``}`,children:[(0,z.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary`,children:(0,z.jsx)(c,{className:`size-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{className:`truncate text-sm font-medium`,children:BE[e.kind]??BE.context}),(0,z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.title})]}),e.kind===`notify`&&(0,z.jsxs)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`ack`),children:[(0,z.jsx)(Af,{className:`mr-1 size-3.5`}),` Got it`]}),e.kind===`validation`&&(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`yes`),children:`Approve`}),(0,z.jsx)(Z,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void u(`no`),children:`Reject`})]}),!l&&(0,z.jsxs)(Z,{size:`sm`,variant:`secondary`,onClick:()=>i(`/inbox/${encodeURIComponent(e.job_id)}`),children:[`Review `,(0,z.jsx)(Of,{className:`ml-1 size-3.5`})]})]})}var UE=[`[&_h1]:text-xl [&_h1]:font-medium [&_h1]:leading-[1.3] [&_h1]:mb-4 [&_h1]:text-[var(--ink)]`,`[&_h2]:text-base [&_h2]:font-medium [&_h2]:mb-3 [&_h2]:mt-4 [&_h2]:text-[var(--ink)]`,`[&_p]:text-xs [&_p]:leading-[1.65] [&_p]:text-[var(--ink2)] [&_p]:mb-3`,`[&_ul]:list-none [&_ol]:list-none`,`[&_li]:relative [&_li]:pl-5 [&_li]:pb-3.5 [&_li]:text-xs [&_li]:leading-[1.65] [&_li]:text-[var(--ink2)]`,`[&_li]:before:content-[''] [&_li]:before:absolute [&_li]:before:left-[2px] [&_li]:before:top-[8px] [&_li]:before:size-1.5 [&_li]:before:border [&_li]:before:border-[var(--mut)] [&_li]:before:rounded-[2px] [&_li]:before:rotate-45`,`[&_b]:text-[var(--ink)] [&_b]:font-semibold [&_strong]:text-[var(--ink)] [&_strong]:font-semibold`,`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-[oklch(0_0_0/0.28)] [&_pre]:text-xs`,`[&_code]:font-mono [&_code]:text-xs`,`[&_a]:text-[var(--bone)] [&_a]:underline [&_a]:decoration-dotted`].join(` `);function WE({nodeId:e,path:t,onClose:n,className:r}){let[i,a]=(0,v.useState)(`pretty`),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(s(!0),l(null),d(null),wp(e,t).then(e=>{d(e),s(!1)}).catch(e=>{l(e instanceof Error?e.message:String(e)),s(!1)}))},[e,t]),(0,v.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]),t?(0,z.jsxs)(`div`,{className:J(`relative z-[1] flex h-full w-[21.5rem] shrink-0 flex-col border-l border-[var(--line)] bg-[var(--panel)]`,r),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 px-3.5 py-3 border-b border-[var(--line)]`,children:[(0,z.jsx)(`span`,{className:`text-xs text-[var(--done)] shrink-0`,children:`◆`}),(0,z.jsx)(`span`,{className:`font-mono text-xs text-[var(--ink2)] flex-1 truncate`,style:{direction:`rtl`,textAlign:`left`,unicodeBidi:`plaintext`},title:t,children:t}),(0,z.jsxs)(`div`,{className:`flex gap-1.5 shrink-0`,children:[(0,z.jsx)(GE,{on:i===`pretty`,onClick:()=>a(`pretty`),children:`Pretty`}),(0,z.jsx)(GE,{on:i===`raw`,onClick:()=>a(`raw`),children:`Raw`}),(0,z.jsx)(GE,{onClick:n,"aria-label":`Close file peek`,children:`✕`})]})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-auto px-5 py-5`,children:[o&&(0,z.jsx)(`div`,{className:`flex items-center justify-center h-16 text-[var(--dim)] text-xs`,children:(0,z.jsx)(`span`,{className:`animate-pulse`,children:`Loading…`})}),c&&(0,z.jsx)(`div`,{className:`text-xs text-[var(--blk)]`,children:c}),u&&!o&&(0,z.jsxs)(z.Fragment,{children:[u.truncated&&(0,z.jsx)(`div`,{className:`mb-3 text-xs text-[var(--dim)]`,children:`File truncated — showing partial content`}),i===`raw`?(0,z.jsx)(`pre`,{className:`text-xs font-mono text-[var(--ink2)] whitespace-pre-wrap break-all leading-[1.7]`,children:u.content}):(0,z.jsx)(KE,{content:u.content})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-[var(--line)] px-3.5 py-2.5 text-xs text-[var(--dim)]`,children:[`any file path in the stream opens here`,(0,z.jsx)(`span`,{className:`kbd ml-auto`,children:`esc`})]})]}):null}function GE({on:e,onClick:t,children:n,...r}){return(0,z.jsx)(`button`,{type:`button`,onClick:t,className:J(`font-mono text-xs px-2 py-1 border transition-all duration-[0.12s] cursor-pointer`,e?`text-[var(--bone-ink)] bg-[var(--bone)] border-[var(--bone)]`:`text-[var(--mut)] bg-transparent border-[var(--line)] hover:text-[var(--ink)] hover:border-[var(--line2)]`),...r,children:n})}function KE({content:e}){if(e.startsWith(`---
|
|
79
|
+
`),i=n.length,a=r.length;if((i+1)*(a+1)>jE){let e=[];for(let t of n)e.push({kind:`del`,text:t});for(let t of r)e.push({kind:`add`,text:t});return e}let o=Array.from({length:i+1},()=>Array(a+1).fill(0));for(let e=i-1;e>=0;e--)for(let t=a-1;t>=0;t--)o[e][t]=n[e]===r[t]?o[e+1][t+1]+1:Math.max(o[e+1][t],o[e][t+1]);let s=[],c=0,l=0;for(;c<i&&l<a;)n[c]===r[l]?(s.push({kind:`ctx`,text:n[c]}),c++,l++):o[c+1][l]>=o[c][l+1]?(s.push({kind:`del`,text:n[c]}),c++):(s.push({kind:`add`,text:r[l]}),l++);for(;c<i;)s.push({kind:`del`,text:n[c++]});for(;l<a;)s.push({kind:`add`,text:r[l++]});return s}function NE(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function PE(e){let t=e.call.arguments??{},n=NE(t,[`old_string`,`oldText`,`old`,`before`,`search`]),r=NE(t,[`new_string`,`newText`,`new`,`after`,`replace`]),i=ME(n,r),a=bE(e.result),o=e.isError;return(0,z.jsxs)(wE,{call:e.call,subtitle:CE(e.call),inProgress:e.inProgress,isError:o,children:[n||r?(0,z.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:i.map((e,t)=>(0,z.jsx)(`div`,{className:J(`px-3 whitespace-pre-wrap`,e.kind===`add`&&`bg-[rgba(46,160,67,0.18)] text-[#aef0bf]`,e.kind===`del`&&`bg-[rgba(192,57,43,0.18)] text-[#ffb4ab]`,e.kind===`ctx`&&`opacity-70`),dangerouslySetInnerHTML:{__html:(e.kind===`add`?`+ `:e.kind===`del`?`- `:` `)+zT(e.text)}},t))}):(0,z.jsx)(`div`,{className:hE,children:`no diff available`}),a&&(0,z.jsx)(`div`,{className:J(`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,o&&`text-[#ff9b8a]`),dangerouslySetInnerHTML:{__html:zT(a)}}),(0,z.jsx)(TE,{result:e.result})]})}var FE={ts:`ts`,tsx:`tsx`,js:`js`,jsx:`jsx`,json:`json`,sh:`bash`,py:`python`,html:`html`,xml:`xml`,css:`css`,md:`markdown`,yml:`yaml`,yaml:`yaml`};function IE(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function LE(e){let t=e.call.arguments??{},n=CE(e.call),r=IE(t,[`content`,`contents`,`text`,`body`,`new_string`,`file_text`]),i=bE(e.result),a=e.isError,o=(()=>{if(!r)return``;let e=/\.([a-z0-9]+)$/i.exec(n),t=e&&FE[e[1].toLowerCase()]||``;return GT(r,t)})();return(0,z.jsxs)(wE,{call:e.call,subtitle:n,inProgress:e.inProgress,isError:a,children:[r?(0,z.jsx)(`div`,{className:pE,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:o}}):(0,z.jsx)(`div`,{className:hE,children:`no content`}),i&&(0,z.jsx)(`div`,{className:J(`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,a&&`text-[#ff9b8a]`),dangerouslySetInnerHTML:{__html:zT(i)}}),(0,z.jsx)(TE,{result:e.result})]})}function RE(e){let t=e.pattern??e.query??e.regex??e.search;return typeof t==`string`?t:``}function zE(e){let t=RE(e.call.arguments??{}),n=bE(e.result),r=n?n.split(`
|
|
80
|
+
`).filter(e=>e.length>0):[],i=e.inProgress;return(0,z.jsxs)(wE,{call:e.call,subtitle:t,inProgress:i,isError:e.isError,children:[r.length>0?(0,z.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:r.map((e,t)=>(0,z.jsx)(`div`,{className:`px-3 py-1 font-mono text-xs opacity-85`,dangerouslySetInnerHTML:{__html:zT(e)}},t))}):!i&&(0,z.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no matches`}),(0,z.jsx)(TE,{result:e.result})]})}function BE(e){let t=SE(e.call.arguments),n=bE(e.result),r=e.isError,i=e.inProgress;return(0,z.jsxs)(wE,{call:e.call,inProgress:i,isError:r,children:[t&&(0,z.jsx)(`pre`,{className:`m-0 px-3 py-2 bg-[#11161c] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-60 border-b border-[#222b35]`,children:t}),n&&(0,z.jsx)(`div`,{className:J(`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-muted [&_code]:font-mono [&_code]:text-xs [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_p]:my-[0.4em] [&_a]:text-primary`,r&&`text-[#ff9b8a]`),style:{padding:`8px 11px`},dangerouslySetInnerHTML:{__html:WT(n)}}),(0,z.jsx)(TE,{result:e.result}),!t&&!n&&!i&&(0,z.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no output`})]})}var VE={bash:DE,shell:DE,sh:DE,run:DE,terminal:DE,read:AE,read_file:AE,cat:AE,view:AE,edit:PE,str_replace:PE,apply_patch:PE,write:LE,write_file:LE,create:LE,grep:zE,search:zE,rg:zE};function HE(e){return VE[(e||``).toLowerCase()]??BE}Object.keys(VE);function UE({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i,hiddenToolCallIds:a}){let o=e.role,s=zg(e);return s!==null&&(o!==`custom`||e.display===!0)?(0,z.jsx)(GE,{presentation:s}):o===`user`?e.origin===`inbox`?(0,z.jsx)(eD,{message:e}):(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)(YE,{message:e})}):o===`assistant`?(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)(XE,{message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i,hiddenToolCallIds:a})}):o===`toolResult`?(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)($E,{message:e})}):o===`bashExecution`?(0,z.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,z.jsx)(qE,{message:e})}):o===`custom`&&e.customType===WE?(0,z.jsx)(KE,{message:e}):null}var WE=`crtr-cycle-divider`;function GE({presentation:e}){let t=tE(),[n,r]=(0,v.useState)(null),i=n??t===`verbose`;return(0,z.jsx)(`div`,{className:`text-xs ${i?`pb-2`:``}`,children:i?(0,z.jsx)(`button`,{type:`button`,className:`user block w-full text-left`,"aria-expanded":`true`,onClick:()=>r(!1),children:(0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:e.body})}):(0,z.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 text-left`,"aria-expanded":`false`,onClick:()=>r(!0),children:[(0,z.jsxs)(`span`,{className:`shrink-0 font-mono font-semibold text-[var(--bone)]`,children:[`[`,e.label,`]`]}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[var(--dim)]`,children:e.summary}),(0,z.jsx)(jf,{className:`size-3.5 shrink-0 -rotate-90 text-[var(--dim)] transition-transform`})]})})}function KE({message:e}){let t=typeof e.content==`string`?e.content:`yielded — new cycle begins`;return(0,z.jsxs)(`div`,{className:`flex items-center gap-3 my-1`,style:{opacity:.55},children:[(0,z.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}}),(0,z.jsx)(`span`,{className:`text-xs text-[var(--dim)] whitespace-nowrap`,children:t}),(0,z.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}})]})}function qE({message:e}){let t=e.excludeFromContext?`!!`:`!`,n=e.exitCode===void 0&&!e.cancelled;return(0,z.jsxs)(`div`,{className:`font-mono text-xs rounded border border-[var(--border,#333)] overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`px-2 py-1 bg-[var(--surface-raised,#1a1a1a)] flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`opacity-60 select-none`,children:t}),(0,z.jsx)(`span`,{className:`whitespace-pre-wrap break-all`,children:e.command}),n&&(0,z.jsx)(`span`,{className:`ml-auto opacity-50`,children:`running…`}),e.cancelled&&(0,z.jsx)(`span`,{className:`ml-auto opacity-70`,children:`cancelled`}),!n&&!e.cancelled&&e.exitCode!==0&&(0,z.jsxs)(`span`,{className:`ml-auto opacity-70`,children:[`exit `,e.exitCode]})]}),e.output!==``&&(0,z.jsx)(`pre`,{className:`px-2 py-1 whitespace-pre-wrap break-all m-0`,children:e.output}),e.truncated&&(0,z.jsx)(`div`,{className:`px-2 py-1 opacity-50`,children:`output truncated`})]})}function JE({text:e}){return(0,z.jsxs)(`div`,{className:`queued`,children:[(0,z.jsxs)(`div`,{className:`tag`,children:[(0,z.jsx)(`span`,{className:`select-none`,children:`⋯`}),(0,z.jsx)(`span`,{children:`queued`})]}),(0,z.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e})]})}function YE({message:e}){let t=e.content;return(0,z.jsx)(`div`,{className:`user`,children:typeof t==`string`?(0,z.jsx)(`div`,{className:`whitespace-pre-wrap`,children:t}):t.map((e,t)=>e.type===`text`?(0,z.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text},t):e.type===`image`?(0,z.jsx)(sE,{image:e},t):null)})}function XE({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i,hiddenToolCallIds:a}){let o=e.content,s=e=>t&&n&&e===o.length-1,c=o.some(e=>e.type===`toolCall`),l=e.stopReason,u=!c&&(l===`error`||l===`aborted`);return(0,z.jsxs)(z.Fragment,{children:[o.map((e,t)=>{if(e.type===`text`)return(0,z.jsx)(iE,{text:e.text,inProgress:s(t)},t);if(e.type===`thinking`)return(0,z.jsx)(aE,{thinking:e.thinking,inProgress:s(t)},t);if(e.type===`toolCall`){let o=e;return a?.has(o.id)?null:(0,z.jsx)(QE,{call:o,streaming:n,resultFor:r,executingToolIds:i},t)}return null}),u&&(0,z.jsx)(ZE,{stopReason:l,errorMessage:e.errorMessage})]})}function ZE({stopReason:e,errorMessage:t}){let n=e===`aborted`?t&&t!==`Request was aborted`?t:`Operation aborted`:`Error: ${t||`Unknown error`}`;return(0,z.jsxs)(`div`,{className:`msg-error`,children:[(0,z.jsx)(`span`,{className:`ic`,"aria-hidden":`true`,children:`⚠`}),(0,z.jsx)(`span`,{className:`txt`,children:n})]})}function QE({call:e,streaming:t,resultFor:n,executingToolIds:r}){let i=HE(e.name),a=n(e.id);return(0,z.jsx)(i,{call:e,result:a,inProgress:t&&r.has(e.id),isError:a?.isError??!1})}function $E({message:e}){return(0,z.jsx)(HE(e.toolName),{call:{type:`toolCall`,id:e.toolCallId,name:e.toolName,arguments:{}},result:e,inProgress:!1,isError:e.isError})}function eD({message:e}){let{onPeek:t,peekedPath:n}=fE(),r=typeof e.content==`string`?e.content:e.content.filter(e=>e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``),i=jg(r),a=uE(r);function o(e){if(a.length===0)return(0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:e});let r=[],i=e,o=0;for(let e of a){let a=i.indexOf(e);if(a===-1)continue;a>0&&r.push((0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i.slice(0,a)},o++));let s=n===e;r.push((0,z.jsx)(`span`,{onClick:n=>{n.stopPropagation(),t(e)},className:[`filelink text-xs`,s&&`peeked`].filter(Boolean).join(` `),children:e},o++)),i=i.slice(a+e.length)}return i&&r.push((0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i},o++)),(0,z.jsx)(z.Fragment,{children:r})}return(0,z.jsxs)(`div`,{className:`inbound`,children:[(0,z.jsx)(`span`,{className:`ic select-none`,children:`◍`}),(0,z.jsxs)(`div`,{className:`body`,children:[(0,z.jsxs)(`div`,{className:`src`,children:[(0,z.jsx)(`span`,{children:`inbox`}),i&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{children:`·`}),(0,z.jsxs)(`span`,{children:[`from `,i]})]})]}),o(r)]})]})}function tD(e){return e.role===`assistant`?Dg(e):``}function nD(e){return e.role===`user`&&zg(e)===null}function rD(e){return e.role===`assistant`?e.content.filter(e=>e.type===`toolCall`).map(e=>e.id):[]}function iD(e,t,n){let r=[],i=null,a=e=>i===null?(i={startIndex:e,key:null,toolCallIds:new Set,memberIndexes:new Set,settled:!1},r.push(i),i):i,o=()=>{i!==null&&(i.settled=!0),i=null},s=(e,t)=>{for(let n of rD(t))e.key??=n,e.toolCallIds.add(n)};for(let[t,n]of e.entries()){if(n.role===`user`){nD(n)?o():zg(n)?.kind===`revive`?i!==null&&i.memberIndexes.add(t):a(t).memberIndexes.add(t);continue}if(n.role===`assistant`){if(tD(n).trim()!==``)o(),rD(n).length>0&&s(a(t),n);else{let e=a(t);e.memberIndexes.add(t),s(e,n)}continue}if(n.role===`bashExecution`||n.role===`compactionSummary`||n.role===`branchSummary`){o();continue}if(n.role===`custom`){let e=n;if(e.display===!1)continue;if(e.customType===`crtr-cycle-divider`){o();continue}zg(n)?.kind===`bearings`?i!==null&&i.memberIndexes.add(t):a(t).memberIndexes.add(t);continue}a(t).memberIndexes.add(t)}return r.flatMap(e=>{let r=e.key===null?void 0:t[e.key];return!e.settled||e.key===null||e.toolCallIds.size===0||[...e.toolCallIds].some(e=>n.has(e))||typeof r!=`string`||r.trim()===``?[]:[{...e,key:e.key,text:r.trim()}]})}function aD({messages:e,partialToolResults:t,executingToolIds:n,toolGroupSummaries:r,queued:i,streaming:a,bottomInsetPx:o=0,keyboardOpen:s=!1,composerHeightPx:c}){let l=tE(),u=(0,v.useMemo)(()=>{let i=new Map,a=new Set,o=new Map,s;for(let[t,n]of e.entries())if(n.role===`assistant`){s=n;for(let e of n.content)e.type===`toolCall`&&(a.add(e.id),o.set(e.id,t))}else n.role===`toolResult`&&i.set(n.toolCallId,n);for(let[e,n]of t)i.has(e)||i.set(e,n);let c=new Set,u=new Map,d=new Map;if(l===`focused`)for(let t of iD(e,r,n)){for(let e of t.memberIndexes)c.add(e);for(let e of t.toolCallIds){let t=o.get(e);if(t===void 0)continue;let n=u.get(t)??new Set;n.add(e),u.set(t,n)}let e={kind:`summary`,key:t.key,text:t.text,toolCallCount:t.toolCallIds.size},n=d.get(t.startIndex)??[];n.push(e),d.set(t.startIndex,n)}let f=[];e.forEach((e,t)=>{!(e.role===`toolResult`&&a.has(e.toolCallId))&&!c.has(t)&&f.push({kind:`message`,message:e,hiddenToolCallIds:u.get(t)}),f.push(...d.get(t)??[])});let p=0,m=f.map(e=>e.kind===`message`&&e.message.role===`user`&&e.message.origin!==`inbox`?(p+=1,`turn ${p}`):null);return{visible:f,resultMap:i,lastAssistant:s,turnLabels:m}},[l,n,e,t,r]),d=u.visible,f=e=>u.resultMap.get(e),p=(0,v.useRef)(null),m=(0,v.useRef)(!0),h=(0,v.useRef)(!1),g=by({count:d.length,getScrollElement:()=>p.current,estimateSize:()=>96,overscan:10}),_=()=>{if(h.current)return;let e=p.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;m.current=t<48},y=(e=8)=>{let t=p.current;if(!t||!m.current){h.current=!1;return}h.current=!0,t.scrollTop=t.scrollHeight,requestAnimationFrame(e>0?()=>y(e-1):()=>{h.current=!1})};return(0,v.useEffect)(()=>{m.current&&(d.length>0||i.length>0)&&queueMicrotask(()=>y())},[d,a,i,o,s,c]),(0,z.jsxs)(`div`,{ref:p,className:`flex min-h-0 flex-1 flex-col overflow-auto py-2`,style:o>0?{paddingBottom:`${o}px`}:void 0,onScroll:_,children:[(0,z.jsx)(`div`,{className:`relative w-full`,style:{height:`${g.getTotalSize()}px`},children:g.getVirtualItems().map(e=>{let t=d[e.index];return t?(0,z.jsxs)(`div`,{"data-index":e.index,ref:g.measureElement,className:`px-3.5 py-1.5 box-border`,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:[u.turnLabels[e.index]&&(0,z.jsxs)(`div`,{className:`flex items-center gap-3 mt-2.5 mb-3.5`,children:[l!==`focused`&&(0,z.jsx)(`span`,{className:`font-inst text-xs tracking-[0.16em] uppercase text-[var(--dim)]`,children:u.turnLabels[e.index]}),(0,z.jsx)(`div`,{className:`flex-1 h-px bg-[var(--line2)]`})]}),t.kind===`summary`?(0,z.jsx)(oD,{text:t.text,toolCallCount:t.toolCallCount}):(0,z.jsx)(UE,{executingToolIds:n,hiddenToolCallIds:t.hiddenToolCallIds,message:t.message,isLastAssistant:t.message===u.lastAssistant,streaming:a,resultFor:f})]},t.kind===`summary`?`summary:${t.key}`:e.key):null})}),i.length>0&&(0,z.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.map((e,t)=>(0,z.jsx)(`div`,{className:`px-3.5 py-1.5 box-border`,children:(0,z.jsx)(JE,{text:e})},t))})]})}function oD({text:e,toolCallCount:t}){return(0,z.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2 text-xs text-[var(--dim)]`,children:[(0,z.jsx)(`span`,{className:`shrink-0 text-[var(--bone)]`,"aria-hidden":`true`,children:`✦`}),(0,z.jsxs)(`span`,{className:`shrink-0`,children:[t,` tool call`,t===1?``:`s`]}),(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:e})]})}var sD={notify:`Your agent has an update`,validation:`Your agent needs your approval`,decision:`Your agent needs a decision`,context:`Your agent needs more from you`,error:`Your agent hit a problem`};function cD({conversationId:e}){let t=Nm(e),[n]=Bn(),r=ct(),i=n.get(`ask`);return t.length===0?null:(0,z.jsx)(`div`,{className:`flex flex-col gap-2 border-b border-primary/20 bg-primary/5 px-4 py-3`,children:t.map(e=>(0,z.jsx)(lD,{deck:e,highlighted:i!==null&&e.job_id===i,navKey:r.key},e.id))})}function lD({deck:e,highlighted:t=!1,navKey:n}){let r=(0,v.useRef)(null);(0,v.useEffect)(()=>{t&&r.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[t,n]);let i=dt(),{refetch:a}=Mm(),[o,s]=(0,v.useState)(!1),c=Fm(e.kind).icon,l=e.kind===`notify`||e.kind===`validation`,u=async t=>{if(!o){s(!0);try{let n=(await Om(e.job_id)).interactions[0],r=t===`ack`?{id:n.id}:{id:n.id,selectedOptionIds:[(t===`yes`?n.options.find(e=>e.id===`yes`)?.id??n.options[0]?.id:n.options.find(e=>e.id===`no`)?.id??n.options[1]?.id)??t]};await km(e.job_id,{responses:[r]}),zm(`Done — thanks!`,`success`),a()}catch(e){if(Sm(e)){zm(e instanceof Error?e.message:`That request was already handled.`),a();return}zm(`Something went wrong — try again.`)}finally{s(!1)}}};return(0,z.jsxs)(`div`,{ref:r,className:`flex items-center gap-3 ${t?`rounded-md ring-2 ring-primary ring-offset-2 ring-offset-background`:``}`,children:[(0,z.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary`,children:(0,z.jsx)(c,{className:`size-4`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{className:`truncate text-sm font-medium`,children:sD[e.kind]??sD.context}),(0,z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.title})]}),e.kind===`notify`&&(0,z.jsxs)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`ack`),children:[(0,z.jsx)(Af,{className:`mr-1 size-3.5`}),` Got it`]}),e.kind===`validation`&&(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`yes`),children:`Approve`}),(0,z.jsx)(Z,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void u(`no`),children:`Reject`})]}),!l&&(0,z.jsxs)(Z,{size:`sm`,variant:`secondary`,onClick:()=>i(`/inbox/${encodeURIComponent(e.job_id)}`),children:[`Review `,(0,z.jsx)(Of,{className:`ml-1 size-3.5`})]})]})}var uD=[`[&_h1]:text-xl [&_h1]:font-medium [&_h1]:leading-[1.3] [&_h1]:mb-4 [&_h1]:text-[var(--ink)]`,`[&_h2]:text-base [&_h2]:font-medium [&_h2]:mb-3 [&_h2]:mt-4 [&_h2]:text-[var(--ink)]`,`[&_p]:text-xs [&_p]:leading-[1.65] [&_p]:text-[var(--ink2)] [&_p]:mb-3`,`[&_ul]:list-none [&_ol]:list-none`,`[&_li]:relative [&_li]:pl-5 [&_li]:pb-3.5 [&_li]:text-xs [&_li]:leading-[1.65] [&_li]:text-[var(--ink2)]`,`[&_li]:before:content-[''] [&_li]:before:absolute [&_li]:before:left-[2px] [&_li]:before:top-[8px] [&_li]:before:size-1.5 [&_li]:before:border [&_li]:before:border-[var(--mut)] [&_li]:before:rounded-[2px] [&_li]:before:rotate-45`,`[&_b]:text-[var(--ink)] [&_b]:font-semibold [&_strong]:text-[var(--ink)] [&_strong]:font-semibold`,`[&_pre]:overflow-auto [&_pre]:p-[10px_12px] [&_pre]:rounded-md [&_pre]:bg-[oklch(0_0_0/0.28)] [&_pre]:text-xs`,`[&_code]:font-mono [&_code]:text-xs`,`[&_a]:text-[var(--bone)] [&_a]:underline [&_a]:decoration-dotted`].join(` `);function dD({nodeId:e,path:t,onClose:n,className:r}){let[i,a]=(0,v.useState)(`pretty`),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(s(!0),l(null),d(null),wp(e,t).then(e=>{d(e),s(!1)}).catch(e=>{l(e instanceof Error?e.message:String(e)),s(!1)}))},[e,t]),(0,v.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]),t?(0,z.jsxs)(`div`,{className:J(`relative z-[1] flex h-full w-[21.5rem] shrink-0 flex-col border-l border-[var(--line)] bg-[var(--panel)]`,r),children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 px-3.5 py-3 border-b border-[var(--line)]`,children:[(0,z.jsx)(`span`,{className:`text-xs text-[var(--done)] shrink-0`,children:`◆`}),(0,z.jsx)(`span`,{className:`font-mono text-xs text-[var(--ink2)] flex-1 truncate`,style:{direction:`rtl`,textAlign:`left`,unicodeBidi:`plaintext`},title:t,children:t}),(0,z.jsxs)(`div`,{className:`flex gap-1.5 shrink-0`,children:[(0,z.jsx)(fD,{on:i===`pretty`,onClick:()=>a(`pretty`),children:`Pretty`}),(0,z.jsx)(fD,{on:i===`raw`,onClick:()=>a(`raw`),children:`Raw`}),(0,z.jsx)(fD,{onClick:n,"aria-label":`Close file peek`,children:`✕`})]})]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-auto px-5 py-5`,children:[o&&(0,z.jsx)(`div`,{className:`flex items-center justify-center h-16 text-[var(--dim)] text-xs`,children:(0,z.jsx)(`span`,{className:`animate-pulse`,children:`Loading…`})}),c&&(0,z.jsx)(`div`,{className:`text-xs text-[var(--blk)]`,children:c}),u&&!o&&(0,z.jsxs)(z.Fragment,{children:[u.truncated&&(0,z.jsx)(`div`,{className:`mb-3 text-xs text-[var(--dim)]`,children:`File truncated — showing partial content`}),i===`raw`?(0,z.jsx)(`pre`,{className:`text-xs font-mono text-[var(--ink2)] whitespace-pre-wrap break-all leading-[1.7]`,children:u.content}):(0,z.jsx)(pD,{content:u.content})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-[var(--line)] px-3.5 py-2.5 text-xs text-[var(--dim)]`,children:[`any file path in the stream opens here`,(0,z.jsx)(`span`,{className:`kbd ml-auto`,children:`esc`})]})]}):null}function fD({on:e,onClick:t,children:n,...r}){return(0,z.jsx)(`button`,{type:`button`,onClick:t,className:J(`font-mono text-xs px-2 py-1 border transition-all duration-[0.12s] cursor-pointer`,e?`text-[var(--bone-ink)] bg-[var(--bone)] border-[var(--bone)]`:`text-[var(--mut)] bg-transparent border-[var(--line)] hover:text-[var(--ink)] hover:border-[var(--line2)]`),...r,children:n})}function pD({content:e}){if(e.startsWith(`---
|
|
74
81
|
`)||e.startsWith(`---\r
|
|
75
82
|
`)){let t=e.indexOf(`
|
|
76
83
|
---
|
|
77
84
|
`,4);if(t!==-1){let n=e.slice(4,t),r=e.slice(t+5),i=n.split(`
|
|
78
|
-
`).map(e=>{let t=e.indexOf(`:`);return t<1?null:{key:e.slice(0,t).trim(),val:e.slice(t+1).trim()}}).filter(Boolean);return(0,z.jsxs)(z.Fragment,{children:[i.length>0&&(0,z.jsx)(`div`,{className:`fm-chips`,children:i.map(({key:e,val:t})=>(0,z.jsxs)(`span`,{className:`fm-chip`,children:[e,` `,(0,z.jsx)(`b`,{children:t})]},e))}),(0,z.jsx)(`div`,{className:
|
|
79
|
-
`)?e+uD:e,S);return(0,z.jsxs)(`div`,{className:`memory-ref-shell relative`,children:[(0,z.jsx)(`div`,{ref:p,"aria-hidden":`true`,className:J(dD,i),children:N.map((e,t)=>e.highlighted?(0,z.jsx)(`span`,{className:`ref-hl`,children:e.text},t):(0,z.jsx)(`span`,{children:e.text},t))}),(0,z.jsx)(ym,{...d,ref:b,value:e,className:J(i,fD),onChange:k,onKeyDown:M,onSelect:A,onScroll:ee,onClick:j}),(0,z.jsx)(lD,{state:E,activeIndex:g,onHoverIndex:_,onSelect:e=>O(e)})]})}function mD(e,t){let n=[],r=0;for(let i of t)i.start>r&&n.push({text:e.slice(r,i.start),highlighted:!1}),n.push({text:e.slice(i.start,i.end),highlighted:!0}),r=i.end;return r<e.length&&n.push({text:e.slice(r),highlighted:!1}),n}var hD=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],gD=e=>({"--i":e}),_D={borderBottom:`1px solid var(--line)`,background:`linear-gradient(180deg, rgba(33,31,25,.7), rgba(20,19,16,0))`};function vD(e){let t=dt(),{store:n,detail:r,input:i,setInput:a,reviving:o,actionError:s,peekedPath:c,setPeekedPath:l,dormant:u,brokerUp:d,writable:f,streaming:p,canDrive:m,commands:h,refs:g,commandNames:_,onReplaceToken:y,sendPrimary:b,onInputKeyDown:x,selectCommand:S,doRevive:C,doClose:w}=wv(e.id);return(0,v.useEffect)(()=>{let e=e=>{!e.altKey||e.metaKey||e.ctrlKey||e.code!==`KeyD`||document.activeElement instanceof HTMLTextAreaElement||(e.preventDefault(),LT())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,z.jsx)(YT.Provider,{value:{peekedPath:c,onPeek:l},children:(0,z.jsxs)(`div`,{className:`in flex h-full min-h-0 flex-col`,children:[(0,z.jsxs)(`div`,{className:J(`con-head rv flex shrink-0 items-center gap-3 px-6 py-4`,u&&`opacity-80`),style:{..._D,...gD(1)},children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/`),className:`flex shrink-0 items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-[var(--ink)]`,children:[(0,z.jsx)(Mf,{className:`size-4`}),`Conversations`]}),(0,z.jsx)(Nh,{store:n,detail:r}),(0,z.jsx)(`div`,{className:`flex-1`}),(0,z.jsx)(bD,{})]}),(0,z.jsx)(`div`,{className:`rv`,style:gD(2),children:(0,z.jsx)(zh,{store:n,detail:r})}),(0,z.jsx)(SD,{state:n.brokerStatus,dormant:u}),n.error&&(0,z.jsxs)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:[n.error.code,`: `,n.error.message]}),s&&(0,z.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:s}),(0,z.jsx)(VE,{conversationId:e.id}),(0,z.jsxs)(`div`,{className:`streamwrap relative flex min-h-0 flex-1 overflow-hidden`,children:[(0,z.jsx)(eg,{currentId:e.id,onNavigate:e=>t(`/nodes/${e}`)}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,z.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,z.jsx)(zE,{messages:n.messages,partialToolResults:n.partialToolResults,executingToolIds:n.executingToolIds,queued:n.queued,streaming:p})}),u?(0,z.jsx)(wD,{id:e.id,reviving:o,onRevive:C,onClose:w}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(CD,{store:n,canDrive:m,streaming:p,onClose:w}),(0,z.jsxs)(`div`,{className:`relative flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,z.jsx)(Ev,{commands:h,query:i,visible:i.startsWith(`/`),onSelect:S}),(0,z.jsx)(pD,{className:`resize-none font-mono text-sm`,value:i,refs:g,commandNames:_,onReplaceToken:y,onChange:e=>a(e.currentTarget.value),onKeyDown:x,disabled:!m,placeholder:xD(f,d),rows:3}),(0,z.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,z.jsx)(TD,{id:e.id}),(0,z.jsx)(Z,{variant:`default`,onClick:b,disabled:!m||!i.trim(),children:p?`Steer`:`Send`})]})]})]})]}),(0,z.jsx)(WE,{nodeId:e.id,path:c,onClose:()=>l(null)})]}),(0,z.jsx)(Uh,{store:n,detail:r}),(0,z.jsx)(kv,{store:n})]})})}var yD=[{value:`focused`,label:`Focused`},{value:`standard`,label:`Standard`},{value:`verbose`,label:`Verbose`}];function bD(){let e=zT();return(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,title:`Transcript detail — Focused / Standard / Verbose (⌥D to cycle)`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Detail`}),(0,z.jsxs)(fm,{value:e,onValueChange:e=>IT(e),children:[(0,z.jsx)(mm,{size:`sm`,className:`text-sm`,"aria-label":`Transcript detail`,children:(0,z.jsx)(pm,{})}),(0,z.jsx)(hm,{children:yD.map(e=>(0,z.jsx)(gm,{value:e.value,children:e.label},e.value))})]})]})}function xD(e,t){return e?t?`Type a prompt, or / for commands…`:`broker is down — input is frozen`:`read-only — this view cannot drive this session`}function SD({state:e,dormant:t}){return t||e!==`down`&&e!==`reconnecting`?null:(0,z.jsx)(`div`,{className:[`broker-banner border px-4 py-2 text-sm`,e===`down`?`bg-destructive/15 text-destructive border-destructive/30`:`bg-warning/15 border-warning/30`].join(` `),children:e===`down`?`Broker is down — history frozen, input disabled. Waiting for auto-revive…`:`Reconnecting to the broker…`})}function CD({store:e,canDrive:t,streaming:n,onClose:r}){let[i,a]=(0,v.useState)(null),o=i??e.state?.thinkingLevel??`medium`;return(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-2`,children:[(0,z.jsx)(Z,{variant:`secondary`,size:`sm`,disabled:!t||!n,onClick:()=>e.abort(),children:`Abort`}),(0,z.jsxs)(`label`,{className:`tiny-sel relative`,"aria-disabled":!t,children:[`thinking `,(0,z.jsx)(`b`,{children:o}),(0,z.jsx)(jf,{className:`size-3.5`}),(0,z.jsx)(`select`,{disabled:!t,value:o,onChange:t=>{let n=t.currentTarget.value;a(n),e.setThinkingLevel(n)},"aria-label":`Thinking level`,className:`absolute inset-0 cursor-pointer opacity-0`,children:hD.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))})]}),(0,z.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.cycleModel(),children:`Cycle model`}),(0,z.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.compact(),children:`Compact`}),(0,z.jsx)(Z,{variant:`destructive`,size:`sm`,className:`ml-auto`,onClick:r,children:`Close node`})]})}function wD({id:e,reviving:t,onRevive:n,onClose:r}){return(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-3`,children:[(0,z.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`This node is dormant (read-only). Revive to drive it live.`}),(0,z.jsx)(TD,{id:e}),(0,z.jsx)(Z,{variant:`default`,disabled:t,onClick:n,children:t?`Revive…`:`Revive`}),(0,z.jsx)(Z,{variant:`destructive`,onClick:r,children:`Close node`})]})}function TD({id:e}){let[t,n]=(0,v.useState)(!1);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{variant:`secondary`,onClick:()=>n(!0),children:`Message (inbox)`}),(0,z.jsx)(ED,{id:e,open:t,onOpenChange:n})]})}function ED({id:e,open:t,onOpenChange:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(i(``),o(``),u(null))},[t]),(0,z.jsx)(nm,{open:t,onOpenChange:n,children:(0,z.jsxs)(am,{children:[(0,z.jsxs)(om,{children:[(0,z.jsx)(cm,{children:`Send an inbox message`}),(0,z.jsx)(lm,{children:`A directive deliverable to any node, including a dormant one.`})]}),(0,z.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),r.trim()){c(!0),u(null);try{let t=await xp(e,{body:r.trim(),...a.trim()?{tier:a.trim()}:{}});u(`delivered=${String(t.delivered)} revived=${String(t.revived)}`),i(``)}catch(e){u(Tv(e))}finally{c(!1)}}},className:`flex flex-col gap-3`,children:[(0,z.jsx)(ym,{value:r,onChange:e=>i(e.currentTarget.value),rows:4,required:!0,placeholder:`Message body…`}),(0,z.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[`tier`,(0,z.jsx)(`input`,{className:`rounded border bg-transparent px-2 py-1 text-sm`,value:a,onChange:e=>o(e.currentTarget.value),placeholder:`(default)`})]}),l&&(0,z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:l}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>n(!1),disabled:s,children:`Close`}),(0,z.jsx)(Z,{type:`submit`,variant:`default`,disabled:s,children:s?`Sending…`:`Send`})]})]})]})})}function DD(e){e.key===`Enter`&&e.stopPropagation()}function OD(e){return e.writable?e.canDrive?`Type a prompt. Enter makes a new line; Send submits.`:`broker is down — input is frozen`:`read-only — this view cannot drive`}function kD({screen:e,onMetricsChange:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(!1),o=(0,v.useRef)(0),s=(0,v.useRef)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useMemo)(()=>(e,r=o.current)=>{a.current=e,o.current=r;let c=Math.ceil(n.current?.getBoundingClientRect().height??0),l={height:c,keyboardHeight:r,keyboardOpen:e},u=i.current??document.querySelector(`.mobile-shell-root`);i.current=u,u&&u.style.setProperty(`--composer-height`,`${c}px`),(s.current.height!==l.height||s.current.keyboardHeight!==l.keyboardHeight||s.current.keyboardOpen!==l.keyboardOpen)&&(s.current=l,t(l))},[t]),l=(0,v.useMemo)(()=>e=>{let t=i.current??document.querySelector(`.mobile-shell-root`);if(i.current=t,!t)return;let n=window.visualViewport,r=n&&e?Math.max(0,Math.round(window.innerHeight-(n.height+n.offsetTop))):0,a=n?Math.max(0,Math.round(n.offsetTop)):0;t.style.setProperty(`--kb-height`,`${r}px`),t.style.setProperty(`--vv-offset`,`${a}px`),t.dataset.keyboardOpen=e||r>0?`true`:`false`,c(e||r>0,r)},[c]);return(0,v.useLayoutEffect)(()=>{let e=r.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,180)}px`,c(a.current))},[e.input,c]),(0,v.useEffect)(()=>{let e=document.querySelector(`.mobile-shell-root`);if(i.current=e,!e)return;let t=()=>{let e=window.visualViewport,t=e?window.innerHeight-(e.height+e.offsetTop)>0:a.current;l(t)},o=window.visualViewport,s=()=>{o||l(!0)},u=()=>{o||l(!1)},d=r.current;d?.addEventListener(`focus`,s),d?.addEventListener(`blur`,u);let f=()=>t();o&&(o.addEventListener(`resize`,f),o.addEventListener(`scroll`,f)),window.addEventListener(`resize`,f),t();let p=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>c(a.current));return p&&n.current&&p.observe(n.current),()=>{d?.removeEventListener(`focus`,s),d?.removeEventListener(`blur`,u),window.removeEventListener(`resize`,f),o&&(o.removeEventListener(`resize`,f),o.removeEventListener(`scroll`,f)),p?.disconnect(),e&&(e.style.setProperty(`--kb-height`,`0px`),e.style.setProperty(`--vv-offset`,`0px`),e.style.setProperty(`--composer-height`,`0px`),delete e.dataset.keyboardOpen)}},[c,l]),(0,z.jsxs)(`div`,{ref:n,className:`mobile-composer shrink-0 border-t border-border bg-[var(--panel)] px-3 py-3`,children:[(0,z.jsx)(pD,{ref:r,className:`mobile-composer-textarea resize-none rounded-xl border-border bg-[rgba(0,0,0,.16)] font-mono text-base leading-6 text-[var(--ink)] placeholder:text-[var(--dim)]`,rows:2,value:e.input,refs:e.refs,commandNames:e.commandNames,onReplaceToken:t=>{e.onReplaceToken(t),requestAnimationFrame(()=>c(a.current))},placeholder:OD(e),onChange:t=>{e.setInput(t.currentTarget.value),requestAnimationFrame(()=>c(a.current))},onKeyDown:DD}),(0,z.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[e.streaming&&(0,z.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,disabled:!e.canDrive,onClick:()=>e.store.abort(),children:`Stop`}),(0,z.jsx)(Z,{type:`button`,size:`sm`,className:`flex-1`,disabled:!e.canDrive||!e.input.trim(),onClick:()=>e.sendPrimary(),children:e.streaming?`Steer`:`Send`})]}),!e.store.serverConnected&&(0,z.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Offline — draft saved locally.`}),e.store.serverConnected&&!e.canDrive&&(0,z.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`This thread is not live — input is frozen.`})]})}var AD={live:`border-success/25 bg-success/10 text-success`,working:`border-success/25 bg-success/10 text-success`,idle:`border-border bg-transparent text-muted-foreground`,"needs-you":`border-warning/30 bg-warning/10 text-warning`,done:`border-border bg-transparent text-muted-foreground`,reconnecting:`border-warning/30 bg-warning/10 text-warning`,offline:`border-destructive/30 bg-destructive/10 text-destructive`};function jD({title:e,statusLabel:t,statusTone:n,onBack:r,onOpenOverflow:i}){return(0,z.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 border-b px-3 py-2 [border-color:var(--line)] [background:var(--panel)]`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to conversations`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(Mf,{className:`size-4`})}),(0,z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,z.jsx)(`h1`,{className:`truncate text-base font-medium text-[var(--ink)]`,children:e})}),t&&(0,z.jsxs)(`span`,{className:J(`inline-flex max-w-[44vw] items-center gap-1.5 rounded-full border px-2 py-1 text-xs font-medium`,AD[n]),children:[n===`working`||n===`reconnecting`?(0,z.jsx)(Yf,{className:`size-3.5 shrink-0 animate-spin`}):(0,z.jsx)(`span`,{className:`size-2 shrink-0 rounded-full`,style:{background:n===`live`?`var(--success)`:n===`needs-you`?`var(--warning)`:n===`offline`?`var(--destructive)`:`var(--dim)`}}),(0,z.jsx)(`span`,{className:`truncate`,children:t})]}),(0,z.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`More thread actions`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(Hf,{className:`size-4`})})]})}var MD=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function ND({open:e,screen:t,onClose:n}){let[r,i]=(0,v.useState)(t.store.state?.thinkingLevel??`medium`);return(0,v.useEffect)(()=>{i(t.store.state?.thinkingLevel??`medium`)},[t.store.state?.thinkingLevel]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),e?(0,z.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Thread actions`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,z.jsxs)(`section`,{className:`max-h-[88vh] w-full overflow-auto rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Thread actions`}),(0,z.jsx)(`p`,{className:`truncate text-sm text-[var(--ink)]`,children:t.detail?.name?.trim()||`Thread`})]}),(0,z.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close thread actions`,className:`flex size-8 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(ap,{className:`size-4`})})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pt-4 pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,z.jsxs)(`section`,{className:`space-y-3`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Session`}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.cycleModel(),disabled:!t.canDrive,children:`Cycle model`}),(0,z.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.compact(),disabled:!t.canDrive,children:`Compact`}),(0,z.jsx)(Z,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>void t.doClose(),children:`Close node`}),t.dormant&&(0,z.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>void t.doRevive(),disabled:t.reviving,children:t.reviving?`Reviving…`:`Revive`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Thinking`}),(0,z.jsxs)(fm,{value:r,onValueChange:e=>{let n=e;i(n),t.store.setThinkingLevel(n)},disabled:!t.canDrive,children:[(0,z.jsx)(mm,{size:`sm`,className:`min-w-36 text-sm`,children:(0,z.jsx)(pm,{placeholder:`Thinking`})}),(0,z.jsx)(hm,{children:MD.map(e=>(0,z.jsx)(gm,{value:e,children:e},e))})]})]})]}),(0,z.jsxs)(`section`,{className:`space-y-2`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Context`}),(0,z.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-[rgba(0,0,0,.12)]`,children:(0,z.jsx)(zh,{store:t.store,detail:t.detail})})]}),(0,z.jsxs)(`section`,{className:`space-y-2`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Instruments`}),(0,z.jsx)(`div`,{className:`panel overflow-hidden p-3`,children:(0,z.jsx)(Fh,{store:t.store,detail:t.detail})})]})]})]})}):null}function PD({id:e}){let t=dt(),n=wv(e),{nodes:r}=Zp(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useCallback)(e=>{s(t=>t.height===e.height&&t.keyboardHeight===e.keyboardHeight&&t.keyboardOpen===e.keyboardOpen?t:e)},[]),l=(0,v.useMemo)(()=>yh(r),[r]),u=(0,v.useMemo)(()=>Yh(r,e).thisGraph[0]?.node.node_id??e,[e,r]),d=(0,v.useMemo)(()=>l.find(e=>e.id===u)??null,[l,u]),f=n.detail?.name?.trim()||n.detail?.kind?.trim()||`Conversation`,{label:p,tone:m}=(0,v.useMemo)(()=>FD(n,d),[d,n]),h=n.store.messages.length===0,g=ID(n,d),_=(0,v.useMemo)(()=>({peekedPath:n.peekedPath,onPeek:n.setPeekedPath}),[n.peekedPath,n.setPeekedPath]);return(0,z.jsx)(YT.Provider,{value:_,children:(0,z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,z.jsx)(jD,{title:f,statusLabel:p,statusTone:m,onBack:()=>t(`/`),onOpenOverflow:()=>a(!0)}),n.actionError&&(0,z.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/10 px-4 py-2 text-sm text-destructive`,children:n.actionError}),n.store.error&&!n.actionError&&(0,z.jsx)(`div`,{className:`border-b border-warning/30 bg-warning/10 px-4 py-2 text-sm text-warning`,children:n.store.error.message}),(0,z.jsx)(VE,{conversationId:u}),(0,z.jsxs)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,z.jsx)(zE,{messages:n.store.messages,partialToolResults:n.store.partialToolResults,executingToolIds:n.store.executingToolIds,queued:n.store.queued,streaming:n.streaming,bottomInsetPx:o.keyboardHeight,keyboardOpen:o.keyboardOpen,composerHeightPx:o.height}),h&&(0,z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center px-8 text-center text-sm text-muted-foreground`,children:(0,z.jsxs)(`div`,{className:`max-w-sm space-y-2 rounded-2xl border border-border bg-[rgba(0,0,0,.14)] px-4 py-3 shadow-lg shadow-black/20`,children:[(0,z.jsx)(`p`,{className:`font-medium text-[var(--ink)]`,children:g}),(0,z.jsx)(`p`,{children:n.store.serverConnected?`Waiting for the thread to load…`:`Drafts stay local while the broker reconnects.`})]})})]}),(0,z.jsx)(kD,{screen:n,onMetricsChange:c}),(0,z.jsx)(kv,{store:n.store}),(0,z.jsx)(ND,{open:i,screen:n,onClose:()=>a(!1)}),n.peekedPath&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 flex justify-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n.setPeekedPath(null)},children:(0,z.jsx)(WE,{nodeId:e,path:n.peekedPath,onClose:()=>n.setPeekedPath(null),className:`w-full max-w-[100vw]`})})]})})}function FD(e,t){if(e.store.brokerStatus===`down`)return{label:`Offline`,tone:`offline`};if(e.store.brokerStatus===`reconnecting`)return{label:`Reconnecting…`,tone:`reconnecting`};if(e.streaming)return{label:`Working…`,tone:`working`};if(e.store.source===`static`){if(!t)return{label:`Cached`,tone:`idle`};switch(t.state){case`needs-you`:return{label:`Needs you`,tone:`needs-you`};case`active`:return{label:`Active`,tone:`live`};case`idle`:return{label:`Idle`,tone:`idle`};case`done`:return{label:`Done`,tone:`done`}}}return{label:`Live`,tone:`live`}}function ID(e,t){return e.store.brokerStatus===`down`?`Couldn’t reach your thread yet — retrying quietly.`:e.store.brokerStatus===`reconnecting`?`Reconnecting to your thread…`:e.store.source===`static`?t?.state===`needs-you`?`Cached thread — waiting for your reply.`:`Cached thread — connecting to the live broker.`:`Loading conversation…`}function LD(){let{decks:e,loading:t}=Mm();return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,z.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,z.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Inbox`}),e.length>0&&(0,z.jsx)(`span`,{className:`font-inst text-xs`,style:{fontWeight:600,color:`#ff8260`,background:`var(--blk-dim)`,border:`1px solid rgba(255,94,54,.35)`,padding:`1.5px 7px`,borderRadius:`99px`},children:e.length})]}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,z.jsx)(VD,{}):e.length===0?(0,z.jsx)(BD,{}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map(e=>(0,z.jsx)(RD,{deck:e},e.id))})})]})}function RD({deck:e}){let t=dt(),n=Fm(e.kind),r=n.icon,i=e.claim_owner===void 0?e.subtitle:`claimed by ${e.claim_owner} · ${e.subtitle}`;return(0,z.jsx)(`li`,{className:`list-none`,children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),className:`panel flex w-full items-start gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,z.jsx)(`span`,{className:`mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},title:n.label,children:(0,z.jsx)(r,{className:`size-4.5`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,z.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title}),(0,z.jsx)(`span`,{className:`instlabel shrink-0`,children:n.label})]}),(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:i}),(0,z.jsx)(zD,{deck:e,className:`mt-1.5`})]}),(0,z.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.08em`,color:`var(--mut)`},title:`waiting ${Im(e.blocked_since)}`,children:Im(e.blocked_since)})]})})}function zD({deck:e,className:t}){return e.source_label===void 0?null:(0,z.jsxs)(`div`,{className:J(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs`,t),children:[(0,z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`in `,(0,z.jsx)(`span`,{className:`font-medium text-foreground/80`,children:e.conversation_title})]}),(0,z.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,z.jsx)(Mn,{to:`/nodes/${encodeURIComponent(e.asking_node_id)}`,onClick:e=>e.stopPropagation(),className:`font-mono text-muted-foreground hover:text-primary hover:underline`,title:e.cwd,children:e.source_label}),(0,z.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,z.jsx)(`span`,{className:`font-mono text-muted-foreground/60`,title:e.cwd,children:e.cwd})]})}function BD(){return(0,z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center py-16 text-center`,children:[(0,z.jsx)(`p`,{className:`text-2xl`,style:{fontStyle:`italic`,color:`var(--ink)`},children:`You're all caught up.`}),(0,z.jsx)(`p`,{className:`mt-1.5 text-sm`,style:{color:`var(--mut)`},children:`Nothing needs your input right now.`})]})}function VD(){return(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2].map(e=>(0,z.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,z.jsx)(`div`,{className:`size-9 shrink-0 animate-pulse rounded-lg bg-muted`}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,z.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded-none bg-muted`}),(0,z.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded-none bg-muted/70`})]})]},e))})}function HD({deckId:e}){let t=dt(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(0);(0,v.useEffect)(()=>{let n=!1;return r(null),l({}),s(null),d(!1),a(!0),Om(e).then(e=>{n||(r(e),l(Object.fromEntries(e.interactions.map(e=>[e.id,{id:e.id}]))),a(!1))}).catch(e=>{if(!n){if(Sm(e)){zm(e instanceof mp?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}s(e instanceof Error?e:Error(`Failed to load deck.`)),a(!1)}}),()=>{n=!0}},[e,t,f]);let m=(e,t)=>l(n=>({...n,[e]:{...n[e],id:e,...t}}));if(i)return(0,z.jsx)(tO,{});if(o)return(0,z.jsx)(UD,{error:o,onRetry:()=>p(e=>e+1),onBack:()=>t(`/inbox`)});if(!n)return(0,z.jsx)(tO,{});let h=async e=>{if(u)return;d(!0);let r=Object.values(e??c).map(({selectedOptionId:e,...t})=>t);try{await km(n.job_id,{responses:r}),zm(`Done — thanks!`,`success`),t(`/inbox`,{replace:!0})}catch(e){if(Sm(e)){zm(e instanceof mp?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}zm(e instanceof mp?e.message:`Something went wrong — try again.`),d(!1)}},g=n.interactions.length===1?n.interactions[0]:null,_=Fm(n.kind).icon;return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col px-6 py-8`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox`),className:`mb-4 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,z.jsx)(Df,{className:`size-4`}),` Inbox`]}),(0,z.jsxs)(`header`,{className:`mb-5 flex items-start gap-3`,children:[(0,z.jsx)(`span`,{className:`mt-0.5 inline-flex size-10 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},children:(0,z.jsx)(_,{className:`size-5`})}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:n.title}),(0,z.jsx)(`p`,{className:`mt-0.5 text-sm`,style:{color:`var(--mut)`},children:n.subtitle}),(0,z.jsx)(zD,{deck:n,className:`mt-2`})]})]}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,z.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.interactions.map(e=>(0,z.jsx)(KD,{interaction:e,answer:c[e.id]??{id:e.id},onChange:t=>m(e.id,t),conversationId:n.conversation_id,busy:u,onResolveWith:g?t=>void h({[e.id]:t}):void 0},e.id))})}),!WD(g)&&(0,z.jsxs)(`footer`,{className:`mt-6 flex shrink-0 items-center justify-end gap-2 border-t border-border pt-4`,children:[(0,z.jsx)(Z,{variant:`ghost`,onClick:()=>t(`/inbox`),disabled:u,children:`Cancel`}),(0,z.jsx)(Z,{onClick:()=>void h(),disabled:u||!GD(n,c),children:u?`Sending…`:`Submit`})]})]})}function UD({error:e,onRetry:t,onBack:n}){return(0,z.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col justify-center px-6 py-8`,children:(0,z.jsxs)(`section`,{className:`panel p-5`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Couldn’t load the deck`}),(0,z.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.message}),(0,z.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,z.jsx)(Z,{onClick:t,children:`Retry`}),(0,z.jsx)(Z,{variant:`ghost`,onClick:n,children:`Back to inbox`})]})]})})}function WD(e){return e!==null&&(e.kind===`notify`||e.kind===`validation`)}function GD(e,t){return e.interactions.every(e=>{let n=t[e.id];if(!n)return!1;if(e.kind===`notify`||e.kind===`error`)return!0;let r=!!n.selectedOptionIds?.length||!!n.freetext?.trim();return e.options.length===0&&!e.allowFreetext||r})}function KD({interaction:e,answer:t,onChange:n,conversationId:r,busy:i,onResolveWith:a}){switch(e.kind){case`notify`:return(0,z.jsx)(XD,{interaction:e,onGotIt:()=>a?.({id:e.id}),direct:!!a});case`validation`:return(0,z.jsx)(ZD,{interaction:e,answer:t,onChange:n,busy:i,onResolveWith:a});case`context`:return(0,z.jsx)($D,{interaction:e,answer:t,onChange:n});case`error`:return(0,z.jsx)(eO,{interaction:e,answer:t,onChange:n,conversationId:r});default:return(0,z.jsx)(QD,{interaction:e,answer:t,onChange:n})}}function qD({body:e}){return e?(0,z.jsx)(`div`,{className:`prose prose-sm max-w-none text-sm text-foreground/85 dark:prose-invert`,dangerouslySetInnerHTML:{__html:ST(OT(e))}}):null}function JD({children:e,className:t}){return(0,z.jsx)(`section`,{className:J(`panel p-5`,t),children:e})}function YD({it:e}){return(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),(0,z.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:e.subtitle})]})}function XD({interaction:e,onGotIt:t,direct:n}){return(0,z.jsxs)(JD,{children:[(0,z.jsx)(YD,{it:e}),(0,z.jsx)(qD,{body:e.body}),n&&(0,z.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,z.jsxs)(Z,{onClick:t,children:[(0,z.jsx)(Af,{className:`mr-1.5 size-4`}),` Got it`]})})]})}function ZD({interaction:e,answer:t,onChange:n,busy:r,onResolveWith:i}){let a=e.options.find(e=>e.id===`yes`)??e.options[0],o=e.options.find(e=>e.id===`no`)??e.options[1],s=r=>{let a={...t,id:e.id,selectedOptionIds:[r]};i?i(a):n({selectedOptionIds:[r],selectedOptionId:void 0})};return(0,z.jsxs)(JD,{children:[(0,z.jsx)(YD,{it:e}),(0,z.jsx)(qD,{body:e.body}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3`,children:[(0,z.jsx)(ym,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Add a comment (optional)`,className:`resize-none text-sm`}),(0,z.jsxs)(`div`,{className:`flex gap-3`,children:[(0,z.jsx)(Z,{className:`flex-1`,size:`lg`,disabled:r,onClick:()=>a&&s(a.id),children:a?.label??`Approve`}),(0,z.jsx)(Z,{className:`flex-1`,size:`lg`,variant:`outline`,disabled:r,onClick:()=>o&&s(o.id),children:o?.label??`Reject`})]}),!i&&t.selectedOptionIds?.[0]&&(0,z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected: `,e.options.find(e=>e.id===t.selectedOptionIds?.[0])?.label]})]})]})}function QD({interaction:e,answer:t,onChange:n}){let r=new Set(t.selectedOptionIds??[]),i=t=>{if(e.multiSelect){let e=new Set(r);e.has(t)?e.delete(t):e.add(t),n({selectedOptionIds:[...e],selectedOptionId:void 0})}else n({selectedOptionIds:[t],selectedOptionId:void 0})};return(0,z.jsxs)(JD,{children:[(0,z.jsx)(YD,{it:e}),(0,z.jsx)(qD,{body:e.body}),(0,z.jsx)(`ul`,{className:`mt-4 flex flex-col gap-2`,children:e.options.map(t=>{let n=r.has(t.id);return(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(t.id),className:J(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,n?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:[(0,z.jsx)(`span`,{className:J(`mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e.multiSelect?`rounded`:`rounded-full`,n?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/40`),children:n&&(0,z.jsx)(Af,{className:`size-3`})}),(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block text-sm font-medium`,children:t.label}),t.description&&(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:t.description})]})]})},t.id)})}),e.allowFreetext&&(0,z.jsx)(ym,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Anything else? (optional)`,className:`mt-3 resize-none text-sm`})]})}function $D({interaction:e,answer:t,onChange:n}){let r=t.selectedOptionIds?.[0];return(0,z.jsxs)(JD,{children:[(0,z.jsx)(YD,{it:e}),e.body&&(0,z.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border p-3`,style:{background:`color-mix(in oklch, var(--ink) 3%, transparent)`},children:[(0,z.jsx)(`p`,{className:`instlabel mb-1.5`,children:`Why we're asking`}),(0,z.jsx)(qD,{body:e.body})]}),e.options.length>0&&(0,z.jsx)(`ul`,{className:`mb-3 flex flex-col gap-2`,children:e.options.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:J(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,r===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})})},e.id))}),(e.allowFreetext||e.options.length===0)&&(0,z.jsx)(ym,{autoFocus:!0,rows:3,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Your answer`,className:`resize-none text-sm`})]})}function eO({interaction:e,answer:t,onChange:n,conversationId:r}){let i=dt();return(0,z.jsxs)(JD,{className:`border-destructive/30`,children:[(0,z.jsx)(YD,{it:e}),(0,z.jsx)(qD,{body:e.body}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[e.options.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:J(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,t.selectedOptionIds?.[0]===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})},e.id)),(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(`/c/${encodeURIComponent(r)}`),className:`flex w-full items-center gap-2 rounded-xl border border-border px-4 py-3 text-left text-sm font-medium transition-colors hover:border-primary/40 hover:bg-accent/40`,children:`Take over — open the conversation`})]})]})}function tO(){return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full max-w-2xl flex-col gap-5 px-6 py-8`,children:[(0,z.jsx)(`div`,{className:`h-4 w-16 animate-pulse rounded-none bg-muted`}),(0,z.jsx)(`div`,{className:`h-7 w-1/2 animate-pulse rounded-none bg-muted`}),(0,z.jsx)(`div`,{className:`h-40 w-full animate-pulse rounded-2xl bg-muted/60`})]})}var nO=`crtr-push-token-v1`,rO=`/__push-token`;async function iO(e){if(typeof caches>`u`)return;let t=await caches.open(nO);if(e===void 0||e===``){await t.delete(rO);return}await t.put(rO,new Response(e))}function aO(){let e={"content-type":`application/json`};return pp!==void 0&&(e.authorization=`Bearer ${pp}`),e}function oO(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}function sO(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function cO(){let e=await fetch(`/__crtr/push/vapid-public-key`,{headers:aO()});if(!e.ok)throw Error(`could not load the push key (${e.status})`);return(await e.json()).publicKey}async function lO(e){let t=await fetch(`/__crtr/push/subscribe`,{method:`POST`,headers:aO(),body:JSON.stringify(e.toJSON())});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`subscribe failed (${t.status})`)}}async function uO(){if(!oO())return`unsupported`;if(Notification.permission===`denied`)return`denied`;let e=await navigator.serviceWorker.getRegistration();return e===void 0||await e.pushManager.getSubscription()===null?`unsubscribed`:`subscribed`}async function dO(){if(!oO())throw Error(`push notifications are not supported in this browser`);if(await Notification.requestPermission()!==`granted`)throw Error(`notification permission was not granted`);let e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();if(t!==null){await iO(pp);try{await lO(t)}catch(e){throw await t.unsubscribe().catch(()=>{}),await iO(void 0).catch(()=>{}),e}return}let n=await cO(),r=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:sO(n)});try{await iO(pp)}catch(e){throw await r.unsubscribe().catch(()=>{}),e}try{await lO(r)}catch(e){throw await r.unsubscribe().catch(()=>{}),await iO(void 0).catch(()=>{}),e}}async function fO(){if(!oO())return;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return;let t=await e.pushManager.getSubscription();if(t===null)return;let n=t.endpoint;await t.unsubscribe(),await iO(void 0).catch(()=>{});try{await fetch(`/__crtr/push/subscribe`,{method:`DELETE`,headers:aO(),body:JSON.stringify({endpoint:n})})}catch{}}function pO(){let[e,t]=(0,v.useState)(()=>oO()?`unsubscribed`:`unsupported`),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{uO().then(t)},[]);return(0,v.useEffect)(()=>{o()},[o]),{status:e,busy:n,error:i,enable:(0,v.useCallback)(()=>{r(!0),a(null),dO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o]),disable:(0,v.useCallback)(()=>{r(!0),a(null),fO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o])}}function mO(){let[e,t]=(0,v.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col gap-8 overflow-auto px-6 py-8`,children:[(0,z.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Settings`}),(0,z.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,z.jsx)(`h2`,{className:`instlabel`,children:`Appearance`}),(0,z.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e?`Dark theme`:`Light theme`,` is active.`]}),(0,z.jsxs)(Z,{variant:`outline`,onClick:()=>{let e=document.documentElement,n=!e.classList.contains(`dark`);e.classList.toggle(`dark`,n),e.classList.toggle(`light`,!n),t(n)},children:[`Switch to `,e?`light`:`dark`]})]}),(0,z.jsx)(hO,{})]})}function hO(){let{status:e,busy:t,error:n,enable:r,disable:i}=pO();return(0,z.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,z.jsx)(`h2`,{className:`instlabel`,children:`Notifications`}),e===`unsupported`&&(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications aren’t supported in this browser.`}),e===`denied`&&(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications off — enable them for this site in your browser/OS settings.`}),e===`unsubscribed`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Get a push when an agent needs you or finishes, even when this tab is closed.`}),(0,z.jsx)(Z,{variant:`outline`,onClick:r,disabled:t,children:`Enable notifications`})]}),e===`subscribed`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications are on for this browser.`}),(0,z.jsx)(Z,{variant:`outline`,onClick:i,disabled:t,children:`Disable notifications`})]}),n!==null&&(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--warning)`},children:n})]})}var gO=`(max-width: 767px)`;function _O(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(gO).matches}function vO(){let[e,t]=(0,v.useState)(_O);return(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(gO),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function yO(e,t,n){let r=new URLSearchParams;t!==void 0&&t!==``&&r.set(`ask`,t),n!==void 0&&n!==``&&r.set(`token`,n);let i=r.toString();return`/c/${encodeURIComponent(e)}${i===``?``:`?${i}`}`}function bO(){let{id:e}=pt();return vO()?(0,z.jsx)(PD,{id:e??``},e):(0,z.jsx)(vD,{id:e??``},e)}function xO(){let{deckId:e}=pt();return(0,z.jsx)(HD,{deckId:e??``})}function SO(){return(0,z.jsxs)(Bt,{children:[(0,z.jsx)(Rt,{path:`/`,element:(0,z.jsx)(Ch,{})}),(0,z.jsx)(Rt,{path:`/new`,element:(0,z.jsx)(Lt,{to:`/?new=1`,replace:!0})}),(0,z.jsx)(Rt,{path:`/canvas`,element:(0,z.jsx)(oh,{})}),(0,z.jsx)(Rt,{path:`/nodes/:id`,element:(0,z.jsx)(bO,{})}),(0,z.jsx)(Rt,{path:`/c/:id`,element:(0,z.jsx)(bO,{})}),(0,z.jsx)(Rt,{path:`/inbox`,element:(0,z.jsx)(LD,{})}),(0,z.jsx)(Rt,{path:`/inbox/:deckId`,element:(0,z.jsx)(xO,{})}),(0,z.jsx)(Rt,{path:`/settings`,element:(0,z.jsx)(mO,{})}),(0,z.jsx)(Rt,{path:`*`,element:(0,z.jsx)(Ch,{})})]})}function CO(){let e=dt();return(0,v.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let t=t=>{let n=t.data;if(n?.type!==`crtr-deep-link`||typeof n.conversationId!=`string`)return;let r=typeof n.askId==`string`?n.askId:void 0;e(yO(n.conversationId,r,pp))};return navigator.serviceWorker.addEventListener(`message`,t),()=>navigator.serviceWorker.removeEventListener(`message`,t)},[e]),null}function wO(){return zp(e=>e.reachable)?null:(0,z.jsx)(`div`,{role:`status`,className:`fixed inset-x-0 top-0 z-50 bg-warning/90 px-4 py-1.5 text-center text-sm font-medium text-background`,children:`Reconnecting…`})}function TO(e){e(`/?new=1`)}var EO=[{id:`conversations`,label:`Conversations`,path:`/`},{id:`canvas`,label:`Canvas`,path:`/canvas`},{id:`inbox`,label:`Inbox`,path:`/inbox`},{id:`settings`,label:`Settings`,path:`/settings`}],DO={conversations:Zf,canvas:Qf,inbox:Kf,settings:np};function OO({compact:e}){let t=dt();return(0,z.jsxs)(`aside`,{"aria-label":`Primary`,style:e?{width:58}:void 0,className:J(`flex flex-none flex-col gap-0.5 py-4 [border-right:1px_solid_var(--line)] [background:linear-gradient(180deg,rgba(20,19,16,.6),rgba(20,19,16,.2))]`,e?`items-center`:`w-57 px-3`),children:[(0,z.jsxs)(Mn,{to:`/`,title:`crouter`,className:J(`flex items-center no-underline [color:var(--ink)]`,e?`justify-center pt-1 pb-4`:`gap-2.5 px-2.5 pt-1 pb-4 text-base font-medium tracking-[.01em]`),children:[(0,z.jsx)(`span`,{className:`font-inst flex flex-none items-center justify-center rounded-md text-xs font-bold [background:var(--bone)] [color:var(--bone-ink)]`,style:{width:22,height:22},children:`cr`}),!e&&`crouter`]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>TO(t),title:`New chat (⌘⇧O)`,"aria-label":`New chat`,className:J(`flex items-center rounded-lg font-medium transition-all [color:var(--bone-ink)] [background:var(--bone)] hover:[background:var(--ink)]`,e?`mb-1 size-9 justify-center`:`mb-1.5 h-9 gap-2.5 px-3 text-sm`),children:[(0,z.jsx)($f,{size:e?18:16,className:`flex-none`,"aria-hidden":!0}),!e&&(0,z.jsx)(`span`,{children:`New chat`})]}),EO.map(t=>{let n=DO[t.id]??Zf;return(0,z.jsxs)(Nn,{to:t.path,end:t.path===`/`,title:e?t.label:void 0,className:({isActive:t})=>J(`relative flex items-center no-underline transition-all`,e?`size-9 justify-center rounded-lg border border-transparent opacity-75`:`h-9 gap-2.5 rounded-lg border border-transparent px-3 text-sm font-medium`,t?`[color:var(--ink)] opacity-100 [background:rgba(232,228,216,.06)] [border-color:var(--line)] [box-shadow:inset_0_1px_0_var(--raise)]`:`[color:var(--ink2)] hover:opacity-100 hover:[color:var(--ink)] hover:[background:rgba(232,228,216,.04)]`),children:[(0,z.jsx)(n,{size:18,className:e?void 0:`flex-none opacity-75`,"aria-hidden":!0}),!e&&(0,z.jsx)(`span`,{children:t.label}),t.id===`inbox`&&(0,z.jsx)(kO,{compact:e})]},t.id)}),(0,z.jsx)(`div`,{className:`flex-1`})]})}function kO({compact:e}){let t=jm();return t<=0?null:e?(0,z.jsx)(`span`,{className:`absolute right-[5px] top-[5px] size-2.5 rounded-full [background:var(--blk)] [box-shadow:0_0_10px_rgba(255,94,54,.55)] [animation:pulse-hot_1.6s_ease-out_infinite]`}):(0,z.jsx)(`span`,{className:`font-inst ml-auto rounded-full border px-2 py-0.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:t})}function AO(e,t){let n=(0,v.useRef)(e),r=(0,v.useRef)(t);n.current=e,r.current=t,(0,v.useEffect)(()=>{let e=e=>{let t=document.activeElement;t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement||t instanceof HTMLElement&&t.isContentEditable||n.current(e)&&(e.preventDefault(),r.current(e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function jO({open:e,onClose:t}){let{nodes:n}=Zp(),r=dt(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(0),c=(0,v.useRef)(null),l=(0,v.useMemo)(()=>{let e=n.filter(e=>e.enterable).map(e=>({id:e.node_id,title:dh(e),dot:gh(e),kind:e.kind,last:e.last_activity??e.created}));e.sort((e,t)=>t.last.localeCompare(e.last));let t=i.trim().toLowerCase();return t?e.filter(e=>e.title.toLowerCase().includes(t)||e.kind.toLowerCase().includes(t)):e},[n,i]);if((0,v.useEffect)(()=>{e&&(a(``),s(0),c.current?.focus())},[e]),(0,v.useEffect)(()=>{s(e=>Math.min(e,Math.max(0,l.length-1)))},[l.length]),!e)return null;let u=e=>{e&&(r(`/c/${encodeURIComponent(e.id)}`),t())};return(0,z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center px-4 pt-24`,style:{background:`var(--scrim)`},onClick:t,children:(0,z.jsxs)(`div`,{className:`panel w-full max-w-xl overflow-hidden p-0`,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,l.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),u(l[o]))},children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,style:{borderColor:`var(--line)`},children:[(0,z.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Jump to`}),(0,z.jsx)(`input`,{ref:c,value:i,onChange:e=>a(e.currentTarget.value),placeholder:`Search conversations…`,className:`flex-1 bg-transparent text-sm outline-none`,style:{color:`var(--ink)`}}),(0,z.jsx)(`span`,{className:`kbd`,children:`esc`})]}),(0,z.jsx)(`ul`,{className:`max-h-80 overflow-auto py-1`,children:l.length===0?(0,z.jsx)(`li`,{className:`px-4 py-3 text-sm italic`,style:{color:`var(--mut)`},children:`no live nodes`}):l.map((e,t)=>(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(e),onMouseEnter:()=>s(t),className:J(`flex w-full items-center gap-2.5 px-4 py-2 text-left transition-colors`,t===o&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,z.jsx)(`span`,{className:J(`dot shrink-0`,e.dot)}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,style:{color:`var(--ink)`},children:e.title}),(0,z.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:e.kind})]})},e.id))})]})})}var MO=/^\/(nodes|c)\//;function NO({children:e}){let t=ct(),n=dt(),[r,i]=(0,v.useState)(!1);return AO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey&&e.code===`KeyO`,[]),(0,v.useCallback)(()=>TO(n),[n])),AO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&e.code===`KeyK`,[]),(0,v.useCallback)(()=>i(e=>!e),[])),(0,z.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,z.jsx)(OO,{compact:MO.test(t.pathname)}),(0,z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),(0,z.jsx)(jO,{open:r,onClose:()=>i(!1)})]})}var PO=/^\/(?:c|nodes)\/([^/]+)\/?$/;function FO(e){let t=PO.exec(e);if(!t)return null;let n=t[1];return n===void 0?null:decodeURIComponent(n)}var IO=[{id:`home`,label:`Home`,path:`/`,icon:Gf},{id:`inbox`,label:`Inbox`,path:`/inbox`,icon:Kf}];function LO(){let e=dt();return(0,z.jsxs)(`nav`,{"aria-label":`Primary`,className:`mobile-bottom-nav flex flex-none items-stretch gap-1 border-t px-2 pt-1 [border-color:var(--line)] [background:var(--panel)]`,children:[IO.map(e=>(0,z.jsxs)(Nn,{to:e.path,end:e.path===`/`,className:({isActive:e})=>J(`relative flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium no-underline transition-all`,e?`[color:var(--ink)] opacity-100`:`[color:var(--ink2)] opacity-75`),children:[(0,z.jsx)(e.icon,{size:20,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:e.label}),e.id===`inbox`&&(0,z.jsx)(RO,{})]},e.id)),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>TO(e),"aria-label":`New chat`,className:`flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium [color:var(--ink2)]`,children:[(0,z.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,z.jsx)($f,{size:18,"aria-hidden":!0})}),(0,z.jsx)(`span`,{children:`New`})]})]})}function RO(){let e=jm();return e<=0?null:(0,z.jsx)(`span`,{className:`font-inst absolute right-2 top-0 min-w-4 rounded-full border px-1 text-center text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:e})}function zO(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches===!0||window.navigator.standalone===!0}function BO(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(zO);(0,v.useEffect)(()=>{let e=e=>{e.preventDefault(),t(e)},n=()=>{r(!0),t(null)};return window.addEventListener(`beforeinstallprompt`,e),window.addEventListener(`appinstalled`,n),()=>{window.removeEventListener(`beforeinstallprompt`,e),window.removeEventListener(`appinstalled`,n)}},[]);let i=(0,v.useCallback)(async()=>{e!==null&&(await e.prompt(),await e.userChoice,t(null))},[e]);return{canInstall:e!==null&&!n,promptInstall:i}}function VO(){let{canInstall:e,promptInstall:t}=BO(),[n,r]=(0,v.useState)(!1);return!e||n?null:(0,z.jsxs)(`div`,{className:`flex flex-none items-center gap-3 border-t px-3 py-2 text-sm [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,z.jsx)(`span`,{className:`flex-1`,children:`Install crouter for quick, full-screen access.`}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void t(),className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,z.jsx)(Vf,{size:14,"aria-hidden":!0}),`Install`]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>r(!0),"aria-label":`Dismiss install prompt`,className:`[color:var(--ink2)]`,children:(0,z.jsx)(ap,{size:14,"aria-hidden":!0})})]})}function HO(e){let t=(0,v.useSyncExternalStore)(rv.subscribe,rv.getWarmIds),{nodes:n}=Zp();return(0,v.useMemo)(()=>{let r=t.includes(e)?t:[...t,e],i=new Map(n.map(e=>[e.node_id,e]));return r.map(e=>{let t=i.get(e);return{nodeId:e,title:t?dh(t):e,dot:t?gh(t):`idle`}})},[t,n,e])}function UO(e,t,n){let r=e.findIndex(e=>e.nodeId===t);return r===-1?null:e[n===`next`?r+1:r-1]?.nodeId??null}function WO(e,t){let n=e.findIndex(e=>e.nodeId===t);if(n===-1)return null;let r=e[n+1];if(r)return r.nodeId;let i=e[n-1];return i?i.nodeId:null}var GO=48,KO=1.5,qO=24;function JO(e){if(e.scrolled||e.startX<qO)return null;let t=e.endX-e.startX,n=e.endY-e.startY;return Math.abs(t)<GO||Math.abs(t)<Math.abs(n)*KO?null:t<0?`next`:`prev`}function YO(e,t){return t>-48?!1:Math.abs(t)>=Math.abs(e)*KO}function XO({open:e,activeId:t,onClose:n}){let r=dt(),{nodes:i}=Zp(),a=jm(),[o,s]=(0,v.useState)(``),c=(0,v.useMemo)(()=>yh(i),[i]),l=(0,v.useMemo)(()=>{let e=o.trim().toLowerCase();return e?c.filter(t=>t.title.toLowerCase().includes(e)):c},[c,o]);if((0,v.useEffect)(()=>{e&&s(``)},[e]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),!e)return null;let u=e=>{r(e),n()};return(0,z.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Switch conversation`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,z.jsxs)(`section`,{className:`flex max-h-[88vh] w-full flex-col overflow-hidden rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,z.jsx)(`p`,{className:`instlabel flex-1`,children:`Conversations`}),(0,z.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close switcher`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(ap,{className:`size-4`})})]}),(0,z.jsx)(`div`,{className:`border-b border-border px-4 py-2`,children:(0,z.jsx)(`input`,{value:o,onChange:e=>s(e.currentTarget.value),placeholder:`Search conversations\\u2026`,className:`w-full bg-transparent text-sm outline-none [color:var(--ink)] placeholder:[color:var(--dim)]`})}),(0,z.jsxs)(`ul`,{className:`min-h-0 flex-none overflow-auto border-b border-border py-1`,children:[(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(`/`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,z.jsx)(Gf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`text-sm [color:var(--ink)]`,children:`Home`})]})}),(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(`/inbox`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,z.jsx)(Kf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`flex-1 text-sm [color:var(--ink)]`,children:`Inbox`}),a>0&&(0,z.jsx)(`span`,{className:`font-inst rounded-full border px-1.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:a})]})})]}),(0,z.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-auto py-1 pb-[max(0.5rem,env(safe-area-inset-bottom))]`,children:l.length===0?(0,z.jsx)(`li`,{className:`px-4 py-3 text-sm italic [color:var(--mut)]`,children:`no conversations`}):l.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(`/c/${encodeURIComponent(e.id)}`),className:J(`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,e.id===t&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,z.jsx)(`span`,{className:J(`dot shrink-0`,e.state===`needs-you`?`blocked`:e.state),"aria-hidden":!0}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-sm [color:var(--ink)]`,children:e.title}),(0,z.jsx)(`span`,{className:`block truncate text-xs [color:var(--mut)]`,children:bh(e)})]})]})},e.id))})]})})}var ZO=4;function QO({activeId:e}){let t=dt(),n=HO(e),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=n=>{n!==e&&t(`/c/${encodeURIComponent(n)}`)},u=r=>{if(o(null),r===e){let e=WO(n,r);t(e?`/c/${encodeURIComponent(e)}`:`/`)}rv.evict(r)};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`nav`,{"aria-label":`Panes`,className:`mobile-pane-bar flex flex-none items-stretch gap-1.5 border-t px-2 pt-1.5 [border-color:var(--line)] [background:var(--panel)]`,onTouchStart:e=>{let t=e.touches[0];t&&(c.current={x:t.clientX,y:t.clientY,scrollLeft:s.current?.scrollLeft??0})},onTouchEnd:r=>{let i=c.current;if(c.current=null,!i)return;let a=r.changedTouches[0];if(!a)return;let o=Math.abs((s.current?.scrollLeft??0)-i.scrollLeft)>ZO,l=JO({startX:i.x,startY:i.y,endX:a.clientX,endY:a.clientY,scrolled:o});if(!l)return;let u=UO(n,e,l);u&&t(`/c/${encodeURIComponent(u)}`)},children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(!0),"aria-label":`Switch conversation`,className:`flex size-9 shrink-0 items-center justify-center self-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(Jf,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(`div`,{ref:s,className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-1.5`,children:n.map(t=>(0,z.jsx)(tk,{entry:t,active:t.nodeId===e,revealed:a===t.nodeId,onReveal:()=>o(t.nodeId),onDismissReveal:()=>o(null),onSelect:()=>l(t.nodeId),onClose:()=>u(t.nodeId)},t.nodeId))}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>TO(t),"aria-label":`New chat`,className:`mb-1.5 flex size-9 shrink-0 items-center justify-center self-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,z.jsx)($f,{className:`size-4`,"aria-hidden":!0})})]}),(0,z.jsx)(XO,{open:r,activeId:e,onClose:()=>i(!1)})]})}var $O=480,ek=8;function tk({entry:e,active:t,revealed:n,onReveal:r,onDismissReveal:i,onSelect:a,onClose:o}){let s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,z.jsxs)(`button`,{type:`button`,onTouchStart:e=>{let t=e.touches[0];t&&(s.current={x:t.clientX,y:t.clientY},l.current=!1,u(),c.current=setTimeout(()=>{l.current=!0,r()},$O))},onTouchMove:e=>{let t=s.current,n=e.touches[0];!t||!n||Math.hypot(n.clientX-t.x,n.clientY-t.y)>ek&&u()},onTouchEnd:e=>{u();let t=s.current;s.current=null;let n=e.changedTouches[0];if(!(!t||!n)){if(l.current){e.preventDefault();return}YO(n.clientX-t.x,n.clientY-t.y)&&(e.preventDefault(),o())}},onClick:()=>n?i():a(),"aria-label":n?`Close ${e.title}`:e.title,className:J(`relative flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,t?`border-[color:var(--line2)] [background:var(--panel2)] [color:var(--ink)]`:`border-border bg-transparent [color:var(--ink2)]`),children:[(0,z.jsx)(`span`,{className:J(`dot shrink-0`,e.dot),"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`max-w-32 truncate`,children:e.title}),n&&(0,z.jsx)(`span`,{role:`button`,tabIndex:0,onClick:e=>{e.stopPropagation(),o()},"aria-label":`Close ${e.title}`,className:`ml-0.5 flex size-4 shrink-0 items-center justify-center rounded-full [background:var(--destructive)] text-white`,children:(0,z.jsx)(ap,{className:`size-3`,"aria-hidden":!0})})]})}function nk({children:e}){let t=FO(ct().pathname);return(0,z.jsxs)(`div`,{className:`mobile-shell-root flex flex-col overflow-hidden`,children:[(0,z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),t===null?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(VO,{}),(0,z.jsx)(LO,{})]}):(0,z.jsx)(QO,{activeId:t},t)]})}function rk({children:e}){return vO()?(0,z.jsx)(nk,{children:e}):(0,z.jsx)(NO,{children:e})}var ik=`false`,ak=`false`,ok=ik===`true`,sk=ak===`true`;function ck(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,ok||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await w(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!sk)if(ok)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}function lk(e={}){let{immediate:t=!0,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f]=(0,v.useState)(()=>ck({immediate:t,onNeedReload:n,onOfflineReady(){d(!0),i?.()},onNeedRefresh(){l(!0),r?.()},onRegistered:a,onRegisteredSW:o,onRegisterError:s}));return{needRefresh:[c,l],offlineReady:[u,d],updateServiceWorker:f}}function uk(){let{needRefresh:[e,t],offlineReady:[n,r],updateServiceWorker:i}=lk({onRegisterError(e){console.warn(`crtr web: service worker registration failed`,e)}});return(0,v.useEffect)(()=>{n&&(zm(`App ready to work offline`,`success`),r(!1))},[n,r]),{needRefresh:e,dismiss:()=>t(!1),refresh:()=>void i(!0)}}function dk(){let{needRefresh:e,dismiss:t,refresh:n}=uk();return e?(0,z.jsx)(`div`,{className:`pwa-update-banner px-3`,children:(0,z.jsxs)(`div`,{className:`pointer-events-auto flex items-center gap-3 rounded-lg border px-3 py-2 text-sm shadow-md [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,z.jsx)(`span`,{children:`Update ready`}),(0,z.jsxs)(`button`,{type:`button`,onClick:n,className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,z.jsx)(ep,{size:14,"aria-hidden":!0}),`Refresh`]}),(0,z.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss update prompt`,className:`[color:var(--ink2)]`,children:(0,z.jsx)(ap,{size:14,"aria-hidden":!0})})]})}):null}function fk(){let e=Rm(e=>e.toasts),t=Rm(e=>e.dismiss);return e.length===0?null:(0,z.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-50 flex flex-col items-center gap-2`,children:e.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>t(e.id),className:J(`pointer-events-auto border px-4 py-2 font-mono text-sm transition-opacity`,e.tone===`success`?`border-success/40 bg-success/10 text-success`:`border-border bg-card text-foreground`),children:e.message},e.id))})}function pk(){return(0,z.jsx)(An,{children:(0,z.jsxs)(Sf,{delayDuration:300,children:[(0,z.jsx)(wO,{}),(0,z.jsx)(CO,{}),(0,z.jsx)(rk,{children:(0,z.jsx)(SO,{})}),(0,z.jsx)(dk,{}),(0,z.jsx)(fk,{})]})})}document.documentElement.classList.add(`dark`),document.documentElement.classList.remove(`light`);var mk=document.getElementById(`root`);if(!mk)throw Error(`crtr web: #root element not found in index.html`);(0,b.createRoot)(mk).render((0,z.jsx)(v.StrictMode,{children:(0,z.jsx)(pk,{})}));
|
|
85
|
+
`).map(e=>{let t=e.indexOf(`:`);return t<1?null:{key:e.slice(0,t).trim(),val:e.slice(t+1).trim()}}).filter(Boolean);return(0,z.jsxs)(z.Fragment,{children:[i.length>0&&(0,z.jsx)(`div`,{className:`fm-chips`,children:i.map(({key:e,val:t})=>(0,z.jsxs)(`span`,{className:`fm-chip`,children:[e,` `,(0,z.jsx)(`b`,{children:t})]},e))}),(0,z.jsx)(`div`,{className:uD,dangerouslySetInnerHTML:{__html:WT(r)}})]})}}return(0,z.jsx)(`div`,{className:uD,dangerouslySetInnerHTML:{__html:WT(e)}})}var mD=/[A-Za-z0-9_:-]/,hD=/[A-Za-z0-9]/,gD=/[ \t\n\r\f\v]/;function _D(e){return mD.test(e)}function vD(e){return gD.test(e)}function yD(e,t){return t===0||vD(e[t-1])}function bD(e){let t=[],n=e.length;for(let r=0;r<n;r++){if(e[r]!==`/`||!yD(e,r))continue;let i=r+1;for(;i<n&&_D(e[i]);)i++;if(i===r+1)continue;let a=i;for(;a>r+1&&!hD.test(e[a-1]);)a--;if(a===r+1)continue;let o=e.slice(r,a),s=o.slice(1).replace(/:/g,`/`);t.push({start:r,end:a,raw:o,candidate:s})}return t}function xD(e){return`/`+e.replace(/\//g,`:`)}function SD(e,t){let n=e.length,r=Math.max(0,Math.min(t,n)),i=r;for(;i>0&&_D(e[i-1]);)i--;let a=i-1;if(a<0||e[a]!==`/`||!yD(e,a))return null;let o=a+1;for(;o<n&&_D(e[o]);)o++;return{start:a,end:o,surfacePrefix:e.slice(a,r)}}function CD(e,t){let n=/^\/(\S+)/.exec(e);return n?t.has(n[1]):!1}function wD(e,t,n){if(CD(e,n))return[];let r=[];for(let n of bD(e))t.has(n.candidate)&&r.push({start:n.start,end:n.end,name:n.candidate});return r}function TD(e,t,n,r){if(CD(e,r))return null;let i=SD(e,t);if(!i||i.start===0)return null;let a=i.surfacePrefix,o=[];for(let e of n){let t=xD(e.name);t.startsWith(a)&&o.push({name:e.name,label:t,shortForm:e.shortForm})}return o.length===0?null:{start:i.start,end:i.end,items:o}}function ED(e,t,n){let r=xD(n);return{text:e.slice(0,t.start)+r+e.slice(t.end),caret:t.start+r.length}}function DD(e,t,n){return!e||!t||t.start!==e.start||t.end!==e.end?!1:n.slice(e.start,e.end)===e.text}function OD(e,t){return e&&t&&t.start===e.start&&t.end===e.end?e:null}function kD(e,t){return e||t===229}function AD({state:e,activeIndex:t,onSelect:n,onHoverIndex:r}){let i=(0,v.useRef)(!1);if(!e||e.items.length===0)return null;let a=(e,t)=>{i.current=!0,n(e,t)};return(0,z.jsx)(`div`,{className:`ref-suggest absolute bottom-full left-0 right-0 z-20 mb-1 max-h-56 overflow-auto border border-border bg-popover`,role:`listbox`,"aria-label":`Memory reference suggestions`,children:(0,z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:e.items.map((e,n)=>(0,z.jsxs)(`li`,{role:`option`,"aria-selected":n===t,className:J(`ref-suggest-row flex cursor-pointer flex-wrap items-baseline gap-x-2 gap-y-0.5 px-3 py-1.5`,n===t?`ref-suggest-row-active bg-accent/50`:`hover:bg-accent/30`),onPointerDown:t=>{t.preventDefault(),a(e,n)},onPointerEnter:()=>r(n),onClick:()=>{if(i.current){i.current=!1;return}a(e,n)},children:[(0,z.jsx)(`span`,{className:`ref-suggest-label font-mono text-sm font-semibold text-primary`,children:e.label}),e.shortForm&&(0,z.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:e.shortForm})]},e.name))})})}var jD=``,MD=`absolute inset-0 z-0 min-h-16 w-full overflow-hidden whitespace-pre-wrap break-words rounded-md border border-transparent px-3 py-2 text-sm text-[var(--ink)]`,ND=`relative z-10 bg-transparent text-transparent caret-[var(--ink)]`;function PD({value:e,refs:t,commandNames:n,onReplaceToken:r,className:i,onChange:a,onKeyDown:o,onSelect:s,onScroll:c,onClick:l,ref:u,...d}){let f=(0,v.useRef)(null),p=(0,v.useRef)(null),[m,h]=(0,v.useState)(0),[g,_]=(0,v.useState)(0),y=(0,v.useRef)(null),b=e=>{f.current=e,typeof u==`function`?u(e):u&&(u.current=e)},x=(0,v.useMemo)(()=>new Set(t.map(e=>e.name)),[t]),S=(0,v.useMemo)(()=>wD(e,x,n),[e,x,n]),C=(0,v.useMemo)(()=>TD(e,m,t,n),[e,m,t,n]),[w,T]=(0,v.useState)(null),E=DD(w,C,e)?null:C;(0,v.useEffect)(()=>{T(e=>OD(e,C))},[C?.start,C?.end]),(0,v.useEffect)(()=>{_(0)},[E?.start,E?.end,E?.items.length]),(0,v.useEffect)(()=>{let t=y.current;if(!t||t.text!==e)return;y.current=null;let n=f.current;n&&requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(t.caret,t.caret),h(t.caret)})},[e]);let D=e=>{h(e.selectionStart??0)},O=t=>{if(!E)return;let n={start:E.start,end:E.end},i=ED(e,n,t.name);y.current=i,r(i),T({start:n.start,end:i.caret,text:i.text.slice(n.start,i.caret)})},k=e=>{a?.(e),D(e.currentTarget)},A=e=>{s?.(e),D(e.currentTarget)},j=e=>{l?.(e),D(e.currentTarget)},M=t=>{if(kD(t.nativeEvent.isComposing,t.keyCode)){o?.(t),t.defaultPrevented||D(t.currentTarget);return}if(E&&E.items.length>0){if(t.key===`ArrowDown`){t.preventDefault(),_(e=>(e+1)%E.items.length);return}if(t.key===`ArrowUp`){t.preventDefault(),_(e=>(e-1+E.items.length)%E.items.length);return}if(t.key===`Enter`||t.key===`Tab`){t.preventDefault();let e=E.items[g]??E.items[0];e&&O(e);return}if(t.key===`Escape`){t.preventDefault(),t.currentTarget.setSelectionRange(E.end,E.end),h(E.end),T({start:E.start,end:E.end,text:e.slice(E.start,E.end)});return}}o?.(t),t.defaultPrevented||D(t.currentTarget)},ee=e=>{c?.(e),p.current&&(p.current.scrollTop=e.currentTarget.scrollTop,p.current.scrollLeft=e.currentTarget.scrollLeft)};(0,v.useEffect)(()=>{let e=f.current,t=p.current;if(!e||!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft});return n.observe(e),()=>n.disconnect()},[]);let N=FD(e.endsWith(`
|
|
86
|
+
`)?e+jD:e,S);return(0,z.jsxs)(`div`,{className:`memory-ref-shell relative`,children:[(0,z.jsx)(`div`,{ref:p,"aria-hidden":`true`,className:J(MD,i),children:N.map((e,t)=>e.highlighted?(0,z.jsx)(`span`,{className:`ref-hl`,children:e.text},t):(0,z.jsx)(`span`,{children:e.text},t))}),(0,z.jsx)(ym,{...d,ref:b,value:e,className:J(i,ND),onChange:k,onKeyDown:M,onSelect:A,onScroll:ee,onClick:j}),(0,z.jsx)(AD,{state:E,activeIndex:g,onHoverIndex:_,onSelect:e=>O(e)})]})}function FD(e,t){let n=[],r=0;for(let i of t)i.start>r&&n.push({text:e.slice(r,i.start),highlighted:!1}),n.push({text:e.slice(i.start,i.end),highlighted:!0}),r=i.end;return r<e.length&&n.push({text:e.slice(r),highlighted:!1}),n}var ID=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],LD=e=>({"--i":e}),RD={borderBottom:`1px solid var(--line)`,background:`linear-gradient(180deg, rgba(33,31,25,.7), rgba(20,19,16,0))`};function zD(e){let t=dt(),{store:n,detail:r,input:i,setInput:a,reviving:o,actionError:s,peekedPath:c,setPeekedPath:l,dormant:u,brokerUp:d,writable:f,streaming:p,canDrive:m,commands:h,refs:g,commandNames:_,onReplaceToken:y,sendPrimary:b,onInputKeyDown:x,selectCommand:S,doRevive:C,doClose:w}=Bv(e.id);return(0,v.useEffect)(()=>{let e=e=>{!e.altKey||e.metaKey||e.ctrlKey||e.code!==`KeyD`||document.activeElement instanceof HTMLTextAreaElement||(e.preventDefault(),$T())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,z.jsx)(dE.Provider,{value:{peekedPath:c,onPeek:l},children:(0,z.jsxs)(`div`,{className:`in flex h-full min-h-0 flex-col`,children:[(0,z.jsxs)(`div`,{className:J(`con-head rv flex shrink-0 items-center gap-3 px-6 py-4`,u&&`opacity-80`),style:{...RD,...LD(1)},children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/`),className:`flex shrink-0 items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-[var(--ink)]`,children:[(0,z.jsx)(Mf,{className:`size-4`}),`Conversations`]}),(0,z.jsx)(Nh,{store:n,detail:r}),(0,z.jsx)(`div`,{className:`flex-1`}),(0,z.jsx)(VD,{})]}),(0,z.jsx)(`div`,{className:`rv`,style:LD(2),children:(0,z.jsx)(zh,{store:n,detail:r})}),(0,z.jsx)(UD,{state:n.brokerStatus,dormant:u}),n.error&&(0,z.jsxs)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:[n.error.code,`: `,n.error.message]}),s&&(0,z.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:s}),(0,z.jsx)(cD,{conversationId:e.id}),(0,z.jsxs)(`div`,{className:`streamwrap relative flex min-h-0 flex-1 overflow-hidden`,children:[(0,z.jsx)(eg,{currentId:e.id,onNavigate:e=>t(`/nodes/${e}`)}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,z.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,z.jsx)(aD,{messages:n.messages,partialToolResults:n.partialToolResults,executingToolIds:n.executingToolIds,toolGroupSummaries:n.toolGroupSummaries,queued:n.queued,streaming:p})}),u?(0,z.jsx)(GD,{id:e.id,reviving:o,onRevive:C,onClose:w}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(WD,{store:n,canDrive:m,streaming:p,onClose:w}),(0,z.jsxs)(`div`,{className:`relative flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,z.jsx)(Hv,{commands:h,query:i,visible:i.startsWith(`/`),onSelect:S}),(0,z.jsx)(PD,{className:`resize-none font-mono text-sm`,value:i,refs:g,commandNames:_,onReplaceToken:y,onChange:e=>a(e.currentTarget.value),onKeyDown:x,disabled:!m,placeholder:HD(f,d),rows:3}),(0,z.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,z.jsx)(KD,{id:e.id}),(0,z.jsx)(Z,{variant:`default`,onClick:b,disabled:!m||!i.trim(),children:p?`Steer`:`Send`})]})]})]})]}),(0,z.jsx)(dD,{nodeId:e.id,path:c,onClose:()=>l(null)})]}),(0,z.jsx)(Uh,{store:n,detail:r}),(0,z.jsx)(Gv,{store:n})]})})}var BD=[{value:`focused`,label:`Focused`},{value:`standard`,label:`Standard`},{value:`verbose`,label:`Verbose`}];function VD(){let e=tE();return(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,title:`Transcript detail — Focused / Standard / Verbose (⌥D to cycle)`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Detail`}),(0,z.jsxs)(fm,{value:e,onValueChange:e=>QT(e),children:[(0,z.jsx)(mm,{size:`sm`,className:`text-sm`,"aria-label":`Transcript detail`,children:(0,z.jsx)(pm,{})}),(0,z.jsx)(hm,{children:BD.map(e=>(0,z.jsx)(gm,{value:e.value,children:e.label},e.value))})]})]})}function HD(e,t){return e?t?`Type a prompt, or / for commands…`:`broker is down — input is frozen`:`read-only — this view cannot drive this session`}function UD({state:e,dormant:t}){return t||e!==`down`&&e!==`reconnecting`?null:(0,z.jsx)(`div`,{className:[`broker-banner border px-4 py-2 text-sm`,e===`down`?`bg-destructive/15 text-destructive border-destructive/30`:`bg-warning/15 border-warning/30`].join(` `),children:e===`down`?`Broker is down — history frozen, input disabled. Waiting for auto-revive…`:`Reconnecting to the broker…`})}function WD({store:e,canDrive:t,streaming:n,onClose:r}){let[i,a]=(0,v.useState)(null),o=i??e.state?.thinkingLevel??`medium`;return(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-2`,children:[(0,z.jsx)(Z,{variant:`secondary`,size:`sm`,disabled:!t||!n,onClick:()=>e.abort(),children:`Abort`}),(0,z.jsxs)(`label`,{className:`tiny-sel relative`,"aria-disabled":!t,children:[`thinking `,(0,z.jsx)(`b`,{children:o}),(0,z.jsx)(jf,{className:`size-3.5`}),(0,z.jsx)(`select`,{disabled:!t,value:o,onChange:t=>{let n=t.currentTarget.value;a(n),e.setThinkingLevel(n)},"aria-label":`Thinking level`,className:`absolute inset-0 cursor-pointer opacity-0`,children:ID.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))})]}),(0,z.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.cycleModel(),children:`Cycle model`}),(0,z.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.compact(),children:`Compact`}),(0,z.jsx)(Z,{variant:`destructive`,size:`sm`,className:`ml-auto`,onClick:r,children:`Close node`})]})}function GD({id:e,reviving:t,onRevive:n,onClose:r}){return(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-3`,children:[(0,z.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`This node is dormant (read-only). Revive to drive it live.`}),(0,z.jsx)(KD,{id:e}),(0,z.jsx)(Z,{variant:`default`,disabled:t,onClick:n,children:t?`Revive…`:`Revive`}),(0,z.jsx)(Z,{variant:`destructive`,onClick:r,children:`Close node`})]})}function KD({id:e}){let[t,n]=(0,v.useState)(!1);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{variant:`secondary`,onClick:()=>n(!0),children:`Message (inbox)`}),(0,z.jsx)(qD,{id:e,open:t,onOpenChange:n})]})}function qD({id:e,open:t,onOpenChange:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null);return(0,v.useEffect)(()=>{t&&(i(``),o(``),u(null))},[t]),(0,z.jsx)(nm,{open:t,onOpenChange:n,children:(0,z.jsxs)(am,{children:[(0,z.jsxs)(om,{children:[(0,z.jsx)(cm,{children:`Send an inbox message`}),(0,z.jsx)(lm,{children:`A directive deliverable to any node, including a dormant one.`})]}),(0,z.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),r.trim()){c(!0),u(null);try{let t=await xp(e,{body:r.trim(),...a.trim()?{tier:a.trim()}:{}});u(`delivered=${String(t.delivered)} revived=${String(t.revived)}`),i(``)}catch(e){u(Vv(e))}finally{c(!1)}}},className:`flex flex-col gap-3`,children:[(0,z.jsx)(ym,{value:r,onChange:e=>i(e.currentTarget.value),rows:4,required:!0,placeholder:`Message body…`}),(0,z.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[`tier`,(0,z.jsx)(`input`,{className:`rounded border bg-transparent px-2 py-1 text-sm`,value:a,onChange:e=>o(e.currentTarget.value),placeholder:`(default)`})]}),l&&(0,z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:l}),(0,z.jsxs)(sm,{children:[(0,z.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>n(!1),disabled:s,children:`Close`}),(0,z.jsx)(Z,{type:`submit`,variant:`default`,disabled:s,children:s?`Sending…`:`Send`})]})]})]})})}function JD(e){e.key===`Enter`&&e.stopPropagation()}function YD(e){return e.writable?e.canDrive?`Type a prompt. Enter makes a new line; Send submits.`:`broker is down — input is frozen`:`read-only — this view cannot drive`}function XD({screen:e,onMetricsChange:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(!1),o=(0,v.useRef)(0),s=(0,v.useRef)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useMemo)(()=>(e,r=o.current)=>{a.current=e,o.current=r;let c=Math.ceil(n.current?.getBoundingClientRect().height??0),l={height:c,keyboardHeight:r,keyboardOpen:e},u=i.current??document.querySelector(`.mobile-shell-root`);i.current=u,u&&u.style.setProperty(`--composer-height`,`${c}px`),(s.current.height!==l.height||s.current.keyboardHeight!==l.keyboardHeight||s.current.keyboardOpen!==l.keyboardOpen)&&(s.current=l,t(l))},[t]),l=(0,v.useMemo)(()=>e=>{let t=i.current??document.querySelector(`.mobile-shell-root`);if(i.current=t,!t)return;let n=window.visualViewport,r=n&&e?Math.max(0,Math.round(window.innerHeight-(n.height+n.offsetTop))):0,a=n?Math.max(0,Math.round(n.offsetTop)):0;t.style.setProperty(`--kb-height`,`${r}px`),t.style.setProperty(`--vv-offset`,`${a}px`),t.dataset.keyboardOpen=e||r>0?`true`:`false`,c(e||r>0,r)},[c]);return(0,v.useLayoutEffect)(()=>{let e=r.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,180)}px`,c(a.current))},[e.input,c]),(0,v.useEffect)(()=>{let e=document.querySelector(`.mobile-shell-root`);if(i.current=e,!e)return;let t=()=>{let e=window.visualViewport,t=e?window.innerHeight-(e.height+e.offsetTop)>0:a.current;l(t)},o=window.visualViewport,s=()=>{o||l(!0)},u=()=>{o||l(!1)},d=r.current;d?.addEventListener(`focus`,s),d?.addEventListener(`blur`,u);let f=()=>t();o&&(o.addEventListener(`resize`,f),o.addEventListener(`scroll`,f)),window.addEventListener(`resize`,f),t();let p=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>c(a.current));return p&&n.current&&p.observe(n.current),()=>{d?.removeEventListener(`focus`,s),d?.removeEventListener(`blur`,u),window.removeEventListener(`resize`,f),o&&(o.removeEventListener(`resize`,f),o.removeEventListener(`scroll`,f)),p?.disconnect(),e&&(e.style.setProperty(`--kb-height`,`0px`),e.style.setProperty(`--vv-offset`,`0px`),e.style.setProperty(`--composer-height`,`0px`),delete e.dataset.keyboardOpen)}},[c,l]),(0,z.jsxs)(`div`,{ref:n,className:`mobile-composer shrink-0 border-t border-border bg-[var(--panel)] px-3 py-3`,children:[(0,z.jsx)(PD,{ref:r,className:`mobile-composer-textarea resize-none rounded-xl border-border bg-[rgba(0,0,0,.16)] font-mono text-base leading-6 text-[var(--ink)] placeholder:text-[var(--dim)]`,rows:2,value:e.input,refs:e.refs,commandNames:e.commandNames,onReplaceToken:t=>{e.onReplaceToken(t),requestAnimationFrame(()=>c(a.current))},placeholder:YD(e),onChange:t=>{e.setInput(t.currentTarget.value),requestAnimationFrame(()=>c(a.current))},onKeyDown:JD}),(0,z.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[e.streaming&&(0,z.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,disabled:!e.canDrive,onClick:()=>e.store.abort(),children:`Stop`}),(0,z.jsx)(Z,{type:`button`,size:`sm`,className:`flex-1`,disabled:!e.canDrive||!e.input.trim(),onClick:()=>e.sendPrimary(),children:e.streaming?`Steer`:`Send`})]}),!e.store.serverConnected&&(0,z.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Offline — draft saved locally.`}),e.store.serverConnected&&!e.canDrive&&(0,z.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`This thread is not live — input is frozen.`})]})}var ZD={live:`border-success/25 bg-success/10 text-success`,working:`border-success/25 bg-success/10 text-success`,idle:`border-border bg-transparent text-muted-foreground`,"needs-you":`border-warning/30 bg-warning/10 text-warning`,done:`border-border bg-transparent text-muted-foreground`,reconnecting:`border-warning/30 bg-warning/10 text-warning`,offline:`border-destructive/30 bg-destructive/10 text-destructive`};function QD({title:e,statusLabel:t,statusTone:n,onBack:r,onOpenOverflow:i}){return(0,z.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 border-b px-3 py-2 [border-color:var(--line)] [background:var(--panel)]`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to conversations`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(Mf,{className:`size-4`})}),(0,z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,z.jsx)(`h1`,{className:`truncate text-base font-medium text-[var(--ink)]`,children:e})}),t&&(0,z.jsxs)(`span`,{className:J(`inline-flex max-w-[44vw] items-center gap-1.5 rounded-full border px-2 py-1 text-xs font-medium`,ZD[n]),children:[n===`working`||n===`reconnecting`?(0,z.jsx)(Yf,{className:`size-3.5 shrink-0 animate-spin`}):(0,z.jsx)(`span`,{className:`size-2 shrink-0 rounded-full`,style:{background:n===`live`?`var(--success)`:n===`needs-you`?`var(--warning)`:n===`offline`?`var(--destructive)`:`var(--dim)`}}),(0,z.jsx)(`span`,{className:`truncate`,children:t})]}),(0,z.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`More thread actions`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(Hf,{className:`size-4`})})]})}var $D=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function eO({open:e,screen:t,onClose:n}){let[r,i]=(0,v.useState)(t.store.state?.thinkingLevel??`medium`);return(0,v.useEffect)(()=>{i(t.store.state?.thinkingLevel??`medium`)},[t.store.state?.thinkingLevel]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),e?(0,z.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Thread actions`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,z.jsxs)(`section`,{className:`max-h-[88vh] w-full overflow-auto rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Thread actions`}),(0,z.jsx)(`p`,{className:`truncate text-sm text-[var(--ink)]`,children:t.detail?.name?.trim()||`Thread`})]}),(0,z.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close thread actions`,className:`flex size-8 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(ap,{className:`size-4`})})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pt-4 pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,z.jsxs)(`section`,{className:`space-y-3`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Session`}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.cycleModel(),disabled:!t.canDrive,children:`Cycle model`}),(0,z.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.compact(),disabled:!t.canDrive,children:`Compact`}),(0,z.jsx)(Z,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>void t.doClose(),children:`Close node`}),t.dormant&&(0,z.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>void t.doRevive(),disabled:t.reviving,children:t.reviving?`Reviving…`:`Revive`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`instlabel`,children:`Thinking`}),(0,z.jsxs)(fm,{value:r,onValueChange:e=>{let n=e;i(n),t.store.setThinkingLevel(n)},disabled:!t.canDrive,children:[(0,z.jsx)(mm,{size:`sm`,className:`min-w-36 text-sm`,children:(0,z.jsx)(pm,{placeholder:`Thinking`})}),(0,z.jsx)(hm,{children:$D.map(e=>(0,z.jsx)(gm,{value:e,children:e},e))})]})]})]}),(0,z.jsxs)(`section`,{className:`space-y-2`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Context`}),(0,z.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-[rgba(0,0,0,.12)]`,children:(0,z.jsx)(zh,{store:t.store,detail:t.detail})})]}),(0,z.jsxs)(`section`,{className:`space-y-2`,children:[(0,z.jsx)(`p`,{className:`instlabel`,children:`Instruments`}),(0,z.jsx)(`div`,{className:`panel overflow-hidden p-3`,children:(0,z.jsx)(Fh,{store:t.store,detail:t.detail})})]})]})]})}):null}function tO({id:e}){let t=dt(),n=Bv(e),{nodes:r}=Zp(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)({height:0,keyboardHeight:0,keyboardOpen:!1}),c=(0,v.useCallback)(e=>{s(t=>t.height===e.height&&t.keyboardHeight===e.keyboardHeight&&t.keyboardOpen===e.keyboardOpen?t:e)},[]),l=(0,v.useMemo)(()=>yh(r),[r]),u=(0,v.useMemo)(()=>Yh(r,e).thisGraph[0]?.node.node_id??e,[e,r]),d=(0,v.useMemo)(()=>l.find(e=>e.id===u)??null,[l,u]),f=n.detail?.name?.trim()||n.detail?.kind?.trim()||`Conversation`,{label:p,tone:m}=(0,v.useMemo)(()=>nO(n,d),[d,n]),h=n.store.messages.length===0,g=rO(n,d),_=(0,v.useMemo)(()=>({peekedPath:n.peekedPath,onPeek:n.setPeekedPath}),[n.peekedPath,n.setPeekedPath]);return(0,z.jsx)(dE.Provider,{value:_,children:(0,z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,z.jsx)(QD,{title:f,statusLabel:p,statusTone:m,onBack:()=>t(`/`),onOpenOverflow:()=>a(!0)}),n.actionError&&(0,z.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/10 px-4 py-2 text-sm text-destructive`,children:n.actionError}),n.store.error&&!n.actionError&&(0,z.jsx)(`div`,{className:`border-b border-warning/30 bg-warning/10 px-4 py-2 text-sm text-warning`,children:n.store.error.message}),(0,z.jsx)(cD,{conversationId:u}),(0,z.jsxs)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,z.jsx)(aD,{messages:n.store.messages,partialToolResults:n.store.partialToolResults,executingToolIds:n.store.executingToolIds,toolGroupSummaries:n.store.toolGroupSummaries,queued:n.store.queued,streaming:n.streaming,bottomInsetPx:o.keyboardHeight,keyboardOpen:o.keyboardOpen,composerHeightPx:o.height}),h&&(0,z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center px-8 text-center text-sm text-muted-foreground`,children:(0,z.jsxs)(`div`,{className:`max-w-sm space-y-2 rounded-2xl border border-border bg-[rgba(0,0,0,.14)] px-4 py-3 shadow-lg shadow-black/20`,children:[(0,z.jsx)(`p`,{className:`font-medium text-[var(--ink)]`,children:g}),(0,z.jsx)(`p`,{children:n.store.serverConnected?`Waiting for the thread to load…`:`Drafts stay local while the broker reconnects.`})]})})]}),(0,z.jsx)(XD,{screen:n,onMetricsChange:c}),(0,z.jsx)(Gv,{store:n.store}),(0,z.jsx)(eO,{open:i,screen:n,onClose:()=>a(!1)}),n.peekedPath&&(0,z.jsx)(`div`,{className:`fixed inset-0 z-40 flex justify-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n.setPeekedPath(null)},children:(0,z.jsx)(dD,{nodeId:e,path:n.peekedPath,onClose:()=>n.setPeekedPath(null),className:`w-full max-w-[100vw]`})})]})})}function nO(e,t){if(e.store.brokerStatus===`down`)return{label:`Offline`,tone:`offline`};if(e.store.brokerStatus===`reconnecting`)return{label:`Reconnecting…`,tone:`reconnecting`};if(e.streaming)return{label:`Working…`,tone:`working`};if(e.store.source===`static`){if(!t)return{label:`Cached`,tone:`idle`};switch(t.state){case`needs-you`:return{label:`Needs you`,tone:`needs-you`};case`active`:return{label:`Active`,tone:`live`};case`idle`:return{label:`Idle`,tone:`idle`};case`done`:return{label:`Done`,tone:`done`}}}return{label:`Live`,tone:`live`}}function rO(e,t){return e.store.brokerStatus===`down`?`Couldn’t reach your thread yet — retrying quietly.`:e.store.brokerStatus===`reconnecting`?`Reconnecting to your thread…`:e.store.source===`static`?t?.state===`needs-you`?`Cached thread — waiting for your reply.`:`Cached thread — connecting to the live broker.`:`Loading conversation…`}function iO(){let{decks:e,loading:t}=Mm();return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,z.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,z.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Inbox`}),e.length>0&&(0,z.jsx)(`span`,{className:`font-inst text-xs`,style:{fontWeight:600,color:`#ff8260`,background:`var(--blk-dim)`,border:`1px solid rgba(255,94,54,.35)`,padding:`1.5px 7px`,borderRadius:`99px`},children:e.length})]}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,z.jsx)(cO,{}):e.length===0?(0,z.jsx)(sO,{}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map(e=>(0,z.jsx)(aO,{deck:e},e.id))})})]})}function aO({deck:e}){let t=dt(),n=Fm(e.kind),r=n.icon,i=e.claim_owner===void 0?e.subtitle:`claimed by ${e.claim_owner} · ${e.subtitle}`;return(0,z.jsx)(`li`,{className:`list-none`,children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox/${encodeURIComponent(e.job_id)}`),className:`panel flex w-full items-start gap-4 px-4 py-3.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_3%,transparent)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,z.jsx)(`span`,{className:`mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},title:n.label,children:(0,z.jsx)(r,{className:`size-4.5`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,z.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title}),(0,z.jsx)(`span`,{className:`instlabel shrink-0`,children:n.label})]}),(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:i}),(0,z.jsx)(oO,{deck:e,className:`mt-1.5`})]}),(0,z.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.08em`,color:`var(--mut)`},title:`waiting ${Im(e.blocked_since)}`,children:Im(e.blocked_since)})]})})}function oO({deck:e,className:t}){return e.source_label===void 0?null:(0,z.jsxs)(`div`,{className:J(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs`,t),children:[(0,z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`in `,(0,z.jsx)(`span`,{className:`font-medium text-foreground/80`,children:e.conversation_title})]}),(0,z.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,z.jsx)(Mn,{to:`/nodes/${encodeURIComponent(e.asking_node_id)}`,onClick:e=>e.stopPropagation(),className:`font-mono text-muted-foreground hover:text-primary hover:underline`,title:e.cwd,children:e.source_label}),(0,z.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,z.jsx)(`span`,{className:`font-mono text-muted-foreground/60`,title:e.cwd,children:e.cwd})]})}function sO(){return(0,z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center py-16 text-center`,children:[(0,z.jsx)(`p`,{className:`text-2xl`,style:{fontStyle:`italic`,color:`var(--ink)`},children:`You're all caught up.`}),(0,z.jsx)(`p`,{className:`mt-1.5 text-sm`,style:{color:`var(--mut)`},children:`Nothing needs your input right now.`})]})}function cO(){return(0,z.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2].map(e=>(0,z.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,z.jsx)(`div`,{className:`size-9 shrink-0 animate-pulse rounded-lg bg-muted`}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,z.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded-none bg-muted`}),(0,z.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded-none bg-muted/70`})]})]},e))})}function lO({deckId:e}){let t=dt(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(0);(0,v.useEffect)(()=>{let n=!1;return r(null),l({}),s(null),d(!1),a(!0),Om(e).then(e=>{n||(r(e),l(Object.fromEntries(e.interactions.map(e=>[e.id,{id:e.id}]))),a(!1))}).catch(e=>{if(!n){if(Sm(e)){zm(e instanceof mp?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}s(e instanceof Error?e:Error(`Failed to load deck.`)),a(!1)}}),()=>{n=!0}},[e,t,f]);let m=(e,t)=>l(n=>({...n,[e]:{...n[e],id:e,...t}}));if(i)return(0,z.jsx)(SO,{});if(o)return(0,z.jsx)(uO,{error:o,onRetry:()=>p(e=>e+1),onBack:()=>t(`/inbox`)});if(!n)return(0,z.jsx)(SO,{});let h=async e=>{if(u)return;d(!0);let r=Object.values(e??c).map(({selectedOptionId:e,...t})=>t);try{await km(n.job_id,{responses:r}),zm(`Done — thanks!`,`success`),t(`/inbox`,{replace:!0})}catch(e){if(Sm(e)){zm(e instanceof mp?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}zm(e instanceof mp?e.message:`Something went wrong — try again.`),d(!1)}},g=n.interactions.length===1?n.interactions[0]:null,_=Fm(n.kind).icon;return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col px-6 py-8`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>t(`/inbox`),className:`mb-4 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,z.jsx)(Df,{className:`size-4`}),` Inbox`]}),(0,z.jsxs)(`header`,{className:`mb-5 flex items-start gap-3`,children:[(0,z.jsx)(`span`,{className:`mt-0.5 inline-flex size-10 shrink-0 items-center justify-center rounded-lg`,style:{border:`1px solid var(--line)`,color:`var(--ink2)`,background:`color-mix(in oklch, var(--ink) 4%, transparent)`},children:(0,z.jsx)(_,{className:`size-5`})}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:n.title}),(0,z.jsx)(`p`,{className:`mt-0.5 text-sm`,style:{color:`var(--mut)`},children:n.subtitle}),(0,z.jsx)(oO,{deck:n,className:`mt-2`})]})]}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,z.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.interactions.map(e=>(0,z.jsx)(pO,{interaction:e,answer:c[e.id]??{id:e.id},onChange:t=>m(e.id,t),conversationId:n.conversation_id,busy:u,onResolveWith:g?t=>void h({[e.id]:t}):void 0},e.id))})}),!dO(g)&&(0,z.jsxs)(`footer`,{className:`mt-6 flex shrink-0 items-center justify-end gap-2 border-t border-border pt-4`,children:[(0,z.jsx)(Z,{variant:`ghost`,onClick:()=>t(`/inbox`),disabled:u,children:`Cancel`}),(0,z.jsx)(Z,{onClick:()=>void h(),disabled:u||!fO(n,c),children:u?`Sending…`:`Submit`})]})]})}function uO({error:e,onRetry:t,onBack:n}){return(0,z.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col justify-center px-6 py-8`,children:(0,z.jsxs)(`section`,{className:`panel p-5`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Couldn’t load the deck`}),(0,z.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.message}),(0,z.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,z.jsx)(Z,{onClick:t,children:`Retry`}),(0,z.jsx)(Z,{variant:`ghost`,onClick:n,children:`Back to inbox`})]})]})})}function dO(e){return e!==null&&(e.kind===`notify`||e.kind===`validation`)}function fO(e,t){return e.interactions.every(e=>{let n=t[e.id];if(!n)return!1;if(e.kind===`notify`||e.kind===`error`)return!0;let r=!!n.selectedOptionIds?.length||!!n.freetext?.trim();return e.options.length===0&&!e.allowFreetext||r})}function pO({interaction:e,answer:t,onChange:n,conversationId:r,busy:i,onResolveWith:a}){switch(e.kind){case`notify`:return(0,z.jsx)(_O,{interaction:e,onGotIt:()=>a?.({id:e.id}),direct:!!a});case`validation`:return(0,z.jsx)(vO,{interaction:e,answer:t,onChange:n,busy:i,onResolveWith:a});case`context`:return(0,z.jsx)(bO,{interaction:e,answer:t,onChange:n});case`error`:return(0,z.jsx)(xO,{interaction:e,answer:t,onChange:n,conversationId:r});default:return(0,z.jsx)(yO,{interaction:e,answer:t,onChange:n})}}function mO({body:e}){return e?(0,z.jsx)(`div`,{className:`prose prose-sm max-w-none text-sm text-foreground/85 dark:prose-invert`,dangerouslySetInnerHTML:{__html:RT(WT(e))}}):null}function hO({children:e,className:t}){return(0,z.jsx)(`section`,{className:J(`panel p-5`,t),children:e})}function gO({it:e}){return(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),(0,z.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:e.subtitle})]})}function _O({interaction:e,onGotIt:t,direct:n}){return(0,z.jsxs)(hO,{children:[(0,z.jsx)(gO,{it:e}),(0,z.jsx)(mO,{body:e.body}),n&&(0,z.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,z.jsxs)(Z,{onClick:t,children:[(0,z.jsx)(Af,{className:`mr-1.5 size-4`}),` Got it`]})})]})}function vO({interaction:e,answer:t,onChange:n,busy:r,onResolveWith:i}){let a=e.options.find(e=>e.id===`yes`)??e.options[0],o=e.options.find(e=>e.id===`no`)??e.options[1],s=r=>{let a={...t,id:e.id,selectedOptionIds:[r]};i?i(a):n({selectedOptionIds:[r],selectedOptionId:void 0})};return(0,z.jsxs)(hO,{children:[(0,z.jsx)(gO,{it:e}),(0,z.jsx)(mO,{body:e.body}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3`,children:[(0,z.jsx)(ym,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Add a comment (optional)`,className:`resize-none text-sm`}),(0,z.jsxs)(`div`,{className:`flex gap-3`,children:[(0,z.jsx)(Z,{className:`flex-1`,size:`lg`,disabled:r,onClick:()=>a&&s(a.id),children:a?.label??`Approve`}),(0,z.jsx)(Z,{className:`flex-1`,size:`lg`,variant:`outline`,disabled:r,onClick:()=>o&&s(o.id),children:o?.label??`Reject`})]}),!i&&t.selectedOptionIds?.[0]&&(0,z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected: `,e.options.find(e=>e.id===t.selectedOptionIds?.[0])?.label]})]})]})}function yO({interaction:e,answer:t,onChange:n}){let r=new Set(t.selectedOptionIds??[]),i=t=>{if(e.multiSelect){let e=new Set(r);e.has(t)?e.delete(t):e.add(t),n({selectedOptionIds:[...e],selectedOptionId:void 0})}else n({selectedOptionIds:[t],selectedOptionId:void 0})};return(0,z.jsxs)(hO,{children:[(0,z.jsx)(gO,{it:e}),(0,z.jsx)(mO,{body:e.body}),(0,z.jsx)(`ul`,{className:`mt-4 flex flex-col gap-2`,children:e.options.map(t=>{let n=r.has(t.id);return(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(t.id),className:J(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,n?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:[(0,z.jsx)(`span`,{className:J(`mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e.multiSelect?`rounded`:`rounded-full`,n?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/40`),children:n&&(0,z.jsx)(Af,{className:`size-3`})}),(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block text-sm font-medium`,children:t.label}),t.description&&(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:t.description})]})]})},t.id)})}),e.allowFreetext&&(0,z.jsx)(ym,{rows:2,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Anything else? (optional)`,className:`mt-3 resize-none text-sm`})]})}function bO({interaction:e,answer:t,onChange:n}){let r=t.selectedOptionIds?.[0];return(0,z.jsxs)(hO,{children:[(0,z.jsx)(gO,{it:e}),e.body&&(0,z.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border p-3`,style:{background:`color-mix(in oklch, var(--ink) 3%, transparent)`},children:[(0,z.jsx)(`p`,{className:`instlabel mb-1.5`,children:`Why we're asking`}),(0,z.jsx)(mO,{body:e.body})]}),e.options.length>0&&(0,z.jsx)(`ul`,{className:`mb-3 flex flex-col gap-2`,children:e.options.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:J(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,r===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})})},e.id))}),(e.allowFreetext||e.options.length===0)&&(0,z.jsx)(ym,{autoFocus:!0,rows:3,value:t.freetext??``,onChange:e=>n({freetext:e.currentTarget.value}),placeholder:e.freetextLabel??`Your answer`,className:`resize-none text-sm`})]})}function xO({interaction:e,answer:t,onChange:n,conversationId:r}){let i=dt();return(0,z.jsxs)(hO,{className:`border-destructive/30`,children:[(0,z.jsx)(gO,{it:e}),(0,z.jsx)(mO,{body:e.body}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[e.options.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>n({selectedOptionIds:[e.id],selectedOptionId:void 0}),className:J(`flex w-full items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,t.selectedOptionIds?.[0]===e.id?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border hover:border-primary/40 hover:bg-accent/40`),children:(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})},e.id)),(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(`/c/${encodeURIComponent(r)}`),className:`flex w-full items-center gap-2 rounded-xl border border-border px-4 py-3 text-left text-sm font-medium transition-colors hover:border-primary/40 hover:bg-accent/40`,children:`Take over — open the conversation`})]})]})}function SO(){return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full max-w-2xl flex-col gap-5 px-6 py-8`,children:[(0,z.jsx)(`div`,{className:`h-4 w-16 animate-pulse rounded-none bg-muted`}),(0,z.jsx)(`div`,{className:`h-7 w-1/2 animate-pulse rounded-none bg-muted`}),(0,z.jsx)(`div`,{className:`h-40 w-full animate-pulse rounded-2xl bg-muted/60`})]})}var CO=`crtr-push-token-v1`,wO=`/__push-token`;async function TO(e){if(typeof caches>`u`)return;let t=await caches.open(CO);if(e===void 0||e===``){await t.delete(wO);return}await t.put(wO,new Response(e))}function EO(){let e={"content-type":`application/json`};return pp!==void 0&&(e.authorization=`Bearer ${pp}`),e}function DO(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}function OO(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function kO(){let e=await fetch(`/__crtr/push/vapid-public-key`,{headers:EO()});if(!e.ok)throw Error(`could not load the push key (${e.status})`);return(await e.json()).publicKey}async function AO(e){let t=await fetch(`/__crtr/push/subscribe`,{method:`POST`,headers:EO(),body:JSON.stringify(e.toJSON())});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`subscribe failed (${t.status})`)}}async function jO(){if(!DO())return`unsupported`;if(Notification.permission===`denied`)return`denied`;let e=await navigator.serviceWorker.getRegistration();return e===void 0||await e.pushManager.getSubscription()===null?`unsubscribed`:`subscribed`}async function MO(){if(!DO())throw Error(`push notifications are not supported in this browser`);if(await Notification.requestPermission()!==`granted`)throw Error(`notification permission was not granted`);let e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();if(t!==null){await TO(pp);try{await AO(t)}catch(e){throw await t.unsubscribe().catch(()=>{}),await TO(void 0).catch(()=>{}),e}return}let n=await kO(),r=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:OO(n)});try{await TO(pp)}catch(e){throw await r.unsubscribe().catch(()=>{}),e}try{await AO(r)}catch(e){throw await r.unsubscribe().catch(()=>{}),await TO(void 0).catch(()=>{}),e}}async function NO(){if(!DO())return;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return;let t=await e.pushManager.getSubscription();if(t===null)return;let n=t.endpoint;await t.unsubscribe(),await TO(void 0).catch(()=>{});try{await fetch(`/__crtr/push/subscribe`,{method:`DELETE`,headers:EO(),body:JSON.stringify({endpoint:n})})}catch{}}function PO(){let[e,t]=(0,v.useState)(()=>DO()?`unsubscribed`:`unsupported`),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{jO().then(t)},[]);return(0,v.useEffect)(()=>{o()},[o]),{status:e,busy:n,error:i,enable:(0,v.useCallback)(()=>{r(!0),a(null),MO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o]),disable:(0,v.useCallback)(()=>{r(!0),a(null),NO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o])}}function FO(){let[e,t]=(0,v.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,z.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col gap-8 overflow-auto px-6 py-8`,children:[(0,z.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Settings`}),(0,z.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,z.jsx)(`h2`,{className:`instlabel`,children:`Appearance`}),(0,z.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e?`Dark theme`:`Light theme`,` is active.`]}),(0,z.jsxs)(Z,{variant:`outline`,onClick:()=>{let e=document.documentElement,n=!e.classList.contains(`dark`);e.classList.toggle(`dark`,n),e.classList.toggle(`light`,!n),t(n)},children:[`Switch to `,e?`light`:`dark`]})]}),(0,z.jsx)(IO,{})]})}function IO(){let{status:e,busy:t,error:n,enable:r,disable:i}=PO();return(0,z.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,z.jsx)(`h2`,{className:`instlabel`,children:`Notifications`}),e===`unsupported`&&(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications aren’t supported in this browser.`}),e===`denied`&&(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications off — enable them for this site in your browser/OS settings.`}),e===`unsubscribed`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Get a push when an agent needs you or finishes, even when this tab is closed.`}),(0,z.jsx)(Z,{variant:`outline`,onClick:r,disabled:t,children:`Enable notifications`})]}),e===`subscribed`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications are on for this browser.`}),(0,z.jsx)(Z,{variant:`outline`,onClick:i,disabled:t,children:`Disable notifications`})]}),n!==null&&(0,z.jsx)(`p`,{className:`text-sm`,style:{color:`var(--warning)`},children:n})]})}var LO=`(max-width: 767px)`;function RO(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(LO).matches}function zO(){let[e,t]=(0,v.useState)(RO);return(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(LO),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function BO(e,t,n){let r=new URLSearchParams;t!==void 0&&t!==``&&r.set(`ask`,t),n!==void 0&&n!==``&&r.set(`token`,n);let i=r.toString();return`/c/${encodeURIComponent(e)}${i===``?``:`?${i}`}`}function VO(){let{id:e}=pt();return zO()?(0,z.jsx)(tO,{id:e??``},e):(0,z.jsx)(zD,{id:e??``},e)}function HO(){let{deckId:e}=pt();return(0,z.jsx)(lO,{deckId:e??``})}function UO(){return(0,z.jsxs)(Bt,{children:[(0,z.jsx)(Rt,{path:`/`,element:(0,z.jsx)(Ch,{})}),(0,z.jsx)(Rt,{path:`/new`,element:(0,z.jsx)(Lt,{to:`/?new=1`,replace:!0})}),(0,z.jsx)(Rt,{path:`/canvas`,element:(0,z.jsx)(oh,{})}),(0,z.jsx)(Rt,{path:`/nodes/:id`,element:(0,z.jsx)(VO,{})}),(0,z.jsx)(Rt,{path:`/c/:id`,element:(0,z.jsx)(VO,{})}),(0,z.jsx)(Rt,{path:`/inbox`,element:(0,z.jsx)(iO,{})}),(0,z.jsx)(Rt,{path:`/inbox/:deckId`,element:(0,z.jsx)(HO,{})}),(0,z.jsx)(Rt,{path:`/settings`,element:(0,z.jsx)(FO,{})}),(0,z.jsx)(Rt,{path:`*`,element:(0,z.jsx)(Ch,{})})]})}function WO(){let e=dt();return(0,v.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let t=t=>{let n=t.data;if(n?.type!==`crtr-deep-link`||typeof n.conversationId!=`string`)return;let r=typeof n.askId==`string`?n.askId:void 0;e(BO(n.conversationId,r,pp))};return navigator.serviceWorker.addEventListener(`message`,t),()=>navigator.serviceWorker.removeEventListener(`message`,t)},[e]),null}function GO(){return zp(e=>e.reachable)?null:(0,z.jsx)(`div`,{role:`status`,className:`fixed inset-x-0 top-0 z-50 bg-warning/90 px-4 py-1.5 text-center text-sm font-medium text-background`,children:`Reconnecting…`})}function KO(e){e(`/?new=1`)}var qO=[{id:`conversations`,label:`Conversations`,path:`/`},{id:`canvas`,label:`Canvas`,path:`/canvas`},{id:`inbox`,label:`Inbox`,path:`/inbox`},{id:`settings`,label:`Settings`,path:`/settings`}],JO={conversations:Zf,canvas:Qf,inbox:Kf,settings:np};function YO({compact:e}){let t=dt();return(0,z.jsxs)(`aside`,{"aria-label":`Primary`,style:e?{width:58}:void 0,className:J(`flex flex-none flex-col gap-0.5 py-4 [border-right:1px_solid_var(--line)] [background:linear-gradient(180deg,rgba(20,19,16,.6),rgba(20,19,16,.2))]`,e?`items-center`:`w-57 px-3`),children:[(0,z.jsxs)(Mn,{to:`/`,title:`crouter`,className:J(`flex items-center no-underline [color:var(--ink)]`,e?`justify-center pt-1 pb-4`:`gap-2.5 px-2.5 pt-1 pb-4 text-base font-medium tracking-[.01em]`),children:[(0,z.jsx)(`span`,{className:`font-inst flex flex-none items-center justify-center rounded-md text-xs font-bold [background:var(--bone)] [color:var(--bone-ink)]`,style:{width:22,height:22},children:`cr`}),!e&&`crouter`]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>KO(t),title:`New chat (⌘⇧O)`,"aria-label":`New chat`,className:J(`flex items-center rounded-lg font-medium transition-all [color:var(--bone-ink)] [background:var(--bone)] hover:[background:var(--ink)]`,e?`mb-1 size-9 justify-center`:`mb-1.5 h-9 gap-2.5 px-3 text-sm`),children:[(0,z.jsx)($f,{size:e?18:16,className:`flex-none`,"aria-hidden":!0}),!e&&(0,z.jsx)(`span`,{children:`New chat`})]}),qO.map(t=>{let n=JO[t.id]??Zf;return(0,z.jsxs)(Nn,{to:t.path,end:t.path===`/`,title:e?t.label:void 0,className:({isActive:t})=>J(`relative flex items-center no-underline transition-all`,e?`size-9 justify-center rounded-lg border border-transparent opacity-75`:`h-9 gap-2.5 rounded-lg border border-transparent px-3 text-sm font-medium`,t?`[color:var(--ink)] opacity-100 [background:rgba(232,228,216,.06)] [border-color:var(--line)] [box-shadow:inset_0_1px_0_var(--raise)]`:`[color:var(--ink2)] hover:opacity-100 hover:[color:var(--ink)] hover:[background:rgba(232,228,216,.04)]`),children:[(0,z.jsx)(n,{size:18,className:e?void 0:`flex-none opacity-75`,"aria-hidden":!0}),!e&&(0,z.jsx)(`span`,{children:t.label}),t.id===`inbox`&&(0,z.jsx)(XO,{compact:e})]},t.id)}),(0,z.jsx)(`div`,{className:`flex-1`})]})}function XO({compact:e}){let t=jm();return t<=0?null:e?(0,z.jsx)(`span`,{className:`absolute right-[5px] top-[5px] size-2.5 rounded-full [background:var(--blk)] [box-shadow:0_0_10px_rgba(255,94,54,.55)] [animation:pulse-hot_1.6s_ease-out_infinite]`}):(0,z.jsx)(`span`,{className:`font-inst ml-auto rounded-full border px-2 py-0.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:t})}function ZO(e,t){let n=(0,v.useRef)(e),r=(0,v.useRef)(t);n.current=e,r.current=t,(0,v.useEffect)(()=>{let e=e=>{let t=document.activeElement;t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement||t instanceof HTMLElement&&t.isContentEditable||n.current(e)&&(e.preventDefault(),r.current(e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function QO({open:e,onClose:t}){let{nodes:n}=Zp(),r=dt(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(0),c=(0,v.useRef)(null),l=(0,v.useMemo)(()=>{let e=n.filter(e=>e.enterable).map(e=>({id:e.node_id,title:dh(e),dot:gh(e),kind:e.kind,last:e.last_activity??e.created}));e.sort((e,t)=>t.last.localeCompare(e.last));let t=i.trim().toLowerCase();return t?e.filter(e=>e.title.toLowerCase().includes(t)||e.kind.toLowerCase().includes(t)):e},[n,i]);if((0,v.useEffect)(()=>{e&&(a(``),s(0),c.current?.focus())},[e]),(0,v.useEffect)(()=>{s(e=>Math.min(e,Math.max(0,l.length-1)))},[l.length]),!e)return null;let u=e=>{e&&(r(`/c/${encodeURIComponent(e.id)}`),t())};return(0,z.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center px-4 pt-24`,style:{background:`var(--scrim)`},onClick:t,children:(0,z.jsxs)(`div`,{className:`panel w-full max-w-xl overflow-hidden p-0`,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowDown`?(e.preventDefault(),s(e=>Math.min(e+1,l.length-1))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),u(l[o]))},children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,style:{borderColor:`var(--line)`},children:[(0,z.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Jump to`}),(0,z.jsx)(`input`,{ref:c,value:i,onChange:e=>a(e.currentTarget.value),placeholder:`Search conversations…`,className:`flex-1 bg-transparent text-sm outline-none`,style:{color:`var(--ink)`}}),(0,z.jsx)(`span`,{className:`kbd`,children:`esc`})]}),(0,z.jsx)(`ul`,{className:`max-h-80 overflow-auto py-1`,children:l.length===0?(0,z.jsx)(`li`,{className:`px-4 py-3 text-sm italic`,style:{color:`var(--mut)`},children:`no live nodes`}):l.map((e,t)=>(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(e),onMouseEnter:()=>s(t),className:J(`flex w-full items-center gap-2.5 px-4 py-2 text-left transition-colors`,t===o&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,z.jsx)(`span`,{className:J(`dot shrink-0`,e.dot)}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,style:{color:`var(--ink)`},children:e.title}),(0,z.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:e.kind})]})},e.id))})]})})}var $O=/^\/(nodes|c)\//;function ek({children:e}){let t=ct(),n=dt(),[r,i]=(0,v.useState)(!1);return ZO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey&&e.code===`KeyO`,[]),(0,v.useCallback)(()=>KO(n),[n])),ZO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&e.code===`KeyK`,[]),(0,v.useCallback)(()=>i(e=>!e),[])),(0,z.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,z.jsx)(YO,{compact:$O.test(t.pathname)}),(0,z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),(0,z.jsx)(QO,{open:r,onClose:()=>i(!1)})]})}var tk=/^\/(?:c|nodes)\/([^/]+)\/?$/;function nk(e){let t=tk.exec(e);if(!t)return null;let n=t[1];return n===void 0?null:decodeURIComponent(n)}var rk=[{id:`home`,label:`Home`,path:`/`,icon:Gf},{id:`inbox`,label:`Inbox`,path:`/inbox`,icon:Kf}];function ik(){let e=dt();return(0,z.jsxs)(`nav`,{"aria-label":`Primary`,className:`mobile-bottom-nav flex flex-none items-stretch gap-1 border-t px-2 pt-1 [border-color:var(--line)] [background:var(--panel)]`,children:[rk.map(e=>(0,z.jsxs)(Nn,{to:e.path,end:e.path===`/`,className:({isActive:e})=>J(`relative flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium no-underline transition-all`,e?`[color:var(--ink)] opacity-100`:`[color:var(--ink2)] opacity-75`),children:[(0,z.jsx)(e.icon,{size:20,"aria-hidden":!0}),(0,z.jsx)(`span`,{children:e.label}),e.id===`inbox`&&(0,z.jsx)(ak,{})]},e.id)),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>KO(e),"aria-label":`New chat`,className:`flex flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-xs font-medium [color:var(--ink2)]`,children:[(0,z.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,z.jsx)($f,{size:18,"aria-hidden":!0})}),(0,z.jsx)(`span`,{children:`New`})]})]})}function ak(){let e=jm();return e<=0?null:(0,z.jsx)(`span`,{className:`font-inst absolute right-2 top-0 min-w-4 rounded-full border px-1 text-center text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:e})}function ok(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches===!0||window.navigator.standalone===!0}function sk(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(ok);(0,v.useEffect)(()=>{let e=e=>{e.preventDefault(),t(e)},n=()=>{r(!0),t(null)};return window.addEventListener(`beforeinstallprompt`,e),window.addEventListener(`appinstalled`,n),()=>{window.removeEventListener(`beforeinstallprompt`,e),window.removeEventListener(`appinstalled`,n)}},[]);let i=(0,v.useCallback)(async()=>{e!==null&&(await e.prompt(),await e.userChoice,t(null))},[e]);return{canInstall:e!==null&&!n,promptInstall:i}}function ck(){let{canInstall:e,promptInstall:t}=sk(),[n,r]=(0,v.useState)(!1);return!e||n?null:(0,z.jsxs)(`div`,{className:`flex flex-none items-center gap-3 border-t px-3 py-2 text-sm [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,z.jsx)(`span`,{className:`flex-1`,children:`Install crouter for quick, full-screen access.`}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void t(),className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,z.jsx)(Vf,{size:14,"aria-hidden":!0}),`Install`]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>r(!0),"aria-label":`Dismiss install prompt`,className:`[color:var(--ink2)]`,children:(0,z.jsx)(ap,{size:14,"aria-hidden":!0})})]})}function lk(e){let t=(0,v.useSyncExternalStore)(yv.subscribe,yv.getWarmIds),{nodes:n}=Zp();return(0,v.useMemo)(()=>{let r=t.includes(e)?t:[...t,e],i=new Map(n.map(e=>[e.node_id,e]));return r.map(e=>{let t=i.get(e);return{nodeId:e,title:t?dh(t):e,dot:t?gh(t):`idle`}})},[t,n,e])}function uk(e,t,n){let r=e.findIndex(e=>e.nodeId===t);return r===-1?null:e[n===`next`?r+1:r-1]?.nodeId??null}function dk(e,t){let n=e.findIndex(e=>e.nodeId===t);if(n===-1)return null;let r=e[n+1];if(r)return r.nodeId;let i=e[n-1];return i?i.nodeId:null}var fk=48,pk=1.5,mk=24;function hk(e){if(e.scrolled||e.startX<mk)return null;let t=e.endX-e.startX,n=e.endY-e.startY;return Math.abs(t)<fk||Math.abs(t)<Math.abs(n)*pk?null:t<0?`next`:`prev`}function gk(e,t){return t>-48?!1:Math.abs(t)>=Math.abs(e)*pk}function _k({open:e,activeId:t,onClose:n}){let r=dt(),{nodes:i}=Zp(),a=jm(),[o,s]=(0,v.useState)(``),c=(0,v.useMemo)(()=>yh(i),[i]),l=(0,v.useMemo)(()=>{let e=o.trim().toLowerCase();return e?c.filter(t=>t.title.toLowerCase().includes(e)):c},[c,o]);if((0,v.useEffect)(()=>{e&&s(``)},[e]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),!e)return null;let u=e=>{r(e),n()};return(0,z.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Switch conversation`,className:`fixed inset-0 z-50 flex items-end bg-black/45 backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,z.jsxs)(`section`,{className:`flex max-h-[88vh] w-full flex-col overflow-hidden rounded-t-3xl border-t border-border bg-[var(--panel)] shadow-2xl shadow-black/40`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,z.jsx)(`p`,{className:`instlabel flex-1`,children:`Conversations`}),(0,z.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close switcher`,className:`flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(ap,{className:`size-4`})})]}),(0,z.jsx)(`div`,{className:`border-b border-border px-4 py-2`,children:(0,z.jsx)(`input`,{value:o,onChange:e=>s(e.currentTarget.value),placeholder:`Search conversations\\u2026`,className:`w-full bg-transparent text-sm outline-none [color:var(--ink)] placeholder:[color:var(--dim)]`})}),(0,z.jsxs)(`ul`,{className:`min-h-0 flex-none overflow-auto border-b border-border py-1`,children:[(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(`/`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,z.jsx)(Gf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`text-sm [color:var(--ink)]`,children:`Home`})]})}),(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(`/inbox`),className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,children:[(0,z.jsx)(Kf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`flex-1 text-sm [color:var(--ink)]`,children:`Inbox`}),a>0&&(0,z.jsx)(`span`,{className:`font-inst rounded-full border px-1.5 text-xs font-semibold [color:#ff8260] [background:var(--blk-dim)] [border-color:rgba(255,94,54,.35)]`,children:a})]})})]}),(0,z.jsx)(`ul`,{className:`min-h-0 flex-1 overflow-auto py-1 pb-[max(0.5rem,env(safe-area-inset-bottom))]`,children:l.length===0?(0,z.jsx)(`li`,{className:`px-4 py-3 text-sm italic [color:var(--mut)]`,children:`no conversations`}):l.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(`/c/${encodeURIComponent(e.id)}`),className:J(`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`,e.id===t&&`bg-[color-mix(in_oklch,var(--ink)_6%,transparent)]`),children:[(0,z.jsx)(`span`,{className:J(`dot shrink-0`,e.state===`needs-you`?`blocked`:e.state),"aria-hidden":!0}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-sm [color:var(--ink)]`,children:e.title}),(0,z.jsx)(`span`,{className:`block truncate text-xs [color:var(--mut)]`,children:bh(e)})]})]})},e.id))})]})})}var vk=4;function yk({activeId:e}){let t=dt(),n=lk(e),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=n=>{n!==e&&t(`/c/${encodeURIComponent(n)}`)},u=r=>{if(o(null),r===e){let e=dk(n,r);t(e?`/c/${encodeURIComponent(e)}`:`/`)}yv.evict(r)};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`nav`,{"aria-label":`Panes`,className:`mobile-pane-bar flex flex-none items-stretch gap-1.5 border-t px-2 pt-1.5 [border-color:var(--line)] [background:var(--panel)]`,onTouchStart:e=>{let t=e.touches[0];t&&(c.current={x:t.clientX,y:t.clientY,scrollLeft:s.current?.scrollLeft??0})},onTouchEnd:r=>{let i=c.current;if(c.current=null,!i)return;let a=r.changedTouches[0];if(!a)return;let o=Math.abs((s.current?.scrollLeft??0)-i.scrollLeft)>vk,l=hk({startX:i.x,startY:i.y,endX:a.clientX,endY:a.clientY,scrolled:o});if(!l)return;let u=uk(n,e,l);u&&t(`/c/${encodeURIComponent(u)}`)},children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(!0),"aria-label":`Switch conversation`,className:`flex size-9 shrink-0 items-center justify-center self-center rounded-full border border-border bg-transparent text-[var(--ink2)] transition-colors hover:text-[var(--ink)]`,children:(0,z.jsx)(Jf,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(`div`,{ref:s,className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto pb-1.5`,children:n.map(t=>(0,z.jsx)(Sk,{entry:t,active:t.nodeId===e,revealed:a===t.nodeId,onReveal:()=>o(t.nodeId),onDismissReveal:()=>o(null),onSelect:()=>l(t.nodeId),onClose:()=>u(t.nodeId)},t.nodeId))}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>KO(t),"aria-label":`New chat`,className:`mb-1.5 flex size-9 shrink-0 items-center justify-center self-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,z.jsx)($f,{className:`size-4`,"aria-hidden":!0})})]}),(0,z.jsx)(_k,{open:r,activeId:e,onClose:()=>i(!1)})]})}var bk=480,xk=8;function Sk({entry:e,active:t,revealed:n,onReveal:r,onDismissReveal:i,onSelect:a,onClose:o}){let s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,z.jsxs)(`button`,{type:`button`,onTouchStart:e=>{let t=e.touches[0];t&&(s.current={x:t.clientX,y:t.clientY},l.current=!1,u(),c.current=setTimeout(()=>{l.current=!0,r()},bk))},onTouchMove:e=>{let t=s.current,n=e.touches[0];!t||!n||Math.hypot(n.clientX-t.x,n.clientY-t.y)>xk&&u()},onTouchEnd:e=>{u();let t=s.current;s.current=null;let n=e.changedTouches[0];if(!(!t||!n)){if(l.current){e.preventDefault();return}gk(n.clientX-t.x,n.clientY-t.y)&&(e.preventDefault(),o())}},onClick:()=>n?i():a(),"aria-label":n?`Close ${e.title}`:e.title,className:J(`relative flex shrink-0 items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,t?`border-[color:var(--line2)] [background:var(--panel2)] [color:var(--ink)]`:`border-border bg-transparent [color:var(--ink2)]`),children:[(0,z.jsx)(`span`,{className:J(`dot shrink-0`,e.dot),"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`max-w-32 truncate`,children:e.title}),n&&(0,z.jsx)(`span`,{role:`button`,tabIndex:0,onClick:e=>{e.stopPropagation(),o()},"aria-label":`Close ${e.title}`,className:`ml-0.5 flex size-4 shrink-0 items-center justify-center rounded-full [background:var(--destructive)] text-white`,children:(0,z.jsx)(ap,{className:`size-3`,"aria-hidden":!0})})]})}function Ck({children:e}){let t=nk(ct().pathname);return(0,z.jsxs)(`div`,{className:`mobile-shell-root flex flex-col overflow-hidden`,children:[(0,z.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),t===null?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ck,{}),(0,z.jsx)(ik,{})]}):(0,z.jsx)(yk,{activeId:t},t)]})}function wk({children:e}){return zO()?(0,z.jsx)(Ck,{children:e}):(0,z.jsx)(ek,{children:e})}var Tk=`false`,Ek=`false`,Dk=Tk===`true`,Ok=Ek===`true`;function kk(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,Dk||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await w(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!Ok)if(Dk)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}function Ak(e={}){let{immediate:t=!0,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f]=(0,v.useState)(()=>kk({immediate:t,onNeedReload:n,onOfflineReady(){d(!0),i?.()},onNeedRefresh(){l(!0),r?.()},onRegistered:a,onRegisteredSW:o,onRegisterError:s}));return{needRefresh:[c,l],offlineReady:[u,d],updateServiceWorker:f}}function jk(){let{needRefresh:[e,t],offlineReady:[n,r],updateServiceWorker:i}=Ak({onRegisterError(e){console.warn(`crtr web: service worker registration failed`,e)}});return(0,v.useEffect)(()=>{n&&(zm(`App ready to work offline`,`success`),r(!1))},[n,r]),{needRefresh:e,dismiss:()=>t(!1),refresh:()=>void i(!0)}}function Mk(){let{needRefresh:e,dismiss:t,refresh:n}=jk();return e?(0,z.jsx)(`div`,{className:`pwa-update-banner px-3`,children:(0,z.jsxs)(`div`,{className:`pointer-events-auto flex items-center gap-3 rounded-lg border px-3 py-2 text-sm shadow-md [border-color:var(--line)] [background:var(--panel)] [color:var(--ink)]`,children:[(0,z.jsx)(`span`,{children:`Update ready`}),(0,z.jsxs)(`button`,{type:`button`,onClick:n,className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs font-semibold [background:var(--bone)] [color:var(--bone-ink)]`,children:[(0,z.jsx)(ep,{size:14,"aria-hidden":!0}),`Refresh`]}),(0,z.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss update prompt`,className:`[color:var(--ink2)]`,children:(0,z.jsx)(ap,{size:14,"aria-hidden":!0})})]})}):null}function Nk(){let e=Rm(e=>e.toasts),t=Rm(e=>e.dismiss);return e.length===0?null:(0,z.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-50 flex flex-col items-center gap-2`,children:e.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>t(e.id),className:J(`pointer-events-auto border px-4 py-2 font-mono text-sm transition-opacity`,e.tone===`success`?`border-success/40 bg-success/10 text-success`:`border-border bg-card text-foreground`),children:e.message},e.id))})}function Pk(){return(0,z.jsx)(An,{children:(0,z.jsxs)(Sf,{delayDuration:300,children:[(0,z.jsx)(GO,{}),(0,z.jsx)(WO,{}),(0,z.jsx)(wk,{children:(0,z.jsx)(UO,{})}),(0,z.jsx)(Mk,{}),(0,z.jsx)(Nk,{})]})})}document.documentElement.classList.add(`dark`),document.documentElement.classList.remove(`light`);var Fk=document.getElementById(`root`);if(!Fk)throw Error(`crtr web: #root element not found in index.html`);(0,b.createRoot)(Fk).render((0,z.jsx)(v.StrictMode,{children:(0,z.jsx)(Pk,{})}));
|