@north-light/crouter 0.3.157 → 0.3.159

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.
Files changed (92) hide show
  1. package/dist/api/client.d.ts +4 -1
  2. package/dist/api/client.js +5 -0
  3. package/dist/api/dto/broker.d.ts +1 -1
  4. package/dist/api/dto/nodes.d.ts +15 -0
  5. package/dist/api/routes.d.ts +1 -0
  6. package/dist/api/routes.js +1 -0
  7. package/dist/builtin-memory/internal/storage-tiers.md +2 -0
  8. package/dist/builtin-views/chat/core.mjs +6 -51
  9. package/dist/builtin-views/chat/tui.mjs +6 -14
  10. package/dist/builtin-views/chat/web.jsx +2 -7
  11. package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.js +1 -1
  12. package/dist/clients/attach/chrome/bash-jobs.d.ts +0 -5
  13. package/dist/clients/attach/chrome/bash-jobs.js +5 -24
  14. package/dist/clients/attach/chrome/roster.d.ts +4 -3
  15. package/dist/clients/attach/chrome/roster.js +20 -36
  16. package/dist/clients/attach/command.js +5 -5
  17. package/dist/clients/attach/input/controller.d.ts +23 -8
  18. package/dist/clients/attach/input/controller.js +59 -29
  19. package/dist/clients/attach/overlays/dialogs.d.ts +1 -2
  20. package/dist/clients/attach/overlays/graph.d.ts +4 -1
  21. package/dist/clients/attach/overlays/graph.js +25 -7
  22. package/dist/clients/attach/session/context.d.ts +7 -0
  23. package/dist/clients/attach/session/frames.js +1 -8
  24. package/dist/clients/attach/session/input-wiring.d.ts +1 -1
  25. package/dist/clients/attach/session/input-wiring.js +21 -11
  26. package/dist/clients/attach/session/mode.d.ts +4 -3
  27. package/dist/clients/attach/session/mode.js +6 -1
  28. package/dist/clients/attach/session/reconnect.d.ts +3 -3
  29. package/dist/clients/attach/session/reconnect.js +6 -7
  30. package/dist/clients/attach/session/state-sync.d.ts +1 -1
  31. package/dist/clients/attach/session/state-sync.js +2 -2
  32. package/dist/clients/attach/slash/dispatch.d.ts +13 -1
  33. package/dist/clients/attach/slash/dispatch.js +65 -17
  34. package/dist/clients/attach/viewer.js +497 -499
  35. package/dist/clients/web/web-client/shared/protocol.d.ts +5 -3
  36. package/dist/commands/node.js +142 -4
  37. package/dist/commands/surface-inspect.js +4 -3
  38. package/dist/core/__tests__/broker-sdk-wiring.test.js +18 -18
  39. package/dist/core/__tests__/canvas-inbox-watcher.test.js +5 -3
  40. package/dist/core/__tests__/chat-view-reconnect.test.js +44 -23
  41. package/dist/core/__tests__/full/broker-attach-limits.test.js +60 -36
  42. package/dist/core/__tests__/full/broker-attach-stream.test.js +4 -4
  43. package/dist/core/__tests__/full/broker-dialogs.test.js +121 -62
  44. package/dist/core/__tests__/helpers/broker-clients.js +2 -2
  45. package/dist/core/__tests__/session-model.test.js +15 -26
  46. package/dist/core/bash-jobs.d.ts +11 -0
  47. package/dist/core/bash-jobs.js +41 -1
  48. package/dist/core/feed/inbox.d.ts +3 -3
  49. package/dist/core/feed/inbox.js +10 -6
  50. package/dist/core/inspector/core.d.ts +17 -2
  51. package/dist/core/inspector/core.js +172 -23
  52. package/dist/core/inspector/model.d.ts +30 -1
  53. package/dist/core/inspector/model.js +39 -0
  54. package/dist/core/inspector/text.js +14 -1
  55. package/dist/core/inspector/tui.js +71 -3
  56. package/dist/core/keybindings/__tests__/resolve.test.js +2 -2
  57. package/dist/core/keybindings/catalog.d.ts +2 -2
  58. package/dist/core/keybindings/catalog.js +3 -4
  59. package/dist/core/runtime/auth-reload.d.ts +4 -4
  60. package/dist/core/runtime/auth-reload.js +9 -13
  61. package/dist/core/runtime/boot-root.d.ts +2 -2
  62. package/dist/core/runtime/boot-root.js +7 -7
  63. package/dist/core/runtime/broker-protocol.d.ts +23 -27
  64. package/dist/core/runtime/broker-protocol.js +1 -1
  65. package/dist/core/runtime/broker-request.js +5 -11
  66. package/dist/core/runtime/broker.d.ts +21 -13
  67. package/dist/core/runtime/broker.js +151 -186
  68. package/dist/core/runtime/interactive-deliver.js +4 -5
  69. package/dist/core/runtime/model-swap.d.ts +2 -3
  70. package/dist/core/runtime/model-swap.js +3 -4
  71. package/dist/core/runtime/node-read.d.ts +20 -0
  72. package/dist/core/runtime/node-read.js +34 -1
  73. package/dist/core/runtime/resume-root.d.ts +1 -1
  74. package/dist/core/runtime/resume-root.js +6 -6
  75. package/dist/core/runtime/spawn.js +3 -3
  76. package/dist/core/session-model/session-state.d.ts +8 -6
  77. package/dist/core/session-model/session-state.js +6 -16
  78. package/dist/core/tui/host.js +21 -6
  79. package/dist/daemon/api/handlers/nodes.js +18 -1
  80. package/dist/daemon/manage.js +2 -2
  81. package/dist/index.d.ts +1 -1
  82. package/dist/pi-extensions/canvas-bash-valve.js +9 -3
  83. package/dist/web-client/assets/{index-DJhQZoAj.css → index-CpEl9LTS.css} +1 -1
  84. package/dist/web-client/assets/{index--SsQYcKu.js → index-CsuwzlcQ.js} +19 -19
  85. package/dist/web-client/index.html +2 -2
  86. package/dist/web-client/sw.js +1 -1
  87. package/docs/compat/hearth-crtr-v5.md +175 -0
  88. package/docs/public-api.md +2 -2
  89. package/package.json +2 -2
  90. package/runtime.lock.json +6 -6
  91. package/dist/core/__tests__/full/broker-control-preempt.test.d.ts +0 -1
  92. package/dist/core/__tests__/full/broker-control-preempt.test.js +0 -61
@@ -48,32 +48,32 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
48
48
  `},Xa=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Za=function(){v.useEffect(function(){return document.body.setAttribute(Ja,(Xa()+1).toString()),function(){var e=Xa()-1;e<=0?document.body.removeAttribute(Ja):document.body.setAttribute(Ja,e.toString())}},[])},Qa=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Za();var a=v.useMemo(function(){return Ka(i)},[i]);return v.createElement(qa,{styles:Ya(a,!t,i,n?``:`!important`)})},$a=!1;if(typeof window<`u`)try{var eo=Object.defineProperty({},"passive",{get:function(){return $a=!0,!0}});window.addEventListener(`test`,eo,eo),window.removeEventListener(`test`,eo,eo)}catch{$a=!1}var to=$a?{passive:!1}:!1,no=function(e){return e.tagName===`TEXTAREA`},ro=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!no(e)&&n[t]===`visible`)},io=function(e){return ro(e,`overflowY`)},ao=function(e){return ro(e,`overflowX`)},oo=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),lo(e,r)){var i=uo(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},so=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},co=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},lo=function(e,t){return e===`v`?io(t):ao(t)},uo=function(e,t){return e===`v`?so(t):co(t)},H=function(e,t){return e===`h`&&t===`rtl`?-1:1},fo=function(e,t,n,r,i){var a=H(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=uo(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&lo(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},po=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mo=function(e){return[e.deltaX,e.deltaY]},ho=function(e){return e&&`current`in e?e.current:e},go=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_o=function(e){return`
49
49
  .block-interactivity-${e} {pointer-events: none;}
50
50
  .allow-interactivity-${e} {pointer-events: all;}
51
- `},vo=0,yo=[];function bo(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(vo++)[0],a=v.useState(Ha)[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=_a([e.lockRef.current],(e.shards||[]).map(ho),!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=po(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=oo(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=oo(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 fo(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!yo.length||yo[yo.length-1]!==a)){var r=`deltaY`in n?mo(n):po(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&go(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ho).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:xo(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=po(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,mo(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,po(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return yo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,to),document.addEventListener(`touchmove`,c,to),document.addEventListener(`touchstart`,u,to),function(){yo=yo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,to),document.removeEventListener(`touchmove`,c,to),document.removeEventListener(`touchstart`,u,to)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:_o(i)}):null,p?v.createElement(Qa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var So=ja(Ma,bo),Co=v.forwardRef(function(e,t){return v.createElement(Pa,ha({},e,{ref:t,sideCar:So}))});Co.classNames=Pa.classNames;var wo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},To=new WeakMap,Eo=new WeakMap,Do={},Oo=0,ko=function(e){return e&&(e.host||ko(e.parentNode))},Ao=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ko(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})},jo=function(e,t,n,r){var i=Ao(t,Array.isArray(e)?e:[e]);Do[n]||(Do[n]=new WeakMap);var a=Do[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=(To.get(e)||0)+1,l=(a.get(e)||0)+1;To.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Eo.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(),Oo++,function(){o.forEach(function(e){var t=To.get(e)-1,i=a.get(e)-1;To.set(e,t),a.set(e,i),t||(Eo.has(e)||e.removeAttribute(r),Eo.delete(e)),i||e.removeAttribute(n)}),Oo--,Oo||(To=new WeakMap,To=new WeakMap,Eo=new WeakMap,Do={})}},Mo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||wo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),jo(r,i,n,`aria-hidden`)):function(){return null}},No=Object.defineProperty,Po=(e,t)=>No(e,`name`,{value:t,configurable:!0}),Fo=`Dialog`,[Io,Lo]=Or(Fo),[Ro,zo]=Io(Fo),Bo=Po(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=ai({prop:r,defaultProp:i??!1,onChange:a,caller:Fo}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,L.jsx)(Ro,{scope:t,triggerRef:s,contentRef:c,contentId:Ci(),titleId:Ci(),descriptionId:Ci(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Vo=`DialogPortal`,[Ho,Uo]=Io(Vo,{forceMount:void 0}),Wo=Po(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=zo(Vo,t);return(0,L.jsx)(Ho,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,L.jsx)(pi,{present:n||a.open,children:(0,L.jsx)(sa,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Go=`DialogOverlay`,Ko=v.forwardRef(Po(function(e,t){let n=Uo(Go,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=zo(Go,e.__scopeDialog);return a.modal?(0,L.jsx)(pi,{present:r||a.open,children:(0,L.jsx)(Jo,{...i,ref:t})}):null},`DialogOverlay`)),qo=or(`DialogOverlay.RemoveScroll`),Jo=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(Go,n),a=rr(t,Li());return(0,L.jsx)(Co,{as:qo,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(R.div,{"data-state":os(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Yo=`DialogContent`,Xo=v.forwardRef(Po(function(e,t){let n=Uo(Yo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=zo(Yo,e.__scopeDialog);return(0,L.jsx)(pi,{present:r||a.open,children:a.modal?(0,L.jsx)(Zo,{...i,ref:t}):(0,L.jsx)(Qo,{...i,ref:t})})},`DialogContent`)),Zo=v.forwardRef(Po(function(e,t){let n=zo(Yo,e.__scopeDialog),r=v.useRef(null),i=rr(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return Mo(e)},[]),(0,L.jsx)($o,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Kr(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Kr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Kr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Qo=v.forwardRef(Po(function(e,t){let n=zo(Yo,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,L.jsx)($o,{...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`)),$o=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=zo(Yo,n);return pa(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Ji,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Ii,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":os(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),es=`DialogTitle`,ts=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(es,n),{setTitleCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(R.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),ns=`DialogDescription`,rs=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(ns,n),{setDescriptionCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(R.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),is=`DialogClose`,as=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(is,n);return(0,L.jsx)(R.button,{type:`button`,...r,ref:t,onClick:Kr(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function os(e){return e?`open`:`closed`}Po(os,`getState`);var ss=Object.defineProperty,cs=(e,t)=>ss(e,`name`,{value:t,configurable:!0});function ls(e){let[t,n]=v.useState(void 0);return z(()=>{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}cs(ls,`useSize`);var us=[`top`,`right`,`bottom`,`left`],ds=Math.min,fs=Math.max,ps=Math.round,ms=Math.floor,hs=e=>({x:e,y:e}),gs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function _s(e,t,n){return fs(e,ds(t,n))}function vs(e,t){return typeof e==`function`?e(t):e}function ys(e){return e.split(`-`)[0]}function bs(e){return e.split(`-`)[1]}function xs(e){return e===`x`?`y`:`x`}function Ss(e){return e===`y`?`height`:`width`}function Cs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ws(e){return xs(Cs(e))}function Ts(e,t,n){n===void 0&&(n=!1);let r=bs(e),i=ws(e),a=Ss(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ps(o)),[o,Ps(o)]}function Es(e){let t=Ps(e);return[Ds(e),t,Ds(t)]}function Ds(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Os=[`left`,`right`],ks=[`right`,`left`],As=[`top`,`bottom`],js=[`bottom`,`top`];function Ms(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ks:Os:t?Os:ks;case`left`:case`right`:return t?As:js;default:return[]}}function Ns(e,t,n,r){let i=bs(e),a=Ms(ys(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ds)))),a}function Ps(e){let t=ys(e);return gs[t]+e.slice(t.length)}function Fs(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Is(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Fs(e)}function Ls(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 Rs(e,t,n){let{reference:r,floating:i}=e,a=Cs(t),o=ws(t),s=Ss(o),c=ys(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=bs(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function zs(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}=vs(t,e),p=Is(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ls(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=Ls(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 Bs=50,Vs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:zs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Rs(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<Bs&&(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}=Rs(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Hs=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}=vs(e,t)||{};if(l==null)return{};let d=Is(u),f={x:n,y:r},p=ws(i),m=Ss(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=ds(d[_],T),D=ds(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=_s(E,k,O),j=!c.arrow&&bs(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}}}),Us=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}=vs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ys(r),_=Cs(o),v=ys(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ps(o)]:Es(o)),x=p!==`none`;!d&&x&&b.push(...Ns(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=Ts(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`&&_!==Cs(t))||T.every(e=>Cs(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=Cs(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 Ws(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gs(e){return us.some(t=>e[t]>=0)}var Ks=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=vs(e,t);switch(i){case`referenceHidden`:{let e=Ws(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Gs(e)}}}case`escaped`:{let e=Ws(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Gs(e)}}}default:return{}}}}},qs=new Set([`left`,`top`]);async function Js(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ys(n),s=bs(n),c=Cs(n)===`y`,l=qs.has(o)?-1:1,u=a&&c?-1:1,d=vs(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 Ys=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 Js(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}}}}},Xs=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}=vs(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Cs(i),p=xs(f),m=u[p],h=u[f],g=(e,t)=>_s(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}}}}}},Zs=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}=vs(e,t),u={x:n,y:r},d=Cs(i),f=xs(d),p=u[f],m=u[d],h=vs(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=qs.has(ys(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}}}},Qs=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}=vs(e,t),c=await i.detectOverflow(t,s),l=ys(n),u=bs(n),d=Cs(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=ds(p-c[m],g),y=ds(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*fs(c.left,c.right):S=p-2*fs(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 $s(){return typeof window<`u`}function ec(e){return rc(e)?(e.nodeName||``).toLowerCase():`#document`}function tc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nc(e){return((rc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rc(e){return $s()?e instanceof Node||e instanceof tc(e).Node:!1}function ic(e){return $s()?e instanceof Element||e instanceof tc(e).Element:!1}function ac(e){return $s()?e instanceof HTMLElement||e instanceof tc(e).HTMLElement:!1}function oc(e){return!$s()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof tc(e).ShadowRoot}function sc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=vc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function cc(e){return/^(table|td|th)$/.test(ec(e))}function lc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var uc=/transform|translate|scale|rotate|perspective|filter/,dc=/paint|layout|strict|content/,fc=e=>!!e&&e!==`none`,pc;function mc(e){let t=ic(e)?vc(e):e;return fc(t.transform)||fc(t.translate)||fc(t.scale)||fc(t.rotate)||fc(t.perspective)||!gc()&&(fc(t.backdropFilter)||fc(t.filter))||uc.test(t.willChange||``)||dc.test(t.contain||``)}function hc(e){let t=bc(e);for(;ac(t)&&!_c(t);){if(mc(t))return t;if(lc(t))return null;t=bc(t)}return null}function gc(){return pc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),pc}function _c(e){return/^(html|body|#document)$/.test(ec(e))}function vc(e){return tc(e).getComputedStyle(e)}function yc(e){return ic(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bc(e){if(ec(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||oc(e)&&e.host||nc(e);return oc(t)?t.host:t}function xc(e){let t=bc(e);return _c(t)?(e.ownerDocument||e).body:ac(t)&&sc(t)?t:xc(t)}function Sc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xc(e),i=r===e.ownerDocument?.body,a=tc(r);if(i){let e=Cc(a);return t.concat(a,a.visualViewport||[],sc(r)?r:[],e&&n?Sc(e):[])}else return t.concat(r,Sc(r,[],n))}function Cc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wc(e){let t=vc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ac(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ps(n)!==a||ps(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Tc(e){return ic(e)?e:e.contextElement}function Ec(e){let t=Tc(e);if(!ac(t))return hs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wc(t),o=(a?ps(n.width):n.width)/r,s=(a?ps(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dc=hs(0);function Oc(e){let t=tc(e);return!gc()||!t.visualViewport?Dc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===tc(e)}function Ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Tc(e),o=hs(1);t&&(r?ic(r)&&(o=Ec(r)):o=Ec(e));let s=kc(a,n,r)?Oc(a):hs(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=tc(a),t=ic(r)?tc(r):r,n=e,i=Cc(n);for(;i&&t!==n;){let e=Ec(i),t=i.getBoundingClientRect(),r=vc(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=tc(i),i=Cc(n)}}return Ls({width:u,height:d,x:c,y:l})}function jc(e,t){let n=yc(e).scrollLeft;return t?t.left+n:Ac(nc(e)).left+n}function Mc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jc(e,n),y:n.top+t.scrollTop}}function Nc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=nc(r),s=t?lc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=hs(1),u=hs(0),d=ac(r);if((d||!a)&&((ec(r)!==`body`||sc(o))&&(c=yc(r)),d)){let e=Ac(r);l=Ec(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mc(o,c):hs(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 Pc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fc(e){let t=yc(e),n=e.ownerDocument.body,r=fs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=fs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jc(e),o=-t.scrollTop;return vc(n).direction===`rtl`&&(a+=fs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ic=25;function Lc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=tc(e),a=nc(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!gc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jc(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<=Ic&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Rc(e,t){let n=Ac(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ec(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Lc(e,n,t);else if(t===`document`)r=Fc(nc(e));else if(ic(t))r=Rc(t,n);else{let n=Oc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ls(r)}function Bc(e,t){let n=t.get(e);if(n)return n;let r=Sc(e,[],!1).filter(e=>ic(e)&&ec(e)!==`body`),i=null,a=vc(e).position===`fixed`,o=a?bc(e):e;for(;ic(o)&&!_c(o);){let e=vc(o),t=mc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bc(o)}return t.set(e,r),r}function Vc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?lc(t)?[]:Bc(t,this._c):[].concat(n),r],o=zc(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=zc(t,a[e],i);s=fs(n.top,s),c=ds(n.right,c),l=ds(n.bottom,l),u=fs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hc(e){let{width:t,height:n}=wc(e);return{width:t,height:n}}function Uc(e,t,n){let r=ac(t),i=nc(t),a=n===`fixed`,o=Ac(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=hs(0);if((r||!a)&&((ec(t)!==`body`||sc(i))&&(s=yc(t)),r)){let e=Ac(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jc(i));let l=i&&!r&&!a?Mc(i,s):hs(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 Wc(e){return vc(e).position===`static`}function Gc(e,t){if(!ac(e)||vc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return nc(e)===n&&(n=n.ownerDocument.body),n}function Kc(e,t){let n=tc(e);if(lc(e))return n;if(!ac(e)){let t=bc(e);for(;t&&!_c(t);){if(ic(t)&&!Wc(t))return t;t=bc(t)}return n}let r=Gc(e,t);for(;r&&cc(r)&&Wc(r);)r=Gc(r,t);return r&&_c(r)&&Wc(r)&&!mc(r)?n:r||hc(e)||n}var qc=async function(e){let t=this.getOffsetParent||Kc,n=this.getDimensions,r=await n(e.floating);return{reference:Uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jc(e){return vc(e).direction===`rtl`}var Yc={convertOffsetParentRelativeRectToViewportRelativeRect:Nc,getDocumentElement:nc,getClippingRect:Vc,getOffsetParent:Kc,getElementRects:qc,getClientRects:Pc,getDimensions:Hc,getScale:Ec,isElement:ic,isRTL:Jc};function Xc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zc(e,t,n){let r=null,i,a=nc(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=ms(d),h=ms(a.clientWidth-(u+f)),g=ms(a.clientHeight-(d+p)),_=ms(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:fs(0,ds(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xc(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=tc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qc(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=Tc(e),u=i||a?[...l?Sc(l):[],...t?Sc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zc(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?Ac(e):null;c&&g();function g(){let t=Ac(e);h&&!Xc(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 $c=Ys,el=Xs,tl=Us,nl=Qs,rl=Ks,il=Hs,al=Zs,ol=(e,t,n)=>{let r=new Map,i=n??{},a={...Yc,...i.platform,_c:r};return Vs(e,t,{...i,platform:a})},sl=typeof document<`u`?v.useLayoutEffect:function(){};function cl(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(!cl(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)&&!cl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ll(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ul(e,t){let n=ll(e);return Math.round(t*n)/n}function dl(e){let t=v.useRef(e);return sl(()=>{t.current=e}),t}function fl(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);cl(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=dl(c),k=dl(i),A=dl(l),j=v.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),ol(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!cl(E.current,t)&&(E.current=t,y.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);sl(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=v.useRef(!1);sl(()=>(M.current=!0,()=>{M.current=!1}),[]),sl(()=>{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=ul(N.floating,u.x),r=ul(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ll(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 pl=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?{}:il({element:r.current,padding:i}).fn(n):r?il({element:r,padding:i}).fn(n):{}}}},ml=(e,t)=>{let n=$c(e);return{name:n.name,fn:n.fn,options:[e,t]}},hl=(e,t)=>{let n=el(e);return{name:n.name,fn:n.fn,options:[e,t]}},gl=(e,t)=>({fn:al(e).fn,options:[e,t]}),_l=(e,t)=>{let n=tl(e);return{name:n.name,fn:n.fn,options:[e,t]}},vl=(e,t)=>{let n=nl(e);return{name:n.name,fn:n.fn,options:[e,t]}},yl=(e,t)=>{let n=rl(e);return{name:n.name,fn:n.fn,options:[e,t]}},bl=(e,t)=>{let n=pl(e);return{name:n.name,fn:n.fn,options:[e,t]}},xl=Object.defineProperty,Sl=(e,t)=>xl(e,`name`,{value:t,configurable:!0}),Cl=`Popper`,[wl,Tl]=Or(Cl),[El,Dl]=wl(Cl),Ol=Sl(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,L.jsx)(El,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),kl=`PopperAnchor`,Al=v.forwardRef(Sl(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Dl(kl,n),o=v.useRef(null),s=a.onAnchorChange,c=rr(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&&Ll(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(R.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),jl=`PopperContent`,[Ml,Nl]=wl(jl),Pl=v.forwardRef(Sl(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=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Dl(jl,n),[_,y]=v.useState(null),b=rr(t,y),[x,S]=v.useState(null),C=ls(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(Fl),altBoundary:k},{refs:j,floatingStyles:M,placement:ee,isPositioned:N,middlewareData:P}=fl({strategy:`fixed`,placement:E,whileElementsMounted:Sl((...e)=>Qc(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[ml({mainAxis:i+T,alignmentAxis:o}),c&&hl({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?gl():void 0,...A}),c&&_l({...A}),vl({...A,apply:Sl(({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&&bl({element:x,padding:s}),Il({arrowWidth:w,arrowHeight:T}),f&&yl({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),F=g.setPlacementState;z(()=>(F(ee),()=>{F(void 0)}),[ee,F]);let[I,te]=Ll(ee),ne=Ai(m);z(()=>{N&&ne?.()},[N,ne]);let re=P.arrow?.x,ie=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[oe,se]=v.useState();return z(()=>{_&&se(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:N?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(Ml,{scope:n,placedSide:I,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,L.jsx)(R.div,{"data-side":I,"data-align":te,...h,ref:b,style:{...h.style,animation:N?h.style?.animation:`none`}})})})},`PopperContent`));function Fl(e){return e!==null}Sl(Fl,`isNotNull`);var Il=Sl(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]=Ll(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 Ll(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Sl(Ll,`getSideAndAlignFromPlacement`);var Rl=Ol,zl=Al,Bl=Pl,Vl=Object.defineProperty,Hl=v.forwardRef(((e,t)=>Vl(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,L.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Ul=Object.defineProperty,U=(e,t)=>Ul(e,`name`,{value:t,configurable:!0});function W(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])}U(W,`usePrevious`);var Wl=Object.defineProperty,Gl=(e,t)=>Wl(e,`name`,{value:t,configurable:!0});function Kl(e,[t,n]){return Math.min(n,Math.max(t,e))}Gl(Kl,`clamp`);var ql=Object.defineProperty,G=(e,t)=>ql(e,`name`,{value:t,configurable:!0}),Jl=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Yl=[` `,`Enter`],Xl=`Select`,[Zl,Ql,$l]=Mr(Xl),[eu,tu]=Or(Xl,[$l,Tl]),nu=Tl(),[ru,iu]=eu(Xl),[au,ou]=eu(Xl);function su(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=nu(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=Di(l),[T,E]=ai({prop:r,defaultProp:i??!1,onChange:a,caller:Xl}),[D,O]=ai({prop:o,defaultProp:s,onChange:c,caller:Xl}),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=Ci(),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,L.jsx)(Rl,{...g,children:(0,L.jsx)(ru,{scope:t,...te,children:(0,L.jsx)(Zl.Provider,{scope:t,children:(0,L.jsx)(au,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:I,children:Ju(h)?h(te):n})})})})}G(su,`SelectProvider`);var cu=G(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(su,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(qu,{__scopeSelect:t}):null]})})},`Select`),lu=`SelectTrigger`,uu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=nu(n),o=iu(lu,n),s=o.disabled||r,c=rr(t,o.onTriggerChange),l=Ql(n),u=v.useRef(`touch`),[d,f,p]=Xu(e=>{let t=l().filter(e=>!e.disabled),n=Zu(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,L.jsx)(zl,{asChild:!0,...a,children:(0,L.jsx)(R.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":Yu(o.value)?``:void 0,...i,ref:c,onClick:Kr(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Kr(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:Kr(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Jl.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),du=`SelectValue`,fu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=iu(du,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=rr(t,c.onValueNodeChange);z(()=>{l(u)},[l,u]);let f=Yu(c.value);return(0,L.jsx)(R.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,L.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),pu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(R.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[mu,hu]=eu(`SelectPortal`,{forceMount:void 0}),gu=G(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(mu,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(sa,{asChild:!0,...r})})},`SelectPortal`),_u=`SelectContent`,vu=v.forwardRef(G(function(e,t){let n=hu(_u,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=iu(_u,e.__scopeSelect),[o,s]=v.useState();return z(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(pi,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(wu,{...i,ref:t}):(0,L.jsx)(yu,{...i,fragment:o})})},`SelectContent`)),yu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?y.createPortal((0,L.jsx)(xu,{scope:n,children:(0,L.jsx)(Zl.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),bu=10,[xu,Su]=eu(_u),Cu=or(`SelectContent.RemoveScroll`),wu=v.forwardRef(G(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,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=iu(_u,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=rr(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=Ql(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return Mo(b)},[b]),pa();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]=Xu(e=>{let t=k().filter(e=>!e.disabled),n=Zu(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===`popper`?Eu:Tu,oe=ae===Eu?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)(xu,{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,L.jsx)(Co,{as:Cu,allowPinchZoom:!0,children:(0,L.jsx)(Ji,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Kr(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(Ii,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,L.jsx)(ae,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...oe,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Kr(_.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`)),Tu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=iu(_u,n),o=Su(_u,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=rr(t,u),f=Ql(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!==`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-bu,d=Kl(a,[bu,Math.max(bu,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-bu,d=Kl(a,[bu,Math.max(bu,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-bu*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-bu,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=`${bu}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]);z(()=>b(),[b]);let[x,S]=v.useState();return z(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,L.jsx)(Du,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,L.jsx)(R.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Eu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=bu,...a}=e,o=nu(n);return(0,L.jsx)(Bl,{...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`)),[Du,Ou]=eu(_u,{}),ku=`SelectViewport`,Au=v.forwardRef(G(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Su(ku,n),o=Ou(ku,n),s=rr(t,a.onViewportChange),c=v.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Zl.Slot,{scope:n,children:(0,L.jsx)(R.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Kr(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-bu*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`)),[ju,Mu]=eu(`SelectGroup`),Nu=`SelectItem`,[Pu,Fu]=eu(Nu),Iu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=iu(Nu,n),c=Su(Nu,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=rr(t,Ai(e=>c.itemRefCallback?.(e,r,i))),h=Ci(),g=v.useRef(`touch`),_=G(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,L.jsx)(Pu,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(Zl.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,L.jsx)(R.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:Kr(o.onFocus,()=>p(!0)),onBlur:Kr(o.onBlur,()=>p(!1)),onClick:Kr(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Kr(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Kr(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Kr(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Kr(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Kr(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(Yl.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Lu=`SelectItemText`,Ru=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=iu(Lu,n),s=Su(Lu,n),c=Fu(Lu,n),l=ou(Lu,n),[u,d]=v.useState(null),f=Ai(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=rr(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return z(()=>(g(h),()=>_(h)),[g,_,h]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(R.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Yu(o.value)?y.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),zu=`SelectItemIndicator`,Bu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,...r}=e;return Fu(zu,n).isSelected?(0,L.jsx)(R.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Vu=`SelectScrollUpButton`,Hu=v.forwardRef(G(function(e,t){let n=Su(Vu,e.__scopeSelect),r=Ou(Vu,e.__scopeSelect),[i,a]=v.useState(!1),o=rr(t,r.onScrollButtonChange);return z(()=>{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,L.jsx)(Gu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Uu=`SelectScrollDownButton`,Wu=v.forwardRef(G(function(e,t){let n=Su(Uu,e.__scopeSelect),r=Ou(Uu,e.__scopeSelect),[i,a]=v.useState(!1),o=rr(t,r.onScrollButtonChange);return z(()=>{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,L.jsx)(Gu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Gu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Su(`SelectScrollButton`,n),o=v.useRef(null),s=Ql(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),z(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(R.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Kr(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Kr(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Kr(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Ku=`SelectBubbleInput`,qu=v.forwardRef(G(function({__scopeSelect:e,...t},n){let r=iu(Ku,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=rr(n,p),h=i??``,g=W(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,L.jsxs)(R.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...wr,...t.style},ref:m,defaultValue:h,children:[Yu(i)&&!_?(0,L.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Ju(e){return typeof e==`function`}G(Ju,`isFunction`);function Yu(e){return e===``||e===void 0}G(Yu,`shouldShowPlaceholder`);function Xu(e){let t=Ai(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(Xu,`useTypeaheadSearch`);function Zu(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=Qu(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(Zu,`findNextItem`);function Qu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}G(Qu,`wrapArray`);var $u=Object.defineProperty,ed=(e,t)=>$u(e,`name`,{value:t,configurable:!0}),[td,nd]=Or(`Tooltip`,[Tl]);Tl();var rd=`TooltipProvider`,id=700,[ad,od]=td(rd),sd=ed(e=>{let{__scopeTooltip:t,delayDuration:n=id,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,L.jsx)(ad,{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`),[cd,ld]=td(`Tooltip`),[ud,dd]=td(`TooltipPortal`,{forceMount:void 0});function fd(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`)}}ed(fd,`getExitSideFromRect`);function pd(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}ed(pd,`getPaddedExitPoints`);function md(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}]}ed(md,`getPointsFromRect`);function hd(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}ed(hd,`isPointInPolygon`);function gd(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)),_d(t)}ed(gd,`getHull`);function _d(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)}ed(_d,`getHullPresorted`);var vd=sd;function yd(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=yd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function bd(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yd(e))&&(r&&(r+=` `),r+=t);return r}var xd=`-`,Sd=e=>{let t=K(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(xd);return n[0]===``&&n.length!==1&&n.shift(),Cd(n,t)||Td(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},Cd=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?Cd(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(xd);return t.validators.find(({validator:e})=>e(a))?.classGroupId},wd=/^\[(.+)\]$/,Td=e=>{if(wd.test(e)){let t=wd.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},K=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kd(Object.entries(e.classGroups),n).forEach(([e,n])=>{Ed(n,r,e,t)}),r},Ed=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:Dd(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(Od(e)){Ed(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{Ed(i,Dd(t,e),n,r)})})},Dd=(e,t)=>{let n=e;return t.split(xd).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Od=e=>e.isThemeGetter,kd=(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,Ad=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)}}},jd=`!`,Md=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(jd);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},Nd=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},Pd=e=>({cache:Ad(e.cacheSize),parseClassName:Md(e),...Sd(e)}),Fd=/\s+/,Id=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(Fd),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=Nd(c).join(`:`),h=l?m+jd: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 Ld(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=Rd(t))&&(r&&(r+=` `),r+=n);return r}var Rd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Rd(e[r]))&&(n&&(n+=` `),n+=t);return n};function zd(e,...t){let n,r,i,a=o;function o(o){return n=Pd(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=Id(e,n);return i(e,a),a}return function(){return a(Ld.apply(null,arguments))}}var Bd=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},Vd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hd=/^\d+\/\d+$/,Ud=new Set([`px`,`full`,`screen`]),Wd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gd=/\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$/,Kd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yd=e=>Zd(e)||Ud.has(e)||Hd.test(e),Xd=e=>uf(e,`length`,df),Zd=e=>!!e&&!Number.isNaN(Number(e)),Qd=e=>uf(e,`number`,Zd),$d=e=>!!e&&Number.isInteger(Number(e)),ef=e=>e.endsWith(`%`)&&Zd(e.slice(0,-1)),q=e=>Vd.test(e),tf=e=>Wd.test(e),nf=new Set([`length`,`size`,`percentage`]),rf=e=>uf(e,nf,ff),af=e=>uf(e,`position`,ff),of=new Set([`image`,`url`]),sf=e=>uf(e,of,mf),cf=e=>uf(e,``,pf),lf=()=>!0,uf=(e,t,n)=>{let r=Vd.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},df=e=>Gd.test(e)&&!Kd.test(e),ff=()=>!1,pf=e=>qd.test(e),mf=e=>Jd.test(e),hf=zd(()=>{let e=Bd(`colors`),t=Bd(`spacing`),n=Bd(`blur`),r=Bd(`brightness`),i=Bd(`borderColor`),a=Bd(`borderRadius`),o=Bd(`borderSpacing`),s=Bd(`borderWidth`),c=Bd(`contrast`),l=Bd(`grayscale`),u=Bd(`hueRotate`),d=Bd(`invert`),f=Bd(`gap`),p=Bd(`gradientColorStops`),m=Bd(`gradientColorStopPositions`),h=Bd(`inset`),g=Bd(`margin`),_=Bd(`opacity`),v=Bd(`padding`),y=Bd(`saturate`),b=Bd(`scale`),x=Bd(`sepia`),S=Bd(`skew`),C=Bd(`space`),w=Bd(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,q,t],O=()=>[q,t],k=()=>[``,Yd,Xd],A=()=>[`auto`,Zd,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=()=>[Zd,q];return{cacheSize:500,separator:`:`,theme:{colors:[lf],spacing:[Yd,Xd],blur:[`none`,``,tf,q],brightness:I(),borderColor:[e],borderRadius:[`none`,``,`full`,tf,q],borderSpacing:O(),borderWidth:k(),contrast:I(),grayscale:P(),hueRotate:I(),invert:P(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[ef,Xd],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:[tf]}],"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`,$d,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`,$d,q]}],"grid-cols":[{"grid-cols":[lf]}],"col-start-end":[{col:[`auto`,{span:[`full`,$d,q]},q]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[lf]}],"row-start-end":[{row:[`auto`,{span:[$d,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:[tf]},tf]}],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`,tf,Xd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Qd]}],"font-family":[{font:[lf]}],"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`,Zd,Qd]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Yd,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`,Yd,Xd]}],"underline-offset":[{"underline-offset":[`auto`,Yd,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(),af]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,rf]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},sf]}],"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":[Yd,q]}],"outline-w":[{outline:[Yd,Xd]}],"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":[Yd,Xd]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,tf,cf]}],"shadow-color":[{shadow:[lf]}],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`,tf,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:[$d,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:[Yd,Xd,Qd]}],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 hf(bd(e))}function gf({delayDuration:e=0,...t}){return(0,L.jsx)(vd,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}var _f=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yf={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`},bf=(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,...yf,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vf(`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)(bf,{ref:i,iconNode:t,className:vf(`lucide-${_f(e)}`,n),...r}));return n.displayName=`${e}`,n},xf=Y(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Sf=Y(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Cf=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`}]]),wf=Y(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Tf=Y(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ef=Y(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Df=Y(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Of=Y(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),kf=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`}]]),Af=Y(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),jf=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`}]]),Mf=Y(`CircleSlash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),Nf=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`}]]),Pf=Y(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ff=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`}]]),If=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`}]]),Lf=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`}]]),Rf=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`}]]),zf=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`}]]),Bf=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`}]]),Vf=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`}]]),Hf=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`}]]),Uf=Y(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Wf=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`}]]),Gf=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`}]]),Kf=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`}]]),qf=Y(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Jf=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`}]]),Yf=Y(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Xf=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`}]]),Zf=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`}]]),Qf=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`}]]),$f=Y(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),X=`/v1`,ep={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`,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}`,modelAuth:e=>`${X}/model-auth/${e}`,filePeek:()=>`${X}/files/peek`};function tp(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 np(){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 rp=np(),ip=`crtr:relay-token`;function ap(){try{let e=window.localStorage.getItem(ip);return e!==null&&e!==``?e:void 0}catch{return}}function op(){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(ip,e)}catch{}return e}return ap()}var sp=op(),cp=class extends Error{code;constructor(e,t){super(t),this.name=`CommandError`,this.code=e}};async function lp(e,t){let n={};t?.body!==void 0&&(n[`content-type`]=`application/json`),sp!==void 0&&(n.authorization=`Bearer ${sp}`);let r;try{r=await fetch(e,{...t,headers:{...n,...t?.headers}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?new cp(`aborted`,`request aborted`):new cp(`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 tp(a)?new cp(a.error.code,a.error.message):new cp(`bridge`,`HTTP ${r.status} ${r.statusText}`);return a}function up(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 dp(){return rp.run(`canvas:roster`,async()=>{let e=await lp(ep.canvasRoster()),t=e.nodes.map(e=>e.node_id),n=t.length>0?(await lp(ep.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 fp(e){return rp.run(`node:inspect:${e}`,()=>lp(ep.node(e)).then(up))}function pp(e){return rp.run(`node:snapshot:${e}`,()=>lp(ep.nodeSnapshot(e)).then(e=>({node_id:e.node_id,snapshot:e.snapshot,commands:e.commands})))}function mp(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 lp(ep.nodes(),{method:`POST`,body:JSON.stringify(t)}).then(e=>({node_id:e.node_id,name:e.name,status:e.status,follow_up:``}))}function hp(e,t){let n={body:t.body,...t.tier?.trim()?{tier:t.tier.trim()}:{}};return lp(ep.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 gp(e,t={}){return lp(ep.nodeRevive(e),{method:`POST`,body:JSON.stringify({resume:t.fresh!==!0})}).then(e=>({window:null,session:null,resumed:e.resumed,ready:e.revived}))}function _p(e){return lp(ep.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 vp(e,t){return lp(`${ep.filePeek()}?path=${encodeURIComponent(t)}`).then(e=>({path:e.path,content:e.content,truncated:e.truncated}))}async function yp(e,t){try{let n={"content-type":`application/json`};sp!==void 0&&(n.authorization=`Bearer ${sp}`);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 bp(e,t,n){return yp({kind:`exec`,bin:`crtr`,args:e,...t===void 0?{}:{stdin:t}},n)}function xp(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 Sp(e,t,n){let r=await bp(e,t,n);if(!r.ok)throw new cp(`bridge`,r.stderr||`bridge request failed`);let i=xp(r);if(i!==null)throw new cp(i.code,i.message);if(r.exitCode!==void 0&&r.exitCode!==0){let t=r.stderr.trim()===``?r.stdout.trim():r.stderr;throw new cp(`bridge`,t===``?`crtr ${e.join(` `)} failed (${r.exitCode})`:t)}if(r.stdout.trim()!==``)try{return JSON.parse(r.stdout)}catch(e){throw new cp(`bridge`,e instanceof Error?e.message:String(e))}}var Cp=new Set,wp=!1;function Tp(){if(wp)return;wp=!0;let e;try{let t=new URL(`/__crtr/events`,window.location.href);sp!==void 0&&t.searchParams.set(`token`,sp),e=new EventSource(t.toString())}catch{wp=!1;return}e.onmessage=e=>{let t;try{t=JSON.parse(e.data).kind}catch{return}if(t!==void 0)for(let e of Cp)e.kinds.includes(t)&&e.refresh()}}function Ep(e,t){let n=(0,v.useRef)(t);n.current=t,(0,v.useEffect)(()=>{Tp();let t={kinds:e,refresh:()=>n.current()};return Cp.add(t),()=>{Cp.delete(t)}},[e.join(`,`)])}var Dp=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},Op=(e=>e?Dp(e):Dp),kp=e=>e;function Ap(e,t=kp){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 jp=e=>{let t=Op(e),n=e=>Ap(t,e);return Object.assign(n,t),n},Mp=(e=>e?jp(e):jp),Np=Mp(e=>({reachable:!0,setReachable:t=>e({reachable:t})})),Pp=1,Fp=`crtr.web.roster.v1`;function Ip(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Lp(e){return typeof e==`string`}function Rp(e){return typeof e==`number`}function zp(e){return Ip(e)?Lp(e.node_id)&&Lp(e.name)&&Lp(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`)&&Lp(e.cwd)&&(e.parent===null||Lp(e.parent))&&Lp(e.created)&&(e.host_kind===`broker`||e.host_kind===`tmux`)&&typeof e.enterable==`boolean`&&Rp(e.attention_count)&&(e.cycles===void 0||Rp(e.cycles))&&(e.last_activity===void 0||Lp(e.last_activity)):!1}function Bp(e){return Ip(e)?e.schemaVersion===Pp&&Lp(e.generatedAt)&&Rp(e.cachedAt)&&Array.isArray(e.nodes)&&e.nodes.every(zp):!1}function Vp(){try{let e=globalThis.localStorage?.getItem(Fp);if(e==null)return null;let t=JSON.parse(e);return Bp(t)?t:null}catch{return null}}function Hp(e,t){let n={schemaVersion:Pp,nodes:e,generatedAt:t,cachedAt:Date.now()};try{globalThis.localStorage?.setItem(Fp,JSON.stringify(n))}catch{}}var Up=3e4,Wp=new class{state;listeners=new Set;started=!1;timer=null;constructor(){let e=Vp();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(),Up);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 dp();this.setState({nodes:e.nodes,generatedAt:e.generated_at,loading:!1}),Hp(e.nodes,e.generated_at),Np.getState().setReachable(!0)}catch{this.state.loading&&this.setState({...this.state,loading:!1}),Np.getState().setReachable(!1)}}};function Gp(){let e=(0,v.useSyncExternalStore)(Wp.subscribe,Wp.getState);return Ep([`nodes`,`inbox`],Wp.refetch),e}var Kp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qp=bd,Jp=(e,t)=>n=>{if(t?.variants==null)return qp(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=Kp(t)||Kp(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 qp(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)},Yp=Jp(`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,L.jsx)(r?sr:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:J(Yp({variant:t,size:n,className:e})),...i})}function Xp({...e}){return(0,L.jsx)(Bo,{"data-slot":`dialog`,...e})}function Zp({...e}){return(0,L.jsx)(Wo,{"data-slot":`dialog-portal`,...e})}function Qp({className:e,...t}){return(0,L.jsx)(Ko,{"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 $p({className:e,children:t,showCloseButton:n=!0,...r}){return(0,L.jsxs)(Zp,{"data-slot":`dialog-portal`,children:[(0,L.jsx)(Qp,{}),(0,L.jsxs)(Xo,{"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,L.jsxs)(as,{"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,L.jsx)($f,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function em({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function tm({className:e,showCloseButton:t=!1,children:n,...r}){return(0,L.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,L.jsx)(as,{asChild:!0,children:(0,L.jsx)(Z,{variant:`outline`,children:`Close`})})]})}function nm({className:e,...t}){return(0,L.jsx)(ts,{"data-slot":`dialog-title`,className:J(`text-lg leading-none font-semibold`,e),...t})}function rm({className:e,...t}){return(0,L.jsx)(rs,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground`,e),...t})}function im({className:e,type:t,...n}){return(0,L.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 am({className:e,...t}){return(0,L.jsx)(Hl,{"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 om({...e}){return(0,L.jsx)(cu,{"data-slot":`select`,...e})}function sm({...e}){return(0,L.jsx)(fu,{"data-slot":`select-value`,...e})}function cm({className:e,size:t=`default`,children:n,...r}){return(0,L.jsxs)(uu,{"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,L.jsx)(pu,{asChild:!0,children:(0,L.jsx)(Tf,{className:`size-4 opacity-50`})})]})}function lm({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,L.jsx)(gu,{children:(0,L.jsxs)(vu,{"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,L.jsx)(dm,{}),(0,L.jsx)(Au,{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,L.jsx)(fm,{})]})})}function um({className:e,children:t,...n}){return(0,L.jsxs)(Iu,{"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,L.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,L.jsx)(Bu,{children:(0,L.jsx)(wf,{className:`size-4`})})}),(0,L.jsx)(Ru,{children:t})]})}function dm({className:e,...t}){return(0,L.jsx)(Hu,{"data-slot":`select-scroll-up-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(Of,{className:`size-4`})})}function fm({className:e,...t}){return(0,L.jsx)(Wu,{"data-slot":`select-scroll-down-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(Tf,{className:`size-4`})})}function pm({className:e,...t}){return(0,L.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 mm=Jp(`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 hm({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,L.jsx)(n?sr:`span`,{"data-slot":`badge`,"data-variant":t,className:J(mm({variant:t}),e),...r})}function gm(e){return e instanceof cp&&(e.code===`not_found`||e.code===`already_resolved`||e.code===`claimed`)}function _m(e){switch(e){case`notify`:case`validation`:case`decision`:case`context`:case`error`:return e}throw Error(`Unknown deck kind: ${e}`)}function vm(e){return{id:e.id,title:e.title,subtitle:e.subtitle,...e.body===void 0?{}:{body:e.body},kind:_m(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 ym(e){return{id:e.id,job_id:e.job_id,kind:_m(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 bm(e,t){return{id:e.id,job_id:e.job_id??e.id,kind:_m(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(vm)}}function xm(){return rp.run(`human:list`,async()=>(await Sp([`human`,`list`,`--json`])).items.map(ym))}async function Sm(e){let t=await Sp([`human`,`deck`,e,`--json`]),n=(await fp(t.asking_node_id)).cwd;return bm(t,n)}async function Cm(e,t){let n=JSON.stringify({responses:t.responses}),r=await Sp([`human`,`resolve`,e,`--json`],n);if(r.resolved!==!0)throw new cp(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 wm(e){let t=0;for(let n of e)t+=Math.max(0,n.attention_count);return t}function Tm(){let{nodes:e}=Gp();return wm(e)}function Em(){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 Ep([`inbox`,`nodes`],o),(0,v.useEffect)(()=>{let e=!1;return xm().then(n=>{e||(t(n),r(!1))}).catch(()=>{e||r(!1)}),()=>{e=!0}},[i]),{decks:e,loading:n,refetch:o}}function Dm(e){let{decks:t}=Em();return t.filter(t=>t.conversation_id===e)}var Om={notify:{icon:Cf,label:`Update`},validation:{icon:Zf,label:`Approval`},decision:{icon:Rf,label:`Decision`},context:{icon:jf,label:`Question`},error:{icon:Qf,label:`Problem`}};function km(e){switch(e){case`notify`:return Om.notify;case`validation`:return Om.validation;case`decision`:return Om.decision;case`context`:return Om.context;case`error`:return Om.error;default:return Om.context}}function Am(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 jm=1,Mm=Mp(e=>({toasts:[],push:(t,n=`info`)=>{let r=jm++;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 Nm(e,t=`info`){Mm.getState().push(e,t)}var Pm=e=>({"--i":e});async function Fm(e,t){let n=(await Sm(e)).interactions[0];await Cm(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 Im(){let{decks:e,loading:t}=Em(),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,L.jsxs)(`section`,{className:`needs rv`,style:Pm(3),children:[(0,L.jsxs)(`div`,{className:`needs-head`,children:[(0,L.jsx)(Lf,{size:14,className:`flag`,"aria-hidden":!0}),(0,L.jsxs)(`span`,{className:`instlabel`,children:[`Needs you — `,n.length,` blocked`]}),(0,L.jsx)(`div`,{className:`rule`})]}),(0,L.jsx)(`div`,{className:`needs-grid`,children:n.map(e=>(0,L.jsx)(Lm,{deck:e},e.id))})]})}function Lm({deck:e}){let t=pt(),{refetch:n}=Em(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=km(e.kind).label,u=Am(e.blocked_since);e.kind===`decision`&&a===null&&!s&&(async()=>{if(!(e.kind!==`decision`||s||a!==null)){c(!0);try{let t=(await Sm(e.job_id)).interactions[0]?.options??[];o(t.length<=3?t:[])}catch(e){gm(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 Fm(e.job_id,t),Nm(`Done — thanks!`,`success`),n()}catch(e){if(gm(e)){Nm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] resolve failed:`,e),Nm(`Something went wrong — try again.`)}finally{i(!1)}}},f=async t=>{if(!r){i(!0);try{let r=(await Sm(e.job_id)).interactions[0];await Cm(e.job_id,{responses:[{id:r.id,selectedOptionIds:[t]}]}),Nm(`Done — thanks!`,`success`),n()}catch(e){if(gm(e)){Nm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] decision option resolve failed:`,e),Nm(`Something went wrong — try again.`)}finally{i(!1)}}},p=e.kind===`decision`&&a!==null&&a.length>0;return(0,L.jsxs)(`div`,{className:`deck`,children:[(0,L.jsxs)(`div`,{className:`deck-meta`,children:[(0,L.jsx)(`span`,{className:`deck-kind`,children:l}),(0,L.jsx)(`span`,{className:`from`,children:e.asking_node_name}),(0,L.jsxs)(`span`,{className:`age`,children:[`blocked `,u]})]}),(0,L.jsx)(`p`,{className:`deck-q line-clamp-2`,children:e.title}),(0,L.jsxs)(`div`,{className:`deck-actions`,children:[e.kind===`notify`&&(0,L.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`ack`),children:`Got it`}),e.kind===`validation`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z,{type:`button`,size:`sm`,disabled:r,onClick:()=>void d(`yes`),children:`Approve`}),(0,L.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`no`),children:`Reject`})]}),p&&a.map(e=>(0,L.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void f(e.id),children:e.label},e.id)),(0,L.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,L.jsx)(Sf,{"aria-hidden":!0})]})]})]})}var Rm=e=>({"--i":e}),zm=`hosted in a tmux pane — open it in your terminal`;function Bm(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 Vm=[`active`,`idle`,`done`,`dead`,`canceled`],Hm={query:``,status:`all`,blockedOnly:!1};function Um(e){return e.query.trim()!==``||e.status!==`all`||e.blockedOnly}function Wm(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 Gm(e,t){if(!Um(t))return e;let n=new Map(e.map(e=>[e.node_id,e])),r=new Set;for(let i of e){if(!Wm(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 Km=new Set([`dead`,`canceled`]);function qm(e){return Km.has(e.node.status)&&e.children.every(qm)}function Jm(e){return 1+e.children.reduce((e,t)=>e+Jm(t),0)}var Ym=3,Xm={active:Pf,idle:Pf,done:Af,dead:Mf,canceled:Nf};function Zm(e,t){return t?kf:Xm[e]??Pf}function Qm(e){return e.toLocaleTimeString(`en-GB`,{hour12:!1})}function $m(){let[e,t]=(0,v.useState)(()=>Qm(new Date));return(0,v.useEffect)(()=>{let e=setInterval(()=>t(Qm(new Date)),1e3);return()=>clearInterval(e)},[]),e}function eh(){let{nodes:e}=Gp(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(Hm),s=(0,v.useRef)(null),c=$m(),l=e.filter(e=>e.status===`active`).length,u=(0,v.useMemo)(()=>Bm(Gm(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,L.jsxs)(`div`,{className:`in relative z-[1] h-full min-h-0 overflow-auto`,style:{padding:`34px 44px 44px`},children:[(0,L.jsxs)(`div`,{className:`rv flex items-baseline gap-4`,style:Rm(1),children:[(0,L.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:420,letterSpacing:`-0.01em`,fontVariationSettings:`"opsz" 60`,color:`var(--ink)`},children:`Canvas`}),(0,L.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e.length,` `,e.length===1?`node`:`nodes`,l>0&&` · ${l} active`]}),(0,L.jsxs)(`div`,{className:`font-inst text-xs flex items-center gap-2`,style:{marginLeft:`auto`,color:`var(--ink2)`,letterSpacing:`0.1em`},children:[(0,L.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:`var(--act)`,animation:`pulse 2.4s ease-out infinite`}}),(0,L.jsx)(`span`,{children:c})]})]}),(0,L.jsxs)(`div`,{className:`rv flex items-center gap-2.5`,style:{margin:`20px 0 22px`,...Rm(2)},children:[(0,L.jsxs)(`div`,{className:`search`,children:[(0,L.jsx)(Yf,{size:14,className:`opacity-70`,"aria-hidden":!0}),(0,L.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,L.jsx)(`span`,{className:`kbd`,children:`/`})]}),(0,L.jsxs)(`label`,{className:`selectish`,children:[(0,L.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,L.jsx)(`option`,{value:`all`,children:`all statuses`}),Vm.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]}),(0,L.jsx)(`span`,{className:`car`,children:`▾`})]}),(0,L.jsxs)(`label`,{className:`checkish select-none`,children:[(0,L.jsx)(`span`,{className:`box`,style:a.blockedOnly?{background:`var(--blk)`,borderColor:`var(--blk)`}:void 0}),`blocked`,(0,L.jsx)(`input`,{type:`checkbox`,checked:a.blockedOnly,onChange:e=>o(t=>({...t,blockedOnly:e.currentTarget.checked})),className:`sr-only`})]}),(0,L.jsx)(`button`,{type:`button`,className:`btn primary`,style:{marginLeft:`auto`},onClick:()=>{i(e=>e+1),n(!0)},children:`+ Spawn a node`})]}),(0,L.jsx)(Im,{}),(0,L.jsxs)(`div`,{className:`panel rv`,style:{padding:`6px 0`,...Rm(4)},children:[(0,L.jsxs)(`div`,{className:`flex items-center`,style:{padding:`10px 18px 9px`,borderBottom:`1px solid var(--line)`},children:[(0,L.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Node forest`}),(0,L.jsx)(`span`,{className:`font-inst text-xs`,style:{marginLeft:`auto`,color:`var(--dim)`,letterSpacing:`0.1em`},children:`sorted · activity`})]}),(0,L.jsx)(`div`,{className:`tree`,children:e.length===0?(0,L.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,L.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No matching nodes.`}):u.map(e=>(0,L.jsx)(th,{node:e},e.node.node_id))})]}),(0,L.jsx)(rh,{open:t,onClose:()=>n(!1)},r)]})}function th({node:e}){let t=pt(),[n,r]=(0,v.useState)(!1),i=e.node,a=i.attention_count>0,o=Km.has(i.status),s=a?`blocked`:i.status,c=e.children.filter(e=>!qm(e)),l=e.children.filter(e=>qm(e)),u=l.reduce((e,t)=>e+Jm(t),0),d=u>=Ym,f=d?c:e.children,p=()=>{i.enterable&&t(`/nodes/${encodeURIComponent(i.node_id)}`)};return(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsxs)(`div`,{className:`node-id`,children:[(0,L.jsxs)(`div`,{className:`node-l1`,children:[(0,L.jsx)(`span`,{className:`node-name`,children:i.name}),(0,L.jsxs)(`span`,{className:`node-kind`,children:[i.kind,` · `,i.mode]})]}),(0,L.jsxs)(`div`,{className:`node-l2`,children:[(0,L.jsx)(`span`,{className:`node-cwd`,title:i.cwd,children:i.cwd}),i.lifecycle&&(0,L.jsx)(`span`,{className:`node-life`,children:i.lifecycle}),!i.enterable&&(0,L.jsx)(`span`,{className:`node-note`,children:zm})]})]}),(0,L.jsxs)(`div`,{className:`node-right`,children:[a&&(0,L.jsxs)(`span`,{className:`waitflag`,children:[(0,L.jsx)(Lf,{size:14,"aria-hidden":!0}),` `,i.attention_count,` waiting on human`]}),(0,L.jsx)(nh,{status:i.status,blocked:a})]})]}),(f.length>0||d&&u>0)&&(0,L.jsxs)(`div`,{className:`kids`,children:[f.map(e=>(0,L.jsx)(th,{node:e},e.node.node_id)),d&&(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Df,{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,L.jsx)(th,{node:e},e.node.node_id))]})]})]})}function nh({status:e,blocked:t}){let n=Zm(e,t);return(0,L.jsxs)(hm,{variant:`outline`,className:t?`blocked`:e,children:[(0,L.jsx)(n,{"aria-hidden":!0}),e]})}function rh({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,L.jsx)(Xp,{open:e,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)($p,{className:`max-w-md overflow-y-auto max-h-[90dvh]`,children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:`Spawn a node`})}),(0,L.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 mp(r),t()}catch(e){console.error(`[spawn] failed:`,e),S(e instanceof cp?`${e.code}: ${e.message}`:String(e))}finally{b(!1)}},className:`flex flex-col gap-3.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-prompt`,children:`Prompt`}),(0,L.jsx)(pm,{id:`spawn-prompt`,value:n,onChange:e=>r(e.currentTarget.value),rows:4,required:!0,className:`resize-none`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-kind`,children:`Kind`}),(0,L.jsx)(im,{id:`spawn-kind`,value:i,onChange:e=>a(e.currentTarget.value),required:!0})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-mode`,children:`Mode`}),(0,L.jsxs)(om,{value:o===``?`__none__`:o,onValueChange:e=>s(e===`__none__`?``:e),children:[(0,L.jsx)(cm,{id:`spawn-mode`,className:`w-full`,children:(0,L.jsx)(sm,{})}),(0,L.jsxs)(lm,{children:[(0,L.jsx)(um,{value:`__none__`,children:`(default)`}),(0,L.jsx)(um,{value:`base`,children:`base`}),(0,L.jsx)(um,{value:`orchestrator`,children:`orchestrator`})]})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.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,L.jsx)(am,{htmlFor:`spawn-root`,className:`cursor-pointer`,children:`Resident root node`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-cwd`,children:`cwd`}),(0,L.jsx)(im,{id:`spawn-cwd`,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`(inherit)`,className:`font-mono text-sm`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-name`,children:`Name`}),(0,L.jsx)(im,{id:`spawn-name`,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`(auto)`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-model`,children:`Model`}),(0,L.jsx)(im,{id:`spawn-model`,value:m,onChange:e=>h(e.currentTarget.value),placeholder:`(default)`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-parent`,children:`Parent node id`}),(0,L.jsx)(im,{id:`spawn-parent`,value:g,onChange:e=>_(e.currentTarget.value),placeholder:`(this canvas root)`,className:`font-mono text-sm`})]}),x&&(0,L.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,disabled:y,children:`Cancel`}),(0,L.jsx)(Z,{type:`submit`,form:`spawn-form`,disabled:y,children:y?`Spawning…`:`Spawn`})]})]})})}function ih(e){if(!e)return``;let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]??``}function ah(e){let t=e.name?.trim();if(t&&t!==e.kind)return t;let n=ih(e.cwd);return n?`${e.kind} · ${n}`:e.kind}function oh(e){return e.parent===null&&e.host_kind===`broker`}function sh(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 ch(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 lh(e){return e===`done`||e===`dead`||e===`canceled`}function uh(e){return e.attention_count>0?`blocked`:e.status}function dh(e,t,n){return t>0?`needs-you`:e.status===`active`||n>0?`active`:lh(e.status)?`done`:`idle`}function fh(e){switch(e){case`needs-you`:return 0;case`active`:return 1;case`idle`:return 2;case`done`:return 3}}function ph(e){let t=sh(e),n=[];for(let r of e){if(!oh(r))continue;let e=ch(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:ah(r),state:dh(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=fh(e.state)-fh(t.state);return n===0?t.lastActivity.localeCompare(e.lastActivity):n}),n}function mh(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 hh(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 gh=[`Research a topic for me`,`Help me write something`,`Review my code`,`Plan a project`];function _h(){let{nodes:e,loading:t}=Gp(),n=Np(e=>e.reachable),r=(0,v.useMemo)(()=>ph(e),[e]),[i,a]=(0,v.useState)(!1),[o]=Hn();(0,v.useEffect)(()=>{o.get(`new`)!==null&&a(!0)},[o]);let s=!t&&r.length===0;return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,L.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-3`,children:[(0,L.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Conversations`}),!s&&!i&&(0,L.jsx)(Z,{size:`lg`,onClick:()=>a(!0),children:`+ New chat`})]}),!n&&(0,L.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,L.jsx)(vh,{firstRun:s,onCancel:s?void 0:()=>a(!1)}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,L.jsx)(Sh,{}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>(0,L.jsx)(yh,{conversation:e},e.id))})})]})}function vh({firstRun:e,onCancel:t}){let n=pt(),[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 mp({prompt:e,kind:`general`,mode:`base`,root:!0});n(`/c/${encodeURIComponent(t.node_id)}`)}catch(e){c(e instanceof cp?e.message:String(e)),o(!1)}}};return(0,L.jsxs)(`div`,{className:`panel mb-6 p-5`,children:[e&&(0,L.jsx)(`p`,{className:`mb-3 text-base`,style:{fontStyle:`italic`,color:`var(--ink2)`},children:`Start a conversation with an agent.`}),(0,L.jsx)(pm,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{hh(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,L.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:gh.map(e=>(0,L.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,L.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:s}),(0,L.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-2`,children:[t&&(0,L.jsx)(Z,{variant:`ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,L.jsx)(Z,{onClick:()=>void l(),disabled:a||!r.trim(),children:a?`Starting…`:`Start chat`})]})]})}function yh({conversation:e}){let t=pt();return(0,L.jsx)(`li`,{className:`list-none`,children:(0,L.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,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(xh,{state:e.state}),(0,L.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title})]}),(0,L.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:mh(e)})]}),(0,L.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,L.jsxs)(`span`,{title:`cycles`,children:[`⟳ `,e.cycles]}),(0,L.jsxs)(`span`,{title:`nodes in this conversation`,children:[`◦ `,e.nodeCount,` `,e.nodeCount===1?`node`:`nodes`]}),(0,L.jsx)(`span`,{title:`time since last work`,children:Ch(e.lastActivity)})]})]})})}var bh={"needs-you":`needs you`,active:`active`,idle:`idle`,done:`done`};function xh({state:e}){let t=e===`needs-you`?`blocked`:e,n=bh[e];return(0,L.jsx)(`span`,{className:J(`dot shrink-0`,t),title:n,"aria-label":n})}function Sh(){return(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2,3].map(e=>(0,L.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,L.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded bg-muted`}),(0,L.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded bg-muted/70`})]}),(0,L.jsx)(`div`,{className:`h-6 w-16 animate-pulse rounded-full bg-muted`})]},e))})}function Ch(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 wh={active:Wf,idle:Pf,done:Af,dead:Mf,canceled:Nf,blocked:kf};function Th({status:e}){return(0,L.jsx)(wh[e]??Pf,{className:J(`!size-3.5`,e===`active`&&`animate-spin`)})}function Eh(e,t,n,r){return t===`static`?e.status:n===`down`?`dead`:n===`reconnecting`?`idle`:r?`active`:`idle`}function Dh(e){let t=e.store.source===`static`,n=e.store.state?.isStreaming??!1,r=e.detail,i=r?Eh(r,e.store.source,e.store.brokerStatus,n):null;return r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h2`,{className:J(Oh,`min-w-0 truncate`),title:r.name,children:r.name}),i&&(0,L.jsxs)(hm,{className:J(`gap-1.5`,i),children:[(0,L.jsx)(Th,{status:i}),i]}),t&&(0,L.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--idle)`},title:`dormant node — last-known values, not live`,children:`last-known`})]}):(0,L.jsx)(`h2`,{className:Oh,children:`…`})}var Oh=`con-title text-xl font-medium`;function kh(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,L.jsxs)(`div`,{className:`cluster`,children:[i&&(0,L.jsxs)(`div`,{className:`gauge`,children:[(0,L.jsxs)(`div`,{className:`glabel`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Context`}),(0,L.jsxs)(`span`,{className:`gval`,children:[s===null?`—`:Mh(s),s!==null&&(0,L.jsx)(`span`,{className:`u`,children:`%`})]})]}),(0,L.jsx)(`div`,{className:`gbar`,children:(0,L.jsx)(`i`,{style:{width:s===null?`0%`:`${Math.min(100,s)}%`}})}),(0,L.jsxs)(`div`,{className:`gsub`,children:[i.tokens.toLocaleString(),!n&&(0,L.jsxs)(L.Fragment,{children:[` / `,i.window.toLocaleString()]})]})]}),c!==null&&(0,L.jsxs)(`div`,{className:`gauge`,children:[(0,L.jsxs)(`div`,{className:`glabel`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Cost`}),(0,L.jsxs)(`span`,{className:`gval`,children:[(0,L.jsx)(`span`,{className:`u`,style:{marginLeft:0,marginRight:2},children:`$`}),c.toFixed(2)]})]}),(0,L.jsx)(`div`,{className:`gbar`,children:(0,L.jsx)(`i`,{style:{width:`${Math.min(100,c/5*100)}%`}})}),a&&(0,L.jsxs)(`div`,{className:`gsub`,children:[a.turns,` turns`]})]}),(0,L.jsxs)(`div`,{className:`dials`,children:[!n&&a&&c===null&&(0,L.jsx)(Ah,{value:String(a.turns),unit:`turns`}),!n&&a&&(0,L.jsx)(Ah,{value:`${a.user_messages}/${a.assistant_messages}`,unit:`msgs`}),o&&(0,L.jsx)(Ah,{value:`${jh(o.input)} → ${jh(o.output)}`,unit:`tokens`}),!n&&t.tool_calls!==null&&(0,L.jsx)(Ah,{value:String(t.tool_calls),unit:`tools`,hot:r})]})]})}function Ah({value:e,unit:t,hot:n}){return(0,L.jsx)(`div`,{className:`dial`,children:(0,L.jsxs)(`span`,{className:`dval`,style:n?{color:`var(--act)`}:void 0,children:[e,` `,(0,L.jsx)(`em`,{children:t})]})})}function jh(e){return e>=1e6?`${Math.round(e/1e5)/10}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Mh(e){return(Math.round(e*10)/10).toFixed(1)}function Nh({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,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,L.jsx)(Rf,{className:`size-3.5 shrink-0 opacity-70`}),(0,L.jsx)(`b`,{style:Ph,children:i}),a>0&&(0,L.jsxs)(`span`,{style:{color:`var(--act)`,opacity:.8},children:[` +`,a]}),o>0&&(0,L.jsxs)(`span`,{style:{color:`var(--idle)`,opacity:.8},children:[` ~`,o]})]},`branch`))}let a=t?.cwd??null;a!==null&&r.push((0,L.jsx)(`span`,{children:Fh(a)},`cwd`));let o=n.model??t?.model??null;o!==null&&r.push((0,L.jsx)(`span`,{children:(0,L.jsx)(`b`,{style:Ph,children:o})},`model`));let s=n.context??null;return s!==null&&r.push((0,L.jsxs)(`span`,{children:[`ctx `,(0,L.jsx)(`b`,{style:Ph,children:Ih(s.tokens)}),` / `,Ih(s.window)]},`ctx`)),r.length===0?null:(0,L.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,L.jsxs)(v.Fragment,{children:[t>0&&(0,L.jsx)(`span`,{style:{color:`var(--dim)`,opacity:.5},className:`select-none`,children:`·`}),e]},t))})}var Ph={color:`var(--ink2)`,fontWeight:400};function Fh(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 Ih(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Lh(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,L.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,L.jsxs)(`div`,{ref:r,className:`panel rv`,style:Rh,children:[(0,L.jsxs)(`div`,{style:zh,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Instruments`}),(0,L.jsx)(`div`,{style:{flex:1}}),(0,L.jsx)(`span`,{className:`kbd`,children:`⌥i`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`transition-colors`,style:{color:`var(--mut)`},"aria-label":`Close instruments`,children:(0,L.jsx)($f,{className:`size-3.5`})})]}),(0,L.jsx)(kh,{store:e.store,detail:e.detail})]})}):null}var Rh={minWidth:`min(680px, 92vw)`,overflow:`hidden`,"--i":0},zh={display:`flex`,alignItems:`center`,gap:`10px`,padding:`11px 30px`,borderBottom:`1px solid var(--line)`};function Bh(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 Vh(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 Hh(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 Uh(e,t){let n=new Map(e.map(e=>[e.node_id,e])),r=Bh(e),i=Hh(t,n),a=i?.node_id??null;return{thisGraph:i===null?[]:Vh(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 Wh=new Set([`done`,`dead`,`canceled`]),Gh=`crtr:graphrail-collapsed`;function Kh(e){return e.attention_count>0||e.status===`active`}function qh(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&&Kh(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 Jh({currentId:e,onNavigate:t}){let{nodes:n}=Gp(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(Gh)===`1`}catch{return!1}}),[s,c]=(0,v.useState)({}),{thisGraph:l}=Uh(n,e),u=l[0]?.node.node_id??null,{children:d,collapsedByDefault:f}=(0,v.useMemo)(()=>qh(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(Gh,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)(Wh.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,L.jsx)(`aside`,{className:`graphrail rv`,style:Xh,children:(0,L.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,L.jsx)(Df,{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,L.jsx)(rg,{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,L.jsxs)(`aside`,{className:`graphrail rv`,style:Yh,children:[(0,L.jsx)(`div`,{className:`flex items-center justify-end pb-1`,children:(0,L.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,L.jsx)(Df,{className:`size-4 rotate-180`})})}),(0,L.jsx)(Zh,{label:`This graph`,chord:`⌥↑↓ to cycle`}),y,l.length===0&&(0,L.jsx)(Qh,{}),(g.length>0||_.length>0)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`gr-gap`}),(0,L.jsx)(Zh,{label:`Elsewhere`}),g.map(e=>(0,L.jsx)(rg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id)),_.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Df,{className:J(`size-3.5 transition-transform`,r&&`rotate-90`)}),r?`Hide`:`Show`,` `,_.length,` finished`]}),r&&_.map(e=>(0,L.jsx)(rg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id))]})]})]})}var Yh={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},Xh={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 Zh({label:e,chord:t}){return(0,L.jsxs)(`div`,{className:`gr-sec`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:e}),(0,L.jsx)(`div`,{className:`rule`}),t&&(0,L.jsx)(`span`,{title:t,"aria-label":t,className:`flex items-center text-[var(--dim)]`,children:(0,L.jsx)(Vf,{className:`size-3.5`})})]})}function Qh(){return(0,L.jsx)(`span`,{className:`px-3 py-1 font-mono text-xs`,style:{color:`var(--dim)`},children:`—`})}function $h(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 eg(e){return e.split(`/`).filter(Boolean).at(-1)??e}function tg(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 ng={active:`s-active`,idle:`s-idle`,done:`s-done`,dead:`s-dead`,canceled:`s-canceled`};function rg({node:e,depth:t,current:n,elsewhere:r=!1,hasChildren:i=!1,collapsed:a=!1,onToggleCollapse:o,onClick:s}){let c=Wh.has(e.status),l=e.attention_count>0,u=l?`blocked`:e.status,d=$h(e.created),f=t>0?{marginLeft:`${t*12}px`}:void 0,p=(0,L.jsx)(`button`,{type:`button`,onClick:s,className:J(`node-row text-left`,r?`w-full`:`min-w-0 flex-1`,l?`s-blocked`:ng[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,L.jsxs)(`span`,{className:`node-id`,children:[(0,L.jsxs)(`span`,{className:`node-l1`,children:[(0,L.jsx)(`span`,{className:J(`node-name truncate`,n&&`font-semibold`),children:r?eg(e.cwd):e.name}),r?(0,L.jsxs)(`span`,{className:`node-kind truncate`,children:[e.name,` · `,e.kind]}):(0,L.jsx)(`span`,{className:`node-kind`,children:e.kind}),l&&(0,L.jsxs)(hm,{variant:`destructive`,className:`ml-auto gap-1 text-xs`,children:[(0,L.jsx)(Lf,{className:`size-3.5`}),e.attention_count]})]}),(0,L.jsxs)(`span`,{className:`node-l2`,children:[r&&(0,L.jsx)(`span`,{className:`node-cwd`,children:tg(e.cwd)}),(0,L.jsx)(`span`,{className:J(`dot`,u),title:u,"aria-label":u}),d&&(0,L.jsx)(`span`,{className:`text-[var(--dim)]`,children:d})]})]})});return r?(0,L.jsx)(`div`,{style:f,children:p}):(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,style:f,children:[i?(0,L.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,L.jsx)(Df,{className:J(`size-3.5 transition-transform`,!a&&`rotate-90`)})}):(0,L.jsx)(`span`,{className:`size-4 flex-none`,"aria-hidden":`true`}),p]})}function ig(e){let t=e.store.presence,n=e.store.role===`controller`;return(0,L.jsxs)(v.Fragment,{children:[(0,L.jsxs)(`div`,{className:`ctl-state flex shrink-0 items-center gap-1.5 text-xs`,style:{color:`var(--mut)`},children:[`control:`,` `,(0,L.jsx)(`span`,{style:{color:`var(--ink2)`,fontStyle:`italic`},children:n?`you`:t.controller?`another client`:`no one`})]}),n?(0,L.jsx)(`button`,{type:`button`,className:`btn sm shrink-0`,onClick:()=>e.store.releaseControl(),children:`Release control`}):(0,L.jsx)(`button`,{type:`button`,className:`btn primary sm shrink-0`,disabled:!e.store.socketReady,title:e.store.socketReady?void 0:`connecting…`,onClick:()=>e.store.requestControl(),children:`Request control`})]})}function ag(e){let t=e?.diagnostics;return Array.isArray(t)&&t.some(e=>e?.type===`crtr:managed-provider-cooling`)}function og(e){return typeof e==`object`&&!!e}function sg(e){return typeof e==`string`?e:``}function cg(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 lg(e){let t=sg(e.code)||sg(e.errno);return t===``?null:/^(ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOENT|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH)$/i.test(t)?`connection`:null}function ug(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 dg(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=sg(e.reason);return/no running broker/i.test(t)||cg(t)===`connection`?`connection`:`other`}return null}function fg(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 pg(e){if(typeof e==`string`)return e;if(!og(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(og(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 mg(e,t){if(e===`pi→provider`&&ag(t))return{kind:`rate-limit`,disposition:`auto`};if(og(t)){let n=lg(t);if(n!==null)return{kind:n,disposition:fg(e,n)};let r=ug(t);if(r!==null)return{kind:r,disposition:fg(e,r)};let i=dg(t);if(i!==null)return{kind:i,disposition:fg(e,i)}}let n=cg(pg(t));return{kind:n,disposition:fg(e,n)}}var hg=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,sp!==void 0&&t.searchParams.set(`token`,sp),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=mg(`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))}},gg=/^From (?:[a-z0-9]+(?:-[a-z0-9]+)+|system|human) — \d+ update/;function _g(e){return gg.test(e)}function vg(e){let t=/^From ([a-z0-9]+(?:-[a-z0-9]+)+|system|human) — /.exec(e);if(!t)return null;let n=t[1];return typeof n==`string`?n:null}function yg(){return{messages:[],streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]}}function bg(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 xg(e){return wg(e)!==`user`||e.origin||!_g(bg(e))?e:{...e,origin:`inbox`}}function Sg(){return{role:`assistant`,content:[]}}function Cg(e,t){let n=e.messages.map(xg);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&&wg(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&&wg(i)===`assistant`?i:Sg(),o=[...n,a];return{messages:o,streamingIndex:o.length-1,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]}}function wg(e){return e.role??``}function Tg(e){for(let t=e.messages.length-1;t>=0;t--)if(wg(e.messages[t])===`bashExecution`)return t;return null}function Eg(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 Dg(e,t){let n=Tg(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 Og(e,t){let n=Tg(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 kg(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=xg(t.message),r=[...e.messages,n],i=wg(n)===`assistant`,a=e.partialToolResults;if(wg(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&&wg(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,Ag(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,Ag(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 Ag(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 jg=4,Mg=new Set([`knowledge`,`preference`]),Ng=new Set([`node`,`project`,`profile`,`user`,`builtin`]),Pg=new Set([`name`,`kind`,`scope`,`shortForm`]),Fg=new Set([`stop`,`length`,`toolUse`,`error`,`aborted`]),Ig=new Set([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),Lg=200,Rg=256*1024,zg=20,Bg=8*1024*1024;function Vg(e){return{schemaVersion:jg,...e}}function Hg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e){return typeof e==`string`}function Ug(e){return typeof e==`number`}function Wg(e){return typeof e==`boolean`}function Gg(e){return Array.isArray(e)&&e.every(Q)}function Kg(e){return!Hg(e)||e.type!==`text`||!Q(e.text)?!1:e.textSignature===void 0||Q(e.textSignature)}function qg(e){return Hg(e)&&e.type===`image`&&Q(e.data)&&Q(e.mimeType)}function Jg(e){return Hg(e)&&e.type===`toolCall`&&Q(e.id)&&Q(e.name)&&Hg(e.arguments)&&(e.thoughtSignature===void 0||Q(e.thoughtSignature))}function Yg(e){return Hg(e)&&Ug(e.input)&&Ug(e.output)&&Ug(e.cacheRead)&&Ug(e.cacheWrite)&&Ug(e.total)}function Xg(e){return Hg(e)&&Ug(e.input)&&Ug(e.output)&&Ug(e.cacheRead)&&Ug(e.cacheWrite)&&(e.cacheWrite1h===void 0||Ug(e.cacheWrite1h))&&(e.reasoning===void 0||Ug(e.reasoning))&&Ug(e.totalTokens)&&Yg(e.cost)}function Zg(e){return typeof e==`string`&&Fg.has(e)}function Qg(e){return typeof e==`string`&&Ig.has(e)}function $g(e){return!Hg(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)||Ug(e.code))}function e_(e){return!Hg(e)||!Q(e.type)||!Ug(e.timestamp)?!1:(e.error===void 0||$g(e.error))&&(e.details===void 0||Hg(e.details))}function t_(e){return!Hg(e)||e.role!==`user`||!Ug(e.timestamp)?!1:typeof e.content==`string`||Array.isArray(e.content)&&e.content.every(e=>Kg(e)||qg(e))}function n_(e){return!Hg(e)||e.role!==`assistant`||!Ug(e.timestamp)||!Array.isArray(e.content)||!e.content.every(e=>Kg(e)||Hg(e)&&e.type===`thinking`&&Q(e.thinking)&&(e.thinkingSignature===void 0||Q(e.thinkingSignature))&&(e.redacted===void 0||Wg(e.redacted))||Jg(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(e_))&&Xg(e.usage)&&Zg(e.stopReason)&&(e.errorMessage===void 0||Q(e.errorMessage))}function r_(e){return!Hg(e)||e.role!==`toolResult`||!Ug(e.timestamp)?!1:Q(e.toolCallId)&&Q(e.toolName)&&Array.isArray(e.content)&&e.content.every(e=>Kg(e)||qg(e))&&Wg(e.isError)}function i_(e){return Hg(e)&&e.role===`bashExecution`&&Q(e.command)&&Q(e.output)&&Ug(e.timestamp)&&(e.exitCode===void 0||Ug(e.exitCode))&&Wg(e.cancelled)&&Wg(e.truncated)&&(e.fullOutputPath===void 0||Q(e.fullOutputPath))&&(e.excludeFromContext===void 0||Wg(e.excludeFromContext))}function a_(e){return t_(e)||n_(e)||r_(e)||i_(e)}function o_(e){return!Hg(e)||!Q(e.role)?!1:e.role!==`user`&&e.role!==`assistant`&&e.role!==`toolResult`&&e.role!==`bashExecution`}function s_(e){return a_(e)||o_(e)}function c_(e){if(!Hg(e))return!1;let t=Object.keys(e);return t.length!==Pg.size||!t.every(e=>Pg.has(e))?!1:Q(e.name)&&Mg.has(e.kind)&&Ng.has(e.scope)&&Q(e.shortForm)}function l_(e){return Gg(e)}function u_(e){return!Hg(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 d_(e){return e===null?!0:Hg(e)?Q(e.sessionId)&&(e.sessionFile===void 0||Q(e.sessionFile))&&(e.model===void 0||Hg(e.model)&&Q(e.model.id))&&Wg(e.isStreaming)&&Wg(e.isCompacting)&&Qg(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))&&Wg(e.autoCompactionEnabled)&&Ug(e.messageCount)&&Ug(e.pendingMessageCount):!1}function f_(e,t){return Hg(t)?t.schemaVersion===jg&&t.nodeId===e&&Array.isArray(t.messages)&&t.messages.every(s_)&&d_(t.sessionState)&&Array.isArray(t.commands)&&t.commands.every(u_)&&Array.isArray(t.refs)&&t.refs.every(c_)&&l_(t.engineLeadingCommandNames)&&Wg(t.isStreaming)&&(t.activity===null||Q(t.activity))&&Ug(t.updatedAt)&&(t.source===`broker`||t.source===`static`):!1}function p_(e){return new TextEncoder().encode(JSON.stringify(e)).length}function m_(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 h_(e,t,n){let r=e.messages.slice(-t),i={...e,messages:r};for(;r.length>1&&p_(i)>n;)r=r.slice(1),i={...e,messages:r};return i}function g_(e){return`crtr.web.transcript.tail.${e}`}function __(e){try{let t=globalThis.localStorage?.getItem(g_(e));if(t==null)return null;let n=JSON.parse(t);return f_(e,n)?n:(globalThis.localStorage?.removeItem(g_(e)),null)}catch{try{globalThis.localStorage?.removeItem(g_(e))}catch{}return null}}function v_(e){let t=h_(m_(e),zg,Rg);try{globalThis.localStorage?.setItem(g_(e.nodeId),JSON.stringify(t))}catch{}}var y_=`crtr-web-transcript-cache`,b_=1,x_=`entries`;function S_(){return new Promise((e,t)=>{if(typeof indexedDB>`u`){t(Error(`indexedDB unavailable`));return}let n=indexedDB.open(y_,b_);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(x_)||e.createObjectStore(x_,{keyPath:`nodeId`}).createIndex(`updatedAt`,`updatedAt`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))})}async function C_(e,t){await new Promise((n,r)=>{let i=e.transaction(x_,`readwrite`);i.objectStore(x_).delete(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB delete failed`))})}async function w_(e){try{let t=await S_(),n=await new Promise((n,r)=>{let i=t.transaction(x_,`readonly`).objectStore(x_).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error??Error(`indexedDB read failed`))});return f_(e,n)?(t.close(),n):(n!=null&&await C_(t,e),t.close(),null)}catch{return null}}async function T_(e){let t=[];await new Promise((n,r)=>{let i=e.transaction(x_,`readonly`).objectStore(x_).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:p_(r)}),e.continue()},i.onerror=()=>r(i.error??Error(`indexedDB cursor failed`))});let n=t.reduce((e,t)=>e+t.size,0);n<=Bg||await new Promise((r,i)=>{let a=e.transaction(x_,`readwrite`),o=a.objectStore(x_),s=0;for(;n>Bg&&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 E_(e){let t=h_(m_(e),Lg,Rg);try{let e=await S_();await new Promise((n,r)=>{let i=e.transaction(x_,`readwrite`);i.objectStore(x_).put(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB write failed`))}),await T_(e),e.close()}catch{}}function D_(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 O_(e){return{clientId:e,conn:`connecting`,conv:yg(),role:`observer`,controllerId:null,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 k_={"no-broker":`no-broker`,"no-node":`no-node`,invalid:`invalid`,transient:`closed`};function A_(e){return e===`welcome`||e===`control_changed`||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 j_(e,t){switch(t.kind){case`connecting`:return e.conn===`connecting`?e:{...e,conn:`connecting`};case`closed`:{let n=k_[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 B_(e,t.frame)}}function M_(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 N_(e,t){return e.length===t.length&&e.every((e,n)=>M_(e,t[n]))}function P_(e,t){return e.name===t.name&&e.kind===t.kind&&e.scope===t.scope&&e.shortForm===t.shortForm}function F_(e,t){return e.length===t.length&&e.every((e,n)=>P_(e,t[n]))}function I_(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function L_(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 R_(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||D_(t.expansion))}):[]}catch{return[]}}function z_(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 B_(e,t){if(!A_(t.type))return{...e,conv:kg(e.conv,t)};switch(t.type){case`welcome`:{let n=Cg(t.snapshot,e.conv),r=t.controller_id,i=t.snapshot.state;return{...e,conn:`open`,conv:n,controllerId:r,role:r===e.clientId?`controller`:`observer`,session:i,model:i.model?.id,sessionName:i.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`control_changed`:return e.controllerId===t.controller_id?e:{...e,controllerId:t.controller_id,role:t.controller_id===e.clientId?`controller`:`observer`};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.code===`not_controller`?`read-only — another viewer is the controller`: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(L_(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?R_(t.detail):[];return N_(e.commands,n)?e:{...e,commands:n}}case`bash_start`:return{...e,conv:Eg(e.conv,t.command,t.excludeFromContext)};case`bash_output`:return{...e,conv:Dg(e.conv,t.chunk)};case`bash_end`:return{...e,conv:Og(e.conv,t)};case`data`:return t.kind!==`list_memory_refs`||t.id!==e.pendingRefsRequestId||!Array.isArray(t.refs)||!t.refs.every(c_)||!l_(t.engineLeadingCommandNames)||F_(e.refs,t.refs)&&I_(e.engineLeadingCommandNames,t.engineLeadingCommandNames)?e:{...e,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames};default:return e}}var V_=1500,H_=800,U_=5e3,W_=10;function G_(e){return Math.min(U_,H_*2**e)}var K_=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=O_(this.clientId);let t=__(e);t&&(this.state={...this.state,conv:z_(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;w_(this.nodeId).then(t=>{if(e===this.gen&&!this.liveAttached&&!(t===null||t.updatedAt<=this.cachedUpdatedAt)){this.state={...this.state,conv:z_(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,this.state.conn===`open`&&this.send({type:`request_control`})}background(){this.pinned=!1,this.send({type:`release_control`})}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=j_(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=Vg({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`});v_(e),E_(e),this.cachedUpdatedAt=e.updatedAt}send(e){this.client?.send(e)}dial(){let e=this.gen,t=new hg(this.nodeId,{onOpen:()=>{e===this.gen&&t.send({type:`hello`,role:`observer`,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.pinned&&t.send({type:`request_control`}),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())},V_);else if(t===`no-broker`&&this.noBrokerAttempts<W_){let t=this.noBrokerAttempts;this.noBrokerAttempts+=1,this.timer=setTimeout(()=>{e===this.gen&&this.dial()},G_(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:`take control before sending`});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`})},takeControl:()=>this.send({type:`request_control`}),releaseControl:()=>this.send({type:`release_control`}),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})}}},q_=4,J_=new class{handles=new Map;mru=[];poolListeners=new Set;warmIdsSnapshot=[];acquire(e){let t=this.handles.get(e);return t||(t=new K_(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>q_;){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 Y_(e){let t=J_.acquire(e);return{state:(0,v.useSyncExternalStore)(t.subscribe,t.getState),actions:t.actions}}var X_={branch:null,model:null,tokens:null,context:null,tool_calls:null,stats:null,git_status:null};function Z_(e,t){return{...Q_,...t.state,sessionId:t.state?.sessionId??e,isStreaming:!1}}var Q_={sessionId:``,isStreaming:!1,isCompacting:!1,thinkingLevel:`off`,steeringMode:`all`,followUpMode:`all`,autoCompactionEnabled:!1,messageCount:0,pendingMessageCount:0};function $_(e){let{state:t,actions:n}=Y_(e),r=Np(e=>e.reachable),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let n=!1;if(t.conn!==`no-broker`){a(null);return}return pp(e).then(t=>{if(n)return;a(t);let r=Vg({nodeId:e,messages:Cg(t.snapshot).messages,sessionState:Z_(e,t.snapshot),commands:t.commands,refs:[],engineLeadingCommandNames:[],isStreaming:!1,activity:null,updatedAt:Date.now(),source:`static`});v_(r),E_(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:Cg(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:Z_(e,o.snapshot),[e,o,t.conn,c]),u=(0,v.useMemo)(()=>o===null?{...X_,model:t.model??null}:{...X_,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:_,presence:{viewers:0,controller:t.controllerId},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,requestControl:n.takeControl,releaseControl:n.releaseControl,dialogResponse:(e,t)=>n.answerDialog({type:`extension_ui_response`,id:e,...t})}}var ev=400,tv=4e3;function nv(e){return e.dormant&&e.status===`active`&&e.socketReady&&e.attempt<8}function rv(e){return Math.min(tv,ev*2**Math.max(0,e))}var iv=1,av=400;function ov(e){return`crtr.web.draft.${e}`}function sv(e,t){if(typeof t!=`object`||!t)return!1;let n=t;return n.schemaVersion===iv&&n.nodeId===e&&typeof n.text==`string`&&typeof n.updatedAt==`number`}function cv(e){try{let t=globalThis.localStorage?.getItem(ov(e));if(t==null)return``;let n=JSON.parse(t);return sv(e,n)?n.text:``}catch{return``}}function lv(e,t){let n={schemaVersion:iv,nodeId:e,text:t,updatedAt:Date.now()};try{globalThis.localStorage?.setItem(ov(e),JSON.stringify(n))}catch{}}function uv(e){try{globalThis.localStorage?.removeItem(ov(e))}catch{}}var dv=new Map;function fv(e,t){let n=dv.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{dv.delete(e),t===``?uv(e):lv(e,t)},av);dv.set(e,r)}function pv(e){let t=dv.get(e);t&&(clearTimeout(t),dv.delete(e))}var mv=new Set([`reload`]);function hv(e){let t=$_(e),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>(J_.focus(e),()=>{J_.background(e)}),[e]);let[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{a(cv(e))},[e]),(0,v.useEffect)(()=>{fv(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([...mv,...t.engineLeadingCommandNames]),[t.engineLeadingCommandNames]);(0,v.useEffect)(()=>{let t=!1;return fp(e).then(e=>{t||r(e)}).catch(e=>{t||l(gv(e))}),()=>{t=!0}},[e]);let b=(0,v.useRef)(0);(0,v.useEffect)(()=>{b.current=0},[e]),(0,v.useEffect)(()=>{if(!nv({dormant:f,status:n?.status,socketReady:t.socketReady,attempt:b.current}))return;let e=b.current;b.current+=1;let r=setTimeout(()=>t.reconnect(),rv(e));return()=>clearTimeout(r)},[f,n?.status,t.socketReady,t.reconnect]);let x=()=>{!i.trim()||!g||(h?t.steer(i):t.prompt(i),pv(e),uv(e),a(``))};return{store:t,detail:n,input:i,setInput:a,reviving:o,actionError:c,peekedPath:u,setPeekedPath:d,dormant:f,brokerUp:p,isController:m,streaming:h,canDrive:g,commands:_,refs:t.refs,commandNames:y,onReplaceToken:e=>{a(e.text)},sendPrimary:x,onInputKeyDown:e=>{hh(e,a,x)},selectCommand:e=>{a(`/${e.name} `)},doRevive:async()=>{s(!0),l(null);try{await gp(e),t.reconnect()}catch(e){l(gv(e))}finally{s(!1)}},doClose:async()=>{l(null);try{await _p(e)}catch(e){l(gv(e))}}}}function gv(e){return e instanceof cp?`${e.code}: ${e.message}`:String(e)}function _v(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,L.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,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:n.map(t=>(0,L.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,L.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-primary`,children:[`/`,t.name]}),t.argument_hint&&(0,L.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground/70`,children:t.argument_hint}),(0,L.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground/50`,children:[t.source,t.location&&(0,L.jsxs)(L.Fragment,{children:[` · `,t.location]})]}),(0,L.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:t.description})]},t.name))}):(0,L.jsx)(`div`,{className:`px-3 py-2 text-xs italic text-muted-foreground`,children:`no matching commands`})}):null}var vv=new Set([`select`,`confirm`,`input`,`editor`,`notify`]);function yv(e){return vv.has(e.method)}function bv(e){let t=e.store.dialog,n=t&&yv(t)?t:null,r=e.store.role===`controller`;return(0,L.jsx)(Xp,{open:n!==null,children:(0,L.jsx)($p,{showCloseButton:!1,className:n&&!r?`opacity-90`:void 0,children:n&&(r?(0,L.jsx)(Tv,{req:n,store:e.store},n.id):(0,L.jsx)(xv,{req:n},n.id))})})}function xv(e){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`text-sm font-semibold`,children:`The controller is being prompted`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:wv(e.req)})]})}function Sv(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 Cv(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,L.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,L.jsxs)(`span`,{children:[n>0&&(0,L.jsx)(`br`,{}),r]},n)})}function wv(e){switch(e.method){case`select`:return`${e.title} — ${e.options.length} options`;case`confirm`:return`${e.title}: ${e.message}`;case`input`:return e.title;case`editor`:return e.title;case`notify`:return e.message}}function Tv(e){let t=()=>e.store.dialogResponse(e.req.id,{cancelled:!0});return e.req.method===`select`?(0,L.jsx)(Ev,{req:e.req,store:e.store,cancel:t}):(0,L.jsx)(Dv,{req:e.req,store:e.store,cancel:t})}function Ev(e){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:e.req.title})}),(0,L.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.req.options.map(t=>(0,L.jsx)(`li`,{children:(0,L.jsx)(Z,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>e.store.dialogResponse(e.req.id,{value:t}),children:t})},t))}),(0,L.jsx)(tm,{children:(0,L.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`})})]})}function Dv(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,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:t.title})}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{variant:`secondary`,onClick:()=>e.store.dialogResponse(t.id,{confirmed:!1}),children:`No`}),(0,L.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,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:Cv(r.title)})}),r.method===`editor`?(0,L.jsx)(pm,{className:`resize-none font-mono text-sm`,rows:8,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}):(0,L.jsx)(im,{placeholder:r.placeholder??``,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`}),(0,L.jsx)(Z,{onClick:()=>e.store.dialogResponse(r.id,{value:t}),children:`Submit`})]})]})}if(e.req.method===`notify`){let t=e.req;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:J(`rounded-none border px-3 py-2 text-sm`,Sv(t.notifyType)),children:Cv(t.message)}),(0,L.jsx)(tm,{children:(0,L.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`OK`})})]})}return null}function Ov(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 kv(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 Av(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var jv=(e,t)=>Math.abs(e-t)<1.01,Mv=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Nv,Pv=()=>{if(Nv!==void 0)return Nv;if(typeof navigator>`u`)return Nv=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Nv=!0;let e=navigator.maxTouchPoints;return Nv=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Fv=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Iv=e=>e,Lv=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},Rv=(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(Fv(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(Fv(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},zv={passive:!0},Bv=typeof window>`u`||`onscrollend`in window,Vv=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Bv,o=0,s=a?null:Mv(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,zv),a&&r.addEventListener(`scrollend`,u,zv),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},Hv=(e,t)=>Vv(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Uv=(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`]},Wv=(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})},Gv=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:Iv,rangeExtractor:Lv,onChange:()=>{},measureElement:Uv,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=kv(()=>(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,!(!Pv()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,zv),e.addEventListener(`touchend`,n,zv),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&&(Pv()&&(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=kv(()=>[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=kv(()=>[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=Ov(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=kv(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=Jv(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=kv(()=>{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++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=kv(()=>[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 Av(t[Kv(0,t.length-1,r?e=>n[e*2]:e=>Av(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){return e===0?!1:Pv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(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),!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&&jv(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()}},Kv=(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 qv(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 Jv(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=qv(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=Kv(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 Yv=typeof document<`u`?v.useLayoutEffect:v.useEffect;function Xv({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 Gv(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),Yv(()=>l._didMount(),[]),Yv(()=>(o(l),l._willUpdate())),Yv(()=>{s(l)}),l}function Zv(e){return Xv({observeElementRect:Rv,observeElementOffset:Hv,scrollToFn:Wv,...e})}var Qv={};function $v(e){let t=Qv[e];if(t)return t;t=Qv[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 ey(e,t){typeof t!=`string`&&(t=ey.defaultChars);let n=$v(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})}ey.defaultChars=`;/?:@&=+$,#`,ey.componentChars=``;var ty={};function ny(e){let t=ty[e];if(t)return t;t=ty[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 ry(e,t,n){typeof t!=`string`&&(n=t,t=ry.defaultChars),n===void 0&&(n=!0);let r=ny(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}ry.defaultChars=`;/?:@&=+$,-_.!~*'()#`,ry.componentChars=`-_.!~*'()`;function iy(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 ay(){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 oy=/^([a-z0-9.+-]+:)/i,sy=/:[0-9]*$/,cy=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ly=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
53
- `,` `],uy=[`/`,`?`,`#`],dy=255,fy=/^[+a-z0-9A-Z_-]{0,63}$/,py=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,my={javascript:!0,"javascript:":!0},hy={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function gy(e,t){if(e&&e instanceof ay)return e;let n=new ay;return n.parse(e,t),n}ay.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=cy.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=oy.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&&my[o])&&(a=a.substr(2),this.slashes=!0)),!my[o]&&(i||o&&!hy[o])){let e=-1;for(let t=0;t<uy.length;t++)r=a.indexOf(uy[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<ly.length;t++)r=a.indexOf(ly[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(py);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>dy&&(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),hy[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},ay.prototype.parseHost=function(e){let t=sy.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 _y=s({decode:()=>ey,encode:()=>ry,format:()=>iy,parse:()=>gy}),vy=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,yy=/[\0-\x1F\x7F-\x9F]/,by=/[\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]/,xy=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Sy=/[\$\+<->\^`\|~\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]/,Cy=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,wy=s({Any:()=>vy,Cc:()=>yy,Cf:()=>by,P:()=>xy,S:()=>Sy,Z:()=>Cy}),Ty=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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))),Ey=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),Dy=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]]),Oy=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 ky(e){return e>=55296&&e<=57343||e>1114111?65533:Dy.get(e)??e}var Ay;(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`})(Ay||={});var jy=32,My;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(My||={});function Ny(e){return e>=Ay.ZERO&&e<=Ay.NINE}function Py(e){return e>=Ay.UPPER_A&&e<=Ay.UPPER_F||e>=Ay.LOWER_A&&e<=Ay.LOWER_F}function Fy(e){return e>=Ay.UPPER_A&&e<=Ay.UPPER_Z||e>=Ay.LOWER_A&&e<=Ay.LOWER_Z||Ny(e)}function Iy(e){return e===Ay.EQUALS||Fy(e)}var Ly;(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`})(Ly||={});var Ry;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Ry||={});var zy=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Ly.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ry.Strict}startEntity(e){this.decodeMode=e,this.state=Ly.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Ly.EntityStart:return e.charCodeAt(t)===Ay.NUM?(this.state=Ly.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ly.NamedEntity,this.stateNamedEntity(e,t));case Ly.NumericStart:return this.stateNumericStart(e,t);case Ly.NumericDecimal:return this.stateNumericDecimal(e,t);case Ly.NumericHex:return this.stateNumericHex(e,t);case Ly.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|jy)===Ay.LOWER_X?(this.state=Ly.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ly.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(Ny(r)||Py(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(Ny(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===Ay.SEMI)this.consumed+=1;else if(this.decodeMode===Ry.Strict)return 0;return this.emitCodePoint(ky(this.result),this.consumed),this.errors&&(e!==Ay.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&My.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Vy(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ry.Attribute&&(i===0||Iy(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&My.VALUE_LENGTH)>>14,i!==0){if(a===Ay.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ry.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]&My.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]&~My.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Ly.NamedEntity:return this.result!==0&&(this.decodeMode!==Ry.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ly.NumericDecimal:return this.emitNumericEntity(0,2);case Ly.NumericHex:return this.emitNumericEntity(0,3);case Ly.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ly.EntityStart:return 0}}};function By(e){let t=``,n=new zy(e,e=>t+=Oy(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 Vy(e,t,n,r){let i=(t&My.BRANCH_LENGTH)>>7,a=t&My.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 Hy=By(Ty);By(Ey);function Uy(e,t=Ry.Legacy){return Hy(e,t)}function Wy(e){return Hy(e,Ry.Strict)}var Gy=s({arrayReplaceAt:()=>Zy,asciiTrim:()=>bb,assign:()=>Xy,escapeHtml:()=>ub,escapeRE:()=>fb,fromCodePoint:()=>$y,has:()=>Yy,isMdAsciiPunct:()=>_b,isPunctChar:()=>hb,isPunctCharCode:()=>gb,isSpace:()=>pb,isString:()=>qy,isValidEntityCode:()=>Qy,isWhiteSpace:()=>mb,lib:()=>xb,normalizeReference:()=>vb,unescapeAll:()=>ab,unescapeMd:()=>ib});function Ky(e){return Object.prototype.toString.call(e)}function qy(e){return Ky(e)===`[object String]`}var Jy=Object.prototype.hasOwnProperty;function Yy(e,t){return Jy.call(e,t)}function Xy(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 Zy(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Qy(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 $y(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 eb=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,tb=RegExp(eb.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),nb=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function rb(e,t){if(t.charCodeAt(0)===35&&nb.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Qy(n)?$y(n):e}let n=Uy(e);return n===e?e:n}function ib(e){return e.indexOf(`\\`)<0?e:e.replace(eb,`$1`)}function ab(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(tb,function(e,t,n){return t||rb(e,n)})}var ob=/[&<>"]/,sb=/[&<>"]/g,cb={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function lb(e){return cb[e]}function ub(e){return ob.test(e)?e.replace(sb,lb):e}var db=/[.?*+^$[\]\\(){}|-]/g;function fb(e){return e.replace(db,`\\$&`)}function pb(e){switch(e){case 9:case 32:return!0}return!1}function mb(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 hb(e){return xy.test(e)||Sy.test(e)}function gb(e){return hb($y(e))}function _b(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 yb(e){return e===32||e===9||e===10||e===13}function bb(e){let t=0;for(;t<e.length&&yb(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&yb(e.charCodeAt(n));n--);return e.slice(t,n+1)}var xb={mdurl:_y,ucmicro:wy};function Sb(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 Cb(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=ab(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=ab(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function wb(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+=ab(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+=ab(e.slice(t,a)),o}var Tb=s({parseLinkDestination:()=>Cb,parseLinkLabel:()=>Sb,parseLinkTitle:()=>wb}),Eb={};Eb.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+ub(a.content)+`</code>`},Eb.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+ub(e[t].content)+`</code></pre>
54
- `},Eb.fence=function(e,t,n,r,i){let a=e[t],o=a.info?ab(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)||ub(a.content),l.indexOf(`<pre`)===0)return l+`
55
- `;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`},Eb.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)},Eb.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
51
+ `},vo=0,yo=[];function bo(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(vo++)[0],a=v.useState(Ha)[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=_a([e.lockRef.current],(e.shards||[]).map(ho),!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=po(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=oo(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=oo(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 fo(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!yo.length||yo[yo.length-1]!==a)){var r=`deltaY`in n?mo(n):po(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&go(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ho).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:xo(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=po(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,mo(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,po(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return yo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,to),document.addEventListener(`touchmove`,c,to),document.addEventListener(`touchstart`,u,to),function(){yo=yo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,to),document.removeEventListener(`touchmove`,c,to),document.removeEventListener(`touchstart`,u,to)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:_o(i)}):null,p?v.createElement(Qa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var So=ja(Ma,bo),Co=v.forwardRef(function(e,t){return v.createElement(Pa,ha({},e,{ref:t,sideCar:So}))});Co.classNames=Pa.classNames;var wo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},To=new WeakMap,Eo=new WeakMap,Do={},Oo=0,ko=function(e){return e&&(e.host||ko(e.parentNode))},Ao=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ko(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})},jo=function(e,t,n,r){var i=Ao(t,Array.isArray(e)?e:[e]);Do[n]||(Do[n]=new WeakMap);var a=Do[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=(To.get(e)||0)+1,l=(a.get(e)||0)+1;To.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Eo.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(),Oo++,function(){o.forEach(function(e){var t=To.get(e)-1,i=a.get(e)-1;To.set(e,t),a.set(e,i),t||(Eo.has(e)||e.removeAttribute(r),Eo.delete(e)),i||e.removeAttribute(n)}),Oo--,Oo||(To=new WeakMap,To=new WeakMap,Eo=new WeakMap,Do={})}},Mo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||wo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),jo(r,i,n,`aria-hidden`)):function(){return null}},No=Object.defineProperty,Po=(e,t)=>No(e,`name`,{value:t,configurable:!0}),Fo=`Dialog`,[Io,Lo]=Or(Fo),[Ro,zo]=Io(Fo),Bo=Po(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=ai({prop:r,defaultProp:i??!1,onChange:a,caller:Fo}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,L.jsx)(Ro,{scope:t,triggerRef:s,contentRef:c,contentId:Ci(),titleId:Ci(),descriptionId:Ci(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Vo=`DialogPortal`,[Ho,Uo]=Io(Vo,{forceMount:void 0}),Wo=Po(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=zo(Vo,t);return(0,L.jsx)(Ho,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,L.jsx)(pi,{present:n||a.open,children:(0,L.jsx)(sa,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Go=`DialogOverlay`,Ko=v.forwardRef(Po(function(e,t){let n=Uo(Go,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=zo(Go,e.__scopeDialog);return a.modal?(0,L.jsx)(pi,{present:r||a.open,children:(0,L.jsx)(Jo,{...i,ref:t})}):null},`DialogOverlay`)),qo=or(`DialogOverlay.RemoveScroll`),Jo=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(Go,n),a=rr(t,Li());return(0,L.jsx)(Co,{as:qo,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(R.div,{"data-state":os(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Yo=`DialogContent`,Xo=v.forwardRef(Po(function(e,t){let n=Uo(Yo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=zo(Yo,e.__scopeDialog);return(0,L.jsx)(pi,{present:r||a.open,children:a.modal?(0,L.jsx)(Zo,{...i,ref:t}):(0,L.jsx)(Qo,{...i,ref:t})})},`DialogContent`)),Zo=v.forwardRef(Po(function(e,t){let n=zo(Yo,e.__scopeDialog),r=v.useRef(null),i=rr(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return Mo(e)},[]),(0,L.jsx)($o,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Kr(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Kr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Kr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Qo=v.forwardRef(Po(function(e,t){let n=zo(Yo,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,L.jsx)($o,{...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`)),$o=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=zo(Yo,n);return pa(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Ji,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Ii,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":os(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),es=`DialogTitle`,ts=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(es,n),{setTitleCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(R.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),ns=`DialogDescription`,rs=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(ns,n),{setDescriptionCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(R.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),is=`DialogClose`,as=v.forwardRef(Po(function(e,t){let{__scopeDialog:n,...r}=e,i=zo(is,n);return(0,L.jsx)(R.button,{type:`button`,...r,ref:t,onClick:Kr(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function os(e){return e?`open`:`closed`}Po(os,`getState`);var ss=Object.defineProperty,cs=(e,t)=>ss(e,`name`,{value:t,configurable:!0});function ls(e){let[t,n]=v.useState(void 0);return z(()=>{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}cs(ls,`useSize`);var us=[`top`,`right`,`bottom`,`left`],ds=Math.min,fs=Math.max,ps=Math.round,ms=Math.floor,hs=e=>({x:e,y:e}),gs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function _s(e,t,n){return fs(e,ds(t,n))}function vs(e,t){return typeof e==`function`?e(t):e}function ys(e){return e.split(`-`)[0]}function bs(e){return e.split(`-`)[1]}function xs(e){return e===`x`?`y`:`x`}function Ss(e){return e===`y`?`height`:`width`}function Cs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ws(e){return xs(Cs(e))}function Ts(e,t,n){n===void 0&&(n=!1);let r=bs(e),i=ws(e),a=Ss(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ps(o)),[o,Ps(o)]}function Es(e){let t=Ps(e);return[Ds(e),t,Ds(t)]}function Ds(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Os=[`left`,`right`],ks=[`right`,`left`],As=[`top`,`bottom`],js=[`bottom`,`top`];function Ms(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ks:Os:t?Os:ks;case`left`:case`right`:return t?As:js;default:return[]}}function Ns(e,t,n,r){let i=bs(e),a=Ms(ys(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ds)))),a}function Ps(e){let t=ys(e);return gs[t]+e.slice(t.length)}function Fs(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Is(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Fs(e)}function Ls(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 Rs(e,t,n){let{reference:r,floating:i}=e,a=Cs(t),o=ws(t),s=Ss(o),c=ys(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=bs(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function zs(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}=vs(t,e),p=Is(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ls(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=Ls(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 Bs=50,Vs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:zs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Rs(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<Bs&&(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}=Rs(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Hs=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}=vs(e,t)||{};if(l==null)return{};let d=Is(u),f={x:n,y:r},p=ws(i),m=Ss(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=ds(d[_],T),D=ds(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=_s(E,k,O),j=!c.arrow&&bs(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}}}),Us=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}=vs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ys(r),_=Cs(o),v=ys(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ps(o)]:Es(o)),x=p!==`none`;!d&&x&&b.push(...Ns(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=Ts(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`&&_!==Cs(t))||T.every(e=>Cs(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=Cs(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 Ws(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gs(e){return us.some(t=>e[t]>=0)}var Ks=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=vs(e,t);switch(i){case`referenceHidden`:{let e=Ws(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Gs(e)}}}case`escaped`:{let e=Ws(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Gs(e)}}}default:return{}}}}},qs=new Set([`left`,`top`]);async function Js(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ys(n),s=bs(n),c=Cs(n)===`y`,l=qs.has(o)?-1:1,u=a&&c?-1:1,d=vs(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 Ys=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 Js(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}}}}},Xs=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}=vs(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Cs(i),p=xs(f),m=u[p],h=u[f],g=(e,t)=>_s(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}}}}}},Zs=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}=vs(e,t),u={x:n,y:r},d=Cs(i),f=xs(d),p=u[f],m=u[d],h=vs(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=qs.has(ys(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}}}},Qs=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}=vs(e,t),c=await i.detectOverflow(t,s),l=ys(n),u=bs(n),d=Cs(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=ds(p-c[m],g),y=ds(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*fs(c.left,c.right):S=p-2*fs(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 $s(){return typeof window<`u`}function ec(e){return rc(e)?(e.nodeName||``).toLowerCase():`#document`}function tc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nc(e){return((rc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rc(e){return $s()?e instanceof Node||e instanceof tc(e).Node:!1}function ic(e){return $s()?e instanceof Element||e instanceof tc(e).Element:!1}function ac(e){return $s()?e instanceof HTMLElement||e instanceof tc(e).HTMLElement:!1}function oc(e){return!$s()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof tc(e).ShadowRoot}function sc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=vc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function cc(e){return/^(table|td|th)$/.test(ec(e))}function lc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var uc=/transform|translate|scale|rotate|perspective|filter/,dc=/paint|layout|strict|content/,fc=e=>!!e&&e!==`none`,pc;function mc(e){let t=ic(e)?vc(e):e;return fc(t.transform)||fc(t.translate)||fc(t.scale)||fc(t.rotate)||fc(t.perspective)||!gc()&&(fc(t.backdropFilter)||fc(t.filter))||uc.test(t.willChange||``)||dc.test(t.contain||``)}function hc(e){let t=bc(e);for(;ac(t)&&!_c(t);){if(mc(t))return t;if(lc(t))return null;t=bc(t)}return null}function gc(){return pc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),pc}function _c(e){return/^(html|body|#document)$/.test(ec(e))}function vc(e){return tc(e).getComputedStyle(e)}function yc(e){return ic(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bc(e){if(ec(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||oc(e)&&e.host||nc(e);return oc(t)?t.host:t}function xc(e){let t=bc(e);return _c(t)?(e.ownerDocument||e).body:ac(t)&&sc(t)?t:xc(t)}function Sc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xc(e),i=r===e.ownerDocument?.body,a=tc(r);if(i){let e=Cc(a);return t.concat(a,a.visualViewport||[],sc(r)?r:[],e&&n?Sc(e):[])}else return t.concat(r,Sc(r,[],n))}function Cc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wc(e){let t=vc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ac(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ps(n)!==a||ps(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Tc(e){return ic(e)?e:e.contextElement}function Ec(e){let t=Tc(e);if(!ac(t))return hs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wc(t),o=(a?ps(n.width):n.width)/r,s=(a?ps(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dc=hs(0);function Oc(e){let t=tc(e);return!gc()||!t.visualViewport?Dc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===tc(e)}function Ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Tc(e),o=hs(1);t&&(r?ic(r)&&(o=Ec(r)):o=Ec(e));let s=kc(a,n,r)?Oc(a):hs(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=tc(a),t=ic(r)?tc(r):r,n=e,i=Cc(n);for(;i&&t!==n;){let e=Ec(i),t=i.getBoundingClientRect(),r=vc(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=tc(i),i=Cc(n)}}return Ls({width:u,height:d,x:c,y:l})}function jc(e,t){let n=yc(e).scrollLeft;return t?t.left+n:Ac(nc(e)).left+n}function Mc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jc(e,n),y:n.top+t.scrollTop}}function Nc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=nc(r),s=t?lc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=hs(1),u=hs(0),d=ac(r);if((d||!a)&&((ec(r)!==`body`||sc(o))&&(c=yc(r)),d)){let e=Ac(r);l=Ec(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mc(o,c):hs(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 Pc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fc(e){let t=yc(e),n=e.ownerDocument.body,r=fs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=fs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jc(e),o=-t.scrollTop;return vc(n).direction===`rtl`&&(a+=fs(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ic=25;function Lc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=tc(e),a=nc(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!gc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jc(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<=Ic&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Rc(e,t){let n=Ac(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ec(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Lc(e,n,t);else if(t===`document`)r=Fc(nc(e));else if(ic(t))r=Rc(t,n);else{let n=Oc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ls(r)}function Bc(e,t){let n=t.get(e);if(n)return n;let r=Sc(e,[],!1).filter(e=>ic(e)&&ec(e)!==`body`),i=null,a=vc(e).position===`fixed`,o=a?bc(e):e;for(;ic(o)&&!_c(o);){let e=vc(o),t=mc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bc(o)}return t.set(e,r),r}function Vc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?lc(t)?[]:Bc(t,this._c):[].concat(n),r],o=zc(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=zc(t,a[e],i);s=fs(n.top,s),c=ds(n.right,c),l=ds(n.bottom,l),u=fs(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hc(e){let{width:t,height:n}=wc(e);return{width:t,height:n}}function Uc(e,t,n){let r=ac(t),i=nc(t),a=n===`fixed`,o=Ac(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=hs(0);if((r||!a)&&((ec(t)!==`body`||sc(i))&&(s=yc(t)),r)){let e=Ac(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jc(i));let l=i&&!r&&!a?Mc(i,s):hs(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 Wc(e){return vc(e).position===`static`}function Gc(e,t){if(!ac(e)||vc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return nc(e)===n&&(n=n.ownerDocument.body),n}function Kc(e,t){let n=tc(e);if(lc(e))return n;if(!ac(e)){let t=bc(e);for(;t&&!_c(t);){if(ic(t)&&!Wc(t))return t;t=bc(t)}return n}let r=Gc(e,t);for(;r&&cc(r)&&Wc(r);)r=Gc(r,t);return r&&_c(r)&&Wc(r)&&!mc(r)?n:r||hc(e)||n}var qc=async function(e){let t=this.getOffsetParent||Kc,n=this.getDimensions,r=await n(e.floating);return{reference:Uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jc(e){return vc(e).direction===`rtl`}var Yc={convertOffsetParentRelativeRectToViewportRelativeRect:Nc,getDocumentElement:nc,getClippingRect:Vc,getOffsetParent:Kc,getElementRects:qc,getClientRects:Pc,getDimensions:Hc,getScale:Ec,isElement:ic,isRTL:Jc};function Xc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zc(e,t,n){let r=null,i,a=nc(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=ms(d),h=ms(a.clientWidth-(u+f)),g=ms(a.clientHeight-(d+p)),_=ms(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:fs(0,ds(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xc(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=tc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qc(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=Tc(e),u=i||a?[...l?Sc(l):[],...t?Sc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zc(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?Ac(e):null;c&&g();function g(){let t=Ac(e);h&&!Xc(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 $c=Ys,el=Xs,tl=Us,nl=Qs,rl=Ks,il=Hs,al=Zs,ol=(e,t,n)=>{let r=new Map,i=n??{},a={...Yc,...i.platform,_c:r};return Vs(e,t,{...i,platform:a})},sl=typeof document<`u`?v.useLayoutEffect:function(){};function cl(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(!cl(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)&&!cl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ll(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ul(e,t){let n=ll(e);return Math.round(t*n)/n}function dl(e){let t=v.useRef(e);return sl(()=>{t.current=e}),t}function fl(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);cl(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=dl(c),k=dl(i),A=dl(l),j=v.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),ol(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!cl(E.current,t)&&(E.current=t,y.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);sl(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=v.useRef(!1);sl(()=>(M.current=!0,()=>{M.current=!1}),[]),sl(()=>{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=ul(N.floating,u.x),r=ul(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ll(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 pl=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?{}:il({element:r.current,padding:i}).fn(n):r?il({element:r,padding:i}).fn(n):{}}}},ml=(e,t)=>{let n=$c(e);return{name:n.name,fn:n.fn,options:[e,t]}},hl=(e,t)=>{let n=el(e);return{name:n.name,fn:n.fn,options:[e,t]}},gl=(e,t)=>({fn:al(e).fn,options:[e,t]}),_l=(e,t)=>{let n=tl(e);return{name:n.name,fn:n.fn,options:[e,t]}},vl=(e,t)=>{let n=nl(e);return{name:n.name,fn:n.fn,options:[e,t]}},yl=(e,t)=>{let n=rl(e);return{name:n.name,fn:n.fn,options:[e,t]}},bl=(e,t)=>{let n=pl(e);return{name:n.name,fn:n.fn,options:[e,t]}},xl=Object.defineProperty,Sl=(e,t)=>xl(e,`name`,{value:t,configurable:!0}),Cl=`Popper`,[wl,Tl]=Or(Cl),[El,Dl]=wl(Cl),Ol=Sl(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,L.jsx)(El,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),kl=`PopperAnchor`,Al=v.forwardRef(Sl(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Dl(kl,n),o=v.useRef(null),s=a.onAnchorChange,c=rr(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&&Ll(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(R.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),jl=`PopperContent`,[Ml,Nl]=wl(jl),Pl=v.forwardRef(Sl(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=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Dl(jl,n),[_,y]=v.useState(null),b=rr(t,y),[x,S]=v.useState(null),C=ls(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(Fl),altBoundary:k},{refs:j,floatingStyles:M,placement:ee,isPositioned:N,middlewareData:P}=fl({strategy:`fixed`,placement:E,whileElementsMounted:Sl((...e)=>Qc(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[ml({mainAxis:i+T,alignmentAxis:o}),c&&hl({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?gl():void 0,...A}),c&&_l({...A}),vl({...A,apply:Sl(({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&&bl({element:x,padding:s}),Il({arrowWidth:w,arrowHeight:T}),f&&yl({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),F=g.setPlacementState;z(()=>(F(ee),()=>{F(void 0)}),[ee,F]);let[I,te]=Ll(ee),ne=Ai(m);z(()=>{N&&ne?.()},[N,ne]);let re=P.arrow?.x,ie=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[oe,se]=v.useState();return z(()=>{_&&se(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:N?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(Ml,{scope:n,placedSide:I,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,L.jsx)(R.div,{"data-side":I,"data-align":te,...h,ref:b,style:{...h.style,animation:N?h.style?.animation:`none`}})})})},`PopperContent`));function Fl(e){return e!==null}Sl(Fl,`isNotNull`);var Il=Sl(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]=Ll(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 Ll(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Sl(Ll,`getSideAndAlignFromPlacement`);var Rl=Ol,zl=Al,Bl=Pl,Vl=Object.defineProperty,Hl=v.forwardRef(((e,t)=>Vl(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,L.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Ul=Object.defineProperty,U=(e,t)=>Ul(e,`name`,{value:t,configurable:!0});function W(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])}U(W,`usePrevious`);var Wl=Object.defineProperty,Gl=(e,t)=>Wl(e,`name`,{value:t,configurable:!0});function Kl(e,[t,n]){return Math.min(n,Math.max(t,e))}Gl(Kl,`clamp`);var ql=Object.defineProperty,G=(e,t)=>ql(e,`name`,{value:t,configurable:!0}),Jl=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Yl=[` `,`Enter`],Xl=`Select`,[Zl,Ql,$l]=Mr(Xl),[eu,tu]=Or(Xl,[$l,Tl]),nu=Tl(),[ru,iu]=eu(Xl),[au,ou]=eu(Xl);function su(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=nu(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=Di(l),[T,E]=ai({prop:r,defaultProp:i??!1,onChange:a,caller:Xl}),[D,O]=ai({prop:o,defaultProp:s,onChange:c,caller:Xl}),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=Ci(),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,L.jsx)(Rl,{...g,children:(0,L.jsx)(ru,{scope:t,...te,children:(0,L.jsx)(Zl.Provider,{scope:t,children:(0,L.jsx)(au,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:I,children:Ju(h)?h(te):n})})})})}G(su,`SelectProvider`);var cu=G(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(su,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(qu,{__scopeSelect:t}):null]})})},`Select`),lu=`SelectTrigger`,uu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=nu(n),o=iu(lu,n),s=o.disabled||r,c=rr(t,o.onTriggerChange),l=Ql(n),u=v.useRef(`touch`),[d,f,p]=Xu(e=>{let t=l().filter(e=>!e.disabled),n=Zu(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,L.jsx)(zl,{asChild:!0,...a,children:(0,L.jsx)(R.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":Yu(o.value)?``:void 0,...i,ref:c,onClick:Kr(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Kr(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:Kr(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Jl.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),du=`SelectValue`,fu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=iu(du,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=rr(t,c.onValueNodeChange);z(()=>{l(u)},[l,u]);let f=Yu(c.value);return(0,L.jsx)(R.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,L.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),pu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(R.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[mu,hu]=eu(`SelectPortal`,{forceMount:void 0}),gu=G(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(mu,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(sa,{asChild:!0,...r})})},`SelectPortal`),_u=`SelectContent`,vu=v.forwardRef(G(function(e,t){let n=hu(_u,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=iu(_u,e.__scopeSelect),[o,s]=v.useState();return z(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(pi,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(wu,{...i,ref:t}):(0,L.jsx)(yu,{...i,fragment:o})})},`SelectContent`)),yu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?y.createPortal((0,L.jsx)(xu,{scope:n,children:(0,L.jsx)(Zl.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),bu=10,[xu,Su]=eu(_u),Cu=or(`SelectContent.RemoveScroll`),wu=v.forwardRef(G(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,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=iu(_u,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=rr(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=Ql(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return Mo(b)},[b]),pa();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]=Xu(e=>{let t=k().filter(e=>!e.disabled),n=Zu(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===`popper`?Eu:Tu,oe=ae===Eu?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)(xu,{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,L.jsx)(Co,{as:Cu,allowPinchZoom:!0,children:(0,L.jsx)(Ji,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Kr(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(Ii,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,L.jsx)(ae,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...oe,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Kr(_.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`)),Tu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=iu(_u,n),o=Su(_u,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=rr(t,u),f=Ql(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!==`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-bu,d=Kl(a,[bu,Math.max(bu,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-bu,d=Kl(a,[bu,Math.max(bu,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-bu*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-bu,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=`${bu}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]);z(()=>b(),[b]);let[x,S]=v.useState();return z(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,L.jsx)(Du,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,L.jsx)(R.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Eu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=bu,...a}=e,o=nu(n);return(0,L.jsx)(Bl,{...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`)),[Du,Ou]=eu(_u,{}),ku=`SelectViewport`,Au=v.forwardRef(G(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Su(ku,n),o=Ou(ku,n),s=rr(t,a.onViewportChange),c=v.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Zl.Slot,{scope:n,children:(0,L.jsx)(R.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Kr(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-bu*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`)),[ju,Mu]=eu(`SelectGroup`),Nu=`SelectItem`,[Pu,Fu]=eu(Nu),Iu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=iu(Nu,n),c=Su(Nu,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=rr(t,Ai(e=>c.itemRefCallback?.(e,r,i))),h=Ci(),g=v.useRef(`touch`),_=G(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,L.jsx)(Pu,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(Zl.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,L.jsx)(R.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:Kr(o.onFocus,()=>p(!0)),onBlur:Kr(o.onBlur,()=>p(!1)),onClick:Kr(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:Kr(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:Kr(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Kr(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Kr(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Kr(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(Yl.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Lu=`SelectItemText`,Ru=v.forwardRef(G(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=iu(Lu,n),s=Su(Lu,n),c=Fu(Lu,n),l=ou(Lu,n),[u,d]=v.useState(null),f=Ai(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=rr(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return z(()=>(g(h),()=>_(h)),[g,_,h]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(R.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Yu(o.value)?y.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),zu=`SelectItemIndicator`,Bu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,...r}=e;return Fu(zu,n).isSelected?(0,L.jsx)(R.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Vu=`SelectScrollUpButton`,Hu=v.forwardRef(G(function(e,t){let n=Su(Vu,e.__scopeSelect),r=Ou(Vu,e.__scopeSelect),[i,a]=v.useState(!1),o=rr(t,r.onScrollButtonChange);return z(()=>{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,L.jsx)(Gu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Uu=`SelectScrollDownButton`,Wu=v.forwardRef(G(function(e,t){let n=Su(Uu,e.__scopeSelect),r=Ou(Uu,e.__scopeSelect),[i,a]=v.useState(!1),o=rr(t,r.onScrollButtonChange);return z(()=>{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,L.jsx)(Gu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Gu=v.forwardRef(G(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Su(`SelectScrollButton`,n),o=v.useRef(null),s=Ql(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),z(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(R.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Kr(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Kr(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Kr(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Ku=`SelectBubbleInput`,qu=v.forwardRef(G(function({__scopeSelect:e,...t},n){let r=iu(Ku,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=rr(n,p),h=i??``,g=W(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,L.jsxs)(R.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...wr,...t.style},ref:m,defaultValue:h,children:[Yu(i)&&!_?(0,L.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Ju(e){return typeof e==`function`}G(Ju,`isFunction`);function Yu(e){return e===``||e===void 0}G(Yu,`shouldShowPlaceholder`);function Xu(e){let t=Ai(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(Xu,`useTypeaheadSearch`);function Zu(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=Qu(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(Zu,`findNextItem`);function Qu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}G(Qu,`wrapArray`);var $u=Object.defineProperty,ed=(e,t)=>$u(e,`name`,{value:t,configurable:!0}),[td,nd]=Or(`Tooltip`,[Tl]);Tl();var rd=`TooltipProvider`,id=700,[ad,od]=td(rd),sd=ed(e=>{let{__scopeTooltip:t,delayDuration:n=id,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,L.jsx)(ad,{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`),[cd,ld]=td(`Tooltip`),[ud,dd]=td(`TooltipPortal`,{forceMount:void 0});function fd(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`)}}ed(fd,`getExitSideFromRect`);function pd(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}ed(pd,`getPaddedExitPoints`);function md(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}]}ed(md,`getPointsFromRect`);function hd(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}ed(hd,`isPointInPolygon`);function gd(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)),_d(t)}ed(gd,`getHull`);function _d(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)}ed(_d,`getHullPresorted`);var vd=sd;function yd(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=yd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function bd(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yd(e))&&(r&&(r+=` `),r+=t);return r}var xd=`-`,Sd=e=>{let t=K(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(xd);return n[0]===``&&n.length!==1&&n.shift(),Cd(n,t)||Td(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},Cd=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?Cd(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(xd);return t.validators.find(({validator:e})=>e(a))?.classGroupId},wd=/^\[(.+)\]$/,Td=e=>{if(wd.test(e)){let t=wd.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},K=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kd(Object.entries(e.classGroups),n).forEach(([e,n])=>{Ed(n,r,e,t)}),r},Ed=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:Dd(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(Od(e)){Ed(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{Ed(i,Dd(t,e),n,r)})})},Dd=(e,t)=>{let n=e;return t.split(xd).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},Od=e=>e.isThemeGetter,kd=(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,Ad=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)}}},jd=`!`,Md=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(jd);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},Nd=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},Pd=e=>({cache:Ad(e.cacheSize),parseClassName:Md(e),...Sd(e)}),Fd=/\s+/,Id=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(Fd),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=Nd(c).join(`:`),h=l?m+jd: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 Ld(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=Rd(t))&&(r&&(r+=` `),r+=n);return r}var Rd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Rd(e[r]))&&(n&&(n+=` `),n+=t);return n};function zd(e,...t){let n,r,i,a=o;function o(o){return n=Pd(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=Id(e,n);return i(e,a),a}return function(){return a(Ld.apply(null,arguments))}}var Bd=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},Vd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hd=/^\d+\/\d+$/,Ud=new Set([`px`,`full`,`screen`]),Wd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gd=/\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$/,Kd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yd=e=>Zd(e)||Ud.has(e)||Hd.test(e),Xd=e=>uf(e,`length`,df),Zd=e=>!!e&&!Number.isNaN(Number(e)),Qd=e=>uf(e,`number`,Zd),$d=e=>!!e&&Number.isInteger(Number(e)),ef=e=>e.endsWith(`%`)&&Zd(e.slice(0,-1)),q=e=>Vd.test(e),tf=e=>Wd.test(e),nf=new Set([`length`,`size`,`percentage`]),rf=e=>uf(e,nf,ff),af=e=>uf(e,`position`,ff),of=new Set([`image`,`url`]),sf=e=>uf(e,of,mf),cf=e=>uf(e,``,pf),lf=()=>!0,uf=(e,t,n)=>{let r=Vd.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},df=e=>Gd.test(e)&&!Kd.test(e),ff=()=>!1,pf=e=>qd.test(e),mf=e=>Jd.test(e),hf=zd(()=>{let e=Bd(`colors`),t=Bd(`spacing`),n=Bd(`blur`),r=Bd(`brightness`),i=Bd(`borderColor`),a=Bd(`borderRadius`),o=Bd(`borderSpacing`),s=Bd(`borderWidth`),c=Bd(`contrast`),l=Bd(`grayscale`),u=Bd(`hueRotate`),d=Bd(`invert`),f=Bd(`gap`),p=Bd(`gradientColorStops`),m=Bd(`gradientColorStopPositions`),h=Bd(`inset`),g=Bd(`margin`),_=Bd(`opacity`),v=Bd(`padding`),y=Bd(`saturate`),b=Bd(`scale`),x=Bd(`sepia`),S=Bd(`skew`),C=Bd(`space`),w=Bd(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,q,t],O=()=>[q,t],k=()=>[``,Yd,Xd],A=()=>[`auto`,Zd,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=()=>[Zd,q];return{cacheSize:500,separator:`:`,theme:{colors:[lf],spacing:[Yd,Xd],blur:[`none`,``,tf,q],brightness:I(),borderColor:[e],borderRadius:[`none`,``,`full`,tf,q],borderSpacing:O(),borderWidth:k(),contrast:I(),grayscale:P(),hueRotate:I(),invert:P(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[ef,Xd],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:[tf]}],"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`,$d,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`,$d,q]}],"grid-cols":[{"grid-cols":[lf]}],"col-start-end":[{col:[`auto`,{span:[`full`,$d,q]},q]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[lf]}],"row-start-end":[{row:[`auto`,{span:[$d,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:[tf]},tf]}],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`,tf,Xd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Qd]}],"font-family":[{font:[lf]}],"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`,Zd,Qd]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Yd,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`,Yd,Xd]}],"underline-offset":[{"underline-offset":[`auto`,Yd,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(),af]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,rf]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},sf]}],"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":[Yd,q]}],"outline-w":[{outline:[Yd,Xd]}],"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":[Yd,Xd]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,tf,cf]}],"shadow-color":[{shadow:[lf]}],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`,tf,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:[$d,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:[Yd,Xd,Qd]}],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 hf(bd(e))}function gf({delayDuration:e=0,...t}){return(0,L.jsx)(vd,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}var _f=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yf={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`},bf=(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,...yf,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vf(`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)(bf,{ref:i,iconNode:t,className:vf(`lucide-${_f(e)}`,n),...r}));return n.displayName=`${e}`,n},xf=Y(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Sf=Y(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Cf=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`}]]),wf=Y(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Tf=Y(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ef=Y(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Df=Y(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Of=Y(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),kf=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`}]]),Af=Y(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),jf=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`}]]),Mf=Y(`CircleSlash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),Nf=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`}]]),Pf=Y(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ff=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`}]]),If=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`}]]),Lf=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`}]]),Rf=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`}]]),zf=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`}]]),Bf=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`}]]),Vf=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`}]]),Hf=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`}]]),Uf=Y(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Wf=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`}]]),Gf=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`}]]),Kf=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`}]]),qf=Y(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Jf=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`}]]),Yf=Y(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Xf=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`}]]),Zf=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`}]]),Qf=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`}]]),$f=Y(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),X=`/v1`,ep={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}`,modelAuth:e=>`${X}/model-auth/${e}`,filePeek:()=>`${X}/files/peek`};function tp(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 np(){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 rp=np(),ip=`crtr:relay-token`;function ap(){try{let e=window.localStorage.getItem(ip);return e!==null&&e!==``?e:void 0}catch{return}}function op(){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(ip,e)}catch{}return e}return ap()}var sp=op(),cp=class extends Error{code;constructor(e,t){super(t),this.name=`CommandError`,this.code=e}};async function lp(e,t){let n={};t?.body!==void 0&&(n[`content-type`]=`application/json`),sp!==void 0&&(n.authorization=`Bearer ${sp}`);let r;try{r=await fetch(e,{...t,headers:{...n,...t?.headers}})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?new cp(`aborted`,`request aborted`):new cp(`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 tp(a)?new cp(a.error.code,a.error.message):new cp(`bridge`,`HTTP ${r.status} ${r.statusText}`);return a}function up(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 dp(){return rp.run(`canvas:roster`,async()=>{let e=await lp(ep.canvasRoster()),t=e.nodes.map(e=>e.node_id),n=t.length>0?(await lp(ep.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 fp(e){return rp.run(`node:inspect:${e}`,()=>lp(ep.node(e)).then(up))}function pp(e){return rp.run(`node:snapshot:${e}`,()=>lp(ep.nodeSnapshot(e)).then(e=>({node_id:e.node_id,snapshot:e.snapshot,commands:e.commands})))}function mp(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 lp(ep.nodes(),{method:`POST`,body:JSON.stringify(t)}).then(e=>({node_id:e.node_id,name:e.name,status:e.status,follow_up:``}))}function hp(e,t){let n={body:t.body,...t.tier?.trim()?{tier:t.tier.trim()}:{}};return lp(ep.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 gp(e,t={}){return lp(ep.nodeRevive(e),{method:`POST`,body:JSON.stringify({resume:t.fresh!==!0})}).then(e=>({window:null,session:null,resumed:e.resumed,ready:e.revived}))}function _p(e){return lp(ep.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 vp(e,t){return lp(`${ep.filePeek()}?path=${encodeURIComponent(t)}`).then(e=>({path:e.path,content:e.content,truncated:e.truncated}))}async function yp(e,t){try{let n={"content-type":`application/json`};sp!==void 0&&(n.authorization=`Bearer ${sp}`);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 bp(e,t,n){return yp({kind:`exec`,bin:`crtr`,args:e,...t===void 0?{}:{stdin:t}},n)}function xp(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 Sp(e,t,n){let r=await bp(e,t,n);if(!r.ok)throw new cp(`bridge`,r.stderr||`bridge request failed`);let i=xp(r);if(i!==null)throw new cp(i.code,i.message);if(r.exitCode!==void 0&&r.exitCode!==0){let t=r.stderr.trim()===``?r.stdout.trim():r.stderr;throw new cp(`bridge`,t===``?`crtr ${e.join(` `)} failed (${r.exitCode})`:t)}if(r.stdout.trim()!==``)try{return JSON.parse(r.stdout)}catch(e){throw new cp(`bridge`,e instanceof Error?e.message:String(e))}}var Cp=new Set,wp=!1;function Tp(){if(wp)return;wp=!0;let e;try{let t=new URL(`/__crtr/events`,window.location.href);sp!==void 0&&t.searchParams.set(`token`,sp),e=new EventSource(t.toString())}catch{wp=!1;return}e.onmessage=e=>{let t;try{t=JSON.parse(e.data).kind}catch{return}if(t!==void 0)for(let e of Cp)e.kinds.includes(t)&&e.refresh()}}function Ep(e,t){let n=(0,v.useRef)(t);n.current=t,(0,v.useEffect)(()=>{Tp();let t={kinds:e,refresh:()=>n.current()};return Cp.add(t),()=>{Cp.delete(t)}},[e.join(`,`)])}var Dp=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},Op=(e=>e?Dp(e):Dp),kp=e=>e;function Ap(e,t=kp){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 jp=e=>{let t=Op(e),n=e=>Ap(t,e);return Object.assign(n,t),n},Mp=(e=>e?jp(e):jp),Np=Mp(e=>({reachable:!0,setReachable:t=>e({reachable:t})})),Pp=1,Fp=`crtr.web.roster.v1`;function Ip(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Lp(e){return typeof e==`string`}function Rp(e){return typeof e==`number`}function zp(e){return Ip(e)?Lp(e.node_id)&&Lp(e.name)&&Lp(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`)&&Lp(e.cwd)&&(e.parent===null||Lp(e.parent))&&Lp(e.created)&&(e.host_kind===`broker`||e.host_kind===`tmux`)&&typeof e.enterable==`boolean`&&Rp(e.attention_count)&&(e.cycles===void 0||Rp(e.cycles))&&(e.last_activity===void 0||Lp(e.last_activity)):!1}function Bp(e){return Ip(e)?e.schemaVersion===Pp&&Lp(e.generatedAt)&&Rp(e.cachedAt)&&Array.isArray(e.nodes)&&e.nodes.every(zp):!1}function Vp(){try{let e=globalThis.localStorage?.getItem(Fp);if(e==null)return null;let t=JSON.parse(e);return Bp(t)?t:null}catch{return null}}function Hp(e,t){let n={schemaVersion:Pp,nodes:e,generatedAt:t,cachedAt:Date.now()};try{globalThis.localStorage?.setItem(Fp,JSON.stringify(n))}catch{}}var Up=3e4,Wp=new class{state;listeners=new Set;started=!1;timer=null;constructor(){let e=Vp();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(),Up);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 dp();this.setState({nodes:e.nodes,generatedAt:e.generated_at,loading:!1}),Hp(e.nodes,e.generated_at),Np.getState().setReachable(!0)}catch{this.state.loading&&this.setState({...this.state,loading:!1}),Np.getState().setReachable(!1)}}};function Gp(){let e=(0,v.useSyncExternalStore)(Wp.subscribe,Wp.getState);return Ep([`nodes`,`inbox`],Wp.refetch),e}var Kp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qp=bd,Jp=(e,t)=>n=>{if(t?.variants==null)return qp(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=Kp(t)||Kp(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 qp(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)},Yp=Jp(`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,L.jsx)(r?sr:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:J(Yp({variant:t,size:n,className:e})),...i})}function Xp({...e}){return(0,L.jsx)(Bo,{"data-slot":`dialog`,...e})}function Zp({...e}){return(0,L.jsx)(Wo,{"data-slot":`dialog-portal`,...e})}function Qp({className:e,...t}){return(0,L.jsx)(Ko,{"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 $p({className:e,children:t,showCloseButton:n=!0,...r}){return(0,L.jsxs)(Zp,{"data-slot":`dialog-portal`,children:[(0,L.jsx)(Qp,{}),(0,L.jsxs)(Xo,{"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,L.jsxs)(as,{"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,L.jsx)($f,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function em({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function tm({className:e,showCloseButton:t=!1,children:n,...r}){return(0,L.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,L.jsx)(as,{asChild:!0,children:(0,L.jsx)(Z,{variant:`outline`,children:`Close`})})]})}function nm({className:e,...t}){return(0,L.jsx)(ts,{"data-slot":`dialog-title`,className:J(`text-lg leading-none font-semibold`,e),...t})}function rm({className:e,...t}){return(0,L.jsx)(rs,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground`,e),...t})}function im({className:e,type:t,...n}){return(0,L.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 am({className:e,...t}){return(0,L.jsx)(Hl,{"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 om({...e}){return(0,L.jsx)(cu,{"data-slot":`select`,...e})}function sm({...e}){return(0,L.jsx)(fu,{"data-slot":`select-value`,...e})}function cm({className:e,size:t=`default`,children:n,...r}){return(0,L.jsxs)(uu,{"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,L.jsx)(pu,{asChild:!0,children:(0,L.jsx)(Tf,{className:`size-4 opacity-50`})})]})}function lm({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,L.jsx)(gu,{children:(0,L.jsxs)(vu,{"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,L.jsx)(dm,{}),(0,L.jsx)(Au,{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,L.jsx)(fm,{})]})})}function um({className:e,children:t,...n}){return(0,L.jsxs)(Iu,{"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,L.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,L.jsx)(Bu,{children:(0,L.jsx)(wf,{className:`size-4`})})}),(0,L.jsx)(Ru,{children:t})]})}function dm({className:e,...t}){return(0,L.jsx)(Hu,{"data-slot":`select-scroll-up-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(Of,{className:`size-4`})})}function fm({className:e,...t}){return(0,L.jsx)(Wu,{"data-slot":`select-scroll-down-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(Tf,{className:`size-4`})})}function pm({className:e,...t}){return(0,L.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 mm=Jp(`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 hm({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,L.jsx)(n?sr:`span`,{"data-slot":`badge`,"data-variant":t,className:J(mm({variant:t}),e),...r})}function gm(e){return e instanceof cp&&(e.code===`not_found`||e.code===`already_resolved`||e.code===`claimed`)}function _m(e){switch(e){case`notify`:case`validation`:case`decision`:case`context`:case`error`:return e}throw Error(`Unknown deck kind: ${e}`)}function vm(e){return{id:e.id,title:e.title,subtitle:e.subtitle,...e.body===void 0?{}:{body:e.body},kind:_m(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 ym(e){return{id:e.id,job_id:e.job_id,kind:_m(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 bm(e,t){return{id:e.id,job_id:e.job_id??e.id,kind:_m(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(vm)}}function xm(){return rp.run(`human:list`,async()=>(await Sp([`human`,`list`,`--json`])).items.map(ym))}async function Sm(e){let t=await Sp([`human`,`deck`,e,`--json`]),n=(await fp(t.asking_node_id)).cwd;return bm(t,n)}async function Cm(e,t){let n=JSON.stringify({responses:t.responses}),r=await Sp([`human`,`resolve`,e,`--json`],n);if(r.resolved!==!0)throw new cp(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 wm(e){let t=0;for(let n of e)t+=Math.max(0,n.attention_count);return t}function Tm(){let{nodes:e}=Gp();return wm(e)}function Em(){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 Ep([`inbox`,`nodes`],o),(0,v.useEffect)(()=>{let e=!1;return xm().then(n=>{e||(t(n),r(!1))}).catch(()=>{e||r(!1)}),()=>{e=!0}},[i]),{decks:e,loading:n,refetch:o}}function Dm(e){let{decks:t}=Em();return t.filter(t=>t.conversation_id===e)}var Om={notify:{icon:Cf,label:`Update`},validation:{icon:Zf,label:`Approval`},decision:{icon:Rf,label:`Decision`},context:{icon:jf,label:`Question`},error:{icon:Qf,label:`Problem`}};function km(e){switch(e){case`notify`:return Om.notify;case`validation`:return Om.validation;case`decision`:return Om.decision;case`context`:return Om.context;case`error`:return Om.error;default:return Om.context}}function Am(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 jm=1,Mm=Mp(e=>({toasts:[],push:(t,n=`info`)=>{let r=jm++;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 Nm(e,t=`info`){Mm.getState().push(e,t)}var Pm=e=>({"--i":e});async function Fm(e,t){let n=(await Sm(e)).interactions[0];await Cm(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 Im(){let{decks:e,loading:t}=Em(),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,L.jsxs)(`section`,{className:`needs rv`,style:Pm(3),children:[(0,L.jsxs)(`div`,{className:`needs-head`,children:[(0,L.jsx)(Lf,{size:14,className:`flag`,"aria-hidden":!0}),(0,L.jsxs)(`span`,{className:`instlabel`,children:[`Needs you — `,n.length,` blocked`]}),(0,L.jsx)(`div`,{className:`rule`})]}),(0,L.jsx)(`div`,{className:`needs-grid`,children:n.map(e=>(0,L.jsx)(Lm,{deck:e},e.id))})]})}function Lm({deck:e}){let t=pt(),{refetch:n}=Em(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),l=km(e.kind).label,u=Am(e.blocked_since);e.kind===`decision`&&a===null&&!s&&(async()=>{if(!(e.kind!==`decision`||s||a!==null)){c(!0);try{let t=(await Sm(e.job_id)).interactions[0]?.options??[];o(t.length<=3?t:[])}catch(e){gm(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 Fm(e.job_id,t),Nm(`Done — thanks!`,`success`),n()}catch(e){if(gm(e)){Nm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] resolve failed:`,e),Nm(`Something went wrong — try again.`)}finally{i(!1)}}},f=async t=>{if(!r){i(!0);try{let r=(await Sm(e.job_id)).interactions[0];await Cm(e.job_id,{responses:[{id:r.id,selectedOptionIds:[t]}]}),Nm(`Done — thanks!`,`success`),n()}catch(e){if(gm(e)){Nm(e instanceof Error?e.message:`That request was already handled.`),n();return}console.error(`[needs-you] decision option resolve failed:`,e),Nm(`Something went wrong — try again.`)}finally{i(!1)}}},p=e.kind===`decision`&&a!==null&&a.length>0;return(0,L.jsxs)(`div`,{className:`deck`,children:[(0,L.jsxs)(`div`,{className:`deck-meta`,children:[(0,L.jsx)(`span`,{className:`deck-kind`,children:l}),(0,L.jsx)(`span`,{className:`from`,children:e.asking_node_name}),(0,L.jsxs)(`span`,{className:`age`,children:[`blocked `,u]})]}),(0,L.jsx)(`p`,{className:`deck-q line-clamp-2`,children:e.title}),(0,L.jsxs)(`div`,{className:`deck-actions`,children:[e.kind===`notify`&&(0,L.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`ack`),children:`Got it`}),e.kind===`validation`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z,{type:`button`,size:`sm`,disabled:r,onClick:()=>void d(`yes`),children:`Approve`}),(0,L.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void d(`no`),children:`Reject`})]}),p&&a.map(e=>(0,L.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,disabled:r,onClick:()=>void f(e.id),children:e.label},e.id)),(0,L.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,L.jsx)(Sf,{"aria-hidden":!0})]})]})]})}var Rm=e=>({"--i":e}),zm=`hosted in a tmux pane — open it in your terminal`;function Bm(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 Vm=[`active`,`idle`,`done`,`dead`,`canceled`],Hm={query:``,status:`all`,blockedOnly:!1};function Um(e){return e.query.trim()!==``||e.status!==`all`||e.blockedOnly}function Wm(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 Gm(e,t){if(!Um(t))return e;let n=new Map(e.map(e=>[e.node_id,e])),r=new Set;for(let i of e){if(!Wm(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 Km=new Set([`dead`,`canceled`]);function qm(e){return Km.has(e.node.status)&&e.children.every(qm)}function Jm(e){return 1+e.children.reduce((e,t)=>e+Jm(t),0)}var Ym=3,Xm={active:Pf,idle:Pf,done:Af,dead:Mf,canceled:Nf};function Zm(e,t){return t?kf:Xm[e]??Pf}function Qm(e){return e.toLocaleTimeString(`en-GB`,{hour12:!1})}function $m(){let[e,t]=(0,v.useState)(()=>Qm(new Date));return(0,v.useEffect)(()=>{let e=setInterval(()=>t(Qm(new Date)),1e3);return()=>clearInterval(e)},[]),e}function eh(){let{nodes:e}=Gp(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(Hm),s=(0,v.useRef)(null),c=$m(),l=e.filter(e=>e.status===`active`).length,u=(0,v.useMemo)(()=>Bm(Gm(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,L.jsxs)(`div`,{className:`in relative z-[1] h-full min-h-0 overflow-auto`,style:{padding:`34px 44px 44px`},children:[(0,L.jsxs)(`div`,{className:`rv flex items-baseline gap-4`,style:Rm(1),children:[(0,L.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:420,letterSpacing:`-0.01em`,fontVariationSettings:`"opsz" 60`,color:`var(--ink)`},children:`Canvas`}),(0,L.jsxs)(`span`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e.length,` `,e.length===1?`node`:`nodes`,l>0&&` · ${l} active`]}),(0,L.jsxs)(`div`,{className:`font-inst text-xs flex items-center gap-2`,style:{marginLeft:`auto`,color:`var(--ink2)`,letterSpacing:`0.1em`},children:[(0,L.jsx)(`span`,{style:{width:`8px`,height:`8px`,borderRadius:`50%`,background:`var(--act)`,animation:`pulse 2.4s ease-out infinite`}}),(0,L.jsx)(`span`,{children:c})]})]}),(0,L.jsxs)(`div`,{className:`rv flex items-center gap-2.5`,style:{margin:`20px 0 22px`,...Rm(2)},children:[(0,L.jsxs)(`div`,{className:`search`,children:[(0,L.jsx)(Yf,{size:14,className:`opacity-70`,"aria-hidden":!0}),(0,L.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,L.jsx)(`span`,{className:`kbd`,children:`/`})]}),(0,L.jsxs)(`label`,{className:`selectish`,children:[(0,L.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,L.jsx)(`option`,{value:`all`,children:`all statuses`}),Vm.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]}),(0,L.jsx)(`span`,{className:`car`,children:`▾`})]}),(0,L.jsxs)(`label`,{className:`checkish select-none`,children:[(0,L.jsx)(`span`,{className:`box`,style:a.blockedOnly?{background:`var(--blk)`,borderColor:`var(--blk)`}:void 0}),`blocked`,(0,L.jsx)(`input`,{type:`checkbox`,checked:a.blockedOnly,onChange:e=>o(t=>({...t,blockedOnly:e.currentTarget.checked})),className:`sr-only`})]}),(0,L.jsx)(`button`,{type:`button`,className:`btn primary`,style:{marginLeft:`auto`},onClick:()=>{i(e=>e+1),n(!0)},children:`+ Spawn a node`})]}),(0,L.jsx)(Im,{}),(0,L.jsxs)(`div`,{className:`panel rv`,style:{padding:`6px 0`,...Rm(4)},children:[(0,L.jsxs)(`div`,{className:`flex items-center`,style:{padding:`10px 18px 9px`,borderBottom:`1px solid var(--line)`},children:[(0,L.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Node forest`}),(0,L.jsx)(`span`,{className:`font-inst text-xs`,style:{marginLeft:`auto`,color:`var(--dim)`,letterSpacing:`0.1em`},children:`sorted · activity`})]}),(0,L.jsx)(`div`,{className:`tree`,children:e.length===0?(0,L.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,L.jsx)(`p`,{className:`px-3 py-2 text-sm italic`,style:{color:`var(--mut)`},children:`No matching nodes.`}):u.map(e=>(0,L.jsx)(th,{node:e},e.node.node_id))})]}),(0,L.jsx)(rh,{open:t,onClose:()=>n(!1)},r)]})}function th({node:e}){let t=pt(),[n,r]=(0,v.useState)(!1),i=e.node,a=i.attention_count>0,o=Km.has(i.status),s=a?`blocked`:i.status,c=e.children.filter(e=>!qm(e)),l=e.children.filter(e=>qm(e)),u=l.reduce((e,t)=>e+Jm(t),0),d=u>=Ym,f=d?c:e.children,p=()=>{i.enterable&&t(`/nodes/${encodeURIComponent(i.node_id)}`)};return(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsxs)(`div`,{className:`node-id`,children:[(0,L.jsxs)(`div`,{className:`node-l1`,children:[(0,L.jsx)(`span`,{className:`node-name`,children:i.name}),(0,L.jsxs)(`span`,{className:`node-kind`,children:[i.kind,` · `,i.mode]})]}),(0,L.jsxs)(`div`,{className:`node-l2`,children:[(0,L.jsx)(`span`,{className:`node-cwd`,title:i.cwd,children:i.cwd}),i.lifecycle&&(0,L.jsx)(`span`,{className:`node-life`,children:i.lifecycle}),!i.enterable&&(0,L.jsx)(`span`,{className:`node-note`,children:zm})]})]}),(0,L.jsxs)(`div`,{className:`node-right`,children:[a&&(0,L.jsxs)(`span`,{className:`waitflag`,children:[(0,L.jsx)(Lf,{size:14,"aria-hidden":!0}),` `,i.attention_count,` waiting on human`]}),(0,L.jsx)(nh,{status:i.status,blocked:a})]})]}),(f.length>0||d&&u>0)&&(0,L.jsxs)(`div`,{className:`kids`,children:[f.map(e=>(0,L.jsx)(th,{node:e},e.node.node_id)),d&&(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Df,{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,L.jsx)(th,{node:e},e.node.node_id))]})]})]})}function nh({status:e,blocked:t}){let n=Zm(e,t);return(0,L.jsxs)(hm,{variant:`outline`,className:t?`blocked`:e,children:[(0,L.jsx)(n,{"aria-hidden":!0}),e]})}function rh({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,L.jsx)(Xp,{open:e,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)($p,{className:`max-w-md overflow-y-auto max-h-[90dvh]`,children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:`Spawn a node`})}),(0,L.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 mp(r),t()}catch(e){console.error(`[spawn] failed:`,e),S(e instanceof cp?`${e.code}: ${e.message}`:String(e))}finally{b(!1)}},className:`flex flex-col gap-3.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-prompt`,children:`Prompt`}),(0,L.jsx)(pm,{id:`spawn-prompt`,value:n,onChange:e=>r(e.currentTarget.value),rows:4,required:!0,className:`resize-none`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-kind`,children:`Kind`}),(0,L.jsx)(im,{id:`spawn-kind`,value:i,onChange:e=>a(e.currentTarget.value),required:!0})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-mode`,children:`Mode`}),(0,L.jsxs)(om,{value:o===``?`__none__`:o,onValueChange:e=>s(e===`__none__`?``:e),children:[(0,L.jsx)(cm,{id:`spawn-mode`,className:`w-full`,children:(0,L.jsx)(sm,{})}),(0,L.jsxs)(lm,{children:[(0,L.jsx)(um,{value:`__none__`,children:`(default)`}),(0,L.jsx)(um,{value:`base`,children:`base`}),(0,L.jsx)(um,{value:`orchestrator`,children:`orchestrator`})]})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.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,L.jsx)(am,{htmlFor:`spawn-root`,className:`cursor-pointer`,children:`Resident root node`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-cwd`,children:`cwd`}),(0,L.jsx)(im,{id:`spawn-cwd`,value:u,onChange:e=>d(e.currentTarget.value),placeholder:`(inherit)`,className:`font-mono text-sm`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-name`,children:`Name`}),(0,L.jsx)(im,{id:`spawn-name`,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`(auto)`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-model`,children:`Model`}),(0,L.jsx)(im,{id:`spawn-model`,value:m,onChange:e=>h(e.currentTarget.value),placeholder:`(default)`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(am,{htmlFor:`spawn-parent`,children:`Parent node id`}),(0,L.jsx)(im,{id:`spawn-parent`,value:g,onChange:e=>_(e.currentTarget.value),placeholder:`(this canvas root)`,className:`font-mono text-sm`})]}),x&&(0,L.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,disabled:y,children:`Cancel`}),(0,L.jsx)(Z,{type:`submit`,form:`spawn-form`,disabled:y,children:y?`Spawning…`:`Spawn`})]})]})})}function ih(e){if(!e)return``;let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]??``}function ah(e){let t=e.name?.trim();if(t&&t!==e.kind)return t;let n=ih(e.cwd);return n?`${e.kind} · ${n}`:e.kind}function oh(e){return e.parent===null&&e.host_kind===`broker`}function sh(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 ch(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 lh(e){return e===`done`||e===`dead`||e===`canceled`}function uh(e){return e.attention_count>0?`blocked`:e.status}function dh(e,t,n){return t>0?`needs-you`:e.status===`active`||n>0?`active`:lh(e.status)?`done`:`idle`}function fh(e){switch(e){case`needs-you`:return 0;case`active`:return 1;case`idle`:return 2;case`done`:return 3}}function ph(e){let t=sh(e),n=[];for(let r of e){if(!oh(r))continue;let e=ch(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:ah(r),state:dh(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=fh(e.state)-fh(t.state);return n===0?t.lastActivity.localeCompare(e.lastActivity):n}),n}function mh(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 hh(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 gh=[`Research a topic for me`,`Help me write something`,`Review my code`,`Plan a project`];function _h(){let{nodes:e,loading:t}=Gp(),n=Np(e=>e.reachable),r=(0,v.useMemo)(()=>ph(e),[e]),[i,a]=(0,v.useState)(!1),[o]=Hn();(0,v.useEffect)(()=>{o.get(`new`)!==null&&a(!0)},[o]);let s=!t&&r.length===0;return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,L.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-3`,children:[(0,L.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Conversations`}),!s&&!i&&(0,L.jsx)(Z,{size:`lg`,onClick:()=>a(!0),children:`+ New chat`})]}),!n&&(0,L.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,L.jsx)(vh,{firstRun:s,onCancel:s?void 0:()=>a(!1)}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,L.jsx)(Sh,{}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>(0,L.jsx)(yh,{conversation:e},e.id))})})]})}function vh({firstRun:e,onCancel:t}){let n=pt(),[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 mp({prompt:e,kind:`general`,mode:`base`,root:!0});n(`/c/${encodeURIComponent(t.node_id)}`)}catch(e){c(e instanceof cp?e.message:String(e)),o(!1)}}};return(0,L.jsxs)(`div`,{className:`panel mb-6 p-5`,children:[e&&(0,L.jsx)(`p`,{className:`mb-3 text-base`,style:{fontStyle:`italic`,color:`var(--ink2)`},children:`Start a conversation with an agent.`}),(0,L.jsx)(pm,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{hh(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,L.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:gh.map(e=>(0,L.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,L.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,children:s}),(0,L.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-2`,children:[t&&(0,L.jsx)(Z,{variant:`ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,L.jsx)(Z,{onClick:()=>void l(),disabled:a||!r.trim(),children:a?`Starting…`:`Start chat`})]})]})}function yh({conversation:e}){let t=pt();return(0,L.jsx)(`li`,{className:`list-none`,children:(0,L.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,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(xh,{state:e.state}),(0,L.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title})]}),(0,L.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:mh(e)})]}),(0,L.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,L.jsxs)(`span`,{title:`cycles`,children:[`⟳ `,e.cycles]}),(0,L.jsxs)(`span`,{title:`nodes in this conversation`,children:[`◦ `,e.nodeCount,` `,e.nodeCount===1?`node`:`nodes`]}),(0,L.jsx)(`span`,{title:`time since last work`,children:Ch(e.lastActivity)})]})]})})}var bh={"needs-you":`needs you`,active:`active`,idle:`idle`,done:`done`};function xh({state:e}){let t=e===`needs-you`?`blocked`:e,n=bh[e];return(0,L.jsx)(`span`,{className:J(`dot shrink-0`,t),title:n,"aria-label":n})}function Sh(){return(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2,3].map(e=>(0,L.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,L.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded bg-muted`}),(0,L.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded bg-muted/70`})]}),(0,L.jsx)(`div`,{className:`h-6 w-16 animate-pulse rounded-full bg-muted`})]},e))})}function Ch(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 wh={active:Wf,idle:Pf,done:Af,dead:Mf,canceled:Nf,blocked:kf};function Th({status:e}){return(0,L.jsx)(wh[e]??Pf,{className:J(`!size-3.5`,e===`active`&&`animate-spin`)})}function Eh(e,t,n,r){return t===`static`?e.status:n===`down`?`dead`:n===`reconnecting`?`idle`:r?`active`:`idle`}function Dh(e){let t=e.store.source===`static`,n=e.store.state?.isStreaming??!1,r=e.detail,i=r?Eh(r,e.store.source,e.store.brokerStatus,n):null;return r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h2`,{className:J(Oh,`min-w-0 truncate`),title:r.name,children:r.name}),i&&(0,L.jsxs)(hm,{className:J(`gap-1.5`,i),children:[(0,L.jsx)(Th,{status:i}),i]}),t&&(0,L.jsx)(`span`,{className:`font-mono text-xs`,style:{color:`var(--idle)`},title:`dormant node — last-known values, not live`,children:`last-known`})]}):(0,L.jsx)(`h2`,{className:Oh,children:`…`})}var Oh=`con-title text-xl font-medium`;function kh(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,L.jsxs)(`div`,{className:`cluster`,children:[i&&(0,L.jsxs)(`div`,{className:`gauge`,children:[(0,L.jsxs)(`div`,{className:`glabel`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Context`}),(0,L.jsxs)(`span`,{className:`gval`,children:[s===null?`—`:Mh(s),s!==null&&(0,L.jsx)(`span`,{className:`u`,children:`%`})]})]}),(0,L.jsx)(`div`,{className:`gbar`,children:(0,L.jsx)(`i`,{style:{width:s===null?`0%`:`${Math.min(100,s)}%`}})}),(0,L.jsxs)(`div`,{className:`gsub`,children:[i.tokens.toLocaleString(),!n&&(0,L.jsxs)(L.Fragment,{children:[` / `,i.window.toLocaleString()]})]})]}),c!==null&&(0,L.jsxs)(`div`,{className:`gauge`,children:[(0,L.jsxs)(`div`,{className:`glabel`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Cost`}),(0,L.jsxs)(`span`,{className:`gval`,children:[(0,L.jsx)(`span`,{className:`u`,style:{marginLeft:0,marginRight:2},children:`$`}),c.toFixed(2)]})]}),(0,L.jsx)(`div`,{className:`gbar`,children:(0,L.jsx)(`i`,{style:{width:`${Math.min(100,c/5*100)}%`}})}),a&&(0,L.jsxs)(`div`,{className:`gsub`,children:[a.turns,` turns`]})]}),(0,L.jsxs)(`div`,{className:`dials`,children:[!n&&a&&c===null&&(0,L.jsx)(Ah,{value:String(a.turns),unit:`turns`}),!n&&a&&(0,L.jsx)(Ah,{value:`${a.user_messages}/${a.assistant_messages}`,unit:`msgs`}),o&&(0,L.jsx)(Ah,{value:`${jh(o.input)} → ${jh(o.output)}`,unit:`tokens`}),!n&&t.tool_calls!==null&&(0,L.jsx)(Ah,{value:String(t.tool_calls),unit:`tools`,hot:r})]})]})}function Ah({value:e,unit:t,hot:n}){return(0,L.jsx)(`div`,{className:`dial`,children:(0,L.jsxs)(`span`,{className:`dval`,style:n?{color:`var(--act)`}:void 0,children:[e,` `,(0,L.jsx)(`em`,{children:t})]})})}function jh(e){return e>=1e6?`${Math.round(e/1e5)/10}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Mh(e){return(Math.round(e*10)/10).toFixed(1)}function Nh({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,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,L.jsx)(Rf,{className:`size-3.5 shrink-0 opacity-70`}),(0,L.jsx)(`b`,{style:Ph,children:i}),a>0&&(0,L.jsxs)(`span`,{style:{color:`var(--act)`,opacity:.8},children:[` +`,a]}),o>0&&(0,L.jsxs)(`span`,{style:{color:`var(--idle)`,opacity:.8},children:[` ~`,o]})]},`branch`))}let a=t?.cwd??null;a!==null&&r.push((0,L.jsx)(`span`,{children:Fh(a)},`cwd`));let o=n.model??t?.model??null;o!==null&&r.push((0,L.jsx)(`span`,{children:(0,L.jsx)(`b`,{style:Ph,children:o})},`model`));let s=n.context??null;return s!==null&&r.push((0,L.jsxs)(`span`,{children:[`ctx `,(0,L.jsx)(`b`,{style:Ph,children:Ih(s.tokens)}),` / `,Ih(s.window)]},`ctx`)),r.length===0?null:(0,L.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,L.jsxs)(v.Fragment,{children:[t>0&&(0,L.jsx)(`span`,{style:{color:`var(--dim)`,opacity:.5},className:`select-none`,children:`·`}),e]},t))})}var Ph={color:`var(--ink2)`,fontWeight:400};function Fh(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 Ih(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Lh(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,L.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,L.jsxs)(`div`,{ref:r,className:`panel rv`,style:Rh,children:[(0,L.jsxs)(`div`,{style:zh,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Instruments`}),(0,L.jsx)(`div`,{style:{flex:1}}),(0,L.jsx)(`span`,{className:`kbd`,children:`⌥i`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`transition-colors`,style:{color:`var(--mut)`},"aria-label":`Close instruments`,children:(0,L.jsx)($f,{className:`size-3.5`})})]}),(0,L.jsx)(kh,{store:e.store,detail:e.detail})]})}):null}var Rh={minWidth:`min(680px, 92vw)`,overflow:`hidden`,"--i":0},zh={display:`flex`,alignItems:`center`,gap:`10px`,padding:`11px 30px`,borderBottom:`1px solid var(--line)`};function Bh(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 Vh(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 Hh(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 Uh(e,t){let n=new Map(e.map(e=>[e.node_id,e])),r=Bh(e),i=Hh(t,n),a=i?.node_id??null;return{thisGraph:i===null?[]:Vh(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 Wh=new Set([`done`,`dead`,`canceled`]),Gh=`crtr:graphrail-collapsed`;function Kh(e){return e.attention_count>0||e.status===`active`}function qh(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&&Kh(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 Jh({currentId:e,onNavigate:t}){let{nodes:n}=Gp(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(Gh)===`1`}catch{return!1}}),[s,c]=(0,v.useState)({}),{thisGraph:l}=Uh(n,e),u=l[0]?.node.node_id??null,{children:d,collapsedByDefault:f}=(0,v.useMemo)(()=>qh(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(Gh,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)(Wh.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,L.jsx)(`aside`,{className:`graphrail rv`,style:Xh,children:(0,L.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,L.jsx)(Df,{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,L.jsx)(rg,{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,L.jsxs)(`aside`,{className:`graphrail rv`,style:Yh,children:[(0,L.jsx)(`div`,{className:`flex items-center justify-end pb-1`,children:(0,L.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,L.jsx)(Df,{className:`size-4 rotate-180`})})}),(0,L.jsx)(Zh,{label:`This graph`,chord:`⌥↑↓ to cycle`}),y,l.length===0&&(0,L.jsx)(Qh,{}),(g.length>0||_.length>0)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`gr-gap`}),(0,L.jsx)(Zh,{label:`Elsewhere`}),g.map(e=>(0,L.jsx)(rg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id)),_.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Df,{className:J(`size-3.5 transition-transform`,r&&`rotate-90`)}),r?`Hide`:`Show`,` `,_.length,` finished`]}),r&&_.map(e=>(0,L.jsx)(rg,{node:e,depth:0,current:!1,elsewhere:!0,onClick:()=>t(e.node_id)},e.node_id))]})]})]})}var Yh={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},Xh={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 Zh({label:e,chord:t}){return(0,L.jsxs)(`div`,{className:`gr-sec`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:e}),(0,L.jsx)(`div`,{className:`rule`}),t&&(0,L.jsx)(`span`,{title:t,"aria-label":t,className:`flex items-center text-[var(--dim)]`,children:(0,L.jsx)(Vf,{className:`size-3.5`})})]})}function Qh(){return(0,L.jsx)(`span`,{className:`px-3 py-1 font-mono text-xs`,style:{color:`var(--dim)`},children:`—`})}function $h(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 eg(e){return e.split(`/`).filter(Boolean).at(-1)??e}function tg(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 ng={active:`s-active`,idle:`s-idle`,done:`s-done`,dead:`s-dead`,canceled:`s-canceled`};function rg({node:e,depth:t,current:n,elsewhere:r=!1,hasChildren:i=!1,collapsed:a=!1,onToggleCollapse:o,onClick:s}){let c=Wh.has(e.status),l=e.attention_count>0,u=l?`blocked`:e.status,d=$h(e.created),f=t>0?{marginLeft:`${t*12}px`}:void 0,p=(0,L.jsx)(`button`,{type:`button`,onClick:s,className:J(`node-row text-left`,r?`w-full`:`min-w-0 flex-1`,l?`s-blocked`:ng[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,L.jsxs)(`span`,{className:`node-id`,children:[(0,L.jsxs)(`span`,{className:`node-l1`,children:[(0,L.jsx)(`span`,{className:J(`node-name truncate`,n&&`font-semibold`),children:r?eg(e.cwd):e.name}),r?(0,L.jsxs)(`span`,{className:`node-kind truncate`,children:[e.name,` · `,e.kind]}):(0,L.jsx)(`span`,{className:`node-kind`,children:e.kind}),l&&(0,L.jsxs)(hm,{variant:`destructive`,className:`ml-auto gap-1 text-xs`,children:[(0,L.jsx)(Lf,{className:`size-3.5`}),e.attention_count]})]}),(0,L.jsxs)(`span`,{className:`node-l2`,children:[r&&(0,L.jsx)(`span`,{className:`node-cwd`,children:tg(e.cwd)}),(0,L.jsx)(`span`,{className:J(`dot`,u),title:u,"aria-label":u}),d&&(0,L.jsx)(`span`,{className:`text-[var(--dim)]`,children:d})]})]})});return r?(0,L.jsx)(`div`,{style:f,children:p}):(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,style:f,children:[i?(0,L.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,L.jsx)(Df,{className:J(`size-3.5 transition-transform`,!a&&`rotate-90`)})}):(0,L.jsx)(`span`,{className:`size-4 flex-none`,"aria-hidden":`true`}),p]})}function ig(e){let t=e?.diagnostics;return Array.isArray(t)&&t.some(e=>e?.type===`crtr:managed-provider-cooling`)}function ag(e){return typeof e==`object`&&!!e}function og(e){return typeof e==`string`?e:``}function sg(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 cg(e){let t=og(e.code)||og(e.errno);return t===``?null:/^(ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOENT|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH)$/i.test(t)?`connection`:null}function lg(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 ug(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=og(e.reason);return/no running broker/i.test(t)||sg(t)===`connection`?`connection`:`other`}return null}function dg(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 fg(e){if(typeof e==`string`)return e;if(!ag(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(ag(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 pg(e,t){if(e===`pi→provider`&&ig(t))return{kind:`rate-limit`,disposition:`auto`};if(ag(t)){let n=cg(t);if(n!==null)return{kind:n,disposition:dg(e,n)};let r=lg(t);if(r!==null)return{kind:r,disposition:dg(e,r)};let i=ug(t);if(i!==null)return{kind:i,disposition:dg(e,i)}}let n=sg(fg(t));return{kind:n,disposition:dg(e,n)}}var mg=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,sp!==void 0&&t.searchParams.set(`token`,sp),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=pg(`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))}},hg=/^From (?:[a-z0-9]+(?:-[a-z0-9]+)+|system|human) — \d+ update/;function gg(e){return hg.test(e)}function _g(e){let t=/^From ([a-z0-9]+(?:-[a-z0-9]+)+|system|human) — /.exec(e);if(!t)return null;let n=t[1];return typeof n==`string`?n:null}function vg(){return{messages:[],streamingIndex:null,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!1,activity:null,queued:[]}}function yg(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 bg(e){return Cg(e)!==`user`||e.origin||!gg(yg(e))?e:{...e,origin:`inbox`}}function xg(){return{role:`assistant`,content:[]}}function Sg(e,t){let n=e.messages.map(bg);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&&Cg(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&&Cg(i)===`assistant`?i:xg(),o=[...n,a];return{messages:o,streamingIndex:o.length-1,executingToolIds:new Set,partialToolResults:new Map,isStreaming:!0,activity:`Working…`,queued:[]}}function Cg(e){return e.role??``}function wg(e){for(let t=e.messages.length-1;t>=0;t--)if(Cg(e.messages[t])===`bashExecution`)return t;return null}function Tg(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 Eg(e,t){let n=wg(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 Dg(e,t){let n=wg(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 Og(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=bg(t.message),r=[...e.messages,n],i=Cg(n)===`assistant`,a=e.partialToolResults;if(Cg(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&&Cg(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,kg(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,kg(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 kg(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 Ag=4,jg=new Set([`knowledge`,`preference`]),Mg=new Set([`node`,`project`,`profile`,`user`,`builtin`]),Ng=new Set([`name`,`kind`,`scope`,`shortForm`]),Pg=new Set([`stop`,`length`,`toolUse`,`error`,`aborted`]),Fg=new Set([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),Ig=200,Lg=256*1024,Rg=20,zg=8*1024*1024;function Bg(e){return{schemaVersion:Ag,...e}}function Vg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e){return typeof e==`string`}function Hg(e){return typeof e==`number`}function Ug(e){return typeof e==`boolean`}function Wg(e){return Array.isArray(e)&&e.every(Q)}function Gg(e){return!Vg(e)||e.type!==`text`||!Q(e.text)?!1:e.textSignature===void 0||Q(e.textSignature)}function Kg(e){return Vg(e)&&e.type===`image`&&Q(e.data)&&Q(e.mimeType)}function qg(e){return Vg(e)&&e.type===`toolCall`&&Q(e.id)&&Q(e.name)&&Vg(e.arguments)&&(e.thoughtSignature===void 0||Q(e.thoughtSignature))}function Jg(e){return Vg(e)&&Hg(e.input)&&Hg(e.output)&&Hg(e.cacheRead)&&Hg(e.cacheWrite)&&Hg(e.total)}function Yg(e){return Vg(e)&&Hg(e.input)&&Hg(e.output)&&Hg(e.cacheRead)&&Hg(e.cacheWrite)&&(e.cacheWrite1h===void 0||Hg(e.cacheWrite1h))&&(e.reasoning===void 0||Hg(e.reasoning))&&Hg(e.totalTokens)&&Jg(e.cost)}function Xg(e){return typeof e==`string`&&Pg.has(e)}function Zg(e){return typeof e==`string`&&Fg.has(e)}function Qg(e){return!Vg(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)||Hg(e.code))}function $g(e){return!Vg(e)||!Q(e.type)||!Hg(e.timestamp)?!1:(e.error===void 0||Qg(e.error))&&(e.details===void 0||Vg(e.details))}function e_(e){return!Vg(e)||e.role!==`user`||!Hg(e.timestamp)?!1:typeof e.content==`string`||Array.isArray(e.content)&&e.content.every(e=>Gg(e)||Kg(e))}function t_(e){return!Vg(e)||e.role!==`assistant`||!Hg(e.timestamp)||!Array.isArray(e.content)||!e.content.every(e=>Gg(e)||Vg(e)&&e.type===`thinking`&&Q(e.thinking)&&(e.thinkingSignature===void 0||Q(e.thinkingSignature))&&(e.redacted===void 0||Ug(e.redacted))||qg(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($g))&&Yg(e.usage)&&Xg(e.stopReason)&&(e.errorMessage===void 0||Q(e.errorMessage))}function n_(e){return!Vg(e)||e.role!==`toolResult`||!Hg(e.timestamp)?!1:Q(e.toolCallId)&&Q(e.toolName)&&Array.isArray(e.content)&&e.content.every(e=>Gg(e)||Kg(e))&&Ug(e.isError)}function r_(e){return Vg(e)&&e.role===`bashExecution`&&Q(e.command)&&Q(e.output)&&Hg(e.timestamp)&&(e.exitCode===void 0||Hg(e.exitCode))&&Ug(e.cancelled)&&Ug(e.truncated)&&(e.fullOutputPath===void 0||Q(e.fullOutputPath))&&(e.excludeFromContext===void 0||Ug(e.excludeFromContext))}function i_(e){return e_(e)||t_(e)||n_(e)||r_(e)}function a_(e){return!Vg(e)||!Q(e.role)?!1:e.role!==`user`&&e.role!==`assistant`&&e.role!==`toolResult`&&e.role!==`bashExecution`}function o_(e){return i_(e)||a_(e)}function s_(e){if(!Vg(e))return!1;let t=Object.keys(e);return t.length!==Ng.size||!t.every(e=>Ng.has(e))?!1:Q(e.name)&&jg.has(e.kind)&&Mg.has(e.scope)&&Q(e.shortForm)}function c_(e){return Wg(e)}function l_(e){return!Vg(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 u_(e){return e===null?!0:Vg(e)?Q(e.sessionId)&&(e.sessionFile===void 0||Q(e.sessionFile))&&(e.model===void 0||Vg(e.model)&&Q(e.model.id))&&Ug(e.isStreaming)&&Ug(e.isCompacting)&&Zg(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))&&Ug(e.autoCompactionEnabled)&&Hg(e.messageCount)&&Hg(e.pendingMessageCount):!1}function d_(e,t){return Vg(t)?t.schemaVersion===Ag&&t.nodeId===e&&Array.isArray(t.messages)&&t.messages.every(o_)&&u_(t.sessionState)&&Array.isArray(t.commands)&&t.commands.every(l_)&&Array.isArray(t.refs)&&t.refs.every(s_)&&c_(t.engineLeadingCommandNames)&&Ug(t.isStreaming)&&(t.activity===null||Q(t.activity))&&Hg(t.updatedAt)&&(t.source===`broker`||t.source===`static`):!1}function f_(e){return new TextEncoder().encode(JSON.stringify(e)).length}function p_(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 m_(e,t,n){let r=e.messages.slice(-t),i={...e,messages:r};for(;r.length>1&&f_(i)>n;)r=r.slice(1),i={...e,messages:r};return i}function h_(e){return`crtr.web.transcript.tail.${e}`}function g_(e){try{let t=globalThis.localStorage?.getItem(h_(e));if(t==null)return null;let n=JSON.parse(t);return d_(e,n)?n:(globalThis.localStorage?.removeItem(h_(e)),null)}catch{try{globalThis.localStorage?.removeItem(h_(e))}catch{}return null}}function __(e){let t=m_(p_(e),Rg,Lg);try{globalThis.localStorage?.setItem(h_(e.nodeId),JSON.stringify(t))}catch{}}var v_=`crtr-web-transcript-cache`,y_=1,b_=`entries`;function x_(){return new Promise((e,t)=>{if(typeof indexedDB>`u`){t(Error(`indexedDB unavailable`));return}let n=indexedDB.open(v_,y_);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(b_)||e.createObjectStore(b_,{keyPath:`nodeId`}).createIndex(`updatedAt`,`updatedAt`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))})}async function S_(e,t){await new Promise((n,r)=>{let i=e.transaction(b_,`readwrite`);i.objectStore(b_).delete(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB delete failed`))})}async function C_(e){try{let t=await x_(),n=await new Promise((n,r)=>{let i=t.transaction(b_,`readonly`).objectStore(b_).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error??Error(`indexedDB read failed`))});return d_(e,n)?(t.close(),n):(n!=null&&await S_(t,e),t.close(),null)}catch{return null}}async function w_(e){let t=[];await new Promise((n,r)=>{let i=e.transaction(b_,`readonly`).objectStore(b_).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:f_(r)}),e.continue()},i.onerror=()=>r(i.error??Error(`indexedDB cursor failed`))});let n=t.reduce((e,t)=>e+t.size,0);n<=zg||await new Promise((r,i)=>{let a=e.transaction(b_,`readwrite`),o=a.objectStore(b_),s=0;for(;n>zg&&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 T_(e){let t=m_(p_(e),Ig,Lg);try{let e=await x_();await new Promise((n,r)=>{let i=e.transaction(b_,`readwrite`);i.objectStore(b_).put(t),i.oncomplete=()=>n(),i.onerror=()=>r(i.error??Error(`indexedDB write failed`))}),await w_(e),e.close()}catch{}}function E_(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 D_(e){return{clientId:e,conn:`connecting`,conv:vg(),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 O_={"no-broker":`no-broker`,"no-node":`no-node`,invalid:`invalid`,transient:`closed`};function k_(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 A_(e,t){switch(t.kind){case`connecting`:return e.conn===`connecting`?e:{...e,conn:`connecting`};case`closed`:{let n=O_[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 z_(e,t.frame)}}function j_(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 M_(e,t){return e.length===t.length&&e.every((e,n)=>j_(e,t[n]))}function N_(e,t){return e.name===t.name&&e.kind===t.kind&&e.scope===t.scope&&e.shortForm===t.shortForm}function P_(e,t){return e.length===t.length&&e.every((e,n)=>N_(e,t[n]))}function F_(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function I_(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 L_(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||E_(t.expansion))}):[]}catch{return[]}}function R_(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 z_(e,t){if(!k_(t.type))return{...e,conv:Og(e.conv,t)};switch(t.type){case`welcome`:{let n=Sg(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(I_(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?L_(t.detail):[];return M_(e.commands,n)?e:{...e,commands:n}}case`bash_start`:return{...e,conv:Tg(e.conv,t.command,t.excludeFromContext)};case`bash_output`:return{...e,conv:Eg(e.conv,t.chunk)};case`bash_end`:return{...e,conv:Dg(e.conv,t)};case`data`:return t.kind!==`list_memory_refs`||t.id!==e.pendingRefsRequestId||!Array.isArray(t.refs)||!t.refs.every(s_)||!c_(t.engineLeadingCommandNames)||P_(e.refs,t.refs)&&F_(e.engineLeadingCommandNames,t.engineLeadingCommandNames)?e:{...e,refs:t.refs,engineLeadingCommandNames:t.engineLeadingCommandNames};default:return e}}var B_=1500,V_=800,H_=5e3,U_=10;function W_(e){return Math.min(H_,V_*2**e)}var G_=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=D_(this.clientId);let t=g_(e);t&&(this.state={...this.state,conv:R_(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;C_(this.nodeId).then(t=>{if(e===this.gen&&!this.liveAttached&&!(t===null||t.updatedAt<=this.cachedUpdatedAt)){this.state={...this.state,conv:R_(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=A_(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=Bg({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`});__(e),T_(e),this.cachedUpdatedAt=e.updatedAt}send(e){this.client?.send(e)}dial(){let e=this.gen,t=new mg(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())},B_);else if(t===`no-broker`&&this.noBrokerAttempts<U_){let t=this.noBrokerAttempts;this.noBrokerAttempts+=1,this.timer=setTimeout(()=>{e===this.gen&&this.dial()},W_(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})}}},K_=4,q_=new class{handles=new Map;mru=[];poolListeners=new Set;warmIdsSnapshot=[];acquire(e){let t=this.handles.get(e);return t||(t=new G_(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>K_;){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 J_(e){let t=q_.acquire(e);return{state:(0,v.useSyncExternalStore)(t.subscribe,t.getState),actions:t.actions}}var Y_={branch:null,model:null,tokens:null,context:null,tool_calls:null,stats:null,git_status:null};function X_(e,t){return{...Z_,...t.state,sessionId:t.state?.sessionId??e,isStreaming:!1}}var Z_={sessionId:``,isStreaming:!1,isCompacting:!1,thinkingLevel:`off`,steeringMode:`all`,followUpMode:`all`,autoCompactionEnabled:!1,messageCount:0,pendingMessageCount:0};function Q_(e){let{state:t,actions:n}=J_(e),r=Np(e=>e.reachable),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let n=!1;if(t.conn!==`no-broker`){a(null);return}return pp(e).then(t=>{if(n)return;a(t);let r=Bg({nodeId:e,messages:Sg(t.snapshot).messages,sessionState:X_(e,t.snapshot),commands:t.commands,refs:[],engineLeadingCommandNames:[],isStreaming:!1,activity:null,updatedAt:Date.now(),source:`static`});__(r),T_(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:Sg(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:X_(e,o.snapshot),[e,o,t.conn,c]),u=(0,v.useMemo)(()=>o===null?{...Y_,model:t.model??null}:{...Y_,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 $_=400,ev=4e3;function tv(e){return e.dormant&&e.status===`active`&&e.socketReady&&e.attempt<8}function nv(e){return Math.min(ev,$_*2**Math.max(0,e))}var rv=1,iv=400;function av(e){return`crtr.web.draft.${e}`}function ov(e,t){if(typeof t!=`object`||!t)return!1;let n=t;return n.schemaVersion===rv&&n.nodeId===e&&typeof n.text==`string`&&typeof n.updatedAt==`number`}function sv(e){try{let t=globalThis.localStorage?.getItem(av(e));if(t==null)return``;let n=JSON.parse(t);return ov(e,n)?n.text:``}catch{return``}}function cv(e,t){let n={schemaVersion:rv,nodeId:e,text:t,updatedAt:Date.now()};try{globalThis.localStorage?.setItem(av(e),JSON.stringify(n))}catch{}}function lv(e){try{globalThis.localStorage?.removeItem(av(e))}catch{}}var uv=new Map;function dv(e,t){let n=uv.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{uv.delete(e),t===``?lv(e):cv(e,t)},iv);uv.set(e,r)}function fv(e){let t=uv.get(e);t&&(clearTimeout(t),uv.delete(e))}var pv=new Set([`reload`]);function mv(e){let t=Q_(e),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>(q_.focus(e),()=>{q_.background(e)}),[e]);let[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{a(sv(e))},[e]),(0,v.useEffect)(()=>{dv(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([...pv,...t.engineLeadingCommandNames]),[t.engineLeadingCommandNames]);(0,v.useEffect)(()=>{let t=!1;return fp(e).then(e=>{t||r(e)}).catch(e=>{t||l(hv(e))}),()=>{t=!0}},[e]);let b=(0,v.useRef)(0);(0,v.useEffect)(()=>{b.current=0},[e]),(0,v.useEffect)(()=>{if(!tv({dormant:f,status:n?.status,socketReady:t.socketReady,attempt:b.current}))return;let e=b.current;b.current+=1;let r=setTimeout(()=>t.reconnect(),nv(e));return()=>clearTimeout(r)},[f,n?.status,t.socketReady,t.reconnect]);let x=()=>{!i.trim()||!g||(h?t.steer(i):t.prompt(i),fv(e),lv(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=>{hh(e,a,x)},selectCommand:e=>{a(`/${e.name} `)},doRevive:async()=>{s(!0),l(null);try{await gp(e),t.reconnect()}catch(e){l(hv(e))}finally{s(!1)}},doClose:async()=>{l(null);try{await _p(e)}catch(e){l(hv(e))}}}}function hv(e){return e instanceof cp?`${e.code}: ${e.message}`:String(e)}function gv(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,L.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,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:n.map(t=>(0,L.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,L.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-primary`,children:[`/`,t.name]}),t.argument_hint&&(0,L.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground/70`,children:t.argument_hint}),(0,L.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground/50`,children:[t.source,t.location&&(0,L.jsxs)(L.Fragment,{children:[` · `,t.location]})]}),(0,L.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:t.description})]},t.name))}):(0,L.jsx)(`div`,{className:`px-3 py-2 text-xs italic text-muted-foreground`,children:`no matching commands`})}):null}var _v=new Set([`select`,`confirm`,`input`,`editor`,`notify`]);function vv(e){return _v.has(e.method)}function yv(e){let t=e.store.dialog,n=t&&vv(t)?t:null;return(0,L.jsx)(Xp,{open:n!==null,children:(0,L.jsx)($p,{showCloseButton:!1,children:n&&(0,L.jsx)(Sv,{req:n,store:e.store},n.id)})})}function bv(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 xv(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,L.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,L.jsxs)(`span`,{children:[n>0&&(0,L.jsx)(`br`,{}),r]},n)})}function Sv(e){let t=()=>e.store.dialogResponse(e.req.id,{cancelled:!0});return e.req.method===`select`?(0,L.jsx)(Cv,{req:e.req,store:e.store,cancel:t}):(0,L.jsx)(wv,{req:e.req,store:e.store,cancel:t})}function Cv(e){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:e.req.title})}),(0,L.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.req.options.map(t=>(0,L.jsx)(`li`,{children:(0,L.jsx)(Z,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>e.store.dialogResponse(e.req.id,{value:t}),children:t})},t))}),(0,L.jsx)(tm,{children:(0,L.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`})})]})}function wv(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,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:t.title})}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{variant:`secondary`,onClick:()=>e.store.dialogResponse(t.id,{confirmed:!1}),children:`No`}),(0,L.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,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(em,{children:(0,L.jsx)(nm,{children:xv(r.title)})}),r.method===`editor`?(0,L.jsx)(pm,{className:`resize-none font-mono text-sm`,rows:8,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}):(0,L.jsx)(im,{placeholder:r.placeholder??``,value:t,onChange:e=>n(e.currentTarget.value),autoFocus:!0}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{type:`button`,variant:`secondary`,onClick:e.cancel,children:`Cancel`}),(0,L.jsx)(Z,{onClick:()=>e.store.dialogResponse(r.id,{value:t}),children:`Submit`})]})]})}if(e.req.method===`notify`){let t=e.req;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:J(`rounded-none border px-3 py-2 text-sm`,bv(t.notifyType)),children:xv(t.message)}),(0,L.jsx)(tm,{children:(0,L.jsx)(Z,{onClick:()=>e.store.dialogResponse(t.id,{confirmed:!0}),children:`OK`})})]})}return null}function Tv(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 Ev(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 Dv(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Ov=(e,t)=>Math.abs(e-t)<1.01,kv=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Av,jv=()=>{if(Av!==void 0)return Av;if(typeof navigator>`u`)return Av=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Av=!0;let e=navigator.maxTouchPoints;return Av=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Mv=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Nv=e=>e,Pv=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},Fv=(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(Mv(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(Mv(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Iv={passive:!0},Lv=typeof window>`u`||`onscrollend`in window,Rv=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Lv,o=0,s=a?null:kv(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,Iv),a&&r.addEventListener(`scrollend`,u,Iv),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},zv=(e,t)=>Rv(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Bv=(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`]},Vv=(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})},Hv=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:Nv,rangeExtractor:Pv,onChange:()=>{},measureElement:Bv,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=Ev(()=>(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,!(!jv()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Iv),e.addEventListener(`touchend`,n,Iv),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&&(jv()&&(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=Ev(()=>[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=Ev(()=>[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=Tv(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=Ev(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=Gv(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ev(()=>{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++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=Ev(()=>[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 Dv(t[Uv(0,t.length-1,r?e=>n[e*2]:e=>Dv(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){return e===0?!1:jv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(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),!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&&Ov(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()}},Uv=(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 Wv(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 Gv(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=Wv(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=Uv(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 Kv=typeof document<`u`?v.useLayoutEffect:v.useEffect;function qv({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 Hv(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),Kv(()=>l._didMount(),[]),Kv(()=>(o(l),l._willUpdate())),Kv(()=>{s(l)}),l}function Jv(e){return qv({observeElementRect:Fv,observeElementOffset:zv,scrollToFn:Vv,...e})}var Yv={};function Xv(e){let t=Yv[e];if(t)return t;t=Yv[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 Zv(e,t){typeof t!=`string`&&(t=Zv.defaultChars);let n=Xv(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})}Zv.defaultChars=`;/?:@&=+$,#`,Zv.componentChars=``;var Qv={};function $v(e){let t=Qv[e];if(t)return t;t=Qv[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=$v(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 ty(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 ny(){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 ry=/^([a-z0-9.+-]+:)/i,iy=/:[0-9]*$/,ay=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,oy=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
53
+ `,` `],sy=[`/`,`?`,`#`],cy=255,ly=/^[+a-z0-9A-Z_-]{0,63}$/,uy=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dy={javascript:!0,"javascript:":!0},fy={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function py(e,t){if(e&&e instanceof ny)return e;let n=new ny;return n.parse(e,t),n}ny.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=ay.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=ry.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&&dy[o])&&(a=a.substr(2),this.slashes=!0)),!dy[o]&&(i||o&&!fy[o])){let e=-1;for(let t=0;t<sy.length;t++)r=a.indexOf(sy[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<oy.length;t++)r=a.indexOf(oy[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(ly)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(ly)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(uy);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>cy&&(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),fy[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},ny.prototype.parseHost=function(e){let t=iy.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 my=s({decode:()=>Zv,encode:()=>ey,format:()=>ty,parse:()=>py}),hy=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,gy=/[\0-\x1F\x7F-\x9F]/,_y=/[\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]/,vy=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,yy=/[\$\+<->\^`\|~\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]/,by=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,xy=s({Any:()=>hy,Cc:()=>gy,Cf:()=>_y,P:()=>vy,S:()=>yy,Z:()=>by}),Sy=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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))),Cy=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),wy=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]]),Ty=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 Ey(e){return e>=55296&&e<=57343||e>1114111?65533:wy.get(e)??e}var Dy;(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`})(Dy||={});var Oy=32,ky;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(ky||={});function Ay(e){return e>=Dy.ZERO&&e<=Dy.NINE}function jy(e){return e>=Dy.UPPER_A&&e<=Dy.UPPER_F||e>=Dy.LOWER_A&&e<=Dy.LOWER_F}function My(e){return e>=Dy.UPPER_A&&e<=Dy.UPPER_Z||e>=Dy.LOWER_A&&e<=Dy.LOWER_Z||Ay(e)}function Ny(e){return e===Dy.EQUALS||My(e)}var Py;(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`})(Py||={});var Fy;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Fy||={});var Iy=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Py.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Fy.Strict}startEntity(e){this.decodeMode=e,this.state=Py.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Py.EntityStart:return e.charCodeAt(t)===Dy.NUM?(this.state=Py.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Py.NamedEntity,this.stateNamedEntity(e,t));case Py.NumericStart:return this.stateNumericStart(e,t);case Py.NumericDecimal:return this.stateNumericDecimal(e,t);case Py.NumericHex:return this.stateNumericHex(e,t);case Py.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Oy)===Dy.LOWER_X?(this.state=Py.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Py.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(Ay(r)||jy(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(Ay(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===Dy.SEMI)this.consumed+=1;else if(this.decodeMode===Fy.Strict)return 0;return this.emitCodePoint(Ey(this.result),this.consumed),this.errors&&(e!==Dy.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&ky.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Ry(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Fy.Attribute&&(i===0||Ny(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&ky.VALUE_LENGTH)>>14,i!==0){if(a===Dy.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Fy.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]&ky.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]&~ky.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Py.NamedEntity:return this.result!==0&&(this.decodeMode!==Fy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Py.NumericDecimal:return this.emitNumericEntity(0,2);case Py.NumericHex:return this.emitNumericEntity(0,3);case Py.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Py.EntityStart:return 0}}};function Ly(e){let t=``,n=new Iy(e,e=>t+=Ty(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 Ry(e,t,n,r){let i=(t&ky.BRANCH_LENGTH)>>7,a=t&ky.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 zy=Ly(Sy);Ly(Cy);function By(e,t=Fy.Legacy){return zy(e,t)}function Vy(e){return zy(e,Fy.Strict)}var Hy=s({arrayReplaceAt:()=>Jy,asciiTrim:()=>_b,assign:()=>qy,escapeHtml:()=>sb,escapeRE:()=>lb,fromCodePoint:()=>Xy,has:()=>Ky,isMdAsciiPunct:()=>mb,isPunctChar:()=>fb,isPunctCharCode:()=>pb,isSpace:()=>ub,isString:()=>Wy,isValidEntityCode:()=>Yy,isWhiteSpace:()=>db,lib:()=>vb,normalizeReference:()=>hb,unescapeAll:()=>nb,unescapeMd:()=>tb});function Uy(e){return Object.prototype.toString.call(e)}function Wy(e){return Uy(e)===`[object String]`}var Gy=Object.prototype.hasOwnProperty;function Ky(e,t){return Gy.call(e,t)}function qy(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 Jy(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Yy(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 Xy(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 Zy=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Qy=RegExp(Zy.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),$y=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function eb(e,t){if(t.charCodeAt(0)===35&&$y.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Yy(n)?Xy(n):e}let n=By(e);return n===e?e:n}function tb(e){return e.indexOf(`\\`)<0?e:e.replace(Zy,`$1`)}function nb(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(Qy,function(e,t,n){return t||eb(e,n)})}var rb=/[&<>"]/,ib=/[&<>"]/g,ab={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function ob(e){return ab[e]}function sb(e){return rb.test(e)?e.replace(ib,ob):e}var cb=/[.?*+^$[\]\\(){}|-]/g;function lb(e){return e.replace(cb,`\\$&`)}function ub(e){switch(e){case 9:case 32:return!0}return!1}function db(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 fb(e){return vy.test(e)||yy.test(e)}function pb(e){return fb(Xy(e))}function mb(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 hb(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function gb(e){return e===32||e===9||e===10||e===13}function _b(e){let t=0;for(;t<e.length&&gb(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&gb(e.charCodeAt(n));n--);return e.slice(t,n+1)}var vb={mdurl:my,ucmicro:xy};function yb(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 bb(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=nb(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=nb(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function xb(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+=nb(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+=nb(e.slice(t,a)),o}var Sb=s({parseLinkDestination:()=>bb,parseLinkLabel:()=>yb,parseLinkTitle:()=>xb}),Cb={};Cb.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+sb(a.content)+`</code>`},Cb.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+sb(e[t].content)+`</code></pre>
54
+ `},Cb.fence=function(e,t,n,r,i){let a=e[t],o=a.info?nb(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)||sb(a.content),l.indexOf(`<pre`)===0)return l+`
55
+ `;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`},Cb.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)},Cb.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
56
56
  `:`<br>
57
- `},Eb.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
57
+ `},Cb.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
58
58
  `:`<br>
59
59
  `:`
60
- `},Eb.text=function(e,t){return ub(e[t].content)},Eb.html_block=function(e,t){return e[t].content},Eb.html_inline=function(e,t){return e[t].content};function Db(){this.rules=Xy({},Eb)}Db.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+ub(e.attrs[t][0])+`="`+ub(e.attrs[t][1])+`"`;return r},Db.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+=`
60
+ `},Cb.text=function(e,t){return sb(e[t].content)},Cb.html_block=function(e,t){return e[t].content},Cb.html_inline=function(e,t){return e[t].content};function wb(){this.rules=qy({},Cb)}wb.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+sb(e.attrs[t][0])+`="`+sb(e.attrs[t][1])+`"`;return r},wb.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
61
  `),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},Db.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},Db.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+=`
63
- `;break;default:}return r},Db.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 Ob(){this.__rules__=[],this.__cache__=null}Ob.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Ob.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))})})},Ob.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},Ob.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},Ob.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},Ob.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Ob.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},Ob.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Ob.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},Ob.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function kb(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}kb.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},kb.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},kb.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},kb.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},kb.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 Ab(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Ab.prototype.Token=kb;var jb=/\r\n?|\n/g,Mb=/\0/g;function Nb(e){let t;t=e.src.replace(jb,`
64
- `),t=t.replace(Mb,`�`),e.src=t}function Pb(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 Fb(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 Ib(e){return/^<a[>\s]/i.test(e)}function Lb(e){return/^<\/a\s*>/i.test(e)}function Rb(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`&&(Ib(o.content)&&i>0&&i--,Lb(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=Zy(r,a,c)}}}}var zb=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Bb=/\((c|tm|r)\)/i,Vb=/\((c|tm|r)\)/gi,Hb={c:`©`,r:`®`,tm:`™`};function Ub(e,t){return Hb[t.toLowerCase()]}function Wb(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(Vb,Ub)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Gb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&zb.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 Kb(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(Bb.test(e.tokens[t].content)&&Wb(e.tokens[t].children),zb.test(e.tokens[t].content)&&Gb(e.tokens[t].children))}var qb=/['"]/,Jb=/['"]/g,Yb=`’`;function Xb(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Zb(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 Qb(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;){Jb.lastIndex=l;let o=Jb.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=_b(m)||gb(m),_=_b(h)||gb(h),v=mb(m),y=mb(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&&Xb(i,a,o.index,Yb);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]),Xb(i,a,o.index,c),Xb(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&&Xb(i,a,o.index,Yb)}}Object.keys(i).forEach(function(t){e[t].content=Zb(e[t].content,i[t])})}function $b(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!qb.test(e.tokens[t].content)||Qb(e.tokens[t].children,e)}function ex(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 tx=[[`normalize`,Nb],[`block`,Pb],[`inline`,Fb],[`linkify`,Rb],[`replacements`,Kb],[`smartquotes`,$b],[`text_join`,ex]];function nx(){this.ruler=new Ob;for(let e=0;e<tx.length;e++)this.ruler.push(tx[e][0],tx[e][1])}nx.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},nx.prototype.State=Ab;function rx(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(pb(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}rx.prototype.push=function(e,t,n){let r=new kb(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},rx.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},rx.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},rx.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&pb(this.src.charCodeAt(e));e++);return e},rx.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!pb(this.src.charCodeAt(--e)))return e+1;return e},rx.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},rx.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},rx.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(pb(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(``)},rx.prototype.Token=kb;var ix=65536;function ax(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function ox(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 sx(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&&!pb(s)||o===45&&pb(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!pb(t))return!1;a++}let c=ax(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=ax(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=ox(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=ax(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=ox(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>ix))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 cx(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 lx(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 ux(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(pb(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 dx(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&&!pb(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&&!pb(e.src.charCodeAt(r))?-1:r}function px(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),!pb(a))?-1:i}function mx(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 hx(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=px(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=px(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&&mx(e,h),!0}function gx(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(!pb(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(!pb(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&&pb(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&pb(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 _x=`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]*?\\]\\]>)`),yx=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*>)`),bx=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+_x.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(yx.source+`\\s*$`),/^$/,!1]];function xx(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<bx.length&&!bx[s][0].test(o);s++);if(s===bx.length)return!1;if(r)return bx[s][2];let c=t+1,l=bx[s][1].test(``);if(!bx[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),bx[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 Sx(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&&!pb(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&pb(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=bb(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 Cx(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=bb(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 wx(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=bb(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 Tx=[[`table`,sx,[`paragraph`,`reference`]],[`code`,cx],[`fence`,lx,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,ux,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,dx,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,hx,[`paragraph`,`reference`,`blockquote`]],[`reference`,gx],[`html_block`,xx,[`paragraph`,`reference`,`blockquote`]],[`heading`,Sx,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Cx],[`paragraph`,wx]];function Ex(){this.ruler=new Ob;for(let e=0;e<Tx.length;e++)this.ruler.push(Tx[e][0],Tx[e][1],{alt:(Tx[e][2]||[]).slice()})}Ex.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)}},Ex.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)},Ex.prototype.State=rx;function Dx(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}Dx.prototype.pushPending=function(){let e=new kb(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},Dx.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new kb(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},Dx.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=_b(i)||gb(i),l=_b(s)||gb(s),u=mb(i),d=mb(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}},Dx.prototype.Token=kb;function Ox(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 kx(e,t){let n=e.pos;for(;n<e.posMax&&!Ox(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var Ax=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function jx(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(Ax);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 Mx(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&&pb(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Nx=[];for(let e=0;e<256;e++)Nx.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){Nx[e.charCodeAt(0)]=1});function Px(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),pb(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&&Nx[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function Fx(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 Ix(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 Lx(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 Rx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Lx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Lx(e,t[r].delimiters)}var zx={tokenize:Ix,postProcess:Rx};function Bx(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 Vx(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 Hx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Vx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Vx(e,t[r].delimiters)}var Ux={tokenize:Bx,postProcess:Hx};function Wx(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),!(!pb(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),!(!pb(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),!(!pb(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 Gx(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),!(!pb(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),!(!pb(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),!(!pb(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 Kx=/^([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])?)*)$/,qx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Jx(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(qx.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(Kx.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 Yx(e){return/^<a[>\s]/i.test(e)}function Xx(e){return/^<\/a\s*>/i.test(e)}function Zx(e){let t=e|32;return t>=97&&t<=122}function Qx(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&&!Zx(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],Yx(t.content)&&e.linkLevel++,Xx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var $x=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,eS=/^&([a-z][a-z0-9]{1,31});/i;function tS(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($x);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=Qy(t)?$y(t):$y(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(eS);if(r){let n=Wy(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 nS(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 rS(e){let t=e.tokens_meta,n=e.tokens_meta.length;nS(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&nS(t[e].delimiters)}function iS(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 aS=[[`text`,kx],[`linkify`,jx],[`newline`,Mx],[`escape`,Px],[`backticks`,Fx],[`strikethrough`,zx.tokenize],[`emphasis`,Ux.tokenize],[`link`,Wx],[`image`,Gx],[`autolink`,Jx],[`html_inline`,Qx],[`entity`,tS]],oS=[[`balance_pairs`,rS],[`strikethrough`,zx.postProcess],[`emphasis`,Ux.postProcess],[`fragments_join`,iS]];function sS(){this.ruler=new Ob;for(let e=0;e<aS.length;e++)this.ruler.push(aS[e][0],aS[e][1]);this.ruler2=new Ob;for(let e=0;e<oS.length;e++)this.ruler2.push(oS[e][0],oS[e][1])}sS.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},sS.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()},sS.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)},sS.prototype.State=Dx;function cS(e){let t={};e||={},t.src_Any=vy.source,t.src_Cc=yy.source,t.src_Z=Cy.source,t.src_P=xy.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 lS(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function uS(e){return Object.prototype.toString.call(e)}function dS(e){return uS(e)===`[object String]`}function fS(e){return uS(e)===`[object Object]`}function pS(e){return uS(e)===`[object RegExp]`}function mS(e){return uS(e)===`[object Function]`}function hS(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var gS={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function _S(e){return Object.keys(e||{}).reduce(function(e,t){return e||gS.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}}},yS=`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]`,bS=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function xS(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function SS(){return function(e,t){t.normalize(e)}}function CS(e){let t=e.re=cS(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(yS),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)){pS(n.validate)?r.validate=xS(n.validate):mS(n.validate)?r.validate=n.validate:a(t,n),mS(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=SS();return}if(dS(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:SS()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(hS).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 wS(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 TS(e,t){if(!(this instanceof TS))return new TS(e,t);t||_S(e)&&(t=e,e={}),this.__opts__=lS({},gS,t),this.__schemas__=lS({},vS,e),this.__compiled__={},this.__tlds__=bS,this.__tlds_replaced__=!1,this.re={},CS(this)}TS.prototype.add=function(e,t){return this.__schemas__[e]=t,CS(this),this},TS.prototype.set=function(e){return this.__opts__=lS(this.__opts__,e),this},TS.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)},TS.prototype.pretest=function(e){return this.re.pretest.test(e)},TS.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},TS.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 wS(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},TS.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 wS(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},TS.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(),CS(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,CS(this),this)},TS.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},TS.prototype.onCompile=function(){};var ES=2147483647,DS=36,OS=1,kS=26,AS=38,jS=700,MS=72,NS=128,PS=`-`,FS=/^xn--/,IS=/[^\0-\x7F]/,LS=/[\x2E\u3002\uFF0E\uFF61]/g,RS={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},zS=DS-OS,BS=Math.floor,VS=String.fromCharCode;function HS(e){throw RangeError(RS[e])}function US(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function WS(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(LS,`.`);let i=US(e.split(`.`),t).join(`.`);return r+i}function GS(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 KS=e=>String.fromCodePoint(...e),qS=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:DS},JS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},YS=function(e,t,n){let r=0;for(e=n?BS(e/jS):e>>1,e+=BS(e/t);e>455;r+=DS)e=BS(e/zS);return BS(r+36*e/(e+AS))},XS=function(e){let t=[],n=e.length,r=0,i=NS,a=MS,o=e.lastIndexOf(PS);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&HS(`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=DS;;i+=DS){s>=n&&HS(`invalid-input`);let o=qS(e.charCodeAt(s++));o>=DS&&HS(`invalid-input`),o>BS((ES-r)/t)&&HS(`overflow`),r+=o*t;let c=i<=a?OS:i>=a+kS?kS:i-a;if(o<c)break;let l=DS-c;t>BS(ES/l)&&HS(`overflow`),t*=l}let c=t.length+1;a=YS(r-o,c,o==0),BS(r/c)>ES-i&&HS(`overflow`),i+=BS(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},ZS=function(e){let t=[];e=GS(e);let n=e.length,r=NS,i=0,a=MS;for(let n of e)n<128&&t.push(VS(n));let o=t.length,s=o;for(o&&t.push(PS);s<n;){let n=ES;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>BS((ES-i)/c)&&HS(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>ES&&HS(`overflow`),n===r){let e=i;for(let n=DS;;n+=DS){let r=n<=a?OS:n>=a+kS?kS:n-a;if(e<r)break;let i=e-r,o=DS-r;t.push(VS(JS(r+i%o,0))),e=BS(i/o)}t.push(VS(JS(e,0))),a=YS(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},QS={version:`2.3.1`,ucs2:{decode:GS,encode:KS},decode:XS,encode:ZS,toASCII:function(e){return WS(e,function(e){return IS.test(e)?`xn--`+ZS(e):e})},toUnicode:function(e){return WS(e,function(e){return FS.test(e)?XS(e.slice(4).toLowerCase()):e})}},$S={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`]}}}},eC=/^(vbscript|javascript|file|data):/,tC=/^data:image\/(gif|png|jpeg|webp);/;function nC(e){let t=e.trim().toLowerCase();return!eC.test(t)||tC.test(t)}var rC=[`http:`,`https:`,`mailto:`];function iC(e){let t=gy(e,!0);if(t.hostname&&(!t.protocol||rC.indexOf(t.protocol)>=0))try{t.hostname=QS.toASCII(t.hostname)}catch{}return ry(iy(t))}function aC(e){let t=gy(e,!0);if(t.hostname&&(!t.protocol||rC.indexOf(t.protocol)>=0))try{t.hostname=QS.toUnicode(t.hostname)}catch{}return ey(iy(t),ey.defaultChars+`%`)}function oC(e,t){if(!(this instanceof oC))return new oC(e,t);t||qy(e)||(t=e||{},e=`default`),this.inline=new sS,this.block=new Ex,this.core=new nx,this.renderer=new Db,this.linkify=new TS,this.validateLink=nC,this.normalizeLink=iC,this.normalizeLinkText=aC,this.utils=Gy,this.helpers=Xy({},Tb),this.options={},this.configure(e),t&&this.set(t)}oC.prototype.set=function(e){return Xy(this.options,e),this},oC.prototype.configure=function(e){let t=this;if(qy(e)){let t=e;if(e=$S[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},oC.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},oC.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},oC.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},oC.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},oC.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},oC.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},oC.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var sC=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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}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 oe(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 se(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function ce(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 le(e,t){e.relevance===void 0&&(e.relevance=1)}var ue=(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},de=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],fe=`keyword`;function pe(e,t,n=fe){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,pe(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,me(n[0],n[1])]})}}function me(e,t){return t?Number(t):+!he(e)}function he(e){return de.includes(e.toLowerCase())}var ge={},_e=e=>{console.error(e)},ve=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ye=(e,t)=>{ge[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ge[`${e}/${t}`]=!0)},be=Error();function xe(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 Se(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _e(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),be;if(typeof e.beginScope!=`object`||e.beginScope===null)throw _e(`beginScope must be object`),be;xe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Ce(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _e(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),be;if(typeof e.endScope!=`object`||e.endScope===null)throw _e(`endScope must be object`),be;xe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function we(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Te(e){we(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Se(e),Ce(e)}function Ee(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,ce,Te,ue].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[oe,se,le].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&&=pe(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 Oe(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 De(e){return e?e.endsWithParent||De(e.starts):!1}function Oe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:De(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var ke=`11.11.1`,Ae=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},je=i,Me=a,Ne=Symbol(`nomatch`),Pe=7,Fe=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||(ve(s.replace(`{}`,n[1])),ve(`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):(ye(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ye(`10.7.0`,`Please use highlight(code, options) instead.
62
+ `:`>`,i},wb.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},wb.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+=`
63
+ `;break;default:}return r},wb.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 Tb(){this.__rules__=[],this.__cache__=null}Tb.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Tb.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))})})},Tb.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},Tb.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},Tb.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},Tb.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Tb.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},Tb.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Tb.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},Tb.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Eb(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}Eb.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},Eb.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Eb.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},Eb.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},Eb.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 Db(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Db.prototype.Token=Eb;var Ob=/\r\n?|\n/g,kb=/\0/g;function Ab(e){let t;t=e.src.replace(Ob,`
64
+ `),t=t.replace(kb,`�`),e.src=t}function jb(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 Mb(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 Nb(e){return/^<a[>\s]/i.test(e)}function Pb(e){return/^<\/a\s*>/i.test(e)}function Fb(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`&&(Nb(o.content)&&i>0&&i--,Pb(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=Jy(r,a,c)}}}}var Ib=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Lb=/\((c|tm|r)\)/i,Rb=/\((c|tm|r)\)/gi,zb={c:`©`,r:`®`,tm:`™`};function Bb(e,t){return zb[t.toLowerCase()]}function Vb(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(Rb,Bb)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Hb(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&Ib.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 Ub(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(Lb.test(e.tokens[t].content)&&Vb(e.tokens[t].children),Ib.test(e.tokens[t].content)&&Hb(e.tokens[t].children))}var Wb=/['"]/,Gb=/['"]/g,Kb=`’`;function qb(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Jb(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 Yb(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;){Gb.lastIndex=l;let o=Gb.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=mb(m)||pb(m),_=mb(h)||pb(h),v=db(m),y=db(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&&qb(i,a,o.index,Kb);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]),qb(i,a,o.index,c),qb(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&&qb(i,a,o.index,Kb)}}Object.keys(i).forEach(function(t){e[t].content=Jb(e[t].content,i[t])})}function Xb(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!Wb.test(e.tokens[t].content)||Yb(e.tokens[t].children,e)}function Zb(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 Qb=[[`normalize`,Ab],[`block`,jb],[`inline`,Mb],[`linkify`,Fb],[`replacements`,Ub],[`smartquotes`,Xb],[`text_join`,Zb]];function $b(){this.ruler=new Tb;for(let e=0;e<Qb.length;e++)this.ruler.push(Qb[e][0],Qb[e][1])}$b.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},$b.prototype.State=Db;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(ub(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 Eb(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&&ub(this.src.charCodeAt(e));e++);return e},ex.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!ub(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(ub(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=Eb;var tx=65536;function nx(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function rx(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 ix(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&&!ub(s)||o===45&&ub(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!ub(t))return!1;a++}let c=nx(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=nx(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=rx(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=nx(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=rx(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>tx))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 ax(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 ox(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 sx(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(ub(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 cx(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&&!ub(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 lx(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&&!ub(e.src.charCodeAt(r))?-1:r}function ux(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),!ub(a))?-1:i}function dx(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 fx(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=ux(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=lx(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=ux(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=lx(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&&dx(e,h),!0}function px(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(!ub(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(!ub(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&&ub(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&ub(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=hb(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 mx=`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(`.`),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*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),gx=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*>)`),_x=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+mx.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(gx.source+`\\s*$`),/^$/,!1]];function vx(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<_x.length&&!_x[s][0].test(o);s++);if(s===_x.length)return!1;if(r)return _x[s][2];let c=t+1,l=_x[s][1].test(``);if(!_x[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),_x[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 yx(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&&!ub(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&ub(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=_b(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 bx(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=_b(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 xx(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=_b(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 Sx=[[`table`,ix,[`paragraph`,`reference`]],[`code`,ax],[`fence`,ox,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,sx,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,cx,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,fx,[`paragraph`,`reference`,`blockquote`]],[`reference`,px],[`html_block`,vx,[`paragraph`,`reference`,`blockquote`]],[`heading`,yx,[`paragraph`,`reference`,`blockquote`]],[`lheading`,bx],[`paragraph`,xx]];function Cx(){this.ruler=new Tb;for(let e=0;e<Sx.length;e++)this.ruler.push(Sx[e][0],Sx[e][1],{alt:(Sx[e][2]||[]).slice()})}Cx.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)}},Cx.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)},Cx.prototype.State=ex;function wx(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}wx.prototype.pushPending=function(){let e=new Eb(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},wx.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new Eb(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},wx.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=mb(i)||pb(i),l=mb(s)||pb(s),u=db(i),d=db(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}},wx.prototype.Token=Eb;function Tx(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 Ex(e,t){let n=e.pos;for(;n<e.posMax&&!Tx(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var Dx=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Ox(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(Dx);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 kx(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&&ub(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Ax=[];for(let e=0;e<256;e++)Ax.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){Ax[e.charCodeAt(0)]=1});function jx(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),ub(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&&Ax[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function Mx(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 Nx(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 Px(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 Fx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Px(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Px(e,t[r].delimiters)}var Ix={tokenize:Nx,postProcess:Fx};function Lx(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 Rx(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 zx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Rx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Rx(e,t[r].delimiters)}var Bx={tokenize:Lx,postProcess:zx};function Vx(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),!(!ub(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),!(!ub(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),!(!ub(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[hb(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 Hx(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),!(!ub(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),!(!ub(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),!(!ub(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[hb(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 Ux=/^([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])?)*)$/,Wx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Gx(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(Wx.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(Ux.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 Kx(e){return/^<a[>\s]/i.test(e)}function qx(e){return/^<\/a\s*>/i.test(e)}function Jx(e){let t=e|32;return t>=97&&t<=122}function Yx(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&&!Jx(i))return!1;let a=e.src.slice(r).match(hx);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],Kx(t.content)&&e.linkLevel++,qx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var Xx=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Zx=/^&([a-z][a-z0-9]{1,31});/i;function Qx(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(Xx);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=Yy(t)?Xy(t):Xy(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(Zx);if(r){let n=Vy(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 $x(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;$x(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&$x(t[e].delimiters)}function tS(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 nS=[[`text`,Ex],[`linkify`,Ox],[`newline`,kx],[`escape`,jx],[`backticks`,Mx],[`strikethrough`,Ix.tokenize],[`emphasis`,Bx.tokenize],[`link`,Vx],[`image`,Hx],[`autolink`,Gx],[`html_inline`,Yx],[`entity`,Qx]],rS=[[`balance_pairs`,eS],[`strikethrough`,Ix.postProcess],[`emphasis`,Bx.postProcess],[`fragments_join`,tS]];function iS(){this.ruler=new Tb;for(let e=0;e<nS.length;e++)this.ruler.push(nS[e][0],nS[e][1]);this.ruler2=new Tb;for(let e=0;e<rS.length;e++)this.ruler2.push(rS[e][0],rS[e][1])}iS.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},iS.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()},iS.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)},iS.prototype.State=wx;function aS(e){let t={};e||={},t.src_Any=hy.source,t.src_Cc=gy.source,t.src_Z=by.source,t.src_P=vy.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 oS(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function sS(e){return Object.prototype.toString.call(e)}function cS(e){return sS(e)===`[object String]`}function lS(e){return sS(e)===`[object Object]`}function uS(e){return sS(e)===`[object RegExp]`}function dS(e){return sS(e)===`[object Function]`}function fS(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var pS={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function mS(e){return Object.keys(e||{}).reduce(function(e,t){return e||pS.hasOwnProperty(t)},!1)}var hS={"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}}},gS=`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]`,_S=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function vS(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function yS(){return function(e,t){t.normalize(e)}}function bS(e){let t=e.re=aS(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(gS),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,lS(n)){uS(n.validate)?r.validate=vS(n.validate):dS(n.validate)?r.validate=n.validate:a(t,n),dS(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=yS();return}if(cS(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:yS()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(fS).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 xS(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 SS(e,t){if(!(this instanceof SS))return new SS(e,t);t||mS(e)&&(t=e,e={}),this.__opts__=oS({},pS,t),this.__schemas__=oS({},hS,e),this.__compiled__={},this.__tlds__=_S,this.__tlds_replaced__=!1,this.re={},bS(this)}SS.prototype.add=function(e,t){return this.__schemas__[e]=t,bS(this),this},SS.prototype.set=function(e){return this.__opts__=oS(this.__opts__,e),this},SS.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)},SS.prototype.pretest=function(e){return this.re.pretest.test(e)},SS.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},SS.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 xS(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},SS.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 xS(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},SS.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(),bS(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,bS(this),this)},SS.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},SS.prototype.onCompile=function(){};var CS=2147483647,wS=36,TS=1,ES=26,DS=38,OS=700,kS=72,AS=128,jS=`-`,MS=/^xn--/,NS=/[^\0-\x7F]/,PS=/[\x2E\u3002\uFF0E\uFF61]/g,FS={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},IS=wS-TS,LS=Math.floor,RS=String.fromCharCode;function zS(e){throw RangeError(FS[e])}function BS(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function VS(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(PS,`.`);let i=BS(e.split(`.`),t).join(`.`);return r+i}function HS(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 US=e=>String.fromCodePoint(...e),WS=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:wS},GS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},KS=function(e,t,n){let r=0;for(e=n?LS(e/OS):e>>1,e+=LS(e/t);e>455;r+=wS)e=LS(e/IS);return LS(r+36*e/(e+DS))},qS=function(e){let t=[],n=e.length,r=0,i=AS,a=kS,o=e.lastIndexOf(jS);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&zS(`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=wS;;i+=wS){s>=n&&zS(`invalid-input`);let o=WS(e.charCodeAt(s++));o>=wS&&zS(`invalid-input`),o>LS((CS-r)/t)&&zS(`overflow`),r+=o*t;let c=i<=a?TS:i>=a+ES?ES:i-a;if(o<c)break;let l=wS-c;t>LS(CS/l)&&zS(`overflow`),t*=l}let c=t.length+1;a=KS(r-o,c,o==0),LS(r/c)>CS-i&&zS(`overflow`),i+=LS(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},JS=function(e){let t=[];e=HS(e);let n=e.length,r=AS,i=0,a=kS;for(let n of e)n<128&&t.push(RS(n));let o=t.length,s=o;for(o&&t.push(jS);s<n;){let n=CS;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>LS((CS-i)/c)&&zS(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>CS&&zS(`overflow`),n===r){let e=i;for(let n=wS;;n+=wS){let r=n<=a?TS:n>=a+ES?ES:n-a;if(e<r)break;let i=e-r,o=wS-r;t.push(RS(GS(r+i%o,0))),e=LS(i/o)}t.push(RS(GS(e,0))),a=KS(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},YS={version:`2.3.1`,ucs2:{decode:HS,encode:US},decode:qS,encode:JS,toASCII:function(e){return VS(e,function(e){return NS.test(e)?`xn--`+JS(e):e})},toUnicode:function(e){return VS(e,function(e){return MS.test(e)?qS(e.slice(4).toLowerCase()):e})}},XS={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`]}}}},ZS=/^(vbscript|javascript|file|data):/,QS=/^data:image\/(gif|png|jpeg|webp);/;function $S(e){let t=e.trim().toLowerCase();return!ZS.test(t)||QS.test(t)}var eC=[`http:`,`https:`,`mailto:`];function tC(e){let t=py(e,!0);if(t.hostname&&(!t.protocol||eC.indexOf(t.protocol)>=0))try{t.hostname=YS.toASCII(t.hostname)}catch{}return ey(ty(t))}function nC(e){let t=py(e,!0);if(t.hostname&&(!t.protocol||eC.indexOf(t.protocol)>=0))try{t.hostname=YS.toUnicode(t.hostname)}catch{}return Zv(ty(t),Zv.defaultChars+`%`)}function rC(e,t){if(!(this instanceof rC))return new rC(e,t);t||Wy(e)||(t=e||{},e=`default`),this.inline=new iS,this.block=new Cx,this.core=new $b,this.renderer=new wb,this.linkify=new SS,this.validateLink=$S,this.normalizeLink=tC,this.normalizeLinkText=nC,this.utils=Hy,this.helpers=qy({},Sb),this.options={},this.configure(e),t&&this.set(t)}rC.prototype.set=function(e){return qy(this.options,e),this},rC.prototype.configure=function(e){let t=this;if(Wy(e)){let t=e;if(e=XS[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},rC.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},rC.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},rC.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},rC.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},rC.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},rC.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},rC.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var iC=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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}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 oe(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 se(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function ce(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 le(e,t){e.relevance===void 0&&(e.relevance=1)}var ue=(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},de=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],fe=`keyword`;function pe(e,t,n=fe){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,pe(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,me(n[0],n[1])]})}}function me(e,t){return t?Number(t):+!he(e)}function he(e){return de.includes(e.toLowerCase())}var ge={},_e=e=>{console.error(e)},ve=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ye=(e,t)=>{ge[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ge[`${e}/${t}`]=!0)},be=Error();function xe(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 Se(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _e(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),be;if(typeof e.beginScope!=`object`||e.beginScope===null)throw _e(`beginScope must be object`),be;xe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Ce(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _e(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),be;if(typeof e.endScope!=`object`||e.endScope===null)throw _e(`endScope must be object`),be;xe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function we(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Te(e){we(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Se(e),Ce(e)}function Ee(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,ce,Te,ue].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[oe,se,le].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&&=pe(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 Oe(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 De(e){return e?e.endsWithParent||De(e.starts):!1}function Oe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:De(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var ke=`11.11.1`,Ae=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},je=i,Me=a,Ne=Symbol(`nomatch`),Pe=7,Fe=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||(ve(s.replace(`{}`,n[1])),ve(`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):(ye(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ye(`10.7.0`,`Please use highlight(code, options) instead.
66
66
  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]<=Pe&&(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 Ne;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!==Ne)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 _e(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Ee(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:je(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:je(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:je(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 Ae(`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=Me(l,e)}let E=()=>{k(),ye(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ye(`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(_e(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)_e(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 ye(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ye(`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:Me,addPlugin:I,removePlugin:te}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=ke,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},Ie=Fe({});Ie.newInstance=()=>Fe({}),t.exports=Ie,Ie.HighlightJS=Ie,Ie.default=Ie}))()).default,cC=`[A-Za-z$_][0-9A-Za-z$_]*`,lC=`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`],dC=`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`],pC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],mC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],hC=[].concat(pC,dC,fC);function gC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=cC,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:cC,keyword:lC,literal:uC,built_in:hC,"variable.language":mC},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:{_:[...dC,...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([...pC,`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 _C(e){let t=e.regex,n=gC(e),r=cC,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:cC,keyword:lC.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:uC,built_in:hC.concat(i),"variable.language":mC},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$_]*`,yC=`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(`.`),bC=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],xC=`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(`.`),SC=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],CC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],wC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],TC=[].concat(CC,xC,SC);function EC(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:yC,literal:bC,built_in:TC,"variable.language":wC},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:{_:[...xC,...SC]}},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([...CC,`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 DC(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 OC(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 kC(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function AC(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 jC(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 MC(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 NC=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_-]*/}}),PC=`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(`.`),FC=`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(`.`),IC=[...PC,...FC],LC=`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(),RC=`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(),zC=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),BC=`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 VC(e){let t=e.regex,n=NC(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:`:(`+RC.join(`|`)+`)`},{begin:`:(:)?(`+zC.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+BC.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:LC.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+IC.join(`|`)+`)\\b`}]}}function HC(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 UC(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 WC(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function GC(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 KC(e){if(Array.isArray(e))return e}function qC(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 JC(){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 YC(e,t){return KC(e)||qC(e,t)||XC(e,t)||JC()}function XC(e,t){if(e){if(typeof e==`string`)return GC(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)?GC(e,t):void 0}}var ZC=Object.entries,QC=Object.setPrototypeOf,$C=Object.isFrozen,ew=Object.getPrototypeOf,tw=Object.getOwnPropertyDescriptor,nw=Object.freeze,rw=Object.seal,iw=Object.create,aw=typeof Reflect<`u`&&Reflect,ow=aw.apply,sw=aw.construct;nw||=function(e){return e},rw||=function(e){return e},ow||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},sw||=function(e){return new e(...[...arguments].slice(1))};var cw=Ow(Array.prototype.forEach),lw=Ow(Array.prototype.lastIndexOf),uw=Ow(Array.prototype.pop),dw=Ow(Array.prototype.push),fw=Ow(Array.prototype.splice),pw=Array.isArray,mw=Ow(String.prototype.toLowerCase),hw=Ow(String.prototype.toString),gw=Ow(String.prototype.match),_w=Ow(String.prototype.replace),vw=Ow(String.prototype.indexOf),yw=Ow(String.prototype.trim),bw=Ow(Number.prototype.toString),xw=Ow(Boolean.prototype.toString),Sw=typeof BigInt>`u`?null:Ow(BigInt.prototype.toString),Cw=typeof Symbol>`u`?null:Ow(Symbol.prototype.toString),ww=Ow(Object.prototype.hasOwnProperty),Tw=Ow(Object.prototype.toString),Ew=Ow(RegExp.prototype.test),Dw=kw(TypeError);function Ow(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ow(e,t,n)}}function kw(e){return function(){return sw(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mw;if(QC&&QC(e,null),!pw(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&($C(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Aw(e){for(let t=0;t<e.length;t++)ww(e,t)||(e[t]=null);return e}function jw(e){let t=iw(null);for(let r of ZC(e)){var n=YC(r,2);let i=n[0],a=n[1];ww(e,i)&&(pw(a)?t[i]=Aw(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=jw(a):t[i]=a)}return t}function Mw(e){switch(typeof e){case`string`:return e;case`number`:return bw(e);case`boolean`:return xw(e);case`bigint`:return Sw?Sw(e):`0`;case`symbol`:return Cw?Cw(e):`Symbol()`;case`undefined`:return Tw(e);case`function`:case`object`:{if(e===null)return Tw(e);let t=e,n=Nw(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Tw(e)}return Tw(e)}default:return Tw(e)}}function Nw(e,t){for(;e!==null;){let n=tw(e,t);if(n){if(n.get)return Ow(n.get);if(typeof n.value==`function`)return Ow(n.value)}e=ew(e)}function n(){return null}return n}function Pw(e){try{return Ew(e,``),!0}catch{return!1}}var Fw=nw(`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(`.`)),Iw=nw(`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(`.`)),Lw=nw([`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`]),Rw=nw([`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`]),zw=nw(`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(`.`)),Bw=nw([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Vw=nw([`#text`]),Hw=nw(`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(`.`)),Uw=nw(`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(`.`)),Ww=nw(`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(`.`)),Gw=nw([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Kw=rw(/{{[\w\W]*|^[\w\W]*}}/g),qw=rw(/<%[\w\W]*|^[\w\W]*%>/g),Jw=rw(/\${[\w\W]*/g),Yw=rw(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xw=rw(/^aria-[\-\w]+$/),Zw=rw(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qw=rw(/^(?:\w+script|data):/i),$w=rw(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eT=rw(/^html$/i),tT=rw(/^[a-z][.\w]*(-[.\w]+)+$/i),nT=rw(/<[/\w!]/g),rT=rw(/<[/\w]/g),iT=rw(/<\/no(script|embed|frames)/i),aT=rw(/\/>/i),oT={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},sT=function(){return typeof window>`u`?null:window},cT=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}},lT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},uT=function(e,t,n,r){return ww(e,t)&&pw(e[t])?$(r.base?jw(r.base):{},e[t],r.transform):n};function dT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:sT(),t=e=>dT(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==oT.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=Nw(d,`cloneNode`),p=Nw(d,`remove`),m=Nw(d,`nextSibling`),h=Nw(d,`childNodes`),g=Nw(d,`parentNode`),_=Nw(d,`shadowRoot`),v=Nw(d,`attributes`),y=o&&o.prototype?Nw(o.prototype,`nodeType`):null,b=o&&o.prototype?Nw(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 Dw(`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=cT(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,ee=A.createDocumentFragment,N=A.getElementsByTagName,P=r.importNode,F=lT();t.isSupported=typeof ZC==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let I=Kw,te=qw,ne=Jw,re=Yw,ie=Xw,ae=Qw,oe=$w,se=tT,ce=Zw,le=null,ue=$({},[...Fw,...Iw,...Lw,...zw,...Vw]),de=null,fe=$({},[...Hw,...Uw,...Ww,...Gw]),pe=Object.seal(iw(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}})),me=null,he=null,ge=Object.seal(iw(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_e=!0,ve=!0,ye=!1,be=!0,xe=!1,Se=!0,Ce=!1,we=!1,Te=null,Ee=null,De=!1,Oe=!1,ke=!1,Ae=!1,je=!0,Me=!1,Ne=`user-content-`,Pe=!0,Fe=!1,Ie={},Le=null,Re=$({},`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(`.`)),ze=null,Be=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ve=null,He=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ue=`http://www.w3.org/1998/Math/MathML`,We=`http://www.w3.org/2000/svg`,Ge=`http://www.w3.org/1999/xhtml`,Ke=Ge,qe=!1,Je=null,Ye=$({},[Ue,We,Ge],hw),Xe=nw([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ze=$({},Xe),Qe=nw([`annotation-xml`]),$e=$({},Qe),et=$({},[`title`,`style`,`font`,`a`,`script`]),tt=null,nt=[`application/xhtml+xml`,`text/html`],rt=null,it=null,at=n.createElement(`form`),ot=function(e){return e instanceof RegExp||e instanceof Function},st=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(it&&it===e)return;(!e||typeof e!=`object`)&&(e={}),e=jw(e),tt=nt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,rt=tt===`application/xhtml+xml`?hw:mw,le=uT(e,`ALLOWED_TAGS`,ue,{transform:rt}),de=uT(e,`ALLOWED_ATTR`,fe,{transform:rt}),Je=uT(e,`ALLOWED_NAMESPACES`,Ye,{transform:hw}),Ve=uT(e,`ADD_URI_SAFE_ATTR`,He,{transform:rt,base:He}),ze=uT(e,`ADD_DATA_URI_TAGS`,Be,{transform:rt,base:Be}),Le=uT(e,`FORBID_CONTENTS`,Re,{transform:rt}),me=uT(e,`FORBID_TAGS`,jw({}),{transform:rt}),he=uT(e,`FORBID_ATTR`,jw({}),{transform:rt}),Ie=ww(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?jw(e.USE_PROFILES):e.USE_PROFILES:!1,_e=e.ALLOW_ARIA_ATTR!==!1,ve=e.ALLOW_DATA_ATTR!==!1,ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,Ce=e.WHOLE_DOCUMENT||!1,Oe=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Ae=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,je=e.SANITIZE_DOM!==!1,Me=e.SANITIZE_NAMED_PROPS||!1,Pe=e.KEEP_CONTENT!==!1,Fe=e.IN_PLACE||!1,ce=Pw(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Zw,Ke=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ge,Ze=ww(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?jw(e.MATHML_TEXT_INTEGRATION_POINTS):$({},Xe),$e=ww(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?jw(e.HTML_INTEGRATION_POINTS):$({},Qe);let t=ww(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?jw(e.CUSTOM_ELEMENT_HANDLING):iw(null);if(pe=iw(null),ww(t,`tagNameCheck`)&&ot(t.tagNameCheck)&&(pe.tagNameCheck=t.tagNameCheck),ww(t,`attributeNameCheck`)&&ot(t.attributeNameCheck)&&(pe.attributeNameCheck=t.attributeNameCheck),ww(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),rw(pe),xe&&(ve=!1),ke&&(Oe=!0),Ie&&(le=$({},Vw),de=iw(null),Ie.html===!0&&($(le,Fw),$(de,Hw)),Ie.svg===!0&&($(le,Iw),$(de,Uw),$(de,Gw)),Ie.svgFilters===!0&&($(le,Lw),$(de,Uw),$(de,Gw)),Ie.mathMl===!0&&($(le,zw),$(de,Ww),$(de,Gw))),ge.tagCheck=null,ge.attributeCheck=null,ww(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ge.tagCheck=e.ADD_TAGS:pw(e.ADD_TAGS)&&(le===ue&&(le=jw(le)),$(le,e.ADD_TAGS,rt))),ww(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ge.attributeCheck=e.ADD_ATTR:pw(e.ADD_ATTR)&&(de===fe&&(de=jw(de)),$(de,e.ADD_ATTR,rt))),ww(e,`ADD_URI_SAFE_ATTR`)&&pw(e.ADD_URI_SAFE_ATTR)&&$(Ve,e.ADD_URI_SAFE_ATTR,rt),ww(e,`FORBID_CONTENTS`)&&pw(e.FORBID_CONTENTS)&&(Le===Re&&(Le=jw(Le)),$(Le,e.FORBID_CONTENTS,rt)),ww(e,`ADD_FORBID_CONTENTS`)&&pw(e.ADD_FORBID_CONTENTS)&&(Le===Re&&(Le=jw(Le)),$(Le,e.ADD_FORBID_CONTENTS,rt)),Pe&&(le[`#text`]=!0),Ce&&$(le,[`html`,`head`,`body`]),le.table&&($(le,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Dw(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Dw(`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(``)));nw&&nw(e),it=e},ct=$({},[...Iw,...Lw,...Rw]),lt=$({},[...zw,...Bw]),ut=function(e,t,n){return t.namespaceURI===Ge?e===`svg`:t.namespaceURI===Ue?e===`svg`&&(n===`annotation-xml`||Ze[n]):!!ct[e]},dt=function(e,t,n){return t.namespaceURI===Ge?e===`math`:t.namespaceURI===We?e===`math`&&$e[n]:!!lt[e]},ft=function(e,t,n){return t.namespaceURI===We&&!$e[n]||t.namespaceURI===Ue&&!Ze[n]?!1:!lt[e]&&(et[e]||!ct[e])},pt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ke,tagName:`template`});let n=mw(e.tagName),r=mw(t.tagName);return Je[e.namespaceURI]?e.namespaceURI===We?ut(n,t,r):e.namespaceURI===Ue?dt(n,t,r):e.namespaceURI===Ge?ft(n,t,r):!!(tt===`application/xhtml+xml`&&Je[e.namespaceURI]):!1},mt=function(e){dw(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw Dw(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ht=function(e){vt(e);let t=h(e);if(t){let e=[];cw(t,t=>{dw(e,t)}),cw(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{}}},gt=function(e,n){try{dw(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{dw(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Oe||ke)try{mt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},_t=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`||de[rt(i)]))try{e.removeAttribute(i)}catch{}}},vt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===oT.element&&_t(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},yt=function(e){if(!Se)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===oT.processingInstruction||n===oT.comment&&Ew(rT,e.data)){try{p(e)}catch{}continue}if(n===oT.element){let t=e,n=rt(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])}},bt=function(e){let t=null,r=null;if(De)e=`<remove></remove>`+e;else{let t=gw(e,/^[\r\n\t ]+/);r=t&&t[0]}tt===`application/xhtml+xml`&&Ke===Ge&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(Ke===Ge)try{t=new l().parseFromString(i,tt)}catch{}if(!t||!t.documentElement){t=j.createDocument(Ke,`template`,null);try{t.documentElement.innerHTML=qe?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ke===Ge?N.call(t,Ce?`html`:`body`)[0]:Ce?t.documentElement:a},xt=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)},St=function(e){return e=_w(e,I,` `),e=_w(e,te,` `),e=_w(e,ne,` `),e},Ct=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=St(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&cw(r,e=>{Tt(e.content)&&Ct(e.content)})},wt=function(e){let t=b?b(e):null;return typeof t!=`string`||rt(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)},Tt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===oT.documentFragment}catch{return!1}},Et=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Dt(e,n,r){e.length!==0&&cw(e,e=>{e.call(t,n,r,it)})}let Ot=function(e,t){return!!(Se&&e.hasChildNodes()&&!Et(e.firstElementChild)&&Ew(nT,e.textContent)&&Ew(nT,e.innerHTML)||Se&&e.namespaceURI===Ge&&t===`style`&&Et(e.firstElementChild)||e.nodeType===oT.processingInstruction||Se&&e.nodeType===oT.comment&&Ew(rT,e.data))},kt=function(e,t){if(!me[t]&&Nt(t)&&(pe.tagNameCheck instanceof RegExp&&Ew(pe.tagNameCheck,t)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(t)))return!1;if(Pe&&!Le[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=Fe?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return mt(e),!0},At=function(e,n){if(Dt(F.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(wt(e))return mt(e),!0;let r=rt(b?b(e):e.nodeName);if(Dt(F.uponSanitizeElement,e,{tagName:r,allowedTags:le}),e!==n&&g(e)===null)return!0;if(Ot(e,r))return mt(e),!0;if(me[r]||!(ge.tagCheck instanceof Function&&ge.tagCheck(r))&&!le[r]){let t=kt(e,r);return t===!1&&Dt(F.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===oT.element&&!pt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ew(iT,e.innerHTML))return mt(e),!0;if(xe&&e.nodeType===oT.text){let n=St(e.textContent);e.textContent!==n&&(dw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Dt(F.afterSanitizeElements,e,null),!1},jt=function(e,t,r){if(he[t]||Se&&t===`patchsrc`||Se&&t===`for`&&e!==`label`&&e!==`output`||je&&(t===`id`||t===`name`)&&(r in n||r in at))return!1;let i=de[t]||ge.attributeCheck instanceof Function&&ge.attributeCheck(t,e);if(!(ve&&Ew(re,t))&&!(_e&&Ew(ie,t))){if(!i){if(!(Nt(e)&&(pe.tagNameCheck instanceof RegExp&&Ew(pe.tagNameCheck,e)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(e))&&(pe.attributeNameCheck instanceof RegExp&&Ew(pe.attributeNameCheck,t)||pe.attributeNameCheck instanceof Function&&pe.attributeNameCheck(t,e))||t===`is`&&pe.allowCustomizedBuiltInElements&&(pe.tagNameCheck instanceof RegExp&&Ew(pe.tagNameCheck,r)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(r))))return!1}else if(!Ve[t]&&!Ew(ce,_w(r,oe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&vw(r,`data:`)===0&&ze[e])&&!(ye&&!Ew(ae,_w(r,oe,``)))&&r)return!1}return!0},Mt=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Nt=function(e){return!Mt[mw(e)]&&Ew(se,e)},Pt=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},Ft=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),wt(e)?mt(e):uw(t.removed)}catch{gt(n,e)}},It=function(e){Dt(F.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||wt(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0},r=t.length,i=rt(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=rt(o),u=c,d=o===`value`?u:yw(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Dt(F.uponSanitizeAttribute,e,n),d=n.attrValue,Me&&(l===`id`||l===`name`)&&vw(d,Ne)!==0&&(gt(o,e),d=Ne+d),Se&&Ew(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){gt(o,e);continue}if(l===`attributename`&&gw(d,`href`)){gt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){gt(o,e);continue}if(!be&&Ew(aT,d)){gt(o,e);continue}if(xe&&(d=St(d)),!jt(i,l,d)){gt(o,e);continue}d=Pt(i,l,s,d),d!==u&&Ft(e,o,s,d)}}Dt(F.afterSanitizeAttributes,e,null)},Lt=function(e){let t=null,n=xt(e);for(Dt(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Dt(F.uponSanitizeShadowNode,t,null),At(t,e),It(t),Tt(t.content)&&Lt(t.content),(y?y(t):t.nodeType)===oT.element){let e=_(t);Tt(e)&&(Rt(e),Lt(e))}Dt(F.afterSanitizeShadowDOM,e,null)},Rt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Lt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===oT.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`&&rt(e)===`template`){let e=n.content;Tt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Tt(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(qe=!e,qe&&(e=`<!-->`),typeof e!=`string`&&!Et(e)&&(e=Mw(e),typeof e!=`string`))throw Dw(`dirty is not a string, aborting`);if(!t.isSupported)return e;we?(le=Te,de=Ee):st(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(le=jw(le)),F.uponSanitizeAttribute.length>0&&(de=jw(de)),t.removed=[];let c=Fe&&typeof e!=`string`&&Et(e);if(c){yt(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=rt(t);if(!le[n]||me[n])throw ht(e),Dw(`root node is forbidden and cannot be sanitized in-place`)}if(wt(e))throw ht(e),Dw(`root node is clobbered and cannot be sanitized in-place`);try{Rt(e)}catch(t){throw ht(e),t}}else if(Et(e))i=bt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===oT.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Rt(a);else{if(!Oe&&!xe&&!Ce&&e.indexOf(`<`)===-1)return x&&Ae?D(e):e;if(i=bt(e),!i)return Oe?null:Ae?S:``}i&&De&&mt(i.firstChild);let l=c?e:i,u=xt(l);try{for(;o=u.nextNode();)At(o,l),It(o),Tt(o.content)&&Lt(o.content)}catch(n){throw c&&(ht(e),cw(t.removed,e=>{e.element&&vt(e.element)})),n}if(c)return cw(t.removed,e=>{e.element&&vt(e.element)}),xe&&Ct(e),e;if(Oe){if(xe&&Ct(i),ke)for(s=ee.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(de.shadowroot||de.shadowrootmode)&&(s=P.call(r,s,!0)),s}let d=Ce?i.outerHTML:i.innerHTML;return Ce&&le[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ew(eT,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
69
- `+d),xe&&(d=St(d)),x&&Ae?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};st(e),we=!0,Te=le,Ee=de},t.clearConfig=function(){it=null,we=!1,Te=null,Ee=null,x=C,S=``},t.isValidAttribute=function(e,t,n){it||st({});let r=rt(e),i=rt(t);return jt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&ww(F,e)&&dw(F[e],t)},t.removeHook=function(e,t){if(ww(F,e)){if(t!==void 0){let n=lw(F[e],t);return n===-1?void 0:fw(F[e],n,1)[0]}return uw(F[e])}},t.removeHooks=function(e){ww(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=lT()},t}var fT=dT(),pT=null;function mT(){return pT||(pT=fT(globalThis.window??globalThis),pT.addHook(`afterSanitizeAttributes`,e=>{let t=e;t.tagName===`A`&&t.getAttribute?.(`target`)&&t.setAttribute(`rel`,`noopener noreferrer`)}),pT)}function hT(e){return mT().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 gT(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var _T=!1;function vT(){_T||(_T=!0,sC.registerLanguage(`typescript`,_C),sC.registerLanguage(`javascript`,EC),sC.registerLanguage(`json`,DC),sC.registerLanguage(`bash`,OC),sC.registerLanguage(`shell`,kC),sC.registerLanguage(`python`,AC),sC.registerLanguage(`diff`,jC),sC.registerLanguage(`xml`,MC),sC.registerLanguage(`css`,VC),sC.registerLanguage(`markdown`,HC),sC.registerLanguage(`yaml`,UC),sC.registerLanguage(`plaintext`,WC),sC.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),sC.registerAliases([`js`,`jsx`,`mjs`,`cjs`],{languageName:`javascript`}),sC.registerAliases([`sh`,`zsh`,`console`],{languageName:`bash`}),sC.registerAliases([`py`],{languageName:`python`}),sC.registerAliases([`html`,`xhtml`,`svg`],{languageName:`xml`}),sC.registerAliases([`yml`],{languageName:`yaml`}),sC.registerAliases([`md`],{languageName:`markdown`}),sC.registerAliases([`text`,`txt`],{languageName:`plaintext`}))}function yT(e,t){if(vT(),t&&sC.getLanguage(t))try{return sC.highlight(e,{language:t,ignoreIllegals:!0}).value}catch{}return bT.utils.escapeHtml(e)}var bT=new oC({html:!1,linkify:!0,breaks:!1,highlight(e,t){let n=yT(e,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return`<pre class="hljs"><code class="${bT.utils.escapeHtml(r)}">${n}</code></pre>`}});function xT(e){return vT(),hT(bT.render(e??``))}function ST(e,t){vT();let n=yT(e??``,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return hT(`<pre class="hljs"><code class="${bT.utils.escapeHtml(r)}">${n}</code></pre>`)}var CT=`crtr:transcript-detail`,wT=[`focused`,`standard`,`verbose`];function TT(){try{let e=localStorage.getItem(CT);if(e===`focused`||e===`standard`||e===`verbose`)return e}catch{}return`standard`}var ET=TT(),DT=new Set;function OT(){for(let e of DT)e()}function kT(e){if(e!==ET){ET=e;try{localStorage.setItem(CT,e)}catch{}OT()}}function AT(){kT(wT[(wT.indexOf(ET)+1)%wT.length])}function jT(e){return DT.add(e),()=>{DT.delete(e)}}typeof window<`u`&&window.addEventListener(`storage`,e=>{if(e.key!==CT)return;let t=TT();t!==ET&&(ET=t,OT())});function MT(){return(0,v.useSyncExternalStore)(jT,()=>ET,()=>ET)}var NT=[`[&_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(` `),PT={focused:`leading-relaxed`,standard:`leading-relaxed`,verbose:`leading-relaxed`};function FT({text:e,inProgress:t}){let n=(0,v.useMemo)(()=>t?``:xT(e??``),[t,e]),r=PT[MT()];return(0,L.jsx)(`div`,{className:J(`prose`,r),children:t?(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:gT(e??``)}}):(0,L.jsx)(`div`,{className:J(NT,r),dangerouslySetInnerHTML:{__html:n}})})}function IT({thinking:e,inProgress:t}){let n=MT(),[r,i]=(0,v.useState)(!1),a=t||r||n===`verbose`,o=n===`focused`?`Thought`:`Thinking`;return(0,L.jsxs)(`div`,{className:J(`thinking`,a&&`open`),children:[(0,L.jsxs)(`div`,{className:`think-toggle`,onClick:()=>i(e=>!e),children:[o,t?`…`:``]}),(0,L.jsx)(`div`,{className:`think-body whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:gT(e)}})]})}var LT=new Set([`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`,`image/svg+xml`,`image/avif`,`image/bmp`]);function RT({image:e}){let t=(e.mimeType||``).toLowerCase();return(0,L.jsx)(`img`,{className:`block max-w-[min(100%,520px)] max-h-[26rem] rounded-md my-1.5 object-contain`,src:`data:${LT.has(t)?t:`image/png`};base64,${e.data??``}`,alt:`image content`,loading:`lazy`,decoding:`async`})}var zT=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 BT(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 zT.has(i)}function VT(e){let t=/\/[a-zA-Z0-9_.\-/]+\.[a-zA-Z0-9]+/g,n=[],r;for(;(r=t.exec(e))!==null;)BT(r[0])&&n.push(r[0]);return[...new Set(n)]}var HT=(0,v.createContext)({peekedPath:null,onPeek:()=>{}});function UT(){return(0,v.useContext)(HT)}var WT=`[&_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`,GT=`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,KT=`px-3 py-2 opacity-50 text-xs italic`,qT={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 JT(e){return qT[(e||``).toLowerCase()]??`◆`}var YT={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 XT(e){return YT[(e||``).toLowerCase()]??`other`}function ZT(e){return e?e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``):``}function QT(e){return e?e.content.filter(e=>e.type===`image`):[]}function $T(e){if(!e||Object.keys(e).length===0)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function eE(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 tE({call:e,subtitle:t,inProgress:n,isError:r,children:i}){let a=t??eE(e),o=e.name,s=MT(),{peekedPath:c,onPeek:l}=UT(),u=s===`verbose`||s===`standard`&&n,[d,f]=(0,v.useState)(null),p=d??u;return(0,L.jsxs)(`div`,{className:J(`tool`,p&&`open`,r&&`tool-error`),"data-fam":XT(e.name),children:[(0,L.jsxs)(`div`,{className:`tool-head`,onClick:()=>f(!p),children:[(0,L.jsx)(`span`,{className:`tool-glyph`,children:JT(e.name)}),(0,L.jsx)(`span`,{className:`tool-name`,children:o}),a&&(0,L.jsx)(`span`,{className:`tool-arg`,children:BT(a)?(0,L.jsx)(`span`,{className:J(`filelink`,c===a&&`peeked`),onClick:e=>{e.stopPropagation(),l(a)},children:a}):a}),(0,L.jsx)(`span`,{className:`ml-auto shrink-0 flex items-center`,children:(0,L.jsx)(`span`,{className:J(`dot`,n?`active`:r?`error`:`done`),title:n?`running`:r?`error`:`done`,"aria-label":n?`running`:r?`error`:`done`})}),(0,L.jsx)(Tf,{className:J(`size-3.5 text-[var(--dim)] transition-transform`,!p&&`-rotate-90`)})]}),(0,L.jsx)(`div`,{className:`tool-body`,children:i})]})}function nE({result:e}){let t=QT(e);return t.length===0?null:(0,L.jsx)(L.Fragment,{children:t.map((e,t)=>(0,L.jsx)(`div`,{className:`px-3 py-1`,children:(0,L.jsx)(RT,{image:e})},t))})}function rE(e){let t=e.command??e.cmd??e.script;return typeof t==`string`?t:``}function iE(e){let t=rE(e.call.arguments??{}),n=ZT(e.result),r=e.inProgress,i=e.isError;return(0,L.jsxs)(tE,{call:e.call,subtitle:``,inProgress:r,isError:i,children:[(0,L.jsxs)(`pre`,{className:J(GT,i&&`text-[#ff9b8a]`),children:[t&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{style:{opacity:.6},children:`$ `}),(0,L.jsx)(`span`,{dangerouslySetInnerHTML:{__html:gT(t)}}),`
70
- `]}),(0,L.jsx)(`span`,{dangerouslySetInnerHTML:{__html:gT(n)}}),r&&(0,L.jsx)(`span`,{className:`inline-block size-2 rounded-full bg-[#7fb3ff] ml-1.5 animate-pulse`})]}),(0,L.jsx)(nE,{result:e.result})]})}var aE={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 oE(e){let t=/\.([a-z0-9]+)$/i.exec(e||``);return t&&aE[t[1].toLowerCase()]||``}function sE(e){let t=eE(e.call),n=ZT(e.result),r=n?ST(n,oE(t)):``,i=e.inProgress;return(0,L.jsxs)(tE,{call:e.call,inProgress:i,isError:e.isError,children:[n?(0,L.jsx)(`div`,{className:WT,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:r}}):!i&&(0,L.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no content`}),(0,L.jsx)(nE,{result:e.result})]})}var cE=1e6;function lE(e,t){let n=(e??``).split(`
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 _e(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Ee(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:je(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:je(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:je(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 Ae(`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=Me(l,e)}let E=()=>{k(),ye(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ye(`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(_e(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)_e(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 ye(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ye(`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:Me,addPlugin:I,removePlugin:te}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=ke,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},Ie=Fe({});Ie.newInstance=()=>Fe({}),t.exports=Ie,Ie.HighlightJS=Ie,Ie.default=Ie}))()).default,aC=`[A-Za-z$_][0-9A-Za-z$_]*`,oC=`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(`.`),sC=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],cC=`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(`.`),lC=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],uC=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],dC=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],fC=[].concat(uC,cC,lC);function pC(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=aC,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:aC,keyword:oC,literal:sC,built_in:fC,"variable.language":dC},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:{_:[...cC,...lC]}},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([...uC,`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 mC(e){let t=e.regex,n=pC(e),r=aC,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:aC,keyword:oC.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:sC,built_in:fC.concat(i),"variable.language":dC},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 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={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 TC(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 EC(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function DC(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 OC(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 kC(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 AC=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_-]*/}}),jC=`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(`.`),MC=`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(`.`),NC=[...jC,...MC],PC=`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(),FC=`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(),IC=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),LC=`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 RC(e){let t=e.regex,n=AC(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:`:(`+FC.join(`|`)+`)`},{begin:`:(:)?(`+IC.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+LC.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:PC.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+NC.join(`|`)+`)\\b`}]}}function zC(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 BC(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 VC(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function HC(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 UC(e){if(Array.isArray(e))return e}function WC(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 GC(){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 KC(e,t){return UC(e)||WC(e,t)||qC(e,t)||GC()}function qC(e,t){if(e){if(typeof e==`string`)return HC(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)?HC(e,t):void 0}}var JC=Object.entries,YC=Object.setPrototypeOf,XC=Object.isFrozen,ZC=Object.getPrototypeOf,QC=Object.getOwnPropertyDescriptor,$C=Object.freeze,ew=Object.seal,tw=Object.create,nw=typeof Reflect<`u`&&Reflect,rw=nw.apply,iw=nw.construct;$C||=function(e){return e},ew||=function(e){return e},rw||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},iw||=function(e){return new e(...[...arguments].slice(1))};var aw=Tw(Array.prototype.forEach),ow=Tw(Array.prototype.lastIndexOf),sw=Tw(Array.prototype.pop),cw=Tw(Array.prototype.push),lw=Tw(Array.prototype.splice),uw=Array.isArray,dw=Tw(String.prototype.toLowerCase),fw=Tw(String.prototype.toString),pw=Tw(String.prototype.match),mw=Tw(String.prototype.replace),hw=Tw(String.prototype.indexOf),gw=Tw(String.prototype.trim),_w=Tw(Number.prototype.toString),vw=Tw(Boolean.prototype.toString),yw=typeof BigInt>`u`?null:Tw(BigInt.prototype.toString),bw=typeof Symbol>`u`?null:Tw(Symbol.prototype.toString),xw=Tw(Object.prototype.hasOwnProperty),Sw=Tw(Object.prototype.toString),Cw=Tw(RegExp.prototype.test),ww=Ew(TypeError);function Tw(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return rw(e,t,n)}}function Ew(e){return function(){return iw(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dw;if(YC&&YC(e,null),!uw(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(XC(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Dw(e){for(let t=0;t<e.length;t++)xw(e,t)||(e[t]=null);return e}function Ow(e){let t=tw(null);for(let r of JC(e)){var n=KC(r,2);let i=n[0],a=n[1];xw(e,i)&&(uw(a)?t[i]=Dw(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Ow(a):t[i]=a)}return t}function kw(e){switch(typeof e){case`string`:return e;case`number`:return _w(e);case`boolean`:return vw(e);case`bigint`:return yw?yw(e):`0`;case`symbol`:return bw?bw(e):`Symbol()`;case`undefined`:return Sw(e);case`function`:case`object`:{if(e===null)return Sw(e);let t=e,n=Aw(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Sw(e)}return Sw(e)}default:return Sw(e)}}function Aw(e,t){for(;e!==null;){let n=QC(e,t);if(n){if(n.get)return Tw(n.get);if(typeof n.value==`function`)return Tw(n.value)}e=ZC(e)}function n(){return null}return n}function jw(e){try{return Cw(e,``),!0}catch{return!1}}var Mw=$C(`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(`.`)),Nw=$C(`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(`.`)),Pw=$C([`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`]),Fw=$C([`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`]),Iw=$C(`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(`.`)),Lw=$C([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Rw=$C([`#text`]),zw=$C(`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(`.`)),Bw=$C(`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(`.`)),Vw=$C(`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(`.`)),Hw=$C([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Uw=ew(/{{[\w\W]*|^[\w\W]*}}/g),Ww=ew(/<%[\w\W]*|^[\w\W]*%>/g),Gw=ew(/\${[\w\W]*/g),Kw=ew(/^data-[\-\w.\u00B7-\uFFFF]+$/),qw=ew(/^aria-[\-\w]+$/),Jw=ew(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yw=ew(/^(?:\w+script|data):/i),Xw=ew(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zw=ew(/^html$/i),Qw=ew(/^[a-z][.\w]*(-[.\w]+)+$/i),$w=ew(/<[/\w!]/g),eT=ew(/<[/\w]/g),tT=ew(/<\/no(script|embed|frames)/i),nT=ew(/\/>/i),rT={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},iT=function(){return typeof window>`u`?null:window},aT=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}},oT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},sT=function(e,t,n,r){return xw(e,t)&&uw(e[t])?$(r.base?Ow(r.base):{},e[t],r.transform):n};function cT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iT(),t=e=>cT(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==rT.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=Aw(d,`cloneNode`),p=Aw(d,`remove`),m=Aw(d,`nextSibling`),h=Aw(d,`childNodes`),g=Aw(d,`parentNode`),_=Aw(d,`shadowRoot`),v=Aw(d,`attributes`),y=o&&o.prototype?Aw(o.prototype,`nodeType`):null,b=o&&o.prototype?Aw(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 ww(`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=aT(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,ee=A.createDocumentFragment,N=A.getElementsByTagName,P=r.importNode,F=oT();t.isSupported=typeof JC==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let I=Uw,te=Ww,ne=Gw,re=Kw,ie=qw,ae=Yw,oe=Xw,se=Qw,ce=Jw,le=null,ue=$({},[...Mw,...Nw,...Pw,...Iw,...Rw]),de=null,fe=$({},[...zw,...Bw,...Vw,...Hw]),pe=Object.seal(tw(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}})),me=null,he=null,ge=Object.seal(tw(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_e=!0,ve=!0,ye=!1,be=!0,xe=!1,Se=!0,Ce=!1,we=!1,Te=null,Ee=null,De=!1,Oe=!1,ke=!1,Ae=!1,je=!0,Me=!1,Ne=`user-content-`,Pe=!0,Fe=!1,Ie={},Le=null,Re=$({},`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(`.`)),ze=null,Be=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ve=null,He=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ue=`http://www.w3.org/1998/Math/MathML`,We=`http://www.w3.org/2000/svg`,Ge=`http://www.w3.org/1999/xhtml`,Ke=Ge,qe=!1,Je=null,Ye=$({},[Ue,We,Ge],fw),Xe=$C([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ze=$({},Xe),Qe=$C([`annotation-xml`]),$e=$({},Qe),et=$({},[`title`,`style`,`font`,`a`,`script`]),tt=null,nt=[`application/xhtml+xml`,`text/html`],rt=null,it=null,at=n.createElement(`form`),ot=function(e){return e instanceof RegExp||e instanceof Function},st=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(it&&it===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ow(e),tt=nt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,rt=tt===`application/xhtml+xml`?fw:dw,le=sT(e,`ALLOWED_TAGS`,ue,{transform:rt}),de=sT(e,`ALLOWED_ATTR`,fe,{transform:rt}),Je=sT(e,`ALLOWED_NAMESPACES`,Ye,{transform:fw}),Ve=sT(e,`ADD_URI_SAFE_ATTR`,He,{transform:rt,base:He}),ze=sT(e,`ADD_DATA_URI_TAGS`,Be,{transform:rt,base:Be}),Le=sT(e,`FORBID_CONTENTS`,Re,{transform:rt}),me=sT(e,`FORBID_TAGS`,Ow({}),{transform:rt}),he=sT(e,`FORBID_ATTR`,Ow({}),{transform:rt}),Ie=xw(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ow(e.USE_PROFILES):e.USE_PROFILES:!1,_e=e.ALLOW_ARIA_ATTR!==!1,ve=e.ALLOW_DATA_ATTR!==!1,ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,Ce=e.WHOLE_DOCUMENT||!1,Oe=e.RETURN_DOM||!1,ke=e.RETURN_DOM_FRAGMENT||!1,Ae=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,je=e.SANITIZE_DOM!==!1,Me=e.SANITIZE_NAMED_PROPS||!1,Pe=e.KEEP_CONTENT!==!1,Fe=e.IN_PLACE||!1,ce=jw(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Jw,Ke=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ge,Ze=xw(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Ow(e.MATHML_TEXT_INTEGRATION_POINTS):$({},Xe),$e=xw(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Ow(e.HTML_INTEGRATION_POINTS):$({},Qe);let t=xw(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Ow(e.CUSTOM_ELEMENT_HANDLING):tw(null);if(pe=tw(null),xw(t,`tagNameCheck`)&&ot(t.tagNameCheck)&&(pe.tagNameCheck=t.tagNameCheck),xw(t,`attributeNameCheck`)&&ot(t.attributeNameCheck)&&(pe.attributeNameCheck=t.attributeNameCheck),xw(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ew(pe),xe&&(ve=!1),ke&&(Oe=!0),Ie&&(le=$({},Rw),de=tw(null),Ie.html===!0&&($(le,Mw),$(de,zw)),Ie.svg===!0&&($(le,Nw),$(de,Bw),$(de,Hw)),Ie.svgFilters===!0&&($(le,Pw),$(de,Bw),$(de,Hw)),Ie.mathMl===!0&&($(le,Iw),$(de,Vw),$(de,Hw))),ge.tagCheck=null,ge.attributeCheck=null,xw(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ge.tagCheck=e.ADD_TAGS:uw(e.ADD_TAGS)&&(le===ue&&(le=Ow(le)),$(le,e.ADD_TAGS,rt))),xw(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ge.attributeCheck=e.ADD_ATTR:uw(e.ADD_ATTR)&&(de===fe&&(de=Ow(de)),$(de,e.ADD_ATTR,rt))),xw(e,`ADD_URI_SAFE_ATTR`)&&uw(e.ADD_URI_SAFE_ATTR)&&$(Ve,e.ADD_URI_SAFE_ATTR,rt),xw(e,`FORBID_CONTENTS`)&&uw(e.FORBID_CONTENTS)&&(Le===Re&&(Le=Ow(Le)),$(Le,e.FORBID_CONTENTS,rt)),xw(e,`ADD_FORBID_CONTENTS`)&&uw(e.ADD_FORBID_CONTENTS)&&(Le===Re&&(Le=Ow(Le)),$(Le,e.ADD_FORBID_CONTENTS,rt)),Pe&&(le[`#text`]=!0),Ce&&$(le,[`html`,`head`,`body`]),le.table&&($(le,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ww(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ww(`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(``)));$C&&$C(e),it=e},ct=$({},[...Nw,...Pw,...Fw]),lt=$({},[...Iw,...Lw]),ut=function(e,t,n){return t.namespaceURI===Ge?e===`svg`:t.namespaceURI===Ue?e===`svg`&&(n===`annotation-xml`||Ze[n]):!!ct[e]},dt=function(e,t,n){return t.namespaceURI===Ge?e===`math`:t.namespaceURI===We?e===`math`&&$e[n]:!!lt[e]},ft=function(e,t,n){return t.namespaceURI===We&&!$e[n]||t.namespaceURI===Ue&&!Ze[n]?!1:!lt[e]&&(et[e]||!ct[e])},pt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ke,tagName:`template`});let n=dw(e.tagName),r=dw(t.tagName);return Je[e.namespaceURI]?e.namespaceURI===We?ut(n,t,r):e.namespaceURI===Ue?dt(n,t,r):e.namespaceURI===Ge?ft(n,t,r):!!(tt===`application/xhtml+xml`&&Je[e.namespaceURI]):!1},mt=function(e){cw(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw ww(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ht=function(e){vt(e);let t=h(e);if(t){let e=[];aw(t,t=>{cw(e,t)}),aw(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{}}},gt=function(e,n){try{cw(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{cw(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Oe||ke)try{mt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},_t=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`||de[rt(i)]))try{e.removeAttribute(i)}catch{}}},vt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===rT.element&&_t(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},yt=function(e){if(!Se)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===rT.processingInstruction||n===rT.comment&&Cw(eT,e.data)){try{p(e)}catch{}continue}if(n===rT.element){let t=e,n=rt(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])}},bt=function(e){let t=null,r=null;if(De)e=`<remove></remove>`+e;else{let t=pw(e,/^[\r\n\t ]+/);r=t&&t[0]}tt===`application/xhtml+xml`&&Ke===Ge&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(Ke===Ge)try{t=new l().parseFromString(i,tt)}catch{}if(!t||!t.documentElement){t=j.createDocument(Ke,`template`,null);try{t.documentElement.innerHTML=qe?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ke===Ge?N.call(t,Ce?`html`:`body`)[0]:Ce?t.documentElement:a},xt=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)},St=function(e){return e=mw(e,I,` `),e=mw(e,te,` `),e=mw(e,ne,` `),e},Ct=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=St(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&aw(r,e=>{Tt(e.content)&&Ct(e.content)})},wt=function(e){let t=b?b(e):null;return typeof t!=`string`||rt(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)},Tt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===rT.documentFragment}catch{return!1}},Et=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Dt(e,n,r){e.length!==0&&aw(e,e=>{e.call(t,n,r,it)})}let Ot=function(e,t){return!!(Se&&e.hasChildNodes()&&!Et(e.firstElementChild)&&Cw($w,e.textContent)&&Cw($w,e.innerHTML)||Se&&e.namespaceURI===Ge&&t===`style`&&Et(e.firstElementChild)||e.nodeType===rT.processingInstruction||Se&&e.nodeType===rT.comment&&Cw(eT,e.data))},kt=function(e,t){if(!me[t]&&Nt(t)&&(pe.tagNameCheck instanceof RegExp&&Cw(pe.tagNameCheck,t)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(t)))return!1;if(Pe&&!Le[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=Fe?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return mt(e),!0},At=function(e,n){if(Dt(F.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(wt(e))return mt(e),!0;let r=rt(b?b(e):e.nodeName);if(Dt(F.uponSanitizeElement,e,{tagName:r,allowedTags:le}),e!==n&&g(e)===null)return!0;if(Ot(e,r))return mt(e),!0;if(me[r]||!(ge.tagCheck instanceof Function&&ge.tagCheck(r))&&!le[r]){let t=kt(e,r);return t===!1&&Dt(F.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===rT.element&&!pt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Cw(tT,e.innerHTML))return mt(e),!0;if(xe&&e.nodeType===rT.text){let n=St(e.textContent);e.textContent!==n&&(cw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Dt(F.afterSanitizeElements,e,null),!1},jt=function(e,t,r){if(he[t]||Se&&t===`patchsrc`||Se&&t===`for`&&e!==`label`&&e!==`output`||je&&(t===`id`||t===`name`)&&(r in n||r in at))return!1;let i=de[t]||ge.attributeCheck instanceof Function&&ge.attributeCheck(t,e);if(!(ve&&Cw(re,t))&&!(_e&&Cw(ie,t))){if(!i){if(!(Nt(e)&&(pe.tagNameCheck instanceof RegExp&&Cw(pe.tagNameCheck,e)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(e))&&(pe.attributeNameCheck instanceof RegExp&&Cw(pe.attributeNameCheck,t)||pe.attributeNameCheck instanceof Function&&pe.attributeNameCheck(t,e))||t===`is`&&pe.allowCustomizedBuiltInElements&&(pe.tagNameCheck instanceof RegExp&&Cw(pe.tagNameCheck,r)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(r))))return!1}else if(!Ve[t]&&!Cw(ce,mw(r,oe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&hw(r,`data:`)===0&&ze[e])&&!(ye&&!Cw(ae,mw(r,oe,``)))&&r)return!1}return!0},Mt=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Nt=function(e){return!Mt[dw(e)]&&Cw(se,e)},Pt=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},Ft=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),wt(e)?mt(e):sw(t.removed)}catch{gt(n,e)}},It=function(e){Dt(F.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||wt(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0},r=t.length,i=rt(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=rt(o),u=c,d=o===`value`?u:gw(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Dt(F.uponSanitizeAttribute,e,n),d=n.attrValue,Me&&(l===`id`||l===`name`)&&hw(d,Ne)!==0&&(gt(o,e),d=Ne+d),Se&&Cw(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){gt(o,e);continue}if(l===`attributename`&&pw(d,`href`)){gt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){gt(o,e);continue}if(!be&&Cw(nT,d)){gt(o,e);continue}if(xe&&(d=St(d)),!jt(i,l,d)){gt(o,e);continue}d=Pt(i,l,s,d),d!==u&&Ft(e,o,s,d)}}Dt(F.afterSanitizeAttributes,e,null)},Lt=function(e){let t=null,n=xt(e);for(Dt(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Dt(F.uponSanitizeShadowNode,t,null),At(t,e),It(t),Tt(t.content)&&Lt(t.content),(y?y(t):t.nodeType)===rT.element){let e=_(t);Tt(e)&&(Rt(e),Lt(e))}Dt(F.afterSanitizeShadowDOM,e,null)},Rt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Lt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===rT.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`&&rt(e)===`template`){let e=n.content;Tt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Tt(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(qe=!e,qe&&(e=`<!-->`),typeof e!=`string`&&!Et(e)&&(e=kw(e),typeof e!=`string`))throw ww(`dirty is not a string, aborting`);if(!t.isSupported)return e;we?(le=Te,de=Ee):st(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(le=Ow(le)),F.uponSanitizeAttribute.length>0&&(de=Ow(de)),t.removed=[];let c=Fe&&typeof e!=`string`&&Et(e);if(c){yt(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=rt(t);if(!le[n]||me[n])throw ht(e),ww(`root node is forbidden and cannot be sanitized in-place`)}if(wt(e))throw ht(e),ww(`root node is clobbered and cannot be sanitized in-place`);try{Rt(e)}catch(t){throw ht(e),t}}else if(Et(e))i=bt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===rT.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Rt(a);else{if(!Oe&&!xe&&!Ce&&e.indexOf(`<`)===-1)return x&&Ae?D(e):e;if(i=bt(e),!i)return Oe?null:Ae?S:``}i&&De&&mt(i.firstChild);let l=c?e:i,u=xt(l);try{for(;o=u.nextNode();)At(o,l),It(o),Tt(o.content)&&Lt(o.content)}catch(n){throw c&&(ht(e),aw(t.removed,e=>{e.element&&vt(e.element)})),n}if(c)return aw(t.removed,e=>{e.element&&vt(e.element)}),xe&&Ct(e),e;if(Oe){if(xe&&Ct(i),ke)for(s=ee.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(de.shadowroot||de.shadowrootmode)&&(s=P.call(r,s,!0)),s}let d=Ce?i.outerHTML:i.innerHTML;return Ce&&le[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Cw(Zw,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
69
+ `+d),xe&&(d=St(d)),x&&Ae?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};st(e),we=!0,Te=le,Ee=de},t.clearConfig=function(){it=null,we=!1,Te=null,Ee=null,x=C,S=``},t.isValidAttribute=function(e,t,n){it||st({});let r=rt(e),i=rt(t);return jt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&xw(F,e)&&cw(F[e],t)},t.removeHook=function(e,t){if(xw(F,e)){if(t!==void 0){let n=ow(F[e],t);return n===-1?void 0:lw(F[e],n,1)[0]}return sw(F[e])}},t.removeHooks=function(e){xw(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=oT()},t}var lT=cT(),uT=null;function dT(){return uT||(uT=lT(globalThis.window??globalThis),uT.addHook(`afterSanitizeAttributes`,e=>{let t=e;t.tagName===`A`&&t.getAttribute?.(`target`)&&t.setAttribute(`rel`,`noopener noreferrer`)}),uT)}function fT(e){return dT().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 pT(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var mT=!1;function hT(){mT||(mT=!0,iC.registerLanguage(`typescript`,mC),iC.registerLanguage(`javascript`,CC),iC.registerLanguage(`json`,wC),iC.registerLanguage(`bash`,TC),iC.registerLanguage(`shell`,EC),iC.registerLanguage(`python`,DC),iC.registerLanguage(`diff`,OC),iC.registerLanguage(`xml`,kC),iC.registerLanguage(`css`,RC),iC.registerLanguage(`markdown`,zC),iC.registerLanguage(`yaml`,BC),iC.registerLanguage(`plaintext`,VC),iC.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),iC.registerAliases([`js`,`jsx`,`mjs`,`cjs`],{languageName:`javascript`}),iC.registerAliases([`sh`,`zsh`,`console`],{languageName:`bash`}),iC.registerAliases([`py`],{languageName:`python`}),iC.registerAliases([`html`,`xhtml`,`svg`],{languageName:`xml`}),iC.registerAliases([`yml`],{languageName:`yaml`}),iC.registerAliases([`md`],{languageName:`markdown`}),iC.registerAliases([`text`,`txt`],{languageName:`plaintext`}))}function gT(e,t){if(hT(),t&&iC.getLanguage(t))try{return iC.highlight(e,{language:t,ignoreIllegals:!0}).value}catch{}return _T.utils.escapeHtml(e)}var _T=new rC({html:!1,linkify:!0,breaks:!1,highlight(e,t){let n=gT(e,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return`<pre class="hljs"><code class="${_T.utils.escapeHtml(r)}">${n}</code></pre>`}});function vT(e){return hT(),fT(_T.render(e??``))}function yT(e,t){hT();let n=gT(e??``,(t||``).toLowerCase()),r=t?`language-${t} hljs`:`hljs`;return fT(`<pre class="hljs"><code class="${_T.utils.escapeHtml(r)}">${n}</code></pre>`)}var bT=`crtr:transcript-detail`,xT=[`focused`,`standard`,`verbose`];function ST(){try{let e=localStorage.getItem(bT);if(e===`focused`||e===`standard`||e===`verbose`)return e}catch{}return`standard`}var CT=ST(),wT=new Set;function TT(){for(let e of wT)e()}function ET(e){if(e!==CT){CT=e;try{localStorage.setItem(bT,e)}catch{}TT()}}function DT(){ET(xT[(xT.indexOf(CT)+1)%xT.length])}function OT(e){return wT.add(e),()=>{wT.delete(e)}}typeof window<`u`&&window.addEventListener(`storage`,e=>{if(e.key!==bT)return;let t=ST();t!==CT&&(CT=t,TT())});function kT(){return(0,v.useSyncExternalStore)(OT,()=>CT,()=>CT)}var AT=[`[&_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(` `),jT={focused:`leading-relaxed`,standard:`leading-relaxed`,verbose:`leading-relaxed`};function MT({text:e,inProgress:t}){let n=(0,v.useMemo)(()=>t?``:vT(e??``),[t,e]),r=jT[kT()];return(0,L.jsx)(`div`,{className:J(`prose`,r),children:t?(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:pT(e??``)}}):(0,L.jsx)(`div`,{className:J(AT,r),dangerouslySetInnerHTML:{__html:n}})})}function NT({thinking:e,inProgress:t}){let n=kT(),[r,i]=(0,v.useState)(!1),a=t||r||n===`verbose`,o=n===`focused`?`Thought`:`Thinking`;return(0,L.jsxs)(`div`,{className:J(`thinking`,a&&`open`),children:[(0,L.jsxs)(`div`,{className:`think-toggle`,onClick:()=>i(e=>!e),children:[o,t?`…`:``]}),(0,L.jsx)(`div`,{className:`think-body whitespace-pre-wrap`,dangerouslySetInnerHTML:{__html:pT(e)}})]})}var PT=new Set([`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`,`image/svg+xml`,`image/avif`,`image/bmp`]);function FT({image:e}){let t=(e.mimeType||``).toLowerCase();return(0,L.jsx)(`img`,{className:`block max-w-[min(100%,520px)] max-h-[26rem] rounded-md my-1.5 object-contain`,src:`data:${PT.has(t)?t:`image/png`};base64,${e.data??``}`,alt:`image content`,loading:`lazy`,decoding:`async`})}var IT=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 LT(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 IT.has(i)}function RT(e){let t=/\/[a-zA-Z0-9_.\-/]+\.[a-zA-Z0-9]+/g,n=[],r;for(;(r=t.exec(e))!==null;)LT(r[0])&&n.push(r[0]);return[...new Set(n)]}var zT=(0,v.createContext)({peekedPath:null,onPeek:()=>{}});function BT(){return(0,v.useContext)(zT)}var VT=`[&_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`,HT=`m-0 px-3 py-2 bg-[#0c0f13] text-[#d6dde6] font-mono text-xs whitespace-pre-wrap overflow-auto max-h-[26rem]`,UT=`px-3 py-2 opacity-50 text-xs italic`,WT={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 GT(e){return WT[(e||``).toLowerCase()]??`◆`}var KT={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 qT(e){return KT[(e||``).toLowerCase()]??`other`}function JT(e){return e?e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``):``}function YT(e){return e?e.content.filter(e=>e.type===`image`):[]}function XT(e){if(!e||Object.keys(e).length===0)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function ZT(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 QT({call:e,subtitle:t,inProgress:n,isError:r,children:i}){let a=t??ZT(e),o=e.name,s=kT(),{peekedPath:c,onPeek:l}=BT(),u=s===`verbose`||s===`standard`&&n,[d,f]=(0,v.useState)(null),p=d??u;return(0,L.jsxs)(`div`,{className:J(`tool`,p&&`open`,r&&`tool-error`),"data-fam":qT(e.name),children:[(0,L.jsxs)(`div`,{className:`tool-head`,onClick:()=>f(!p),children:[(0,L.jsx)(`span`,{className:`tool-glyph`,children:GT(e.name)}),(0,L.jsx)(`span`,{className:`tool-name`,children:o}),a&&(0,L.jsx)(`span`,{className:`tool-arg`,children:LT(a)?(0,L.jsx)(`span`,{className:J(`filelink`,c===a&&`peeked`),onClick:e=>{e.stopPropagation(),l(a)},children:a}):a}),(0,L.jsx)(`span`,{className:`ml-auto shrink-0 flex items-center`,children:(0,L.jsx)(`span`,{className:J(`dot`,n?`active`:r?`error`:`done`),title:n?`running`:r?`error`:`done`,"aria-label":n?`running`:r?`error`:`done`})}),(0,L.jsx)(Tf,{className:J(`size-3.5 text-[var(--dim)] transition-transform`,!p&&`-rotate-90`)})]}),(0,L.jsx)(`div`,{className:`tool-body`,children:i})]})}function $T({result:e}){let t=YT(e);return t.length===0?null:(0,L.jsx)(L.Fragment,{children:t.map((e,t)=>(0,L.jsx)(`div`,{className:`px-3 py-1`,children:(0,L.jsx)(FT,{image:e})},t))})}function eE(e){let t=e.command??e.cmd??e.script;return typeof t==`string`?t:``}function tE(e){let t=eE(e.call.arguments??{}),n=JT(e.result),r=e.inProgress,i=e.isError;return(0,L.jsxs)(QT,{call:e.call,subtitle:``,inProgress:r,isError:i,children:[(0,L.jsxs)(`pre`,{className:J(HT,i&&`text-[#ff9b8a]`),children:[t&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{style:{opacity:.6},children:`$ `}),(0,L.jsx)(`span`,{dangerouslySetInnerHTML:{__html:pT(t)}}),`
70
+ `]}),(0,L.jsx)(`span`,{dangerouslySetInnerHTML:{__html:pT(n)}}),r&&(0,L.jsx)(`span`,{className:`inline-block size-2 rounded-full bg-[#7fb3ff] ml-1.5 animate-pulse`})]}),(0,L.jsx)($T,{result:e.result})]})}var nE={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 rE(e){let t=/\.([a-z0-9]+)$/i.exec(e||``);return t&&nE[t[1].toLowerCase()]||``}function iE(e){let t=ZT(e.call),n=JT(e.result),r=n?yT(n,rE(t)):``,i=e.inProgress;return(0,L.jsxs)(QT,{call:e.call,inProgress:i,isError:e.isError,children:[n?(0,L.jsx)(`div`,{className:VT,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:r}}):!i&&(0,L.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no content`}),(0,L.jsx)($T,{result:e.result})]})}var aE=1e6;function oE(e,t){let n=(e??``).split(`
71
71
  `),r=(t??``).split(`
72
- `),i=n.length,a=r.length;if((i+1)*(a+1)>cE){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 uE(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function dE(e){let t=e.call.arguments??{},n=uE(t,[`old_string`,`oldText`,`old`,`before`,`search`]),r=uE(t,[`new_string`,`newText`,`new`,`after`,`replace`]),i=lE(n,r),a=ZT(e.result),o=e.isError;return(0,L.jsxs)(tE,{call:e.call,subtitle:eE(e.call),inProgress:e.inProgress,isError:o,children:[n||r?(0,L.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:i.map((e,t)=>(0,L.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`?`- `:` `)+gT(e.text)}},t))}):(0,L.jsx)(`div`,{className:KT,children:`no diff available`}),a&&(0,L.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:gT(a)}}),(0,L.jsx)(nE,{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 pE(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function mE(e){let t=e.call.arguments??{},n=eE(e.call),r=pE(t,[`content`,`contents`,`text`,`body`,`new_string`,`file_text`]),i=ZT(e.result),a=e.isError,o=(()=>{if(!r)return``;let e=/\.([a-z0-9]+)$/i.exec(n),t=e&&fE[e[1].toLowerCase()]||``;return ST(r,t)})();return(0,L.jsxs)(tE,{call:e.call,subtitle:n,inProgress:e.inProgress,isError:a,children:[r?(0,L.jsx)(`div`,{className:WT,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:o}}):(0,L.jsx)(`div`,{className:KT,children:`no content`}),i&&(0,L.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:gT(i)}}),(0,L.jsx)(nE,{result:e.result})]})}function hE(e){let t=e.pattern??e.query??e.regex??e.search;return typeof t==`string`?t:``}function gE(e){let t=hE(e.call.arguments??{}),n=ZT(e.result),r=n?n.split(`
73
- `).filter(e=>e.length>0):[],i=e.inProgress;return(0,L.jsxs)(tE,{call:e.call,subtitle:t,inProgress:i,isError:e.isError,children:[r.length>0?(0,L.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:r.map((e,t)=>(0,L.jsx)(`div`,{className:`px-3 py-1 font-mono text-xs opacity-85`,dangerouslySetInnerHTML:{__html:gT(e)}},t))}):!i&&(0,L.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no matches`}),(0,L.jsx)(nE,{result:e.result})]})}function _E(e){let t=$T(e.call.arguments),n=ZT(e.result),r=e.isError,i=e.inProgress;return(0,L.jsxs)(tE,{call:e.call,inProgress:i,isError:r,children:[t&&(0,L.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,L.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:xT(n)}}),(0,L.jsx)(nE,{result:e.result}),!t&&!n&&!i&&(0,L.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no output`})]})}var vE={bash:iE,shell:iE,sh:iE,run:iE,terminal:iE,read:sE,read_file:sE,cat:sE,view:sE,edit:dE,str_replace:dE,apply_patch:dE,write:mE,write_file:mE,create:mE,grep:gE,search:gE,rg:gE};function yE(e){return vE[(e||``).toLowerCase()]??_E}Object.keys(vE);function bE({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.role;return a===`user`?e.origin===`inbox`?(0,L.jsx)(AE,{message:e}):(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(TE,{message:e})}):a===`assistant`?(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(EE,{message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i})}):a===`toolResult`?(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(kE,{message:e})}):a===`bashExecution`?(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(CE,{message:e})}):a===`custom`&&e.customType===xE?(0,L.jsx)(SE,{message:e}):null}var xE=`crtr-cycle-divider`;function SE({message:e}){let t=typeof e.content==`string`?e.content:`yielded — new cycle begins`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-3 my-1`,style:{opacity:.55},children:[(0,L.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}}),(0,L.jsx)(`span`,{className:`text-xs text-[var(--dim)] whitespace-nowrap`,children:t}),(0,L.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}})]})}function CE({message:e}){let t=e.excludeFromContext?`!!`:`!`,n=e.exitCode===void 0&&!e.cancelled;return(0,L.jsxs)(`div`,{className:`font-mono text-xs rounded border border-[var(--border,#333)] overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`px-2 py-1 bg-[var(--surface-raised,#1a1a1a)] flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`opacity-60 select-none`,children:t}),(0,L.jsx)(`span`,{className:`whitespace-pre-wrap break-all`,children:e.command}),n&&(0,L.jsx)(`span`,{className:`ml-auto opacity-50`,children:`running…`}),e.cancelled&&(0,L.jsx)(`span`,{className:`ml-auto opacity-70`,children:`cancelled`}),!n&&!e.cancelled&&e.exitCode!==0&&(0,L.jsxs)(`span`,{className:`ml-auto opacity-70`,children:[`exit `,e.exitCode]})]}),e.output!==``&&(0,L.jsx)(`pre`,{className:`px-2 py-1 whitespace-pre-wrap break-all m-0`,children:e.output}),e.truncated&&(0,L.jsx)(`div`,{className:`px-2 py-1 opacity-50`,children:`output truncated`})]})}function wE({text:e}){return(0,L.jsxs)(`div`,{className:`queued`,children:[(0,L.jsxs)(`div`,{className:`tag`,children:[(0,L.jsx)(`span`,{className:`select-none`,children:`⋯`}),(0,L.jsx)(`span`,{children:`queued`})]}),(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e})]})}function TE({message:e}){let t=e.content;return(0,L.jsx)(`div`,{className:`user`,children:typeof t==`string`?(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,children:t}):t.map((e,t)=>e.type===`text`?(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text},t):e.type===`image`?(0,L.jsx)(RT,{image:e},t):null)})}function EE({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,L.jsxs)(L.Fragment,{children:[a.map((e,t)=>e.type===`text`?(0,L.jsx)(FT,{text:e.text,inProgress:o(t)},t):e.type===`thinking`?(0,L.jsx)(IT,{thinking:e.thinking,inProgress:o(t)},t):e.type===`toolCall`?(0,L.jsx)(OE,{call:e,streaming:n,resultFor:r,executingToolIds:i},t):null),l&&(0,L.jsx)(DE,{stopReason:c,errorMessage:e.errorMessage})]})}function DE({stopReason:e,errorMessage:t}){let n=e===`aborted`?t&&t!==`Request was aborted`?t:`Operation aborted`:`Error: ${t||`Unknown error`}`;return(0,L.jsxs)(`div`,{className:`msg-error`,children:[(0,L.jsx)(`span`,{className:`ic`,"aria-hidden":`true`,children:`⚠`}),(0,L.jsx)(`span`,{className:`txt`,children:n})]})}function OE({call:e,streaming:t,resultFor:n,executingToolIds:r}){let i=yE(e.name),a=n(e.id);return(0,L.jsx)(i,{call:e,result:a,inProgress:t&&r.has(e.id),isError:a?.isError??!1})}function kE({message:e}){return(0,L.jsx)(yE(e.toolName),{call:{type:`toolCall`,id:e.toolCallId,name:e.toolName,arguments:{}},result:e,inProgress:!1,isError:e.isError})}function AE({message:e}){let{onPeek:t,peekedPath:n}=UT(),r=typeof e.content==`string`?e.content:e.content.filter(e=>e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``),i=vg(r),a=VT(r);function o(e){if(a.length===0)return(0,L.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,L.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i.slice(0,a)},o++));let s=n===e;r.push((0,L.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,L.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i},o++)),(0,L.jsx)(L.Fragment,{children:r})}return(0,L.jsxs)(`div`,{className:`inbound`,children:[(0,L.jsx)(`span`,{className:`ic select-none`,children:`◍`}),(0,L.jsxs)(`div`,{className:`body`,children:[(0,L.jsxs)(`div`,{className:`src`,children:[(0,L.jsx)(`span`,{children:`inbox`}),i&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{children:`·`}),(0,L.jsxs)(`span`,{children:[`from `,i]})]})]}),o(r)]})]})}function jE({messages:e,partialToolResults:t,executingToolIds:n,queued:r,streaming:i,bottomInsetPx:a=0,keyboardOpen:o=!1,composerHeightPx:s}){let c=MT(),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=Zv({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,L.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,L.jsx)(`div`,{className:`relative w-full`,style:{height:`${h.getTotalSize()}px`},children:h.getVirtualItems().map(e=>{let t=u[e.index];return t?(0,L.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,L.jsxs)(`div`,{className:`flex items-center gap-3 mt-2.5 mb-3.5`,children:[c!==`focused`&&(0,L.jsx)(`span`,{className:`font-inst text-xs tracking-[0.16em] uppercase text-[var(--dim)]`,children:l.turnLabels[e.index]}),(0,L.jsx)(`div`,{className:`flex-1 h-px bg-[var(--line2)]`})]}),(0,L.jsx)(bE,{executingToolIds:n,message:t,isLastAssistant:t===l.lastAssistant,streaming:i,resultFor:d})]},e.key):null})}),r.length>0&&(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map((e,t)=>(0,L.jsx)(`div`,{className:`px-3.5 py-1.5 box-border`,children:(0,L.jsx)(wE,{text:e})},t))})]})}var ME={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 NE({conversationId:e}){let t=Dm(e),[n]=Hn(),r=ut(),i=n.get(`ask`);return t.length===0?null:(0,L.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,L.jsx)(PE,{deck:e,highlighted:i!==null&&e.job_id===i,navKey:r.key},e.id))})}function PE({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=pt(),{refetch:a}=Em(),[o,s]=(0,v.useState)(!1),c=km(e.kind).icon,l=e.kind===`notify`||e.kind===`validation`,u=async t=>{if(!o){s(!0);try{let n=(await Sm(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 Cm(e.job_id,{responses:[r]}),Nm(`Done — thanks!`,`success`),a()}catch(e){if(gm(e)){Nm(e instanceof Error?e.message:`That request was already handled.`),a();return}Nm(`Something went wrong — try again.`)}finally{s(!1)}}};return(0,L.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,L.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary`,children:(0,L.jsx)(c,{className:`size-4`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`truncate text-sm font-medium`,children:ME[e.kind]??ME.context}),(0,L.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.title})]}),e.kind===`notify`&&(0,L.jsxs)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`ack`),children:[(0,L.jsx)(wf,{className:`mr-1 size-3.5`}),` Got it`]}),e.kind===`validation`&&(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`yes`),children:`Approve`}),(0,L.jsx)(Z,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void u(`no`),children:`Reject`})]}),!l&&(0,L.jsxs)(Z,{size:`sm`,variant:`secondary`,onClick:()=>i(`/inbox/${encodeURIComponent(e.job_id)}`),children:[`Review `,(0,L.jsx)(Sf,{className:`ml-1 size-3.5`})]})]})}var FE=[`[&_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 IE({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),vp(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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3.5 py-3 border-b border-[var(--line)]`,children:[(0,L.jsx)(`span`,{className:`text-xs text-[var(--done)] shrink-0`,children:`◆`}),(0,L.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,L.jsxs)(`div`,{className:`flex gap-1.5 shrink-0`,children:[(0,L.jsx)(LE,{on:i===`pretty`,onClick:()=>a(`pretty`),children:`Pretty`}),(0,L.jsx)(LE,{on:i===`raw`,onClick:()=>a(`raw`),children:`Raw`}),(0,L.jsx)(LE,{onClick:n,"aria-label":`Close file peek`,children:`✕`})]})]}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-auto px-5 py-5`,children:[o&&(0,L.jsx)(`div`,{className:`flex items-center justify-center h-16 text-[var(--dim)] text-xs`,children:(0,L.jsx)(`span`,{className:`animate-pulse`,children:`Loading…`})}),c&&(0,L.jsx)(`div`,{className:`text-xs text-[var(--blk)]`,children:c}),u&&!o&&(0,L.jsxs)(L.Fragment,{children:[u.truncated&&(0,L.jsx)(`div`,{className:`mb-3 text-xs text-[var(--dim)]`,children:`File truncated — showing partial content`}),i===`raw`?(0,L.jsx)(`pre`,{className:`text-xs font-mono text-[var(--ink2)] whitespace-pre-wrap break-all leading-[1.7]`,children:u.content}):(0,L.jsx)(RE,{content:u.content})]})]}),(0,L.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,L.jsx)(`span`,{className:`kbd ml-auto`,children:`esc`})]})]}):null}function LE({on:e,onClick:t,children:n,...r}){return(0,L.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 RE({content:e}){if(e.startsWith(`---
72
+ `),i=n.length,a=r.length;if((i+1)*(a+1)>aE){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 sE(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function cE(e){let t=e.call.arguments??{},n=sE(t,[`old_string`,`oldText`,`old`,`before`,`search`]),r=sE(t,[`new_string`,`newText`,`new`,`after`,`replace`]),i=oE(n,r),a=JT(e.result),o=e.isError;return(0,L.jsxs)(QT,{call:e.call,subtitle:ZT(e.call),inProgress:e.inProgress,isError:o,children:[n||r?(0,L.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:i.map((e,t)=>(0,L.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`?`- `:` `)+pT(e.text)}},t))}):(0,L.jsx)(`div`,{className:UT,children:`no diff available`}),a&&(0,L.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:pT(a)}}),(0,L.jsx)($T,{result:e.result})]})}var lE={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 uE(e,t){for(let n of t)if(typeof e[n]==`string`)return e[n];return``}function dE(e){let t=e.call.arguments??{},n=ZT(e.call),r=uE(t,[`content`,`contents`,`text`,`body`,`new_string`,`file_text`]),i=JT(e.result),a=e.isError,o=(()=>{if(!r)return``;let e=/\.([a-z0-9]+)$/i.exec(n),t=e&&lE[e[1].toLowerCase()]||``;return yT(r,t)})();return(0,L.jsxs)(QT,{call:e.call,subtitle:n,inProgress:e.inProgress,isError:a,children:[r?(0,L.jsx)(`div`,{className:VT,style:{padding:`4px 8px`},dangerouslySetInnerHTML:{__html:o}}):(0,L.jsx)(`div`,{className:UT,children:`no content`}),i&&(0,L.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:pT(i)}}),(0,L.jsx)($T,{result:e.result})]})}function fE(e){let t=e.pattern??e.query??e.regex??e.search;return typeof t==`string`?t:``}function pE(e){let t=fE(e.call.arguments??{}),n=JT(e.result),r=n?n.split(`
73
+ `).filter(e=>e.length>0):[],i=e.inProgress;return(0,L.jsxs)(QT,{call:e.call,subtitle:t,inProgress:i,isError:e.isError,children:[r.length>0?(0,L.jsx)(`div`,{className:`m-0 font-mono text-xs overflow-auto max-h-[28rem]`,children:r.map((e,t)=>(0,L.jsx)(`div`,{className:`px-3 py-1 font-mono text-xs opacity-85`,dangerouslySetInnerHTML:{__html:pT(e)}},t))}):!i&&(0,L.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no matches`}),(0,L.jsx)($T,{result:e.result})]})}function mE(e){let t=XT(e.call.arguments),n=JT(e.result),r=e.isError,i=e.inProgress;return(0,L.jsxs)(QT,{call:e.call,inProgress:i,isError:r,children:[t&&(0,L.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,L.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:vT(n)}}),(0,L.jsx)($T,{result:e.result}),!t&&!n&&!i&&(0,L.jsx)(`div`,{className:`px-3 py-2 opacity-50 text-xs italic`,children:`no output`})]})}var hE={bash:tE,shell:tE,sh:tE,run:tE,terminal:tE,read:iE,read_file:iE,cat:iE,view:iE,edit:cE,str_replace:cE,apply_patch:cE,write:dE,write_file:dE,create:dE,grep:pE,search:pE,rg:pE};function gE(e){return hE[(e||``).toLowerCase()]??mE}Object.keys(hE);function _E({message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i}){let a=e.role;return a===`user`?e.origin===`inbox`?(0,L.jsx)(DE,{message:e}):(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(SE,{message:e})}):a===`assistant`?(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(CE,{message:e,isLastAssistant:t,streaming:n,resultFor:r,executingToolIds:i})}):a===`toolResult`?(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(EE,{message:e})}):a===`bashExecution`?(0,L.jsx)(`div`,{className:`text-sm leading-[1.55] break-words`,children:(0,L.jsx)(bE,{message:e})}):a===`custom`&&e.customType===vE?(0,L.jsx)(yE,{message:e}):null}var vE=`crtr-cycle-divider`;function yE({message:e}){let t=typeof e.content==`string`?e.content:`yielded — new cycle begins`;return(0,L.jsxs)(`div`,{className:`flex items-center gap-3 my-1`,style:{opacity:.55},children:[(0,L.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}}),(0,L.jsx)(`span`,{className:`text-xs text-[var(--dim)] whitespace-nowrap`,children:t}),(0,L.jsx)(`div`,{className:`h-px flex-1`,style:{background:`var(--line2)`}})]})}function bE({message:e}){let t=e.excludeFromContext?`!!`:`!`,n=e.exitCode===void 0&&!e.cancelled;return(0,L.jsxs)(`div`,{className:`font-mono text-xs rounded border border-[var(--border,#333)] overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`px-2 py-1 bg-[var(--surface-raised,#1a1a1a)] flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`opacity-60 select-none`,children:t}),(0,L.jsx)(`span`,{className:`whitespace-pre-wrap break-all`,children:e.command}),n&&(0,L.jsx)(`span`,{className:`ml-auto opacity-50`,children:`running…`}),e.cancelled&&(0,L.jsx)(`span`,{className:`ml-auto opacity-70`,children:`cancelled`}),!n&&!e.cancelled&&e.exitCode!==0&&(0,L.jsxs)(`span`,{className:`ml-auto opacity-70`,children:[`exit `,e.exitCode]})]}),e.output!==``&&(0,L.jsx)(`pre`,{className:`px-2 py-1 whitespace-pre-wrap break-all m-0`,children:e.output}),e.truncated&&(0,L.jsx)(`div`,{className:`px-2 py-1 opacity-50`,children:`output truncated`})]})}function xE({text:e}){return(0,L.jsxs)(`div`,{className:`queued`,children:[(0,L.jsxs)(`div`,{className:`tag`,children:[(0,L.jsx)(`span`,{className:`select-none`,children:`⋯`}),(0,L.jsx)(`span`,{children:`queued`})]}),(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e})]})}function SE({message:e}){let t=e.content;return(0,L.jsx)(`div`,{className:`user`,children:typeof t==`string`?(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,children:t}):t.map((e,t)=>e.type===`text`?(0,L.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text},t):e.type===`image`?(0,L.jsx)(FT,{image:e},t):null)})}function CE({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,L.jsxs)(L.Fragment,{children:[a.map((e,t)=>e.type===`text`?(0,L.jsx)(MT,{text:e.text,inProgress:o(t)},t):e.type===`thinking`?(0,L.jsx)(NT,{thinking:e.thinking,inProgress:o(t)},t):e.type===`toolCall`?(0,L.jsx)(TE,{call:e,streaming:n,resultFor:r,executingToolIds:i},t):null),l&&(0,L.jsx)(wE,{stopReason:c,errorMessage:e.errorMessage})]})}function wE({stopReason:e,errorMessage:t}){let n=e===`aborted`?t&&t!==`Request was aborted`?t:`Operation aborted`:`Error: ${t||`Unknown error`}`;return(0,L.jsxs)(`div`,{className:`msg-error`,children:[(0,L.jsx)(`span`,{className:`ic`,"aria-hidden":`true`,children:`⚠`}),(0,L.jsx)(`span`,{className:`txt`,children:n})]})}function TE({call:e,streaming:t,resultFor:n,executingToolIds:r}){let i=gE(e.name),a=n(e.id);return(0,L.jsx)(i,{call:e,result:a,inProgress:t&&r.has(e.id),isError:a?.isError??!1})}function EE({message:e}){return(0,L.jsx)(gE(e.toolName),{call:{type:`toolCall`,id:e.toolCallId,name:e.toolName,arguments:{}},result:e,inProgress:!1,isError:e.isError})}function DE({message:e}){let{onPeek:t,peekedPath:n}=BT(),r=typeof e.content==`string`?e.content:e.content.filter(e=>e.type===`text`).map(e=>typeof e.text==`string`?e.text:``).join(``),i=_g(r),a=RT(r);function o(e){if(a.length===0)return(0,L.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,L.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i.slice(0,a)},o++));let s=n===e;r.push((0,L.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,L.jsx)(`span`,{className:`whitespace-pre-wrap`,children:i},o++)),(0,L.jsx)(L.Fragment,{children:r})}return(0,L.jsxs)(`div`,{className:`inbound`,children:[(0,L.jsx)(`span`,{className:`ic select-none`,children:`◍`}),(0,L.jsxs)(`div`,{className:`body`,children:[(0,L.jsxs)(`div`,{className:`src`,children:[(0,L.jsx)(`span`,{children:`inbox`}),i&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{children:`·`}),(0,L.jsxs)(`span`,{children:[`from `,i]})]})]}),o(r)]})]})}function OE({messages:e,partialToolResults:t,executingToolIds:n,queued:r,streaming:i,bottomInsetPx:a=0,keyboardOpen:o=!1,composerHeightPx:s}){let c=kT(),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=Jv({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,L.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,L.jsx)(`div`,{className:`relative w-full`,style:{height:`${h.getTotalSize()}px`},children:h.getVirtualItems().map(e=>{let t=u[e.index];return t?(0,L.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,L.jsxs)(`div`,{className:`flex items-center gap-3 mt-2.5 mb-3.5`,children:[c!==`focused`&&(0,L.jsx)(`span`,{className:`font-inst text-xs tracking-[0.16em] uppercase text-[var(--dim)]`,children:l.turnLabels[e.index]}),(0,L.jsx)(`div`,{className:`flex-1 h-px bg-[var(--line2)]`})]}),(0,L.jsx)(_E,{executingToolIds:n,message:t,isLastAssistant:t===l.lastAssistant,streaming:i,resultFor:d})]},e.key):null})}),r.length>0&&(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map((e,t)=>(0,L.jsx)(`div`,{className:`px-3.5 py-1.5 box-border`,children:(0,L.jsx)(xE,{text:e})},t))})]})}var kE={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 AE({conversationId:e}){let t=Dm(e),[n]=Hn(),r=ut(),i=n.get(`ask`);return t.length===0?null:(0,L.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,L.jsx)(jE,{deck:e,highlighted:i!==null&&e.job_id===i,navKey:r.key},e.id))})}function jE({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=pt(),{refetch:a}=Em(),[o,s]=(0,v.useState)(!1),c=km(e.kind).icon,l=e.kind===`notify`||e.kind===`validation`,u=async t=>{if(!o){s(!0);try{let n=(await Sm(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 Cm(e.job_id,{responses:[r]}),Nm(`Done — thanks!`,`success`),a()}catch(e){if(gm(e)){Nm(e instanceof Error?e.message:`That request was already handled.`),a();return}Nm(`Something went wrong — try again.`)}finally{s(!1)}}};return(0,L.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,L.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary`,children:(0,L.jsx)(c,{className:`size-4`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`truncate text-sm font-medium`,children:kE[e.kind]??kE.context}),(0,L.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.title})]}),e.kind===`notify`&&(0,L.jsxs)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`ack`),children:[(0,L.jsx)(wf,{className:`mr-1 size-3.5`}),` Got it`]}),e.kind===`validation`&&(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(Z,{size:`sm`,disabled:o,onClick:()=>void u(`yes`),children:`Approve`}),(0,L.jsx)(Z,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void u(`no`),children:`Reject`})]}),!l&&(0,L.jsxs)(Z,{size:`sm`,variant:`secondary`,onClick:()=>i(`/inbox/${encodeURIComponent(e.job_id)}`),children:[`Review `,(0,L.jsx)(Sf,{className:`ml-1 size-3.5`})]})]})}var ME=[`[&_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 NE({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),vp(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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3.5 py-3 border-b border-[var(--line)]`,children:[(0,L.jsx)(`span`,{className:`text-xs text-[var(--done)] shrink-0`,children:`◆`}),(0,L.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,L.jsxs)(`div`,{className:`flex gap-1.5 shrink-0`,children:[(0,L.jsx)(PE,{on:i===`pretty`,onClick:()=>a(`pretty`),children:`Pretty`}),(0,L.jsx)(PE,{on:i===`raw`,onClick:()=>a(`raw`),children:`Raw`}),(0,L.jsx)(PE,{onClick:n,"aria-label":`Close file peek`,children:`✕`})]})]}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-auto px-5 py-5`,children:[o&&(0,L.jsx)(`div`,{className:`flex items-center justify-center h-16 text-[var(--dim)] text-xs`,children:(0,L.jsx)(`span`,{className:`animate-pulse`,children:`Loading…`})}),c&&(0,L.jsx)(`div`,{className:`text-xs text-[var(--blk)]`,children:c}),u&&!o&&(0,L.jsxs)(L.Fragment,{children:[u.truncated&&(0,L.jsx)(`div`,{className:`mb-3 text-xs text-[var(--dim)]`,children:`File truncated — showing partial content`}),i===`raw`?(0,L.jsx)(`pre`,{className:`text-xs font-mono text-[var(--ink2)] whitespace-pre-wrap break-all leading-[1.7]`,children:u.content}):(0,L.jsx)(FE,{content:u.content})]})]}),(0,L.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,L.jsx)(`span`,{className:`kbd ml-auto`,children:`esc`})]})]}):null}function PE({on:e,onClick:t,children:n,...r}){return(0,L.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 FE({content:e}){if(e.startsWith(`---
74
74
  `)||e.startsWith(`---\r
75
75
  `)){let t=e.indexOf(`
76
76
  ---
77
77
  `,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,L.jsxs)(L.Fragment,{children:[i.length>0&&(0,L.jsx)(`div`,{className:`fm-chips`,children:i.map(({key:e,val:t})=>(0,L.jsxs)(`span`,{className:`fm-chip`,children:[e,` `,(0,L.jsx)(`b`,{children:t})]},e))}),(0,L.jsx)(`div`,{className:FE,dangerouslySetInnerHTML:{__html:xT(r)}})]})}}return(0,L.jsx)(`div`,{className:FE,dangerouslySetInnerHTML:{__html:xT(e)}})}var zE=/[A-Za-z0-9_:-]/,BE=/[A-Za-z0-9]/,VE=/[ \t\n\r\f\v]/;function HE(e){return zE.test(e)}function UE(e){return VE.test(e)}function WE(e,t){return t===0||UE(e[t-1])}function GE(e){let t=[],n=e.length;for(let r=0;r<n;r++){if(e[r]!==`/`||!WE(e,r))continue;let i=r+1;for(;i<n&&HE(e[i]);)i++;if(i===r+1)continue;let a=i;for(;a>r+1&&!BE.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 KE(e){return`/`+e.replace(/\//g,`:`)}function qE(e,t){let n=e.length,r=Math.max(0,Math.min(t,n)),i=r;for(;i>0&&HE(e[i-1]);)i--;let a=i-1;if(a<0||e[a]!==`/`||!WE(e,a))return null;let o=a+1;for(;o<n&&HE(e[o]);)o++;return{start:a,end:o,surfacePrefix:e.slice(a,r)}}function JE(e,t){let n=/^\/(\S+)/.exec(e);return n?t.has(n[1]):!1}function YE(e,t,n){if(JE(e,n))return[];let r=[];for(let n of GE(e))t.has(n.candidate)&&r.push({start:n.start,end:n.end,name:n.candidate});return r}function XE(e,t,n,r){if(JE(e,r))return null;let i=qE(e,t);if(!i||i.start===0)return null;let a=i.surfacePrefix,o=[];for(let e of n){let t=KE(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 ZE(e,t,n){let r=KE(n);return{text:e.slice(0,t.start)+r+e.slice(t.end),caret:t.start+r.length}}function QE(e,t,n){return!e||!t||t.start!==e.start||t.end!==e.end?!1:n.slice(e.start,e.end)===e.text}function $E(e,t){return e&&t&&t.start===e.start&&t.end===e.end?e:null}function eD(e,t){return e||t===229}function tD({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,L.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,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:e.items.map((e,n)=>(0,L.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,L.jsx)(`span`,{className:`ref-suggest-label font-mono text-sm font-semibold text-primary`,children:e.label}),e.shortForm&&(0,L.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:e.shortForm})]},e.name))})})}var nD=`​`,rD=`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)]`,iD=`relative z-10 bg-transparent text-transparent caret-[var(--ink)]`;function aD({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)(()=>YE(e,x,n),[e,x,n]),C=(0,v.useMemo)(()=>XE(e,m,t,n),[e,m,t,n]),[w,T]=(0,v.useState)(null),E=QE(w,C,e)?null:C;(0,v.useEffect)(()=>{T(e=>$E(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=ZE(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(eD(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=oD(e.endsWith(`
79
- `)?e+nD:e,S);return(0,L.jsxs)(`div`,{className:`memory-ref-shell relative`,children:[(0,L.jsx)(`div`,{ref:p,"aria-hidden":`true`,className:J(rD,i),children:N.map((e,t)=>e.highlighted?(0,L.jsx)(`span`,{className:`ref-hl`,children:e.text},t):(0,L.jsx)(`span`,{children:e.text},t))}),(0,L.jsx)(pm,{...d,ref:b,value:e,className:J(i,iD),onChange:k,onKeyDown:M,onSelect:A,onScroll:ee,onClick:j}),(0,L.jsx)(tD,{state:E,activeIndex:g,onHoverIndex:_,onSelect:e=>O(e)})]})}function oD(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 sD=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],cD=e=>({"--i":e}),lD={borderBottom:`1px solid var(--line)`,background:`linear-gradient(180deg, rgba(33,31,25,.7), rgba(20,19,16,0))`};function uD(e){let t=pt(),{store:n,detail:r,input:i,setInput:a,reviving:o,actionError:s,peekedPath:c,setPeekedPath:l,dormant:u,brokerUp:d,isController:f,streaming:p,canDrive:m,commands:h,refs:g,commandNames:_,onReplaceToken:y,sendPrimary:b,onInputKeyDown:x,selectCommand:S,doRevive:C,doClose:w}=hv(e.id);return(0,v.useEffect)(()=>{let e=e=>{!e.altKey||e.metaKey||e.ctrlKey||e.code!==`KeyD`||document.activeElement instanceof HTMLTextAreaElement||(e.preventDefault(),AT())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,L.jsx)(HT.Provider,{value:{peekedPath:c,onPeek:l},children:(0,L.jsxs)(`div`,{className:`in flex h-full min-h-0 flex-col`,children:[(0,L.jsxs)(`div`,{className:J(`con-head rv flex shrink-0 items-center gap-3 px-6 py-4`,u&&`opacity-80`),style:{...lD,...cD(1)},children:[(0,L.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,L.jsx)(Ef,{className:`size-4`}),`Conversations`]}),(0,L.jsx)(Dh,{store:n,detail:r}),(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(fD,{}),(0,L.jsx)(ig,{store:n})]}),(0,L.jsx)(`div`,{className:`rv`,style:cD(2),children:(0,L.jsx)(Nh,{store:n,detail:r})}),(0,L.jsx)(mD,{state:n.brokerStatus,dormant:u}),n.error&&(0,L.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,L.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:s}),(0,L.jsx)(NE,{conversationId:e.id}),(0,L.jsxs)(`div`,{className:`streamwrap relative flex min-h-0 flex-1 overflow-hidden`,children:[(0,L.jsx)(Jh,{currentId:e.id,onNavigate:e=>t(`/nodes/${e}`)}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,L.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,L.jsx)(jE,{messages:n.messages,partialToolResults:n.partialToolResults,executingToolIds:n.executingToolIds,queued:n.queued,streaming:p})}),u?(0,L.jsx)(gD,{id:e.id,reviving:o,onRevive:C,onClose:w}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(hD,{store:n,canDrive:m,streaming:p,onClose:w}),(0,L.jsxs)(`div`,{className:`relative flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,L.jsx)(_v,{commands:h,query:i,visible:i.startsWith(`/`),onSelect:S}),(0,L.jsx)(aD,{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:pD(f,d),rows:3}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,L.jsx)(_D,{id:e.id}),(0,L.jsx)(Z,{variant:`default`,onClick:b,disabled:!m||!i.trim(),children:p?`Steer`:`Send`})]})]})]})]}),(0,L.jsx)(IE,{nodeId:e.id,path:c,onClose:()=>l(null)})]}),(0,L.jsx)(Lh,{store:n,detail:r}),(0,L.jsx)(bv,{store:n})]})})}var dD=[{value:`focused`,label:`Focused`},{value:`standard`,label:`Standard`},{value:`verbose`,label:`Verbose`}];function fD(){let e=MT();return(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,title:`Transcript detail — Focused / Standard / Verbose (⌥D to cycle)`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Detail`}),(0,L.jsxs)(om,{value:e,onValueChange:e=>kT(e),children:[(0,L.jsx)(cm,{size:`sm`,className:`text-sm`,"aria-label":`Transcript detail`,children:(0,L.jsx)(sm,{})}),(0,L.jsx)(lm,{children:dD.map(e=>(0,L.jsx)(um,{value:e.value,children:e.label},e.value))})]})]})}function pD(e,t){return e?t?`Type a prompt, or / for commands…`:`broker is down — input is frozen`:`observer — request control to drive this session`}function mD({state:e,dormant:t}){return t||e!==`down`&&e!==`reconnecting`?null:(0,L.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 hD({store:e,canDrive:t,streaming:n,onClose:r}){let[i,a]=(0,v.useState)(null),o=i??e.state?.thinkingLevel??`medium`;return(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-2`,children:[(0,L.jsx)(Z,{variant:`secondary`,size:`sm`,disabled:!t||!n,onClick:()=>e.abort(),children:`Abort`}),(0,L.jsxs)(`label`,{className:`tiny-sel relative`,"aria-disabled":!t,children:[`thinking `,(0,L.jsx)(`b`,{children:o}),(0,L.jsx)(Tf,{className:`size-3.5`}),(0,L.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:sD.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))})]}),(0,L.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.cycleModel(),children:`Cycle model`}),(0,L.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.compact(),children:`Compact`}),(0,L.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,L.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-3`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`This node is dormant (read-only). Revive to drive it live.`}),(0,L.jsx)(_D,{id:e}),(0,L.jsx)(Z,{variant:`default`,disabled:t,onClick:n,children:t?`Revive…`:`Revive`}),(0,L.jsx)(Z,{variant:`destructive`,onClick:r,children:`Close node`})]})}function _D({id:e}){let[t,n]=(0,v.useState)(!1);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z,{variant:`secondary`,onClick:()=>n(!0),children:`Message (inbox)`}),(0,L.jsx)(vD,{id:e,open:t,onOpenChange:n})]})}function vD({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,L.jsx)(Xp,{open:t,onOpenChange:n,children:(0,L.jsxs)($p,{children:[(0,L.jsxs)(em,{children:[(0,L.jsx)(nm,{children:`Send an inbox message`}),(0,L.jsx)(rm,{children:`A directive deliverable to any node, including a dormant one.`})]}),(0,L.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),r.trim()){c(!0),u(null);try{let t=await hp(e,{body:r.trim(),...a.trim()?{tier:a.trim()}:{}});u(`delivered=${String(t.delivered)} revived=${String(t.revived)}`),i(``)}catch(e){u(gv(e))}finally{c(!1)}}},className:`flex flex-col gap-3`,children:[(0,L.jsx)(pm,{value:r,onChange:e=>i(e.currentTarget.value),rows:4,required:!0,placeholder:`Message body…`}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[`tier`,(0,L.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,L.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:l}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>n(!1),disabled:s,children:`Close`}),(0,L.jsx)(Z,{type:`submit`,variant:`default`,disabled:s,children:s?`Sending…`:`Send`})]})]})]})})}function yD(e){e.key===`Enter`&&e.stopPropagation()}function bD(e){return!e.canDrive&&!e.store.serverConnected?`broker is down — input is frozen`:e.canDrive?`Type a prompt. Enter makes a new line; Send submits.`:`observer — request control in More to 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,L.jsxs)(`div`,{ref:n,className:`mobile-composer shrink-0 border-t border-border bg-[var(--panel)] px-3 py-3`,children:[(0,L.jsx)(aD,{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:bD(e),onChange:t=>{e.setInput(t.currentTarget.value),requestAnimationFrame(()=>c(a.current))},onKeyDown:yD}),(0,L.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[e.streaming&&(0,L.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,disabled:!e.canDrive,onClick:()=>e.store.abort(),children:`Stop`}),(0,L.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,L.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Offline — draft saved locally.`}),e.store.serverConnected&&!e.canDrive&&(0,L.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Request control in More to drive this thread.`})]})}var SD={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 CD({title:e,statusLabel:t,statusTone:n,onBack:r,onOpenOverflow:i}){return(0,L.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,L.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,L.jsx)(Ef,{className:`size-4`})}),(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(`h1`,{className:`truncate text-base font-medium text-[var(--ink)]`,children:e})}),t&&(0,L.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`,SD[n]),children:[n===`working`||n===`reconnecting`?(0,L.jsx)(Uf,{className:`size-3.5 shrink-0 animate-spin`}):(0,L.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,L.jsx)(`span`,{className:`truncate`,children:t})]}),(0,L.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,L.jsx)(If,{className:`size-4`})})]})}var wD=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function TD({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,L.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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Thread actions`}),(0,L.jsx)(`p`,{className:`truncate text-sm text-[var(--ink)]`,children:t.detail?.name?.trim()||`Thread`})]}),(0,L.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,L.jsx)($f,{className:`size-4`})})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pt-4 pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,L.jsxs)(`section`,{className:`space-y-3`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Control`}),(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,L.jsx)(ig,{store:t.store})})]}),(0,L.jsxs)(`section`,{className:`space-y-3`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Session`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.cycleModel(),disabled:!t.canDrive,children:`Cycle model`}),(0,L.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.compact(),disabled:!t.canDrive,children:`Compact`}),(0,L.jsx)(Z,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>void t.doClose(),children:`Close node`}),t.dormant&&(0,L.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>void t.doRevive(),disabled:t.reviving,children:t.reviving?`Reviving…`:`Revive`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Thinking`}),(0,L.jsxs)(om,{value:r,onValueChange:e=>{let n=e;i(n),t.store.setThinkingLevel(n)},disabled:!t.canDrive,children:[(0,L.jsx)(cm,{size:`sm`,className:`min-w-36 text-sm`,children:(0,L.jsx)(sm,{placeholder:`Thinking`})}),(0,L.jsx)(lm,{children:wD.map(e=>(0,L.jsx)(um,{value:e,children:e},e))})]})]})]}),(0,L.jsxs)(`section`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Context`}),(0,L.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-[rgba(0,0,0,.12)]`,children:(0,L.jsx)(Nh,{store:t.store,detail:t.detail})})]}),(0,L.jsxs)(`section`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Instruments`}),(0,L.jsx)(`div`,{className:`panel overflow-hidden p-3`,children:(0,L.jsx)(kh,{store:t.store,detail:t.detail})})]})]})]})}):null}function ED({id:e}){let t=pt(),n=hv(e),{nodes:r}=Gp(),[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)(()=>ph(r),[r]),u=(0,v.useMemo)(()=>Uh(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)(()=>DD(n,d),[d,n]),h=n.store.messages.length===0,g=OD(n,d),_=(0,v.useMemo)(()=>({peekedPath:n.peekedPath,onPeek:n.setPeekedPath}),[n.peekedPath,n.setPeekedPath]);return(0,L.jsx)(HT.Provider,{value:_,children:(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,L.jsx)(CD,{title:f,statusLabel:p,statusTone:m,onBack:()=>t(`/`),onOpenOverflow:()=>a(!0)}),n.actionError&&(0,L.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,L.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,L.jsx)(NE,{conversationId:u}),(0,L.jsxs)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,L.jsx)(jE,{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,L.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,L.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,L.jsx)(`p`,{className:`font-medium text-[var(--ink)]`,children:g}),(0,L.jsx)(`p`,{children:n.store.serverConnected?`Waiting for the thread to load…`:`Drafts stay local while the broker reconnects.`})]})})]}),(0,L.jsx)(xD,{screen:n,onMetricsChange:c}),(0,L.jsx)(bv,{store:n.store}),(0,L.jsx)(TD,{open:i,screen:n,onClose:()=>a(!1)}),n.peekedPath&&(0,L.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,L.jsx)(IE,{nodeId:e,path:n.peekedPath,onClose:()=>n.setPeekedPath(null),className:`w-full max-w-[100vw]`})})]})})}function DD(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 OD(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 kD(){let{decks:e,loading:t}=Em();return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,L.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,L.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Inbox`}),e.length>0&&(0,L.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,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,L.jsx)(ND,{}):e.length===0?(0,L.jsx)(MD,{}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map(e=>(0,L.jsx)(AD,{deck:e},e.id))})})]})}function AD({deck:e}){let t=pt(),n=km(e.kind),r=n.icon,i=e.claim_owner===void 0?e.subtitle:`claimed by ${e.claim_owner} · ${e.subtitle}`;return(0,L.jsx)(`li`,{className:`list-none`,children:(0,L.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,L.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,L.jsx)(r,{className:`size-4.5`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title}),(0,L.jsx)(`span`,{className:`instlabel shrink-0`,children:n.label})]}),(0,L.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:i}),(0,L.jsx)(jD,{deck:e,className:`mt-1.5`})]}),(0,L.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.08em`,color:`var(--mut)`},title:`waiting ${Am(e.blocked_since)}`,children:Am(e.blocked_since)})]})})}function jD({deck:e,className:t}){return e.source_label===void 0?null:(0,L.jsxs)(`div`,{className:J(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs`,t),children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`in `,(0,L.jsx)(`span`,{className:`font-medium text-foreground/80`,children:e.conversation_title})]}),(0,L.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,L.jsx)(Pn,{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,L.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,L.jsx)(`span`,{className:`font-mono text-muted-foreground/60`,title:e.cwd,children:e.cwd})]})}function MD(){return(0,L.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center py-16 text-center`,children:[(0,L.jsx)(`p`,{className:`text-2xl`,style:{fontStyle:`italic`,color:`var(--ink)`},children:`You're all caught up.`}),(0,L.jsx)(`p`,{className:`mt-1.5 text-sm`,style:{color:`var(--mut)`},children:`Nothing needs your input right now.`})]})}function ND(){return(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2].map(e=>(0,L.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,L.jsx)(`div`,{className:`size-9 shrink-0 animate-pulse rounded-lg bg-muted`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,L.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded-none bg-muted`}),(0,L.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded-none bg-muted/70`})]})]},e))})}function PD({deckId:e}){let t=pt(),[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),Sm(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(gm(e)){Nm(e instanceof cp?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,L.jsx)(qD,{});if(o)return(0,L.jsx)(FD,{error:o,onRetry:()=>p(e=>e+1),onBack:()=>t(`/inbox`)});if(!n)return(0,L.jsx)(qD,{});let h=async e=>{if(u)return;d(!0);let r=Object.values(e??c).map(({selectedOptionId:e,...t})=>t);try{await Cm(n.job_id,{responses:r}),Nm(`Done — thanks!`,`success`),t(`/inbox`,{replace:!0})}catch(e){if(gm(e)){Nm(e instanceof cp?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}Nm(e instanceof cp?e.message:`Something went wrong — try again.`),d(!1)}},g=n.interactions.length===1?n.interactions[0]:null,_=km(n.kind).icon;return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col px-6 py-8`,children:[(0,L.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,L.jsx)(xf,{className:`size-4`}),` Inbox`]}),(0,L.jsxs)(`header`,{className:`mb-5 flex items-start gap-3`,children:[(0,L.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,L.jsx)(_,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:n.title}),(0,L.jsx)(`p`,{className:`mt-0.5 text-sm`,style:{color:`var(--mut)`},children:n.subtitle}),(0,L.jsx)(jD,{deck:n,className:`mt-2`})]})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.interactions.map(e=>(0,L.jsx)(RD,{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))})}),!ID(g)&&(0,L.jsxs)(`footer`,{className:`mt-6 flex shrink-0 items-center justify-end gap-2 border-t border-border pt-4`,children:[(0,L.jsx)(Z,{variant:`ghost`,onClick:()=>t(`/inbox`),disabled:u,children:`Cancel`}),(0,L.jsx)(Z,{onClick:()=>void h(),disabled:u||!LD(n,c),children:u?`Sending…`:`Submit`})]})]})}function FD({error:e,onRetry:t,onBack:n}){return(0,L.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col justify-center px-6 py-8`,children:(0,L.jsxs)(`section`,{className:`panel p-5`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Couldn’t load the deck`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.message}),(0,L.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,L.jsx)(Z,{onClick:t,children:`Retry`}),(0,L.jsx)(Z,{variant:`ghost`,onClick:n,children:`Back to inbox`})]})]})})}function ID(e){return e!==null&&(e.kind===`notify`||e.kind===`validation`)}function LD(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 RD({interaction:e,answer:t,onChange:n,conversationId:r,busy:i,onResolveWith:a}){switch(e.kind){case`notify`:return(0,L.jsx)(HD,{interaction:e,onGotIt:()=>a?.({id:e.id}),direct:!!a});case`validation`:return(0,L.jsx)(UD,{interaction:e,answer:t,onChange:n,busy:i,onResolveWith:a});case`context`:return(0,L.jsx)(GD,{interaction:e,answer:t,onChange:n});case`error`:return(0,L.jsx)(KD,{interaction:e,answer:t,onChange:n,conversationId:r});default:return(0,L.jsx)(WD,{interaction:e,answer:t,onChange:n})}}function zD({body:e}){return e?(0,L.jsx)(`div`,{className:`prose prose-sm max-w-none text-sm text-foreground/85 dark:prose-invert`,dangerouslySetInnerHTML:{__html:hT(xT(e))}}):null}function BD({children:e,className:t}){return(0,L.jsx)(`section`,{className:J(`panel p-5`,t),children:e})}function VD({it:e}){return(0,L.jsxs)(`div`,{className:`mb-3`,children:[(0,L.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),(0,L.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:e.subtitle})]})}function HD({interaction:e,onGotIt:t,direct:n}){return(0,L.jsxs)(BD,{children:[(0,L.jsx)(VD,{it:e}),(0,L.jsx)(zD,{body:e.body}),n&&(0,L.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,L.jsxs)(Z,{onClick:t,children:[(0,L.jsx)(wf,{className:`mr-1.5 size-4`}),` Got it`]})})]})}function UD({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,L.jsxs)(BD,{children:[(0,L.jsx)(VD,{it:e}),(0,L.jsx)(zD,{body:e.body}),(0,L.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3`,children:[(0,L.jsx)(pm,{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,L.jsxs)(`div`,{className:`flex gap-3`,children:[(0,L.jsx)(Z,{className:`flex-1`,size:`lg`,disabled:r,onClick:()=>a&&s(a.id),children:a?.label??`Approve`}),(0,L.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,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected: `,e.options.find(e=>e.id===t.selectedOptionIds?.[0])?.label]})]})]})}function WD({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,L.jsxs)(BD,{children:[(0,L.jsx)(VD,{it:e}),(0,L.jsx)(zD,{body:e.body}),(0,L.jsx)(`ul`,{className:`mt-4 flex flex-col gap-2`,children:e.options.map(t=>{let n=r.has(t.id);return(0,L.jsx)(`li`,{children:(0,L.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,L.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,L.jsx)(wf,{className:`size-3`})}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:t.label}),t.description&&(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:t.description})]})]})},t.id)})}),e.allowFreetext&&(0,L.jsx)(pm,{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 GD({interaction:e,answer:t,onChange:n}){let r=t.selectedOptionIds?.[0];return(0,L.jsxs)(BD,{children:[(0,L.jsx)(VD,{it:e}),e.body&&(0,L.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border p-3`,style:{background:`color-mix(in oklch, var(--ink) 3%, transparent)`},children:[(0,L.jsx)(`p`,{className:`instlabel mb-1.5`,children:`Why we're asking`}),(0,L.jsx)(zD,{body:e.body})]}),e.options.length>0&&(0,L.jsx)(`ul`,{className:`mb-3 flex flex-col gap-2`,children:e.options.map(e=>(0,L.jsx)(`li`,{children:(0,L.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,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})})},e.id))}),(e.allowFreetext||e.options.length===0)&&(0,L.jsx)(pm,{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 KD({interaction:e,answer:t,onChange:n,conversationId:r}){let i=pt();return(0,L.jsxs)(BD,{className:`border-destructive/30`,children:[(0,L.jsx)(VD,{it:e}),(0,L.jsx)(zD,{body:e.body}),(0,L.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[e.options.map(e=>(0,L.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,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})},e.id)),(0,L.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 qD(){return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full max-w-2xl flex-col gap-5 px-6 py-8`,children:[(0,L.jsx)(`div`,{className:`h-4 w-16 animate-pulse rounded-none bg-muted`}),(0,L.jsx)(`div`,{className:`h-7 w-1/2 animate-pulse rounded-none bg-muted`}),(0,L.jsx)(`div`,{className:`h-40 w-full animate-pulse rounded-2xl bg-muted/60`})]})}var JD=`crtr-push-token-v1`,YD=`/__push-token`;async function XD(e){if(typeof caches>`u`)return;let t=await caches.open(JD);if(e===void 0||e===``){await t.delete(YD);return}await t.put(YD,new Response(e))}function ZD(){let e={"content-type":`application/json`};return sp!==void 0&&(e.authorization=`Bearer ${sp}`),e}function QD(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}function $D(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 eO(){let e=await fetch(`/__crtr/push/vapid-public-key`,{headers:ZD()});if(!e.ok)throw Error(`could not load the push key (${e.status})`);return(await e.json()).publicKey}async function tO(e){let t=await fetch(`/__crtr/push/subscribe`,{method:`POST`,headers:ZD(),body:JSON.stringify(e.toJSON())});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`subscribe failed (${t.status})`)}}async function nO(){if(!QD())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 rO(){if(!QD())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 XD(sp);try{await tO(t)}catch(e){throw await t.unsubscribe().catch(()=>{}),await XD(void 0).catch(()=>{}),e}return}let n=await eO(),r=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:$D(n)});try{await XD(sp)}catch(e){throw await r.unsubscribe().catch(()=>{}),e}try{await tO(r)}catch(e){throw await r.unsubscribe().catch(()=>{}),await XD(void 0).catch(()=>{}),e}}async function iO(){if(!QD())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 XD(void 0).catch(()=>{});try{await fetch(`/__crtr/push/subscribe`,{method:`DELETE`,headers:ZD(),body:JSON.stringify({endpoint:n})})}catch{}}function aO(){let[e,t]=(0,v.useState)(()=>QD()?`unsubscribed`:`unsupported`),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{nO().then(t)},[]);return(0,v.useEffect)(()=>{o()},[o]),{status:e,busy:n,error:i,enable:(0,v.useCallback)(()=>{r(!0),a(null),rO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o]),disable:(0,v.useCallback)(()=>{r(!0),a(null),iO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o])}}function oO(){let[e,t]=(0,v.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,L.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,L.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Settings`}),(0,L.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,L.jsx)(`h2`,{className:`instlabel`,children:`Appearance`}),(0,L.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e?`Dark theme`:`Light theme`,` is active.`]}),(0,L.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,L.jsx)(sO,{})]})}function sO(){let{status:e,busy:t,error:n,enable:r,disable:i}=aO();return(0,L.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,L.jsx)(`h2`,{className:`instlabel`,children:`Notifications`}),e===`unsupported`&&(0,L.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications aren’t supported in this browser.`}),e===`denied`&&(0,L.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,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Z,{variant:`outline`,onClick:r,disabled:t,children:`Enable notifications`})]}),e===`subscribed`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications are on for this browser.`}),(0,L.jsx)(Z,{variant:`outline`,onClick:i,disabled:t,children:`Disable notifications`})]}),n!==null&&(0,L.jsx)(`p`,{className:`text-sm`,style:{color:`var(--warning)`},children:n})]})}var cO=`(max-width: 767px)`;function lO(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(cO).matches}function uO(){let[e,t]=(0,v.useState)(lO);return(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(cO),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function dO(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 fO(){let{id:e}=ht();return uO()?(0,L.jsx)(ED,{id:e??``},e):(0,L.jsx)(uD,{id:e??``},e)}function pO(){let{deckId:e}=ht();return(0,L.jsx)(PD,{deckId:e??``})}function mO(){return(0,L.jsxs)(Ht,{children:[(0,L.jsx)(Bt,{path:`/`,element:(0,L.jsx)(_h,{})}),(0,L.jsx)(Bt,{path:`/new`,element:(0,L.jsx)(zt,{to:`/?new=1`,replace:!0})}),(0,L.jsx)(Bt,{path:`/canvas`,element:(0,L.jsx)(eh,{})}),(0,L.jsx)(Bt,{path:`/nodes/:id`,element:(0,L.jsx)(fO,{})}),(0,L.jsx)(Bt,{path:`/c/:id`,element:(0,L.jsx)(fO,{})}),(0,L.jsx)(Bt,{path:`/inbox`,element:(0,L.jsx)(kD,{})}),(0,L.jsx)(Bt,{path:`/inbox/:deckId`,element:(0,L.jsx)(pO,{})}),(0,L.jsx)(Bt,{path:`/settings`,element:(0,L.jsx)(oO,{})}),(0,L.jsx)(Bt,{path:`*`,element:(0,L.jsx)(_h,{})})]})}function hO(){let e=pt();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(dO(n.conversationId,r,sp))};return navigator.serviceWorker.addEventListener(`message`,t),()=>navigator.serviceWorker.removeEventListener(`message`,t)},[e]),null}function gO(){return Np(e=>e.reachable)?null:(0,L.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 _O(e){e(`/?new=1`)}var vO=[{id:`conversations`,label:`Conversations`,path:`/`},{id:`canvas`,label:`Canvas`,path:`/canvas`},{id:`inbox`,label:`Inbox`,path:`/inbox`},{id:`settings`,label:`Settings`,path:`/settings`}],yO={conversations:Gf,canvas:Kf,inbox:Bf,settings:Xf};function bO({compact:e}){let t=pt();return(0,L.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,L.jsxs)(Pn,{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,L.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,L.jsxs)(`button`,{type:`button`,onClick:()=>_O(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,L.jsx)(qf,{size:e?18:16,className:`flex-none`,"aria-hidden":!0}),!e&&(0,L.jsx)(`span`,{children:`New chat`})]}),vO.map(t=>{let n=yO[t.id]??Gf;return(0,L.jsxs)(Fn,{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,L.jsx)(n,{size:18,className:e?void 0:`flex-none opacity-75`,"aria-hidden":!0}),!e&&(0,L.jsx)(`span`,{children:t.label}),t.id===`inbox`&&(0,L.jsx)(xO,{compact:e})]},t.id)}),(0,L.jsx)(`div`,{className:`flex-1`})]})}function xO({compact:e}){let t=Tm();return t<=0?null:e?(0,L.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,L.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 SO(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 CO({open:e,onClose:t}){let{nodes:n}=Gp(),r=pt(),[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:ah(e),dot:uh(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,L.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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,style:{borderColor:`var(--line)`},children:[(0,L.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Jump to`}),(0,L.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,L.jsx)(`span`,{className:`kbd`,children:`esc`})]}),(0,L.jsx)(`ul`,{className:`max-h-80 overflow-auto py-1`,children:l.length===0?(0,L.jsx)(`li`,{className:`px-4 py-3 text-sm italic`,style:{color:`var(--mut)`},children:`no live nodes`}):l.map((e,t)=>(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(`span`,{className:J(`dot shrink-0`,e.dot)}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,style:{color:`var(--ink)`},children:e.title}),(0,L.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:e.kind})]})},e.id))})]})})}var wO=/^\/(nodes|c)\//;function TO({children:e}){let t=ut(),n=pt(),[r,i]=(0,v.useState)(!1);return SO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey&&e.code===`KeyO`,[]),(0,v.useCallback)(()=>_O(n),[n])),SO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&e.code===`KeyK`,[]),(0,v.useCallback)(()=>i(e=>!e),[])),(0,L.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,L.jsx)(bO,{compact:wO.test(t.pathname)}),(0,L.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),(0,L.jsx)(CO,{open:r,onClose:()=>i(!1)})]})}var EO=/^\/(?:c|nodes)\/([^/]+)\/?$/;function DO(e){let t=EO.exec(e);if(!t)return null;let n=t[1];return n===void 0?null:decodeURIComponent(n)}var OO=[{id:`home`,label:`Home`,path:`/`,icon:zf},{id:`inbox`,label:`Inbox`,path:`/inbox`,icon:Bf}];function kO(){let e=pt();return(0,L.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:[OO.map(e=>(0,L.jsxs)(Fn,{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,L.jsx)(e.icon,{size:20,"aria-hidden":!0}),(0,L.jsx)(`span`,{children:e.label}),e.id===`inbox`&&(0,L.jsx)(AO,{})]},e.id)),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>_O(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,L.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,L.jsx)(qf,{size:18,"aria-hidden":!0})}),(0,L.jsx)(`span`,{children:`New`})]})]})}function AO(){let e=Tm();return e<=0?null:(0,L.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 jO(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches===!0||window.navigator.standalone===!0}function MO(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(jO);(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 NO(){let{canInstall:e,promptInstall:t}=MO(),[n,r]=(0,v.useState)(!1);return!e||n?null:(0,L.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,L.jsx)(`span`,{className:`flex-1`,children:`Install crouter for quick, full-screen access.`}),(0,L.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,L.jsx)(Ff,{size:14,"aria-hidden":!0}),`Install`]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>r(!0),"aria-label":`Dismiss install prompt`,className:`[color:var(--ink2)]`,children:(0,L.jsx)($f,{size:14,"aria-hidden":!0})})]})}function PO(e){let t=(0,v.useSyncExternalStore)(J_.subscribe,J_.getWarmIds),{nodes:n}=Gp();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?ah(t):e,dot:t?uh(t):`idle`}})},[t,n,e])}function FO(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 IO(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 LO=48,RO=1.5,zO=24;function BO(e){if(e.scrolled||e.startX<zO)return null;let t=e.endX-e.startX,n=e.endY-e.startY;return Math.abs(t)<LO||Math.abs(t)<Math.abs(n)*RO?null:t<0?`next`:`prev`}function VO(e,t){return t>-48?!1:Math.abs(t)>=Math.abs(e)*RO}function HO({open:e,activeId:t,onClose:n}){let r=pt(),{nodes:i}=Gp(),a=Tm(),[o,s]=(0,v.useState)(``),c=(0,v.useMemo)(()=>ph(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,L.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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,L.jsx)(`p`,{className:`instlabel flex-1`,children:`Conversations`}),(0,L.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,L.jsx)($f,{className:`size-4`})})]}),(0,L.jsx)(`div`,{className:`border-b border-border px-4 py-2`,children:(0,L.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,L.jsxs)(`ul`,{className:`min-h-0 flex-none overflow-auto border-b border-border py-1`,children:[(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(zf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`text-sm [color:var(--ink)]`,children:`Home`})]})}),(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(Bf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`flex-1 text-sm [color:var(--ink)]`,children:`Inbox`}),a>0&&(0,L.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,L.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,L.jsx)(`li`,{className:`px-4 py-3 text-sm italic [color:var(--mut)]`,children:`no conversations`}):l.map(e=>(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(`span`,{className:J(`dot shrink-0`,e.state===`needs-you`?`blocked`:e.state),"aria-hidden":!0}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm [color:var(--ink)]`,children:e.title}),(0,L.jsx)(`span`,{className:`block truncate text-xs [color:var(--mut)]`,children:mh(e)})]})]})},e.id))})]})})}var UO=4;function WO({activeId:e}){let t=pt(),n=PO(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=IO(n,r);t(e?`/c/${encodeURIComponent(e)}`:`/`)}J_.evict(r)};return(0,L.jsxs)(L.Fragment,{children:[(0,L.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)>UO,l=BO({startX:i.x,startY:i.y,endX:a.clientX,endY:a.clientY,scrolled:o});if(!l)return;let u=FO(n,e,l);u&&t(`/c/${encodeURIComponent(u)}`)},children:[(0,L.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,L.jsx)(Hf,{className:`size-4`,"aria-hidden":!0})}),(0,L.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,L.jsx)(qO,{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,L.jsx)(`button`,{type:`button`,onClick:()=>_O(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,L.jsx)(qf,{className:`size-4`,"aria-hidden":!0})})]}),(0,L.jsx)(HO,{open:r,activeId:e,onClose:()=>i(!1)})]})}var GO=480,KO=8;function qO({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,L.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()},GO))},onTouchMove:e=>{let t=s.current,n=e.touches[0];!t||!n||Math.hypot(n.clientX-t.x,n.clientY-t.y)>KO&&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}VO(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,L.jsx)(`span`,{className:J(`dot shrink-0`,e.dot),"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`max-w-32 truncate`,children:e.title}),n&&(0,L.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,L.jsx)($f,{className:`size-3`,"aria-hidden":!0})})]})}function JO({children:e}){let t=DO(ut().pathname);return(0,L.jsxs)(`div`,{className:`mobile-shell-root flex flex-col overflow-hidden`,children:[(0,L.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),t===null?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(NO,{}),(0,L.jsx)(kO,{})]}):(0,L.jsx)(WO,{activeId:t},t)]})}function YO({children:e}){return uO()?(0,L.jsx)(JO,{children:e}):(0,L.jsx)(TO,{children:e})}var XO=`false`,ZO=`false`,QO=XO===`true`,$O=ZO===`true`;function ek(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,QO||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()},!$O)if(QO)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 tk(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)(()=>ek({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 nk(){let{needRefresh:[e,t],offlineReady:[n,r],updateServiceWorker:i}=tk({onRegisterError(e){console.warn(`crtr web: service worker registration failed`,e)}});return(0,v.useEffect)(()=>{n&&(Nm(`App ready to work offline`,`success`),r(!1))},[n,r]),{needRefresh:e,dismiss:()=>t(!1),refresh:()=>void i(!0)}}function rk(){let{needRefresh:e,dismiss:t,refresh:n}=nk();return e?(0,L.jsx)(`div`,{className:`pwa-update-banner px-3`,children:(0,L.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,L.jsx)(`span`,{children:`Update ready`}),(0,L.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,L.jsx)(Jf,{size:14,"aria-hidden":!0}),`Refresh`]}),(0,L.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss update prompt`,className:`[color:var(--ink2)]`,children:(0,L.jsx)($f,{size:14,"aria-hidden":!0})})]})}):null}function ik(){let e=Mm(e=>e.toasts),t=Mm(e=>e.dismiss);return e.length===0?null:(0,L.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,L.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 ak(){return(0,L.jsx)(Mn,{children:(0,L.jsxs)(gf,{delayDuration:300,children:[(0,L.jsx)(gO,{}),(0,L.jsx)(hO,{}),(0,L.jsx)(YO,{children:(0,L.jsx)(mO,{})}),(0,L.jsx)(rk,{}),(0,L.jsx)(ik,{})]})})}document.documentElement.classList.add(`dark`),document.documentElement.classList.remove(`light`);var ok=document.getElementById(`root`);if(!ok)throw Error(`crtr web: #root element not found in index.html`);(0,b.createRoot)(ok).render((0,L.jsx)(v.StrictMode,{children:(0,L.jsx)(ak,{})}));
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,L.jsxs)(L.Fragment,{children:[i.length>0&&(0,L.jsx)(`div`,{className:`fm-chips`,children:i.map(({key:e,val:t})=>(0,L.jsxs)(`span`,{className:`fm-chip`,children:[e,` `,(0,L.jsx)(`b`,{children:t})]},e))}),(0,L.jsx)(`div`,{className:ME,dangerouslySetInnerHTML:{__html:vT(r)}})]})}}return(0,L.jsx)(`div`,{className:ME,dangerouslySetInnerHTML:{__html:vT(e)}})}var IE=/[A-Za-z0-9_:-]/,LE=/[A-Za-z0-9]/,RE=/[ \t\n\r\f\v]/;function zE(e){return IE.test(e)}function BE(e){return RE.test(e)}function VE(e,t){return t===0||BE(e[t-1])}function HE(e){let t=[],n=e.length;for(let r=0;r<n;r++){if(e[r]!==`/`||!VE(e,r))continue;let i=r+1;for(;i<n&&zE(e[i]);)i++;if(i===r+1)continue;let a=i;for(;a>r+1&&!LE.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 UE(e){return`/`+e.replace(/\//g,`:`)}function WE(e,t){let n=e.length,r=Math.max(0,Math.min(t,n)),i=r;for(;i>0&&zE(e[i-1]);)i--;let a=i-1;if(a<0||e[a]!==`/`||!VE(e,a))return null;let o=a+1;for(;o<n&&zE(e[o]);)o++;return{start:a,end:o,surfacePrefix:e.slice(a,r)}}function GE(e,t){let n=/^\/(\S+)/.exec(e);return n?t.has(n[1]):!1}function KE(e,t,n){if(GE(e,n))return[];let r=[];for(let n of HE(e))t.has(n.candidate)&&r.push({start:n.start,end:n.end,name:n.candidate});return r}function qE(e,t,n,r){if(GE(e,r))return null;let i=WE(e,t);if(!i||i.start===0)return null;let a=i.surfacePrefix,o=[];for(let e of n){let t=UE(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 JE(e,t,n){let r=UE(n);return{text:e.slice(0,t.start)+r+e.slice(t.end),caret:t.start+r.length}}function YE(e,t,n){return!e||!t||t.start!==e.start||t.end!==e.end?!1:n.slice(e.start,e.end)===e.text}function XE(e,t){return e&&t&&t.start===e.start&&t.end===e.end?e:null}function ZE(e,t){return e||t===229}function QE({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,L.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,L.jsx)(`ul`,{className:`flex flex-col divide-y divide-border/40`,children:e.items.map((e,n)=>(0,L.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,L.jsx)(`span`,{className:`ref-suggest-label font-mono text-sm font-semibold text-primary`,children:e.label}),e.shortForm&&(0,L.jsx)(`span`,{className:`basis-full text-xs text-muted-foreground`,children:e.shortForm})]},e.name))})})}var $E=`​`,eD=`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)]`,tD=`relative z-10 bg-transparent text-transparent caret-[var(--ink)]`;function nD({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)(()=>KE(e,x,n),[e,x,n]),C=(0,v.useMemo)(()=>qE(e,m,t,n),[e,m,t,n]),[w,T]=(0,v.useState)(null),E=YE(w,C,e)?null:C;(0,v.useEffect)(()=>{T(e=>XE(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=JE(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(ZE(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=rD(e.endsWith(`
79
+ `)?e+$E:e,S);return(0,L.jsxs)(`div`,{className:`memory-ref-shell relative`,children:[(0,L.jsx)(`div`,{ref:p,"aria-hidden":`true`,className:J(eD,i),children:N.map((e,t)=>e.highlighted?(0,L.jsx)(`span`,{className:`ref-hl`,children:e.text},t):(0,L.jsx)(`span`,{children:e.text},t))}),(0,L.jsx)(pm,{...d,ref:b,value:e,className:J(i,tD),onChange:k,onKeyDown:M,onSelect:A,onScroll:ee,onClick:j}),(0,L.jsx)(QE,{state:E,activeIndex:g,onHoverIndex:_,onSelect:e=>O(e)})]})}function rD(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`],aD=e=>({"--i":e}),oD={borderBottom:`1px solid var(--line)`,background:`linear-gradient(180deg, rgba(33,31,25,.7), rgba(20,19,16,0))`};function sD(e){let t=pt(),{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}=mv(e.id);return(0,v.useEffect)(()=>{let e=e=>{!e.altKey||e.metaKey||e.ctrlKey||e.code!==`KeyD`||document.activeElement instanceof HTMLTextAreaElement||(e.preventDefault(),DT())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,L.jsx)(zT.Provider,{value:{peekedPath:c,onPeek:l},children:(0,L.jsxs)(`div`,{className:`in flex h-full min-h-0 flex-col`,children:[(0,L.jsxs)(`div`,{className:J(`con-head rv flex shrink-0 items-center gap-3 px-6 py-4`,u&&`opacity-80`),style:{...oD,...aD(1)},children:[(0,L.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,L.jsx)(Ef,{className:`size-4`}),`Conversations`]}),(0,L.jsx)(Dh,{store:n,detail:r}),(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(lD,{})]}),(0,L.jsx)(`div`,{className:`rv`,style:aD(2),children:(0,L.jsx)(Nh,{store:n,detail:r})}),(0,L.jsx)(dD,{state:n.brokerStatus,dormant:u}),n.error&&(0,L.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,L.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/15 px-4 py-2 text-sm text-destructive`,children:s}),(0,L.jsx)(AE,{conversationId:e.id}),(0,L.jsxs)(`div`,{className:`streamwrap relative flex min-h-0 flex-1 overflow-hidden`,children:[(0,L.jsx)(Jh,{currentId:e.id,onNavigate:e=>t(`/nodes/${e}`)}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,L.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,L.jsx)(OE,{messages:n.messages,partialToolResults:n.partialToolResults,executingToolIds:n.executingToolIds,queued:n.queued,streaming:p})}),u?(0,L.jsx)(pD,{id:e.id,reviving:o,onRevive:C,onClose:w}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(fD,{store:n,canDrive:m,streaming:p,onClose:w}),(0,L.jsxs)(`div`,{className:`relative flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,L.jsx)(gv,{commands:h,query:i,visible:i.startsWith(`/`),onSelect:S}),(0,L.jsx)(nD,{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:uD(f,d),rows:3}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,L.jsx)(mD,{id:e.id}),(0,L.jsx)(Z,{variant:`default`,onClick:b,disabled:!m||!i.trim(),children:p?`Steer`:`Send`})]})]})]})]}),(0,L.jsx)(NE,{nodeId:e.id,path:c,onClose:()=>l(null)})]}),(0,L.jsx)(Lh,{store:n,detail:r}),(0,L.jsx)(yv,{store:n})]})})}var cD=[{value:`focused`,label:`Focused`},{value:`standard`,label:`Standard`},{value:`verbose`,label:`Verbose`}];function lD(){let e=kT();return(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,title:`Transcript detail — Focused / Standard / Verbose (⌥D to cycle)`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Detail`}),(0,L.jsxs)(om,{value:e,onValueChange:e=>ET(e),children:[(0,L.jsx)(cm,{size:`sm`,className:`text-sm`,"aria-label":`Transcript detail`,children:(0,L.jsx)(sm,{})}),(0,L.jsx)(lm,{children:cD.map(e=>(0,L.jsx)(um,{value:e.value,children:e.label},e.value))})]})]})}function uD(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 dD({state:e,dormant:t}){return t||e!==`down`&&e!==`reconnecting`?null:(0,L.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 fD({store:e,canDrive:t,streaming:n,onClose:r}){let[i,a]=(0,v.useState)(null),o=i??e.state?.thinkingLevel??`medium`;return(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-2`,children:[(0,L.jsx)(Z,{variant:`secondary`,size:`sm`,disabled:!t||!n,onClick:()=>e.abort(),children:`Abort`}),(0,L.jsxs)(`label`,{className:`tiny-sel relative`,"aria-disabled":!t,children:[`thinking `,(0,L.jsx)(`b`,{children:o}),(0,L.jsx)(Tf,{className:`size-3.5`}),(0,L.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,L.jsx)(`option`,{value:e,children:e},e))})]}),(0,L.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.cycleModel(),children:`Cycle model`}),(0,L.jsx)(Z,{variant:`ghost`,size:`sm`,disabled:!t,onClick:()=>e.compact(),children:`Compact`}),(0,L.jsx)(Z,{variant:`destructive`,size:`sm`,className:`ml-auto`,onClick:r,children:`Close node`})]})}function pD({id:e,reviving:t,onRevive:n,onClose:r}){return(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border px-4 py-3`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`This node is dormant (read-only). Revive to drive it live.`}),(0,L.jsx)(mD,{id:e}),(0,L.jsx)(Z,{variant:`default`,disabled:t,onClick:n,children:t?`Revive…`:`Revive`}),(0,L.jsx)(Z,{variant:`destructive`,onClick:r,children:`Close node`})]})}function mD({id:e}){let[t,n]=(0,v.useState)(!1);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Z,{variant:`secondary`,onClick:()=>n(!0),children:`Message (inbox)`}),(0,L.jsx)(hD,{id:e,open:t,onOpenChange:n})]})}function hD({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,L.jsx)(Xp,{open:t,onOpenChange:n,children:(0,L.jsxs)($p,{children:[(0,L.jsxs)(em,{children:[(0,L.jsx)(nm,{children:`Send an inbox message`}),(0,L.jsx)(rm,{children:`A directive deliverable to any node, including a dormant one.`})]}),(0,L.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),r.trim()){c(!0),u(null);try{let t=await hp(e,{body:r.trim(),...a.trim()?{tier:a.trim()}:{}});u(`delivered=${String(t.delivered)} revived=${String(t.revived)}`),i(``)}catch(e){u(hv(e))}finally{c(!1)}}},className:`flex flex-col gap-3`,children:[(0,L.jsx)(pm,{value:r,onChange:e=>i(e.currentTarget.value),rows:4,required:!0,placeholder:`Message body…`}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[`tier`,(0,L.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,L.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:l}),(0,L.jsxs)(tm,{children:[(0,L.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>n(!1),disabled:s,children:`Close`}),(0,L.jsx)(Z,{type:`submit`,variant:`default`,disabled:s,children:s?`Sending…`:`Send`})]})]})]})})}function gD(e){e.key===`Enter`&&e.stopPropagation()}function _D(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 vD({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,L.jsxs)(`div`,{ref:n,className:`mobile-composer shrink-0 border-t border-border bg-[var(--panel)] px-3 py-3`,children:[(0,L.jsx)(nD,{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:_D(e),onChange:t=>{e.setInput(t.currentTarget.value),requestAnimationFrame(()=>c(a.current))},onKeyDown:gD}),(0,L.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[e.streaming&&(0,L.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,disabled:!e.canDrive,onClick:()=>e.store.abort(),children:`Stop`}),(0,L.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,L.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Offline — draft saved locally.`}),e.store.serverConnected&&!e.canDrive&&(0,L.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`This thread is not live — input is frozen.`})]})}var yD={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 bD({title:e,statusLabel:t,statusTone:n,onBack:r,onOpenOverflow:i}){return(0,L.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,L.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,L.jsx)(Ef,{className:`size-4`})}),(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(`h1`,{className:`truncate text-base font-medium text-[var(--ink)]`,children:e})}),t&&(0,L.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`,yD[n]),children:[n===`working`||n===`reconnecting`?(0,L.jsx)(Uf,{className:`size-3.5 shrink-0 animate-spin`}):(0,L.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,L.jsx)(`span`,{className:`truncate`,children:t})]}),(0,L.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,L.jsx)(If,{className:`size-4`})})]})}var xD=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function SD({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,L.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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Thread actions`}),(0,L.jsx)(`p`,{className:`truncate text-sm text-[var(--ink)]`,children:t.detail?.name?.trim()||`Thread`})]}),(0,L.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,L.jsx)($f,{className:`size-4`})})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pt-4 pb-[max(1rem,env(safe-area-inset-bottom))]`,children:[(0,L.jsxs)(`section`,{className:`space-y-3`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Session`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.cycleModel(),disabled:!t.canDrive,children:`Cycle model`}),(0,L.jsx)(Z,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>t.store.compact(),disabled:!t.canDrive,children:`Compact`}),(0,L.jsx)(Z,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>void t.doClose(),children:`Close node`}),t.dormant&&(0,L.jsx)(Z,{type:`button`,size:`sm`,onClick:()=>void t.doRevive(),disabled:t.reviving,children:t.reviving?`Reviving…`:`Revive`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`instlabel`,children:`Thinking`}),(0,L.jsxs)(om,{value:r,onValueChange:e=>{let n=e;i(n),t.store.setThinkingLevel(n)},disabled:!t.canDrive,children:[(0,L.jsx)(cm,{size:`sm`,className:`min-w-36 text-sm`,children:(0,L.jsx)(sm,{placeholder:`Thinking`})}),(0,L.jsx)(lm,{children:xD.map(e=>(0,L.jsx)(um,{value:e,children:e},e))})]})]})]}),(0,L.jsxs)(`section`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Context`}),(0,L.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-[rgba(0,0,0,.12)]`,children:(0,L.jsx)(Nh,{store:t.store,detail:t.detail})})]}),(0,L.jsxs)(`section`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`instlabel`,children:`Instruments`}),(0,L.jsx)(`div`,{className:`panel overflow-hidden p-3`,children:(0,L.jsx)(kh,{store:t.store,detail:t.detail})})]})]})]})}):null}function CD({id:e}){let t=pt(),n=mv(e),{nodes:r}=Gp(),[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)(()=>ph(r),[r]),u=(0,v.useMemo)(()=>Uh(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)(()=>wD(n,d),[d,n]),h=n.store.messages.length===0,g=TD(n,d),_=(0,v.useMemo)(()=>({peekedPath:n.peekedPath,onPeek:n.setPeekedPath}),[n.peekedPath,n.setPeekedPath]);return(0,L.jsx)(zT.Provider,{value:_,children:(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,L.jsx)(bD,{title:f,statusLabel:p,statusTone:m,onBack:()=>t(`/`),onOpenOverflow:()=>a(!0)}),n.actionError&&(0,L.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,L.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,L.jsx)(AE,{conversationId:u}),(0,L.jsxs)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,L.jsx)(OE,{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,L.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,L.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,L.jsx)(`p`,{className:`font-medium text-[var(--ink)]`,children:g}),(0,L.jsx)(`p`,{children:n.store.serverConnected?`Waiting for the thread to load…`:`Drafts stay local while the broker reconnects.`})]})})]}),(0,L.jsx)(vD,{screen:n,onMetricsChange:c}),(0,L.jsx)(yv,{store:n.store}),(0,L.jsx)(SD,{open:i,screen:n,onClose:()=>a(!1)}),n.peekedPath&&(0,L.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,L.jsx)(NE,{nodeId:e,path:n.peekedPath,onClose:()=>n.setPeekedPath(null),className:`w-full max-w-[100vw]`})})]})})}function wD(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 TD(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 ED(){let{decks:e,loading:t}=Em();return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-3xl flex-col px-6 py-8`,children:[(0,L.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,L.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Inbox`}),e.length>0&&(0,L.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,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t?(0,L.jsx)(AD,{}):e.length===0?(0,L.jsx)(kD,{}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:e.map(e=>(0,L.jsx)(DD,{deck:e},e.id))})})]})}function DD({deck:e}){let t=pt(),n=km(e.kind),r=n.icon,i=e.claim_owner===void 0?e.subtitle:`claimed by ${e.claim_owner} · ${e.subtitle}`;return(0,L.jsx)(`li`,{className:`list-none`,children:(0,L.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,L.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,L.jsx)(r,{className:`size-4.5`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(`span`,{className:`truncate text-sm`,style:{fontWeight:500,color:`var(--ink)`},children:e.title}),(0,L.jsx)(`span`,{className:`instlabel shrink-0`,children:n.label})]}),(0,L.jsx)(`p`,{className:`mt-0.5 truncate text-sm`,style:{color:`var(--mut)`},children:i}),(0,L.jsx)(OD,{deck:e,className:`mt-1.5`})]}),(0,L.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.08em`,color:`var(--mut)`},title:`waiting ${Am(e.blocked_since)}`,children:Am(e.blocked_since)})]})})}function OD({deck:e,className:t}){return e.source_label===void 0?null:(0,L.jsxs)(`div`,{className:J(`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs`,t),children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`in `,(0,L.jsx)(`span`,{className:`font-medium text-foreground/80`,children:e.conversation_title})]}),(0,L.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,L.jsx)(Pn,{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,L.jsx)(`span`,{className:`text-muted-foreground/40`,children:`·`}),(0,L.jsx)(`span`,{className:`font-mono text-muted-foreground/60`,title:e.cwd,children:e.cwd})]})}function kD(){return(0,L.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center py-16 text-center`,children:[(0,L.jsx)(`p`,{className:`text-2xl`,style:{fontStyle:`italic`,color:`var(--ink)`},children:`You're all caught up.`}),(0,L.jsx)(`p`,{className:`mt-1.5 text-sm`,style:{color:`var(--mut)`},children:`Nothing needs your input right now.`})]})}function AD(){return(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:[0,1,2].map(e=>(0,L.jsxs)(`li`,{className:`panel flex items-center gap-4 px-4 py-3.5`,children:[(0,L.jsx)(`div`,{className:`size-9 shrink-0 animate-pulse rounded-lg bg-muted`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,L.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded-none bg-muted`}),(0,L.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded-none bg-muted/70`})]})]},e))})}function jD({deckId:e}){let t=pt(),[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),Sm(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(gm(e)){Nm(e instanceof cp?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,L.jsx)(WD,{});if(o)return(0,L.jsx)(MD,{error:o,onRetry:()=>p(e=>e+1),onBack:()=>t(`/inbox`)});if(!n)return(0,L.jsx)(WD,{});let h=async e=>{if(u)return;d(!0);let r=Object.values(e??c).map(({selectedOptionId:e,...t})=>t);try{await Cm(n.job_id,{responses:r}),Nm(`Done — thanks!`,`success`),t(`/inbox`,{replace:!0})}catch(e){if(gm(e)){Nm(e instanceof cp?e.message:`That request was already handled.`),t(`/inbox`,{replace:!0});return}Nm(e instanceof cp?e.message:`Something went wrong — try again.`),d(!1)}},g=n.interactions.length===1?n.interactions[0]:null,_=km(n.kind).icon;return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col px-6 py-8`,children:[(0,L.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,L.jsx)(xf,{className:`size-4`}),` Inbox`]}),(0,L.jsxs)(`header`,{className:`mb-5 flex items-start gap-3`,children:[(0,L.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,L.jsx)(_,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h1`,{className:`text-2xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:n.title}),(0,L.jsx)(`p`,{className:`mt-0.5 text-sm`,style:{color:`var(--mut)`},children:n.subtitle}),(0,L.jsx)(OD,{deck:n,className:`mt-2`})]})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.interactions.map(e=>(0,L.jsx)(FD,{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))})}),!ND(g)&&(0,L.jsxs)(`footer`,{className:`mt-6 flex shrink-0 items-center justify-end gap-2 border-t border-border pt-4`,children:[(0,L.jsx)(Z,{variant:`ghost`,onClick:()=>t(`/inbox`),disabled:u,children:`Cancel`}),(0,L.jsx)(Z,{onClick:()=>void h(),disabled:u||!PD(n,c),children:u?`Sending…`:`Submit`})]})]})}function MD({error:e,onRetry:t,onBack:n}){return(0,L.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 max-w-2xl flex-col justify-center px-6 py-8`,children:(0,L.jsxs)(`section`,{className:`panel p-5`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Couldn’t load the deck`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.message}),(0,L.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,L.jsx)(Z,{onClick:t,children:`Retry`}),(0,L.jsx)(Z,{variant:`ghost`,onClick:n,children:`Back to inbox`})]})]})})}function ND(e){return e!==null&&(e.kind===`notify`||e.kind===`validation`)}function PD(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 FD({interaction:e,answer:t,onChange:n,conversationId:r,busy:i,onResolveWith:a}){switch(e.kind){case`notify`:return(0,L.jsx)(zD,{interaction:e,onGotIt:()=>a?.({id:e.id}),direct:!!a});case`validation`:return(0,L.jsx)(BD,{interaction:e,answer:t,onChange:n,busy:i,onResolveWith:a});case`context`:return(0,L.jsx)(HD,{interaction:e,answer:t,onChange:n});case`error`:return(0,L.jsx)(UD,{interaction:e,answer:t,onChange:n,conversationId:r});default:return(0,L.jsx)(VD,{interaction:e,answer:t,onChange:n})}}function ID({body:e}){return e?(0,L.jsx)(`div`,{className:`prose prose-sm max-w-none text-sm text-foreground/85 dark:prose-invert`,dangerouslySetInnerHTML:{__html:fT(vT(e))}}):null}function LD({children:e,className:t}){return(0,L.jsx)(`section`,{className:J(`panel p-5`,t),children:e})}function RD({it:e}){return(0,L.jsxs)(`div`,{className:`mb-3`,children:[(0,L.jsx)(`h2`,{className:`text-base font-semibold`,children:e.title}),(0,L.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:e.subtitle})]})}function zD({interaction:e,onGotIt:t,direct:n}){return(0,L.jsxs)(LD,{children:[(0,L.jsx)(RD,{it:e}),(0,L.jsx)(ID,{body:e.body}),n&&(0,L.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,L.jsxs)(Z,{onClick:t,children:[(0,L.jsx)(wf,{className:`mr-1.5 size-4`}),` Got it`]})})]})}function BD({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,L.jsxs)(LD,{children:[(0,L.jsx)(RD,{it:e}),(0,L.jsx)(ID,{body:e.body}),(0,L.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3`,children:[(0,L.jsx)(pm,{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,L.jsxs)(`div`,{className:`flex gap-3`,children:[(0,L.jsx)(Z,{className:`flex-1`,size:`lg`,disabled:r,onClick:()=>a&&s(a.id),children:a?.label??`Approve`}),(0,L.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,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected: `,e.options.find(e=>e.id===t.selectedOptionIds?.[0])?.label]})]})]})}function VD({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,L.jsxs)(LD,{children:[(0,L.jsx)(RD,{it:e}),(0,L.jsx)(ID,{body:e.body}),(0,L.jsx)(`ul`,{className:`mt-4 flex flex-col gap-2`,children:e.options.map(t=>{let n=r.has(t.id);return(0,L.jsx)(`li`,{children:(0,L.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,L.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,L.jsx)(wf,{className:`size-3`})}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:t.label}),t.description&&(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:t.description})]})]})},t.id)})}),e.allowFreetext&&(0,L.jsx)(pm,{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 HD({interaction:e,answer:t,onChange:n}){let r=t.selectedOptionIds?.[0];return(0,L.jsxs)(LD,{children:[(0,L.jsx)(RD,{it:e}),e.body&&(0,L.jsxs)(`div`,{className:`mb-4 rounded-xl border border-border p-3`,style:{background:`color-mix(in oklch, var(--ink) 3%, transparent)`},children:[(0,L.jsx)(`p`,{className:`instlabel mb-1.5`,children:`Why we're asking`}),(0,L.jsx)(ID,{body:e.body})]}),e.options.length>0&&(0,L.jsx)(`ul`,{className:`mb-3 flex flex-col gap-2`,children:e.options.map(e=>(0,L.jsx)(`li`,{children:(0,L.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,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})})},e.id))}),(e.allowFreetext||e.options.length===0)&&(0,L.jsx)(pm,{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 UD({interaction:e,answer:t,onChange:n,conversationId:r}){let i=pt();return(0,L.jsxs)(LD,{className:`border-destructive/30`,children:[(0,L.jsx)(RD,{it:e}),(0,L.jsx)(ID,{body:e.body}),(0,L.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[e.options.map(e=>(0,L.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,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:e.label}),e.description&&(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:e.description})]})},e.id)),(0,L.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 WD(){return(0,L.jsxs)(`div`,{className:`mx-auto flex h-full max-w-2xl flex-col gap-5 px-6 py-8`,children:[(0,L.jsx)(`div`,{className:`h-4 w-16 animate-pulse rounded-none bg-muted`}),(0,L.jsx)(`div`,{className:`h-7 w-1/2 animate-pulse rounded-none bg-muted`}),(0,L.jsx)(`div`,{className:`h-40 w-full animate-pulse rounded-2xl bg-muted/60`})]})}var GD=`crtr-push-token-v1`,KD=`/__push-token`;async function qD(e){if(typeof caches>`u`)return;let t=await caches.open(GD);if(e===void 0||e===``){await t.delete(KD);return}await t.put(KD,new Response(e))}function JD(){let e={"content-type":`application/json`};return sp!==void 0&&(e.authorization=`Bearer ${sp}`),e}function YD(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}function XD(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 ZD(){let e=await fetch(`/__crtr/push/vapid-public-key`,{headers:JD()});if(!e.ok)throw Error(`could not load the push key (${e.status})`);return(await e.json()).publicKey}async function QD(e){let t=await fetch(`/__crtr/push/subscribe`,{method:`POST`,headers:JD(),body:JSON.stringify(e.toJSON())});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`subscribe failed (${t.status})`)}}async function $D(){if(!YD())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 eO(){if(!YD())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 qD(sp);try{await QD(t)}catch(e){throw await t.unsubscribe().catch(()=>{}),await qD(void 0).catch(()=>{}),e}return}let n=await ZD(),r=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:XD(n)});try{await qD(sp)}catch(e){throw await r.unsubscribe().catch(()=>{}),e}try{await QD(r)}catch(e){throw await r.unsubscribe().catch(()=>{}),await qD(void 0).catch(()=>{}),e}}async function tO(){if(!YD())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 qD(void 0).catch(()=>{});try{await fetch(`/__crtr/push/subscribe`,{method:`DELETE`,headers:JD(),body:JSON.stringify({endpoint:n})})}catch{}}function nO(){let[e,t]=(0,v.useState)(()=>YD()?`unsubscribed`:`unsupported`),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{$D().then(t)},[]);return(0,v.useEffect)(()=>{o()},[o]),{status:e,busy:n,error:i,enable:(0,v.useCallback)(()=>{r(!0),a(null),eO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o]),disable:(0,v.useCallback)(()=>{r(!0),a(null),tO().catch(e=>a(e instanceof Error?e.message:String(e))).then(o).finally(()=>r(!1))},[o])}}function rO(){let[e,t]=(0,v.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,L.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,L.jsx)(`h1`,{className:`text-3xl`,style:{fontWeight:460,letterSpacing:`-0.01em`,color:`var(--ink)`},children:`Settings`}),(0,L.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,L.jsx)(`h2`,{className:`instlabel`,children:`Appearance`}),(0,L.jsxs)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:[e?`Dark theme`:`Light theme`,` is active.`]}),(0,L.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,L.jsx)(iO,{})]})}function iO(){let{status:e,busy:t,error:n,enable:r,disable:i}=nO();return(0,L.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,L.jsx)(`h2`,{className:`instlabel`,children:`Notifications`}),e===`unsupported`&&(0,L.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications aren’t supported in this browser.`}),e===`denied`&&(0,L.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,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Z,{variant:`outline`,onClick:r,disabled:t,children:`Enable notifications`})]}),e===`subscribed`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`text-sm`,style:{color:`var(--mut)`},children:`Notifications are on for this browser.`}),(0,L.jsx)(Z,{variant:`outline`,onClick:i,disabled:t,children:`Disable notifications`})]}),n!==null&&(0,L.jsx)(`p`,{className:`text-sm`,style:{color:`var(--warning)`},children:n})]})}var aO=`(max-width: 767px)`;function oO(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(aO).matches}function sO(){let[e,t]=(0,v.useState)(oO);return(0,v.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(aO),n=e=>t(e.matches);return t(e.matches),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function cO(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 lO(){let{id:e}=ht();return sO()?(0,L.jsx)(CD,{id:e??``},e):(0,L.jsx)(sD,{id:e??``},e)}function uO(){let{deckId:e}=ht();return(0,L.jsx)(jD,{deckId:e??``})}function dO(){return(0,L.jsxs)(Ht,{children:[(0,L.jsx)(Bt,{path:`/`,element:(0,L.jsx)(_h,{})}),(0,L.jsx)(Bt,{path:`/new`,element:(0,L.jsx)(zt,{to:`/?new=1`,replace:!0})}),(0,L.jsx)(Bt,{path:`/canvas`,element:(0,L.jsx)(eh,{})}),(0,L.jsx)(Bt,{path:`/nodes/:id`,element:(0,L.jsx)(lO,{})}),(0,L.jsx)(Bt,{path:`/c/:id`,element:(0,L.jsx)(lO,{})}),(0,L.jsx)(Bt,{path:`/inbox`,element:(0,L.jsx)(ED,{})}),(0,L.jsx)(Bt,{path:`/inbox/:deckId`,element:(0,L.jsx)(uO,{})}),(0,L.jsx)(Bt,{path:`/settings`,element:(0,L.jsx)(rO,{})}),(0,L.jsx)(Bt,{path:`*`,element:(0,L.jsx)(_h,{})})]})}function fO(){let e=pt();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(cO(n.conversationId,r,sp))};return navigator.serviceWorker.addEventListener(`message`,t),()=>navigator.serviceWorker.removeEventListener(`message`,t)},[e]),null}function pO(){return Np(e=>e.reachable)?null:(0,L.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 mO(e){e(`/?new=1`)}var hO=[{id:`conversations`,label:`Conversations`,path:`/`},{id:`canvas`,label:`Canvas`,path:`/canvas`},{id:`inbox`,label:`Inbox`,path:`/inbox`},{id:`settings`,label:`Settings`,path:`/settings`}],gO={conversations:Gf,canvas:Kf,inbox:Bf,settings:Xf};function _O({compact:e}){let t=pt();return(0,L.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,L.jsxs)(Pn,{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,L.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,L.jsxs)(`button`,{type:`button`,onClick:()=>mO(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,L.jsx)(qf,{size:e?18:16,className:`flex-none`,"aria-hidden":!0}),!e&&(0,L.jsx)(`span`,{children:`New chat`})]}),hO.map(t=>{let n=gO[t.id]??Gf;return(0,L.jsxs)(Fn,{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,L.jsx)(n,{size:18,className:e?void 0:`flex-none opacity-75`,"aria-hidden":!0}),!e&&(0,L.jsx)(`span`,{children:t.label}),t.id===`inbox`&&(0,L.jsx)(vO,{compact:e})]},t.id)}),(0,L.jsx)(`div`,{className:`flex-1`})]})}function vO({compact:e}){let t=Tm();return t<=0?null:e?(0,L.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,L.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 yO(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 bO({open:e,onClose:t}){let{nodes:n}=Gp(),r=pt(),[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:ah(e),dot:uh(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,L.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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-3`,style:{borderColor:`var(--line)`},children:[(0,L.jsx)(`span`,{className:`instlabel`,style:{color:`var(--dim)`},children:`Jump to`}),(0,L.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,L.jsx)(`span`,{className:`kbd`,children:`esc`})]}),(0,L.jsx)(`ul`,{className:`max-h-80 overflow-auto py-1`,children:l.length===0?(0,L.jsx)(`li`,{className:`px-4 py-3 text-sm italic`,style:{color:`var(--mut)`},children:`no live nodes`}):l.map((e,t)=>(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(`span`,{className:J(`dot shrink-0`,e.dot)}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,style:{color:`var(--ink)`},children:e.title}),(0,L.jsx)(`span`,{className:`font-inst shrink-0 text-xs`,style:{letterSpacing:`0.04em`,color:`var(--mut)`},children:e.kind})]})},e.id))})]})})}var xO=/^\/(nodes|c)\//;function SO({children:e}){let t=ut(),n=pt(),[r,i]=(0,v.useState)(!1);return yO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey&&e.code===`KeyO`,[]),(0,v.useCallback)(()=>mO(n),[n])),yO((0,v.useCallback)(e=>(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&e.code===`KeyK`,[]),(0,v.useCallback)(()=>i(e=>!e),[])),(0,L.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,L.jsx)(_O,{compact:xO.test(t.pathname)}),(0,L.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),(0,L.jsx)(bO,{open:r,onClose:()=>i(!1)})]})}var CO=/^\/(?:c|nodes)\/([^/]+)\/?$/;function wO(e){let t=CO.exec(e);if(!t)return null;let n=t[1];return n===void 0?null:decodeURIComponent(n)}var TO=[{id:`home`,label:`Home`,path:`/`,icon:zf},{id:`inbox`,label:`Inbox`,path:`/inbox`,icon:Bf}];function EO(){let e=pt();return(0,L.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:[TO.map(e=>(0,L.jsxs)(Fn,{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,L.jsx)(e.icon,{size:20,"aria-hidden":!0}),(0,L.jsx)(`span`,{children:e.label}),e.id===`inbox`&&(0,L.jsx)(DO,{})]},e.id)),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>mO(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,L.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full [background:var(--bone)] [color:var(--bone-ink)]`,children:(0,L.jsx)(qf,{size:18,"aria-hidden":!0})}),(0,L.jsx)(`span`,{children:`New`})]})]})}function DO(){let e=Tm();return e<=0?null:(0,L.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 OO(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches===!0||window.navigator.standalone===!0}function kO(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(OO);(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 AO(){let{canInstall:e,promptInstall:t}=kO(),[n,r]=(0,v.useState)(!1);return!e||n?null:(0,L.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,L.jsx)(`span`,{className:`flex-1`,children:`Install crouter for quick, full-screen access.`}),(0,L.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,L.jsx)(Ff,{size:14,"aria-hidden":!0}),`Install`]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>r(!0),"aria-label":`Dismiss install prompt`,className:`[color:var(--ink2)]`,children:(0,L.jsx)($f,{size:14,"aria-hidden":!0})})]})}function jO(e){let t=(0,v.useSyncExternalStore)(q_.subscribe,q_.getWarmIds),{nodes:n}=Gp();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?ah(t):e,dot:t?uh(t):`idle`}})},[t,n,e])}function MO(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 NO(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 PO=48,FO=1.5,IO=24;function LO(e){if(e.scrolled||e.startX<IO)return null;let t=e.endX-e.startX,n=e.endY-e.startY;return Math.abs(t)<PO||Math.abs(t)<Math.abs(n)*FO?null:t<0?`next`:`prev`}function RO(e,t){return t>-48?!1:Math.abs(t)>=Math.abs(e)*FO}function zO({open:e,activeId:t,onClose:n}){let r=pt(),{nodes:i}=Gp(),a=Tm(),[o,s]=(0,v.useState)(``),c=(0,v.useMemo)(()=>ph(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,L.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,L.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,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,L.jsx)(`p`,{className:`instlabel flex-1`,children:`Conversations`}),(0,L.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,L.jsx)($f,{className:`size-4`})})]}),(0,L.jsx)(`div`,{className:`border-b border-border px-4 py-2`,children:(0,L.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,L.jsxs)(`ul`,{className:`min-h-0 flex-none overflow-auto border-b border-border py-1`,children:[(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(zf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`text-sm [color:var(--ink)]`,children:`Home`})]})}),(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(Bf,{className:`size-4 shrink-0 [color:var(--ink2)]`,"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`flex-1 text-sm [color:var(--ink)]`,children:`Inbox`}),a>0&&(0,L.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,L.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,L.jsx)(`li`,{className:`px-4 py-3 text-sm italic [color:var(--mut)]`,children:`no conversations`}):l.map(e=>(0,L.jsx)(`li`,{children:(0,L.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,L.jsx)(`span`,{className:J(`dot shrink-0`,e.state===`needs-you`?`blocked`:e.state),"aria-hidden":!0}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm [color:var(--ink)]`,children:e.title}),(0,L.jsx)(`span`,{className:`block truncate text-xs [color:var(--mut)]`,children:mh(e)})]})]})},e.id))})]})})}var BO=4;function VO({activeId:e}){let t=pt(),n=jO(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=NO(n,r);t(e?`/c/${encodeURIComponent(e)}`:`/`)}q_.evict(r)};return(0,L.jsxs)(L.Fragment,{children:[(0,L.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)>BO,l=LO({startX:i.x,startY:i.y,endX:a.clientX,endY:a.clientY,scrolled:o});if(!l)return;let u=MO(n,e,l);u&&t(`/c/${encodeURIComponent(u)}`)},children:[(0,L.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,L.jsx)(Hf,{className:`size-4`,"aria-hidden":!0})}),(0,L.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,L.jsx)(WO,{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,L.jsx)(`button`,{type:`button`,onClick:()=>mO(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,L.jsx)(qf,{className:`size-4`,"aria-hidden":!0})})]}),(0,L.jsx)(zO,{open:r,activeId:e,onClose:()=>i(!1)})]})}var HO=480,UO=8;function WO({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,L.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()},HO))},onTouchMove:e=>{let t=s.current,n=e.touches[0];!t||!n||Math.hypot(n.clientX-t.x,n.clientY-t.y)>UO&&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}RO(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,L.jsx)(`span`,{className:J(`dot shrink-0`,e.dot),"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`max-w-32 truncate`,children:e.title}),n&&(0,L.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,L.jsx)($f,{className:`size-3`,"aria-hidden":!0})})]})}function GO({children:e}){let t=wO(ut().pathname);return(0,L.jsxs)(`div`,{className:`mobile-shell-root flex flex-col overflow-hidden`,children:[(0,L.jsx)(`main`,{className:`min-h-0 flex-1 overflow-hidden`,children:e}),t===null?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(AO,{}),(0,L.jsx)(EO,{})]}):(0,L.jsx)(VO,{activeId:t},t)]})}function KO({children:e}){return sO()?(0,L.jsx)(GO,{children:e}):(0,L.jsx)(SO,{children:e})}var qO=`false`,JO=`false`,YO=qO===`true`,XO=JO===`true`;function ZO(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,YO||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()},!XO)if(YO)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 QO(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)(()=>ZO({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 $O(){let{needRefresh:[e,t],offlineReady:[n,r],updateServiceWorker:i}=QO({onRegisterError(e){console.warn(`crtr web: service worker registration failed`,e)}});return(0,v.useEffect)(()=>{n&&(Nm(`App ready to work offline`,`success`),r(!1))},[n,r]),{needRefresh:e,dismiss:()=>t(!1),refresh:()=>void i(!0)}}function ek(){let{needRefresh:e,dismiss:t,refresh:n}=$O();return e?(0,L.jsx)(`div`,{className:`pwa-update-banner px-3`,children:(0,L.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,L.jsx)(`span`,{children:`Update ready`}),(0,L.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,L.jsx)(Jf,{size:14,"aria-hidden":!0}),`Refresh`]}),(0,L.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss update prompt`,className:`[color:var(--ink2)]`,children:(0,L.jsx)($f,{size:14,"aria-hidden":!0})})]})}):null}function tk(){let e=Mm(e=>e.toasts),t=Mm(e=>e.dismiss);return e.length===0?null:(0,L.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,L.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 nk(){return(0,L.jsx)(Mn,{children:(0,L.jsxs)(gf,{delayDuration:300,children:[(0,L.jsx)(pO,{}),(0,L.jsx)(fO,{}),(0,L.jsx)(KO,{children:(0,L.jsx)(dO,{})}),(0,L.jsx)(ek,{}),(0,L.jsx)(tk,{})]})})}document.documentElement.classList.add(`dark`),document.documentElement.classList.remove(`light`);var rk=document.getElementById(`root`);if(!rk)throw Error(`crtr web: #root element not found in index.html`);(0,b.createRoot)(rk).render((0,L.jsx)(v.StrictMode,{children:(0,L.jsx)(nk,{})}));