@vertesia/ui 1.6.0-dev.20261009.095813Z → 1.6.0-dev.20261014.015055Z

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 (143) hide show
  1. package/lib/boot/index.d.ts +12 -1
  2. package/lib/boot/index.d.ts.map +1 -1
  3. package/lib/boot/index.js +65 -10
  4. package/lib/boot/index.js.map +1 -1
  5. package/lib/boot/text.d.ts +13 -0
  6. package/lib/boot/text.d.ts.map +1 -0
  7. package/lib/boot/text.js +68 -0
  8. package/lib/boot/text.js.map +1 -0
  9. package/lib/features/agent/PayloadBuilder.d.ts +6 -0
  10. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  11. package/lib/features/agent/chat/ModernAgentConversation.js +6 -4
  12. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  13. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
  14. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +58 -0
  15. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
  16. package/lib/features/agent/chat/SkillWidgetProvider.d.ts.map +1 -1
  17. package/lib/features/agent/chat/SkillWidgetProvider.js +3 -2
  18. package/lib/features/agent/chat/SkillWidgetProvider.js.map +1 -1
  19. package/lib/i18n/LanguageProvider.d.ts +9 -1
  20. package/lib/i18n/LanguageProvider.d.ts.map +1 -1
  21. package/lib/i18n/LanguageProvider.js +7 -4
  22. package/lib/i18n/LanguageProvider.js.map +1 -1
  23. package/lib/i18n/locales/ar.json +5 -1
  24. package/lib/i18n/locales/de.json +5 -1
  25. package/lib/i18n/locales/en.json +5 -1
  26. package/lib/i18n/locales/es.json +5 -1
  27. package/lib/i18n/locales/fr.json +5 -1
  28. package/lib/i18n/locales/it.json +5 -1
  29. package/lib/i18n/locales/ja.json +5 -1
  30. package/lib/i18n/locales/ko.json +5 -1
  31. package/lib/i18n/locales/pt.json +5 -1
  32. package/lib/i18n/locales/ru.json +5 -1
  33. package/lib/i18n/locales/tr.json +5 -1
  34. package/lib/i18n/locales/zh-TW.json +5 -1
  35. package/lib/i18n/locales/zh.json +5 -1
  36. package/lib/i18n/rtl.d.ts +4 -2
  37. package/lib/i18n/rtl.d.ts.map +1 -1
  38. package/lib/i18n/rtl.js +4 -2
  39. package/lib/i18n/rtl.js.map +1 -1
  40. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  41. package/lib/session/UserSessionProvider.js +10 -4
  42. package/lib/session/UserSessionProvider.js.map +1 -1
  43. package/lib/session/auth/oauth.d.ts.map +1 -1
  44. package/lib/session/auth/oauth.js +15 -11
  45. package/lib/session/auth/oauth.js.map +1 -1
  46. package/lib/shell/VertesiaShell.d.ts +7 -2
  47. package/lib/shell/VertesiaShell.d.ts.map +1 -1
  48. package/lib/shell/VertesiaShell.js +2 -2
  49. package/lib/shell/VertesiaShell.js.map +1 -1
  50. package/lib/shell/login/InviteAcceptModal.d.ts.map +1 -1
  51. package/lib/shell/login/InviteAcceptModal.js +83 -42
  52. package/lib/shell/login/InviteAcceptModal.js.map +1 -1
  53. package/lib/vertesia-ui-boot.js +52 -15
  54. package/lib/vertesia-ui-boot.js.map +1 -1
  55. package/lib/vertesia-ui-core.js +43 -43
  56. package/lib/vertesia-ui-core.js.map +1 -1
  57. package/lib/vertesia-ui-features.js +334 -334
  58. package/lib/vertesia-ui-features.js.map +1 -1
  59. package/lib/vertesia-ui-i18n.B1Nd8-dE.chunk.js +5 -0
  60. package/lib/vertesia-ui-i18n.B1Nd8-dE.chunk.js.map +1 -0
  61. package/lib/vertesia-ui-i18n.B2Z7mx1x.chunk.js +5 -0
  62. package/lib/vertesia-ui-i18n.B2Z7mx1x.chunk.js.map +1 -0
  63. package/lib/vertesia-ui-i18n.B756-YtS.chunk.js +5 -0
  64. package/lib/vertesia-ui-i18n.B756-YtS.chunk.js.map +1 -0
  65. package/lib/vertesia-ui-i18n.BICdgAEn.chunk.js +5 -0
  66. package/lib/vertesia-ui-i18n.BICdgAEn.chunk.js.map +1 -0
  67. package/lib/vertesia-ui-i18n.B_yx0c2A.chunk.js +5 -0
  68. package/lib/vertesia-ui-i18n.B_yx0c2A.chunk.js.map +1 -0
  69. package/lib/vertesia-ui-i18n.BwPrGiQn.chunk.js +5 -0
  70. package/lib/vertesia-ui-i18n.BwPrGiQn.chunk.js.map +1 -0
  71. package/lib/vertesia-ui-i18n.CfQbOHm3.chunk.js +5 -0
  72. package/lib/vertesia-ui-i18n.CfQbOHm3.chunk.js.map +1 -0
  73. package/lib/vertesia-ui-i18n.DMISlF16.chunk.js +5 -0
  74. package/lib/vertesia-ui-i18n.DMISlF16.chunk.js.map +1 -0
  75. package/lib/vertesia-ui-i18n.D_WA36Yq.chunk.js +5 -0
  76. package/lib/vertesia-ui-i18n.D_WA36Yq.chunk.js.map +1 -0
  77. package/lib/vertesia-ui-i18n.Dp3KuMs-.chunk.js +5 -0
  78. package/lib/vertesia-ui-i18n.Dp3KuMs-.chunk.js.map +1 -0
  79. package/lib/vertesia-ui-i18n.DsioKoQ3.chunk.js +5 -0
  80. package/lib/vertesia-ui-i18n.DsioKoQ3.chunk.js.map +1 -0
  81. package/lib/vertesia-ui-i18n.QEIqEPlv.chunk.js +5 -0
  82. package/lib/vertesia-ui-i18n.QEIqEPlv.chunk.js.map +1 -0
  83. package/lib/vertesia-ui-i18n.js +2 -2
  84. package/lib/vertesia-ui-i18n.js.map +1 -1
  85. package/lib/vertesia-ui-layout.js +15 -15
  86. package/lib/vertesia-ui-layout.js.map +1 -1
  87. package/lib/vertesia-ui-rich-text.js +44 -44
  88. package/lib/vertesia-ui-rich-text.js.map +1 -1
  89. package/lib/vertesia-ui-session.js +1 -1
  90. package/lib/vertesia-ui-session.js.map +1 -1
  91. package/lib/vertesia-ui-shell.js +51 -51
  92. package/lib/vertesia-ui-shell.js.map +1 -1
  93. package/lib/vertesia-ui-widgets.js +51 -51
  94. package/lib/vertesia-ui-widgets.js.map +1 -1
  95. package/package.json +20 -20
  96. package/src/boot/index.ts +74 -11
  97. package/src/boot/text.ts +80 -0
  98. package/src/features/agent/chat/ModernAgentConversation.tsx +7 -4
  99. package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +60 -0
  100. package/src/features/agent/chat/SkillWidgetProvider.tsx +3 -2
  101. package/src/i18n/LanguageProvider.tsx +16 -4
  102. package/src/i18n/locales/ar.json +5 -1
  103. package/src/i18n/locales/de.json +5 -1
  104. package/src/i18n/locales/en.json +5 -1
  105. package/src/i18n/locales/es.json +5 -1
  106. package/src/i18n/locales/fr.json +5 -1
  107. package/src/i18n/locales/it.json +5 -1
  108. package/src/i18n/locales/ja.json +5 -1
  109. package/src/i18n/locales/ko.json +5 -1
  110. package/src/i18n/locales/pt.json +5 -1
  111. package/src/i18n/locales/ru.json +5 -1
  112. package/src/i18n/locales/tr.json +5 -1
  113. package/src/i18n/locales/zh-TW.json +5 -1
  114. package/src/i18n/locales/zh.json +5 -1
  115. package/src/i18n/rtl.ts +5 -2
  116. package/src/session/UserSessionProvider.tsx +11 -4
  117. package/src/session/auth/oauth.ts +26 -12
  118. package/src/shell/VertesiaShell.tsx +8 -2
  119. package/src/shell/login/InviteAcceptModal.tsx +112 -65
  120. package/lib/vertesia-ui-i18n.1NWiB6fw.chunk.js +0 -5
  121. package/lib/vertesia-ui-i18n.1NWiB6fw.chunk.js.map +0 -1
  122. package/lib/vertesia-ui-i18n.6Ozlf6Ks.chunk.js +0 -5
  123. package/lib/vertesia-ui-i18n.6Ozlf6Ks.chunk.js.map +0 -1
  124. package/lib/vertesia-ui-i18n.AttJpg8U.chunk.js +0 -5
  125. package/lib/vertesia-ui-i18n.AttJpg8U.chunk.js.map +0 -1
  126. package/lib/vertesia-ui-i18n.BI_xdp49.chunk.js +0 -5
  127. package/lib/vertesia-ui-i18n.BI_xdp49.chunk.js.map +0 -1
  128. package/lib/vertesia-ui-i18n.C-2EEX6w.chunk.js +0 -5
  129. package/lib/vertesia-ui-i18n.C-2EEX6w.chunk.js.map +0 -1
  130. package/lib/vertesia-ui-i18n.CAmo54FO.chunk.js +0 -5
  131. package/lib/vertesia-ui-i18n.CAmo54FO.chunk.js.map +0 -1
  132. package/lib/vertesia-ui-i18n.CbBzmHNP.chunk.js +0 -5
  133. package/lib/vertesia-ui-i18n.CbBzmHNP.chunk.js.map +0 -1
  134. package/lib/vertesia-ui-i18n.DZgTzkIg.chunk.js +0 -5
  135. package/lib/vertesia-ui-i18n.DZgTzkIg.chunk.js.map +0 -1
  136. package/lib/vertesia-ui-i18n.DZsITxq5.chunk.js +0 -5
  137. package/lib/vertesia-ui-i18n.DZsITxq5.chunk.js.map +0 -1
  138. package/lib/vertesia-ui-i18n.Dbf2GHth.chunk.js +0 -5
  139. package/lib/vertesia-ui-i18n.Dbf2GHth.chunk.js.map +0 -1
  140. package/lib/vertesia-ui-i18n.lleWnH5n.chunk.js +0 -5
  141. package/lib/vertesia-ui-i18n.lleWnH5n.chunk.js.map +0 -1
  142. package/lib/vertesia-ui-i18n.wG_XSkbr.chunk.js +0 -5
  143. package/lib/vertesia-ui-i18n.wG_XSkbr.chunk.js.map +0 -1
@@ -4,283 +4,283 @@ function $e(e,n=[]){let r=[];function i(n,i){let a=C.createContext(i);a.displayN
4
4
  function St(e){let t=C.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];At(r)&&typeof Pt==`function`&&(r=Pt(r._payload)),C.Children.forEach(r,e=>{if(Ot(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;At(n)&&typeof Pt==`function`&&(n=Pt(n._payload)),a=Tt(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=C.cloneElement(a,void 0,s):!o&&C.Children.count(r)===1&&C.isValidElement(r)&&(a=r);let c=a?Dt(a):void 0,l=Ye(n,c);if(!a){if(r||r===0)throw Error(o?Nt(e):Mt(e));return r}let u=Et(i,a.props??{});return a.type!==C.Fragment&&(u.ref=n?l:c),C.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}xt(St,`createSlot`);var Ct=Symbol.for(`radix.slottable`);// @__NO_SIDE_EFFECTS__
5
5
  function wt(e){let t=/* @__PURE__ */ xt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ct,t}xt(wt,`createSlottable`);var Tt=/* @__PURE__ */ xt((e,t)=>{if(`child`in e.props){let t=e.props.child;return C.isValidElement(t)?C.cloneElement(t,void 0,e.props.children(t.props.children)):null}return C.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Et(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}xt(Et,`mergeProps`);function Dt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}xt(Dt,`getElementRef`);function Ot(e){return C.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ct}xt(Ot,`isSlottable`);var kt=Symbol.for(`react.lazy`);function At(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===kt&&`_payload`in e&&jt(e._payload)}xt(At,`isLazyComponent`);function jt(e){return typeof e==`object`&&!!e&&`then`in e}xt(jt,`isPromiseLike`);var Mt=/* @__PURE__ */ xt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Nt=/* @__PURE__ */ xt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Pt=C.use,Ft=Object.defineProperty,It=(e,t)=>Ft(e,`name`,{value:t,configurable:!0}),Lt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ St(`Primitive.${n}`),i=C.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),/* @__PURE__ */ t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Rt(e,t){e&&ie.flushSync(()=>e.dispatchEvent(t))}It(Rt,`dispatchDiscreteCustomEvent`);var zt=Object.defineProperty,Bt=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ ((e,t)=>zt(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=C.useState(!1);tt(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?ie.createPortal(/* @__PURE__ */ t(Lt.div,{...i,ref:n}),s):null},`Portal`)),Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ut(e,t){return C.useReducer((e,n)=>t[e][n]??e,e)}Ht(Ut,`useStateMachine`);var Wt=/* @__PURE__ */ Ht(e=>{let{present:t,children:n}=e,r=Gt(t),i=typeof n==`function`?n({present:r.isPresent}):C.Children.only(n),a=qt(r.ref,Yt(i));return typeof n==`function`||r.isPresent?C.cloneElement(i,{ref:a}):null},`Presence`);function Gt(e){let[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),a=C.useRef(`none`),o=C.useRef(void 0),[s,c]=Ut(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return C.useEffect(()=>{s===`mounted`?(a.current=o.current??Jt(r.current),o.current=void 0):a.current=`none`},[s]),tt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Jt(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),tt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=/* @__PURE__ */ Ht(a=>{let o=Jt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=/* @__PURE__ */ Ht(e=>{e.target===t&&(a.current=Jt(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:C.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Jt(t)}else r.current=null;n(e)},[])}}Ht(Gt,`usePresence`);function Kt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ht(Kt,`setRef`);function qt(...e){let t=C.useRef(e);return t.current=e,C.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Kt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Kt(n[e],null)}}},[])}Ht(qt,`useStableComposedRefs`);function Jt(e){return e?.animationName||`none`}Ht(Jt,`getAnimationName`);function Yt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ht(Yt,`getElementRef`);var Xt=Object.defineProperty,Zt=(e,t)=>Xt(e,`name`,{value:t,configurable:!0}),Qt=`Dialog`,[$t,en]=/* @__PURE__ */ $e(Qt),[tn,nn]=$t(Qt),rn=/* @__PURE__ */ Zt(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=C.useRef(null),l=C.useRef(null),[u,d]=ht({prop:i,defaultProp:a??!1,onChange:o,caller:Qt}),[f,p]=C.useState(0),[m,h]=C.useState(0);return/* @__PURE__ */ t(tn,{scope:n,triggerRef:c,contentRef:l,contentId:ot(),titleId:ot(),descriptionId:ot(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),an=`DialogPortal`,[on,sn]=$t(an,{forceMount:void 0}),cn=/* @__PURE__ */ Zt(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=nn(an,n);return/* @__PURE__ */ t(on,{scope:n,forceMount:r,children:C.Children.map(i,e=>/* @__PURE__ */ t(Wt,{present:r||o.open,children:/* @__PURE__ */ t(Bt,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),ln=`DialogOverlay`,un=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let r=sn(ln,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=nn(ln,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Wt,{present:i||o.open,children:/* @__PURE__ */ t(fn,{...a,ref:n})}):null},`DialogOverlay`)),dn=/* @__PURE__ */ St(`DialogOverlay.RemoveScroll`),fn=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(ln,r),o=Ye(n,ne());return/* @__PURE__ */ t(oe,{as:dn,allowPinchZoom:!0,shards:[a.contentRef],children:/* @__PURE__ */ t(Lt.div,{"data-state":wn(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),pn=`DialogContent`,mn=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let r=sn(pn,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=nn(pn,e.__scopeDialog);return/* @__PURE__ */ t(Wt,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(hn,{...a,ref:n}):/* @__PURE__ */ t(gn,{...a,ref:n})})},`DialogContent`)),hn=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let r=nn(pn,e.__scopeDialog),i=C.useRef(null),a=Ye(n,r.contentRef,i);return C.useEffect(()=>{let e=i.current;if(e)return se(e)},[]),/* @__PURE__ */ t(_n,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Be(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),gn=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let r=nn(pn,e.__scopeDialog),i=C.useRef(!1),a=C.useRef(!1);return/* @__PURE__ */ t(_n,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),_n=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=nn(pn,i);return ae(),/* @__PURE__ */ t(e,{children:/* @__PURE__ */ t(re,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(te,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":wn(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),vn=`DialogTitle`,yn=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(vn,r),{setTitleCount:o}=a;return tt(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(Lt.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),bn=`DialogDescription`,xn=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(bn,r),{setDescriptionCount:o}=a;return tt(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(Lt.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),Sn=`DialogClose`,Cn=/* @__PURE__ */ C.forwardRef(/* @__PURE__ */ Zt(function(e,n){let{__scopeDialog:r,...i}=e,a=nn(Sn,r);return/* @__PURE__ */ t(Lt.button,{type:`button`,...i,ref:n,onClick:Be(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function wn(e){return e?`open`:`closed`}Zt(wn,`getState`);
6
6
  /**
7
- * @license lucide-react v1.49.0 - ISC
7
+ * @license lucide-react v1.53.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  const Tn=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
13
13
  /**
14
- * @license lucide-react v1.49.0 - ISC
14
+ * @license lucide-react v1.53.0 - ISC
15
15
  *
16
16
  * This source code is licensed under the ISC license.
17
17
  * See the LICENSE file in the root directory of this source tree.
18
18
  */
19
19
  function En(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Tn(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
20
20
  /**
21
- * @license lucide-react v1.49.0 - ISC
21
+ * @license lucide-react v1.53.0 - ISC
22
22
  *
23
23
  * This source code is licensed under the ISC license.
24
24
  * See the LICENSE file in the root directory of this source tree.
25
25
  */
26
26
  const Dn=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},On=e=>{
27
27
  /**
28
- * @license lucide-react v1.49.0 - ISC
28
+ * @license lucide-react v1.53.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
32
  */
33
33
  let t=Dn(e);return t.charAt(0).toUpperCase()+t.slice(1)},kn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),An={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}
34
34
  /**
35
- * @license lucide-react v1.49.0 - ISC
35
+ * @license lucide-react v1.53.0 - ISC
36
36
  *
37
37
  * This source code is licensed under the ISC license.
38
38
  * See the LICENSE file in the root directory of this source tree.
39
39
  */
40
40
  /**
41
- * @license lucide-react v1.49.0 - ISC
41
+ * @license lucide-react v1.53.0 - ISC
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
46
  ;
47
47
  /**
48
- * @license lucide-react v1.49.0 - ISC
48
+ * @license lucide-react v1.53.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
52
  */
53
53
  function jn(e){return e!=null}function Mn(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??An.width,a=e.size??e.height??An.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?kn(...c):kn(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??An[`stroke-width`])*Number(e.size??e.width??An.width)/Number(t.size??t.width??An.width):t.strokeWidth??An[`stroke-width`];return[`svg`,{...Object.entries(An).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&jn(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&jn(t.width)&&{[r(`width`)]:t.width},...`height`in t&&jn(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}
54
54
  /**
55
- * @license lucide-react v1.49.0 - ISC
55
+ * @license lucide-react v1.53.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
59
  */
60
60
  function Nn(e,t={}){return Mn(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
61
61
  /**
62
- * @license lucide-react v1.49.0 - ISC
62
+ * @license lucide-react v1.53.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
66
  */
67
67
  const Pn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Fn=E({}),In=()=>M(Fn),Ln=O(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{
68
68
  /**
69
- * @license lucide-react v1.49.0 - ISC
69
+ * @license lucide-react v1.53.0 - ISC
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
73
  */
74
74
  /**
75
- * @license lucide-react v1.49.0 - ISC
75
+ * @license lucide-react v1.53.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
79
  */
80
80
  let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=In()??{},y=!!c||Pn(d),[b,x,S=[]]=Nn(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:kn(v,s),hasA11yProp:y,attributes:d});return D(b,{ref:f,...x},[...S.map(([e,t])=>D(e,t)),...Array.isArray(c)?c:[c]])});
81
81
  /**
82
- * @license lucide-react v1.49.0 - ISC
82
+ * @license lucide-react v1.53.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
86
  */
87
87
  function L(e,t=[],n=[]){let r=typeof e==`string`?En(e,t,n):e,i=O(({className:e,...t},n)=>D(Ln,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=On(r.name)),i}
88
88
  /**
89
- * @license lucide-react v1.49.0 - ISC
89
+ * @license lucide-react v1.53.0 - ISC
90
90
  *
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
93
  */
94
94
  const Rn={name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]};Rn.node;const zn=L(Rn),Bn={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]}
95
95
  /**
96
- * @license lucide-react v1.49.0 - ISC
96
+ * @license lucide-react v1.53.0 - ISC
97
97
  *
98
98
  * This source code is licensed under the ISC license.
99
99
  * See the LICENSE file in the root directory of this source tree.
100
100
  */
101
101
  ;Bn.node;const Vn=L(Bn),Hn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}
102
102
  /**
103
- * @license lucide-react v1.49.0 - ISC
103
+ * @license lucide-react v1.53.0 - ISC
104
104
  *
105
105
  * This source code is licensed under the ISC license.
106
106
  * See the LICENSE file in the root directory of this source tree.
107
107
  */
108
108
  ;Hn.node;const Un=L(Hn),Wn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
109
109
  /**
110
- * @license lucide-react v1.49.0 - ISC
110
+ * @license lucide-react v1.53.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
114
  */
115
115
  ;Wn.node;const Gn=L(Wn),Kn={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]}
116
116
  /**
117
- * @license lucide-react v1.49.0 - ISC
117
+ * @license lucide-react v1.53.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
121
  */
122
122
  ;Kn.node;const qn=L(Kn),Jn={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}
123
123
  /**
124
- * @license lucide-react v1.49.0 - ISC
124
+ * @license lucide-react v1.53.0 - ISC
125
125
  *
126
126
  * This source code is licensed under the ISC license.
127
127
  * See the LICENSE file in the root directory of this source tree.
128
128
  */
129
129
  ;Jn.node;const Yn=L(Jn),Xn={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]}
130
130
  /**
131
- * @license lucide-react v1.49.0 - ISC
131
+ * @license lucide-react v1.53.0 - ISC
132
132
  *
133
133
  * This source code is licensed under the ISC license.
134
134
  * See the LICENSE file in the root directory of this source tree.
135
135
  */
136
136
  ;Xn.node;const Zn=L(Xn),Qn={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}
137
137
  /**
138
- * @license lucide-react v1.49.0 - ISC
138
+ * @license lucide-react v1.53.0 - ISC
139
139
  *
140
140
  * This source code is licensed under the ISC license.
141
141
  * See the LICENSE file in the root directory of this source tree.
142
142
  */
143
143
  ;Qn.node;const $n=L(Qn),er={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]}
144
144
  /**
145
- * @license lucide-react v1.49.0 - ISC
145
+ * @license lucide-react v1.53.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
149
  */
150
150
  ;er.node;const tr=L(er),nr={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]}
151
151
  /**
152
- * @license lucide-react v1.49.0 - ISC
152
+ * @license lucide-react v1.53.0 - ISC
153
153
  *
154
154
  * This source code is licensed under the ISC license.
155
155
  * See the LICENSE file in the root directory of this source tree.
156
156
  */
157
157
  ;nr.node;const rr=L(nr),ir={name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]}
158
158
  /**
159
- * @license lucide-react v1.49.0 - ISC
159
+ * @license lucide-react v1.53.0 - ISC
160
160
  *
161
161
  * This source code is licensed under the ISC license.
162
162
  * See the LICENSE file in the root directory of this source tree.
163
163
  */
164
164
  ;ir.node;const ar=L(ir),or={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}
165
165
  /**
166
- * @license lucide-react v1.49.0 - ISC
166
+ * @license lucide-react v1.53.0 - ISC
167
167
  *
168
168
  * This source code is licensed under the ISC license.
169
169
  * See the LICENSE file in the root directory of this source tree.
170
170
  */
171
171
  ;or.node;const sr=L(or),cr={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]}
172
172
  /**
173
- * @license lucide-react v1.49.0 - ISC
173
+ * @license lucide-react v1.53.0 - ISC
174
174
  *
175
175
  * This source code is licensed under the ISC license.
176
176
  * See the LICENSE file in the root directory of this source tree.
177
177
  */
178
- ;cr.node;const lr=L(cr),ur={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]}
178
+ ;cr.node;const lr=L(cr),ur={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
179
179
  /**
180
- * @license lucide-react v1.49.0 - ISC
180
+ * @license lucide-react v1.53.0 - ISC
181
181
  *
182
182
  * This source code is licensed under the ISC license.
183
183
  * See the LICENSE file in the root directory of this source tree.
184
184
  */
185
- ;ur.node;const dr=L(ur),fr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
185
+ ;ur.node;const dr=L(ur),fr={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]}
186
186
  /**
187
- * @license lucide-react v1.49.0 - ISC
187
+ * @license lucide-react v1.53.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
191
  */
192
192
  ;fr.node;const pr=L(fr),mr={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]}
193
193
  /**
194
- * @license lucide-react v1.49.0 - ISC
194
+ * @license lucide-react v1.53.0 - ISC
195
195
  *
196
196
  * This source code is licensed under the ISC license.
197
197
  * See the LICENSE file in the root directory of this source tree.
198
198
  */
199
199
  ;mr.node;const hr=L(mr),gr={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]}
200
200
  /**
201
- * @license lucide-react v1.49.0 - ISC
201
+ * @license lucide-react v1.53.0 - ISC
202
202
  *
203
203
  * This source code is licensed under the ISC license.
204
204
  * See the LICENSE file in the root directory of this source tree.
205
205
  */
206
206
  ;gr.node;const _r=L(gr),vr={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}
207
207
  /**
208
- * @license lucide-react v1.49.0 - ISC
208
+ * @license lucide-react v1.53.0 - ISC
209
209
  *
210
210
  * This source code is licensed under the ISC license.
211
211
  * See the LICENSE file in the root directory of this source tree.
212
212
  */
213
213
  ;vr.node;const yr=L(vr),br={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]}
214
214
  /**
215
- * @license lucide-react v1.49.0 - ISC
215
+ * @license lucide-react v1.53.0 - ISC
216
216
  *
217
217
  * This source code is licensed under the ISC license.
218
218
  * See the LICENSE file in the root directory of this source tree.
219
219
  */
220
220
  ;br.node;const xr=L(br),Sr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}
221
221
  /**
222
- * @license lucide-react v1.49.0 - ISC
222
+ * @license lucide-react v1.53.0 - ISC
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
226
  */
227
227
  ;Sr.node;const Cr=L(Sr),wr={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]}
228
228
  /**
229
- * @license lucide-react v1.49.0 - ISC
229
+ * @license lucide-react v1.53.0 - ISC
230
230
  *
231
231
  * This source code is licensed under the ISC license.
232
232
  * See the LICENSE file in the root directory of this source tree.
233
233
  */
234
234
  ;wr.node;const Tr=L(wr),Er={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]}
235
235
  /**
236
- * @license lucide-react v1.49.0 - ISC
236
+ * @license lucide-react v1.53.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
240
  */
241
241
  ;Er.node;const Dr=L(Er),Or={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]}
242
242
  /**
243
- * @license lucide-react v1.49.0 - ISC
243
+ * @license lucide-react v1.53.0 - ISC
244
244
  *
245
245
  * This source code is licensed under the ISC license.
246
246
  * See the LICENSE file in the root directory of this source tree.
247
247
  */
248
248
  ;Or.node;const kr=L(Or),Ar={name:`square-code`,size:24,node:[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]],aliases:[`code-square`]}
249
249
  /**
250
- * @license lucide-react v1.49.0 - ISC
250
+ * @license lucide-react v1.53.0 - ISC
251
251
  *
252
252
  * This source code is licensed under the ISC license.
253
253
  * See the LICENSE file in the root directory of this source tree.
254
254
  */
255
255
  ;Ar.node;const jr=L(Ar),Mr={name:`strikethrough`,size:24,node:[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]}
256
256
  /**
257
- * @license lucide-react v1.49.0 - ISC
257
+ * @license lucide-react v1.53.0 - ISC
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
261
  */
262
262
  ;Mr.node;const Nr=L(Mr),Pr={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]}
263
263
  /**
264
- * @license lucide-react v1.49.0 - ISC
264
+ * @license lucide-react v1.53.0 - ISC
265
265
  *
266
266
  * This source code is licensed under the ISC license.
267
267
  * See the LICENSE file in the root directory of this source tree.
268
268
  */
269
269
  ;Pr.node;const Fr=L(Pr),Ir={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]}
270
270
  /**
271
- * @license lucide-react v1.49.0 - ISC
271
+ * @license lucide-react v1.53.0 - ISC
272
272
  *
273
273
  * This source code is licensed under the ISC license.
274
274
  * See the LICENSE file in the root directory of this source tree.
275
275
  */
276
276
  ;Ir.node;const Lr=L(Ir),Rr={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
277
277
  /**
278
- * @license lucide-react v1.49.0 - ISC
278
+ * @license lucide-react v1.53.0 - ISC
279
279
  *
280
280
  * This source code is licensed under the ISC license.
281
281
  * See the LICENSE file in the root directory of this source tree.
282
282
  */
283
- ;Rr.node;const zr=L(Rr);function Br(...e){return ue(le(e))}const Vr=E(null);function Hr(){return M(Vr)}function Ur(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function Wr(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Gr(e){return`file:${e}`}const Kr=k(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function qr({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-destructive text-destructive rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-destructive`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-destructive mt-1 max-w-xs truncate`,children:e})]})})}function Jr(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(pr,{className:`w-5 h-5 animate-spin text-muted`})})}function Yr({isOpen:e,onClose:r,title:i,description:a,children:o}){let{t:c}=S();return t(rn,{open:e,onOpenChange:e=>!e&&r(),children:n(cn,{children:[t(un,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(mn,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-card text-card-foreground rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:r,children:[t(Cn,{asChild:!0,children:t(s,{variant:`unstyled`,onClick:r,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-card backdrop-blur-sm hover:bg-muted transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(zr,{className:`w-5 h-5 text-muted`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:o}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-border bg-muted rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(yn,{className:`text-base font-semibold text-card-foreground`,children:i||c(`agent.dashboard`)}),a&&t(xn,{className:`text-sm text-muted mt-0.5`,children:a})]})})]})]})})}function Xr(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}function Zr(e,t){return typeof window>`u`?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Qr(){let e=[1,2,3,4,5].map(e=>Zr(`--chart-${e}`,`#3b82f6`));return{categorical:[...e,...e],blues:e,purples:e,greens:e,diverging:e}}function $r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ei(e){return $r(e)}function ti(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(ri(t,r)||a&&ii(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function ni(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function ri(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(ri(n,t))return!0}return!1}function ii(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function ai(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{ei(e)&&n.push(...ai(e,[...t,r,String(i)]))}):ei(i)&&n.push(...ai(i,[...t,r]))}return n}function oi(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!$r(n))break;i=n}let a=t[t.length-1],o=i[a];$r(o)&&(delete o.url,o.values=r)}return n}function si(e){let t=Qr(),n=Zr(`--font-sans`,`system-ui, sans-serif`),r=Zr(`--foreground`,`#18181b`),i=Zr(`--muted`,`#71717a`),a=Zr(`--border`,`#e4e4e7`);return{background:`transparent`,view:{stroke:`transparent`},range:{category:t.categorical,diverging:t.diverging,heatmap:t.purples,ramp:t.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80},axis:{labelColor:i,titleColor:r,gridColor:a,domainColor:a,tickColor:a,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:i,titleColor:r,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:r,font:n,fontSize:14,fontWeight:600}}}const ci=A(function({spec:r,artifactRunId:i}){let{t:a}=S(),{title:o,description:c,options:l}=r,u=r.spec,[d,f]=I(!1),[p,m]=I(!1),[h,g]=I(null),[_,v]=I(!1),y=F(null),b=F(null),x=F(null),{client:C}=ce(),w=Hr(),E=F(C);E.current=C;let D=F(w);D.current=w;let[O,k]=I(null),[A,M]=I(!1),[ee,te]=I(null),ne=l?.mode||`chart`,re=ne===`dashboard`,ie=l?.enableFullscreen??re,ae=l?.height||Xr(u,ne);N(()=>{let e=ai(u);if(e.length===0){k(u),M(!1),te(null);return}i?console.info(`[VegaLiteChart] resolving artifacts with runId:`,i,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:i});let t=!1;return M(!0),te(null),(async()=>{let n=/* @__PURE__ */ new Map,r=E.current,a=D.current;for(let o of e)try{let e=o.path.join(`.`),t;if(i&&!Ur(o.artifactPath)){let e=Wr(i,o.artifactPath,`inline`);t=a?await a.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url}else{let e=Gr(o.artifactPath);t=a?await a.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let{default:e}=await import(`papaparse`),t=await s.text();l=e.parse(t,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||te(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=oi(u,n);k(e),M(!1)}})(),()=>{t=!0}},[u,i]);let[oe,se]=I(!1),le=F(!1);N(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==le.current&&(le.current=e,se(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ue,de]=I(0),fe=F(0);N(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==fe.current&&(fe.current=e,de(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return fe.current=n,de(n),()=>{clearTimeout(e),t.disconnect()}},[]);let pe=P(()=>ai(u).length>0,[u]),me=P(()=>{if(pe&&!O)return null;let e=O||u;return e?(l?.parameterValues&&(e=ni(e,l.parameterValues)),ti(e)):null},[O,u,pe,l?.parameterValues]),he=j((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>he(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>he(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>he(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),ge=j((e,t=!1)=>{if(!me)return null;let n=si(oe),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ue>0?ue-24:500,i=`vconcat`in me||`hconcat`in me||`concat`in me,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},s=me;i&&r&&(s=he(me,r));let c=s.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=s;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?s:d,...o&&!me.title?{title:o}:{},config:{...n,...me.config}}},[me,o,oe,ue,he]),_e=j(async()=>{let e=_?b.current:y.current;if(e&&!p)try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),ve=j(async()=>{let e=_?b.current:y.current;if(e&&!d){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${o||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[o,d,_]),ye=j(e=>{y.current=e,g(null)},[]),be=j(e=>{b.current=e},[]),xe=j(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),Se=j(()=>{v(e=>!e)},[]);N(()=>{g(null)},[u]);let Ce=({className:e})=>n(`div`,{className:Br(`flex items-center gap-2`,e),children:[n(s,{variant:`unstyled`,onClick:_e,disabled:p,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:a(`agent.copyToClipboard`),children:[t(p?Un:Yn,{className:`w-3 h-3`}),a(p?`agent.copied`:`agent.copy`)]}),n(s,{variant:`unstyled`,onClick:ve,disabled:d,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:a(`agent.exportAsPng`),children:[t(Zn,{className:`w-3 h-3`}),a(d?`agent.exporting`:`agent.export`)]}),ie&&n(s,{variant:`unstyled`,onClick:Se,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors flex items-center gap-1`,title:a(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?xr:hr,{className:`w-3 h-3`}),a(_?`agent.exit`:`agent.fullscreen`)]})]});if(A||pe&&!O)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-muted rounded`,style:{width:`100%`,height:ae},children:n(`div`,{className:`flex items-center gap-2 text-muted`,children:[t(pr,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(ee)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:ee,chartTitle:o})})]})});if(h)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:h,chartTitle:o})})]})});let we=ge(ae),Te=ge(0,!0);return we?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:o,hasData:!!we.data?.values,dataLength:we.data?.values?.length}),n(e,{children:[t(`div`,{className:Br(`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,re&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||(re?`Dashboard`:`Chart`)}),re&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-info text-info`,children:`Interactive`})]}),t(Ce,{})]}),c&&t(`span`,{className:`text-xs text-muted`,children:c}),t(`div`,{ref:x,className:`bg-card text-card-foreground rounded overflow-hidden`,style:{width:`100%`,height:ae,minWidth:0},children:t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:we,onEmbed:e=>ye(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Yr,{isOpen:_,onClose:()=>v(!1),title:o||(re?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:Te&&t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:Te,onEmbed:e=>be(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(Ce,{className:`bg-card rounded-lg shadow-lg p-2 border border-border`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),li={chart:{icon:Vn,label:`chart`,defaultHeight:200},mermaid:{icon:tr,label:`diagram`,defaultHeight:150},proposal:{icon:yr,label:`options`,defaultHeight:100},code:{icon:qn,label:`code`,defaultHeight:80},image:{icon:rr,label:`image`,defaultHeight:150},link:{icon:sr,label:`link`,defaultHeight:24},expand:{icon:Zn,label:`content`,defaultHeight:100},table:{icon:Fr,label:`table`,defaultHeight:150},markdown:{icon:$n,label:`content`,defaultHeight:100},"fusion-fragment":{icon:qn,label:`fragment`,defaultHeight:150}};function R({type:e,error:r,onRetry:i,message:a,height:o}){let c=li[e],l=o??c.defaultHeight,u=e===`link`;if(r)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),i&&t(s,{variant:`unstyled`,onClick:i,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:a||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:a||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var ui=class extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(R,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function di(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function fi(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function pi({content:e}){let{headers:r,rows:i}=P(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(R,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function mi({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function hi(e){return pe.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function gi(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function _i({content:e}){let n=P(()=>{let t=typeof e==`string`?e.trim():``;return t?gi(hi(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(R,{type:`expand`,error:`Empty mockup`})}function vi({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function yi({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Pe();switch(P(()=>n===`auto`?di(e,r,a):n,[e,r,a,n])){case`chart`:{let n=fi(e);return n?t(ui,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(ci,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=fi(e);return n?t(ui,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(ci,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!ci}),n.template&&n.data?t(ui,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(fe,{data:n.data,ChartComponent:ci,artifactRunId:i,children:t(de,{code:JSON.stringify(n.template),data:n.data})})}):t(ui,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(de,{code:JSON.stringify(e)})})}case`table`:return t(ui,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(pi,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(ui,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(ui,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(_i,{content:e})});case`image`:return t(ui,{type:`image`,fallbackCode:r,children:t(vi,{content:e,path:r})});default:return t(mi,{content:e,path:r})}}const bi=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function xi(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function Si(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let Ci;function wi(){return Ci||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:bi,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:bi}}),e)),Ci}function Ti({code:e,className:n}){let r=F(null),[i,a]=I(null),[o,s]=I(null),c=ee().replace(/:/g,`_`);return N(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=xi(e),{svg:i}=await(await wi()).render(n,r),o=Si(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-muted rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-muted rounded`})})}function Ei(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function Di({runId:e,path:t,parseJson:n=!0}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let[s,c]=I({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=j(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=Ei(t);try{let a=Wr(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);N(()=>{l()},[l]);let u=j(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Oi(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function ki(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function Ai(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function ji({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Oi(e),[e]),i=P(()=>{if(r)return null;let t=ki(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(ui,{type:`chart`,fallbackCode:e,children:t(ci,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}function Mi({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Oi(e),[e]),i=P(()=>{if(r)return null;let t=ki(e);return!t||!Ai(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(ui,{type:`chart`,fallbackCode:e,children:t(ci,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Ni({code:e}){let n=e.trim();return n?t(ui,{type:`mermaid`,fallbackCode:e,children:t(Ti,{code:n})}):t(R,{type:`mermaid`,error:`Empty diagram`})}function Pi({code:e}){let n=P(()=>{let t=e.trim();return t?gi(hi(t)):null},[e]);return n?t(ui,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(R,{type:`code`,error:`Empty mockup`})}function Fi({code:e,language:n}){let{artifactRunId:r}=Pe(),i=e.trim(),a=P(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=Di({runId:r,path:i});return r?s?t(R,{type:`expand`,message:`Loading ${i}...`}):c?t(R,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(R,{type:`expand`,error:`No content found in artifact`}):t(yi,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(R,{type:`expand`,error:`No artifact run ID available`})}function Ii(e){return e?.startsWith(`expand`)??!1}function Li(){return{chart:Mi,"vega-lite":ji,vegalite:ji,mermaid:Ni,mockup:Pi,svg:Pi}}const Ri=/* @__PURE__ */ new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function zi(e){return e.trim().replace(/^\/+/,``)}function Bi(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Ri.has(n))return{scheme:n,path:zi(e.slice(t+1))}}return{scheme:`standard`,path:e}}function Vi({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let{scheme:s,path:c}=Bi(e),[l,u]=I(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Ur(c)?Wr(t,c,n):Gr(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=j(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Ur(c)){let a=Wr(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);N(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=j(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function Hi({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=Bi(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(Ui,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function Ui({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=Vi({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(R,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(R,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function Wi({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=Bi(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(Gi,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function Gi({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=Vi({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(R,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(R,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}const Ki=E(()=>({kind:`none`}));Ki.Provider;function qi(){return M(Ki)}const Ji={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function Yi(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Ji,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Ji[n],id:r}}function Xi({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=Yi(l);if(u)return t(Zi,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=Bi(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(Qi,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function Zi({resource:e,rawHref:n,artifactRunId:r,className:i,children:a,ExistingLink:o,rest:c}){let l=qi()(e,{workflowRunId:r,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof o==`function`?t(o,{href:l.href,className:i,...c,children:a}):t(`a`,{href:l.href,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:a}):l.kind===`activate`?t(s,{variant:`link`,size:`none`,className:i,onClick:l.onActivate,children:a}):t(`span`,{className:i,children:a})}function Qi({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=Vi({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(R,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(R,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}function $i(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const ea=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ta=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,na={};function ra(e,t){return((t||na).jsx?ta:ea).test(e)}const ia=/[ \t\n\f\r]/g;function aa(e){return typeof e==`object`?e.type===`text`&&oa(e.value):oa(e)}function oa(e){return e.replace(ia,``)===``}var sa=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};sa.prototype.normal={},sa.prototype.property={},sa.prototype.space=void 0;function ca(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new sa(n,r,t)}function la(e){return e.toLowerCase()}var z=class{constructor(e,t){this.attribute=t,this.property=e}};z.prototype.attribute=``,z.prototype.booleanish=!1,z.prototype.boolean=!1,z.prototype.commaOrSpaceSeparated=!1,z.prototype.commaSeparated=!1,z.prototype.defined=!1,z.prototype.mustUseProperty=!1,z.prototype.number=!1,z.prototype.overloadedBoolean=!1,z.prototype.property=``,z.prototype.spaceSeparated=!1,z.prototype.space=void 0;var ua=/* @__PURE__ */ Oe({boolean:()=>B,booleanish:()=>V,commaOrSpaceSeparated:()=>ma,commaSeparated:()=>pa,number:()=>H,overloadedBoolean:()=>fa,spaceSeparated:()=>U});let da=0;const B=ha(),V=ha(),fa=ha(),H=ha(),U=ha(),pa=ha(),ma=ha();function ha(){return 2**++da}const ga=Object.keys(ua);var _a=class extends z{constructor(e,t,n,r){let i=-1;if(super(e,t),va(this,`space`,r),typeof n==`number`)for(;++i<ga.length;){let e=ga[i];va(this,ga[i],(n&ua[e])===ua[e])}}};_a.prototype.defined=!0;function va(e,t,n){n&&(e[t]=n)}function ya(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new _a(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[la(r)]=r,n[la(a.attribute)]=r}return new sa(t,n,e.space)}const ba=ya({properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:V,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:U,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:H,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:U,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:V,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function xa(e,t){return t in e?e[t]:t}function Sa(e,t){return xa(e,t.toLowerCase())}const Ca=ya({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:pa,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:U,autoFocus:B,autoPlay:B,blocking:U,capture:null,charSet:null,checked:B,cite:null,className:U,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:V,controls:B,controlsList:U,coords:H|pa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:fa,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:U,height:H,hidden:fa,high:H,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:U,itemRef:U,itemScope:B,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:H,pattern:null,ping:U,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:U,required:B,reversed:B,rows:H,rowSpan:H,sandbox:U,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:V,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:pa,part:U,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:Sa}),wa=ya({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:ma,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:pa,g2:pa,glyphName:pa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:ma,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ma,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ma,rev:ma,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ma,requiredFeatures:ma,requiredFonts:ma,requiredFormats:ma,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:ma,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ma,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ma,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:xa}),Ta=ya({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ea=ya({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Sa}),Da=ya({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Oa={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ka=/[A-Z]/g,Aa=/-[a-z]/g,ja=/^data[-\w.:]+$/i;function Ma(e,t){let n=la(t),r=t,i=z;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ja.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Aa,Pa);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Aa.test(e)){let n=e.replace(ka,Na);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=_a}return new i(r,t)}function Na(e){return`-`+e.toLowerCase()}function Pa(e){return e.charAt(1).toUpperCase()}const Fa=ca([ba,Ca,Ta,Ea,Da],`html`),Ia=ca([ba,wa,Ta,Ea,Da],`svg`);function La(e){return e.join(` `).trim()}function Ra(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Va);t&&(n+=t.length);var i=e.lastIndexOf(Ja);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=/* @__PURE__ */ Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Ha)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Ya==e.charAt(0)&&Xa==e.charAt(1)){for(var n=2;Za!=e.charAt(n)&&(Xa!=e.charAt(n)||Ya!=e.charAt(n+1));)++n;if(n+=2,Za===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Qa,comment:o})}}function f(){var e=a(),t=c(Ua);if(t){if(d(),!c(Wa))return s(`property missing ':'`);var n=c(Ga),r=e({type:$a,property:za(t[0].replace(Ba,Za)),value:n?za(n[0].replace(Ba,Za)):Za});return c(Ka),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function za(e){return e?e.replace(qa,Za):Za}var Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo=Ee((()=>{Ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Va=/\n/g,Ha=/^\s*/,Ua=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Wa=/^:\s*/,Ga=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ka=/^[;\s]*/,qa=/^\s+|\s+$/g,Ja=`
283
+ ;Rr.node;const zr=L(Rr);function Br(...e){return ue(le(e))}const Vr=E(null);function Hr(){return M(Vr)}function Ur(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function Wr(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Gr(e){return`file:${e}`}const Kr=k(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function qr({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-destructive text-destructive rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-destructive`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-destructive mt-1 max-w-xs truncate`,children:e})]})})}function Jr(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(dr,{className:`w-5 h-5 animate-spin text-muted`})})}function Yr({isOpen:e,onClose:r,title:i,description:a,children:o}){let{t:c}=S();return t(rn,{open:e,onOpenChange:e=>!e&&r(),children:n(cn,{children:[t(un,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(mn,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-card text-card-foreground rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:r,children:[t(Cn,{asChild:!0,children:t(s,{variant:`unstyled`,onClick:r,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-card backdrop-blur-sm hover:bg-muted transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(zr,{className:`w-5 h-5 text-muted`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:o}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-border bg-muted rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(yn,{className:`text-base font-semibold text-card-foreground`,children:i||c(`agent.dashboard`)}),a&&t(xn,{className:`text-sm text-muted mt-0.5`,children:a})]})})]})]})})}function Xr(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}function Zr(e,t){return typeof window>`u`?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Qr(){let e=[1,2,3,4,5].map(e=>Zr(`--chart-${e}`,`#3b82f6`));return{categorical:[...e,...e],blues:e,purples:e,greens:e,diverging:e}}function $r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ei(e){return $r(e)}function ti(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(ri(t,r)||a&&ii(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function ni(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function ri(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(ri(n,t))return!0}return!1}function ii(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function ai(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{ei(e)&&n.push(...ai(e,[...t,r,String(i)]))}):ei(i)&&n.push(...ai(i,[...t,r]))}return n}function oi(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!$r(n))break;i=n}let a=t[t.length-1],o=i[a];$r(o)&&(delete o.url,o.values=r)}return n}function si(e){let t=Qr(),n=Zr(`--font-sans`,`system-ui, sans-serif`),r=Zr(`--foreground`,`#18181b`),i=Zr(`--muted`,`#71717a`),a=Zr(`--border`,`#e4e4e7`);return{background:`transparent`,view:{stroke:`transparent`},range:{category:t.categorical,diverging:t.diverging,heatmap:t.purples,ramp:t.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80},axis:{labelColor:i,titleColor:r,gridColor:a,domainColor:a,tickColor:a,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:i,titleColor:r,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:r,font:n,fontSize:14,fontWeight:600}}}const ci=A(function({spec:r,artifactRunId:i}){let{t:a}=S(),{title:o,description:c,options:l}=r,u=r.spec,[d,f]=I(!1),[p,m]=I(!1),[h,g]=I(null),[_,v]=I(!1),y=F(null),b=F(null),x=F(null),{client:C}=ce(),w=Hr(),E=F(C);E.current=C;let D=F(w);D.current=w;let[O,k]=I(null),[A,M]=I(!1),[ee,te]=I(null),ne=l?.mode||`chart`,re=ne===`dashboard`,ie=l?.enableFullscreen??re,ae=l?.height||Xr(u,ne);N(()=>{let e=ai(u);if(e.length===0){k(u),M(!1),te(null);return}i?console.info(`[VegaLiteChart] resolving artifacts with runId:`,i,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:i});let t=!1;return M(!0),te(null),(async()=>{let n=/* @__PURE__ */ new Map,r=E.current,a=D.current;for(let o of e)try{let e=o.path.join(`.`),t;if(i&&!Ur(o.artifactPath)){let e=Wr(i,o.artifactPath,`inline`);t=a?await a.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url}else{let e=Gr(o.artifactPath);t=a?await a.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let{default:e}=await import(`papaparse`),t=await s.text();l=e.parse(t,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||te(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=oi(u,n);k(e),M(!1)}})(),()=>{t=!0}},[u,i]);let[oe,se]=I(!1),le=F(!1);N(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==le.current&&(le.current=e,se(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ue,de]=I(0),fe=F(0);N(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==fe.current&&(fe.current=e,de(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return fe.current=n,de(n),()=>{clearTimeout(e),t.disconnect()}},[]);let pe=P(()=>ai(u).length>0,[u]),me=P(()=>{if(pe&&!O)return null;let e=O||u;return e?(l?.parameterValues&&(e=ni(e,l.parameterValues)),ti(e)):null},[O,u,pe,l?.parameterValues]),he=j((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>he(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>he(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>he(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),ge=j((e,t=!1)=>{if(!me)return null;let n=si(oe),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ue>0?ue-24:500,i=`vconcat`in me||`hconcat`in me||`concat`in me,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},s=me;i&&r&&(s=he(me,r));let c=s.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=s;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?s:d,...o&&!me.title?{title:o}:{},config:{...n,...me.config}}},[me,o,oe,ue,he]),_e=j(async()=>{let e=_?b.current:y.current;if(e&&!p)try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),ve=j(async()=>{let e=_?b.current:y.current;if(e&&!d){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${o||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[o,d,_]),ye=j(e=>{y.current=e,g(null)},[]),be=j(e=>{b.current=e},[]),xe=j(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),Se=j(()=>{v(e=>!e)},[]);N(()=>{g(null)},[u]);let Ce=({className:e})=>n(`div`,{className:Br(`flex items-center gap-2`,e),children:[n(s,{variant:`unstyled`,onClick:_e,disabled:p,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:a(`agent.copyToClipboard`),children:[t(p?Un:Yn,{className:`w-3 h-3`}),a(p?`agent.copied`:`agent.copy`)]}),n(s,{variant:`unstyled`,onClick:ve,disabled:d,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:a(`agent.exportAsPng`),children:[t(Zn,{className:`w-3 h-3`}),a(d?`agent.exporting`:`agent.export`)]}),ie&&n(s,{variant:`unstyled`,onClick:Se,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors flex items-center gap-1`,title:a(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?xr:hr,{className:`w-3 h-3`}),a(_?`agent.exit`:`agent.fullscreen`)]})]});if(A||pe&&!O)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-muted rounded`,style:{width:`100%`,height:ae},children:n(`div`,{className:`flex items-center gap-2 text-muted`,children:[t(dr,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(ee)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:ee,chartTitle:o})})]})});if(h)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(qr,{error:h,chartTitle:o})})]})});let we=ge(ae),Te=ge(0,!0);return we?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:o,hasData:!!we.data?.values,dataLength:we.data?.values?.length}),n(e,{children:[t(`div`,{className:Br(`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,re&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-card-foreground`,children:o||(re?`Dashboard`:`Chart`)}),re&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-info text-info`,children:`Interactive`})]}),t(Ce,{})]}),c&&t(`span`,{className:`text-xs text-muted`,children:c}),t(`div`,{ref:x,className:`bg-card text-card-foreground rounded overflow-hidden`,style:{width:`100%`,height:ae,minWidth:0},children:t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:we,onEmbed:e=>ye(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Yr,{isOpen:_,onClose:()=>v(!1),title:o||(re?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:Te&&t(T,{fallback:t(Jr,{}),children:t(Kr,{spec:Te,onEmbed:e=>be(e.view),onError:xe,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(Ce,{className:`bg-card rounded-lg shadow-lg p-2 border border-border`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),li={chart:{icon:Vn,label:`chart`,defaultHeight:200},mermaid:{icon:tr,label:`diagram`,defaultHeight:150},proposal:{icon:yr,label:`options`,defaultHeight:100},code:{icon:qn,label:`code`,defaultHeight:80},image:{icon:rr,label:`image`,defaultHeight:150},link:{icon:sr,label:`link`,defaultHeight:24},expand:{icon:Zn,label:`content`,defaultHeight:100},table:{icon:Fr,label:`table`,defaultHeight:150},markdown:{icon:$n,label:`content`,defaultHeight:100},"fusion-fragment":{icon:qn,label:`fragment`,defaultHeight:150}};function R({type:e,error:r,onRetry:i,message:a,height:o}){let c=li[e],l=o??c.defaultHeight,u=e===`link`;if(r)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),i&&t(s,{variant:`unstyled`,onClick:i,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:a||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:a||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var ui=class extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(R,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function di(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function fi(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function pi({content:e}){let{headers:r,rows:i}=P(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(R,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function mi({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function hi(e){return pe.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function gi(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function _i({content:e}){let n=P(()=>{let t=typeof e==`string`?e.trim():``;return t?gi(hi(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(R,{type:`expand`,error:`Empty mockup`})}function vi({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function yi({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Pe();switch(P(()=>n===`auto`?di(e,r,a):n,[e,r,a,n])){case`chart`:{let n=fi(e);return n?t(ui,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(ci,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=fi(e);return n?t(ui,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(ci,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!ci}),n.template&&n.data?t(ui,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(fe,{data:n.data,ChartComponent:ci,artifactRunId:i,children:t(de,{code:JSON.stringify(n.template),data:n.data})})}):t(ui,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(de,{code:JSON.stringify(e)})})}case`table`:return t(ui,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(pi,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(ui,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(ui,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(_i,{content:e})});case`image`:return t(ui,{type:`image`,fallbackCode:r,children:t(vi,{content:e,path:r})});default:return t(mi,{content:e,path:r})}}const bi=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function xi(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function Si(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let Ci;function wi(){return Ci||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:bi,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:bi}}),e)),Ci}function Ti({code:e,className:n}){let r=F(null),[i,a]=I(null),[o,s]=I(null),c=ee().replace(/:/g,`_`);return N(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=xi(e),{svg:i}=await(await wi()).render(n,r),o=Si(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-muted rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-muted rounded`})})}function Ei(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function Di({runId:e,path:t,parseJson:n=!0}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let[s,c]=I({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=j(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=Ei(t);try{let a=Wr(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);N(()=>{l()},[l]);let u=j(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Oi(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function ki(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function Ai(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function ji({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Oi(e),[e]),i=P(()=>{if(r)return null;let t=ki(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(ui,{type:`chart`,fallbackCode:e,children:t(ci,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}function Mi({code:e}){let{artifactRunId:n}=Pe();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Oi(e),[e]),i=P(()=>{if(r)return null;let t=ki(e);return!t||!Ai(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(ui,{type:`chart`,fallbackCode:e,children:t(ci,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Ni({code:e}){let n=e.trim();return n?t(ui,{type:`mermaid`,fallbackCode:e,children:t(Ti,{code:n})}):t(R,{type:`mermaid`,error:`Empty diagram`})}function Pi({code:e}){let n=P(()=>{let t=e.trim();return t?gi(hi(t)):null},[e]);return n?t(ui,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(R,{type:`code`,error:`Empty mockup`})}function Fi({code:e,language:n}){let{artifactRunId:r}=Pe(),i=e.trim(),a=P(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=Di({runId:r,path:i});return r?s?t(R,{type:`expand`,message:`Loading ${i}...`}):c?t(R,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(R,{type:`expand`,error:`No content found in artifact`}):t(yi,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(R,{type:`expand`,error:`No artifact run ID available`})}function Ii(e){return e?.startsWith(`expand`)??!1}function Li(){return{chart:Mi,"vega-lite":ji,vegalite:ji,mermaid:Ni,mockup:Pi,svg:Pi}}const Ri=/* @__PURE__ */ new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function zi(e){return e.trim().replace(/^\/+/,``)}function Bi(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Ri.has(n))return{scheme:n,path:zi(e.slice(t+1))}}return{scheme:`standard`,path:e}}function Vi({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ce(),i=Hr(),a=F(r);a.current=r;let o=F(i);o.current=i;let{scheme:s,path:c}=Bi(e),[l,u]=I(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Ur(c)?Wr(t,c,n):Gr(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=j(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Ur(c)){let a=Wr(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Gr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);N(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=j(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function Hi({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=Bi(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(Ui,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function Ui({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=Vi({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(R,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(R,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function Wi({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=Bi(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(Gi,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function Gi({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=Vi({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(R,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(R,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}const Ki=E(()=>({kind:`none`}));Ki.Provider;function qi(){return M(Ki)}const Ji={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function Yi(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Ji,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Ji[n],id:r}}function Xi({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=Yi(l);if(u)return t(Zi,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=Bi(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(Qi,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function Zi({resource:e,rawHref:n,artifactRunId:r,className:i,children:a,ExistingLink:o,rest:c}){let l=qi()(e,{workflowRunId:r,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof o==`function`?t(o,{href:l.href,className:i,...c,children:a}):t(`a`,{href:l.href,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:a}):l.kind===`activate`?t(s,{variant:`link`,size:`none`,className:i,onClick:l.onActivate,children:a}):t(`span`,{className:i,children:a})}function Qi({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=Vi({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(R,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(R,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}function $i(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const ea=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ta=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,na={};function ra(e,t){return((t||na).jsx?ta:ea).test(e)}const ia=/[ \t\n\f\r]/g;function aa(e){return typeof e==`object`?e.type===`text`&&oa(e.value):oa(e)}function oa(e){return e.replace(ia,``)===``}var sa=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};sa.prototype.normal={},sa.prototype.property={},sa.prototype.space=void 0;function ca(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new sa(n,r,t)}function la(e){return e.toLowerCase()}var z=class{constructor(e,t){this.attribute=t,this.property=e}};z.prototype.attribute=``,z.prototype.booleanish=!1,z.prototype.boolean=!1,z.prototype.commaOrSpaceSeparated=!1,z.prototype.commaSeparated=!1,z.prototype.defined=!1,z.prototype.mustUseProperty=!1,z.prototype.number=!1,z.prototype.overloadedBoolean=!1,z.prototype.property=``,z.prototype.spaceSeparated=!1,z.prototype.space=void 0;var ua=/* @__PURE__ */ Oe({boolean:()=>B,booleanish:()=>V,commaOrSpaceSeparated:()=>ma,commaSeparated:()=>pa,number:()=>H,overloadedBoolean:()=>fa,spaceSeparated:()=>U});let da=0;const B=ha(),V=ha(),fa=ha(),H=ha(),U=ha(),pa=ha(),ma=ha();function ha(){return 2**++da}const ga=Object.keys(ua);var _a=class extends z{constructor(e,t,n,r){let i=-1;if(super(e,t),va(this,`space`,r),typeof n==`number`)for(;++i<ga.length;){let e=ga[i];va(this,ga[i],(n&ua[e])===ua[e])}}};_a.prototype.defined=!0;function va(e,t,n){n&&(e[t]=n)}function ya(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new _a(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[la(r)]=r,n[la(a.attribute)]=r}return new sa(t,n,e.space)}const ba=ya({properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:V,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:U,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:H,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:U,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:V,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function xa(e,t){return t in e?e[t]:t}function Sa(e,t){return xa(e,t.toLowerCase())}const Ca=ya({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:pa,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:U,autoFocus:B,autoPlay:B,blocking:U,capture:null,charSet:null,checked:B,cite:null,className:U,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:V,controls:B,controlsList:U,coords:H|pa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:fa,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:U,height:H,hidden:fa,high:H,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:U,itemRef:U,itemScope:B,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:H,pattern:null,ping:U,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:U,required:B,reversed:B,rows:H,rowSpan:H,sandbox:U,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:V,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:pa,part:U,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:Sa}),wa=ya({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:ma,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:pa,g2:pa,glyphName:pa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:ma,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ma,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ma,rev:ma,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ma,requiredFeatures:ma,requiredFonts:ma,requiredFormats:ma,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:ma,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ma,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ma,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:xa}),Ta=ya({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Ea=ya({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Sa}),Da=ya({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Oa={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ka=/[A-Z]/g,Aa=/-[a-z]/g,ja=/^data[-\w.:]+$/i;function Ma(e,t){let n=la(t),r=t,i=z;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ja.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Aa,Pa);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Aa.test(e)){let n=e.replace(ka,Na);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=_a}return new i(r,t)}function Na(e){return`-`+e.toLowerCase()}function Pa(e){return e.charAt(1).toUpperCase()}const Fa=ca([ba,Ca,Ta,Ea,Da],`html`),Ia=ca([ba,wa,Ta,Ea,Da],`svg`);function La(e){return e.join(` `).trim()}function Ra(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Va);t&&(n+=t.length);var i=e.lastIndexOf(Ja);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=/* @__PURE__ */ Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Ha)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Ya==e.charAt(0)&&Xa==e.charAt(1)){for(var n=2;Za!=e.charAt(n)&&(Xa!=e.charAt(n)||Ya!=e.charAt(n+1));)++n;if(n+=2,Za===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Qa,comment:o})}}function f(){var e=a(),t=c(Ua);if(t){if(d(),!c(Wa))return s(`property missing ':'`);var n=c(Ga),r=e({type:$a,property:za(t[0].replace(Ba,Za)),value:n?za(n[0].replace(Ba,Za)):Za});return c(Ka),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function za(e){return e?e.replace(qa,Za):Za}var Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo=Ee((()=>{Ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Va=/\n/g,Ha=/^\s*/,Ua=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Wa=/^:\s*/,Ga=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ka=/^[;\s]*/,qa=/^\s+|\s+$/g,Ja=`
284
284
  `,Ya=`/`,Xa=`*`,Za=``,Qa=`comment`,$a=`declaration`})),to=/* @__PURE__ */ Oe({default:()=>no});function no(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Ra(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var ro=Ee((()=>{eo()})),io=/* @__PURE__ */ De((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ao=/* @__PURE__ */ De(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((ro(),je(to))),r=io();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const oo=co(`end`),so=co(`start`);function co(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function lo(e){let t=so(e),n=oo(e);if(t&&n)return{start:t,end:n}}function uo(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?po(e.position):`start`in e||`end`in e?po(e):`line`in e||`column`in e?fo(e):``}function fo(e){return mo(e&&e.line)+`:`+mo(e&&e.column)}function po(e){return fo(e&&e.start)+`-`+fo(e&&e.end)}function mo(e){return e&&typeof e==`number`?e:1}var W=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=uo(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};W.prototype.file=``,W.prototype.name=``,W.prototype.reason=``,W.prototype.message=``,W.prototype.stack=``,W.prototype.column=void 0,W.prototype.line=void 0,W.prototype.ancestors=void 0,W.prototype.cause=void 0,W.prototype.fatal=void 0,W.prototype.place=void 0,W.prototype.ruleId=void 0,W.prototype.source=void 0;var ho=/* @__PURE__ */ Ae(ao(),1);const go={}.hasOwnProperty,_o=/* @__PURE__ */ new Map,vo=/[A-Z]/g,yo=/* @__PURE__ */ new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),bo=/* @__PURE__ */ new Set([`td`,`th`]),xo=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function So(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=No(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Mo(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ia:Fa,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Co(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Co(e,t,n){if(t.type===`element`)return wo(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return To(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Do(e,t,n);if(t.type===`mdxjsEsm`)return Eo(e,t);if(t.type===`root`)return Oo(e,t,n);if(t.type===`text`)return ko(e,t)}function wo(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ia,e.schema=i),e.ancestors.push(t);let a=zo(e,t.tagName,!1),o=Po(e,t),s=Io(e,t);return yo.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!aa(e)})),Ao(e,o,a,t),jo(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function To(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Bo(e,t.position)}function Eo(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bo(e,t.position)}function Do(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ia,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:zo(e,t.name,!0),o=Fo(e,t),s=Io(e,t);return Ao(e,o,a,t),jo(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Oo(e,t,n){let r={};return jo(r,Io(e,t)),e.create(t,e.Fragment,r,n)}function ko(e,t){return t.value}function Ao(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jo(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Mo(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function No(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=so(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Po(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&go.call(t.properties,i)){let a=Lo(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&bo.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Fo(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Bo(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Bo(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Io(e,t){let n=[],r=-1,i=e.passKeys?/* @__PURE__ */ new Map:_o;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Co(e,a,o);s!==void 0&&n.push(s)}return n}function Lo(e,t,n){let r=Ma(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?$i(n):La(n)),r.property===`style`){let t=typeof n==`object`?n:Ro(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Vo(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Oa[r.property]||r.property:r.attribute,n]}}function Ro(e,t){try{return(0,ho.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new W("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=xo+`#cannot-parse-style-attribute`,r}}function zo(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ra(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ra(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return go.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bo(e)}function Bo(e,t){let n=new W("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=xo+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Vo(e){let t={},n;for(n in e)go.call(e,n)&&(t[Ho(n)]=e[n]);return t}function Ho(e){let t=e.replace(vo,Uo);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Uo(e){return`-`+e.toLowerCase()}const Wo={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Go={};function Ko(e,t){let n=t||Go;return qo(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function qo(e,t,n){if(Yo(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Jo(e.children,t,n)}return Array.isArray(e)?Jo(e,t,n):``}function Jo(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=qo(e[i],t,n);return r.join(``)}function Yo(e){return!!(e&&typeof e==`object`)}const Xo=document.createElement(`i`);function Zo(e){let t=`&`+e+`;`;Xo.innerHTML=t;let n=Xo.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function G(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Qo(e,t){return e.length>0?(G(e,e.length,0,t),e):t}const $o={}.hasOwnProperty;function es(e){let t={},n=-1;for(;++n<e.length;)ts(t,e[n]);return t}function ts(e,t){let n;for(n in t){let r=($o.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){$o.call(r,a)||(r[a]=[]);let e=i[a];ns(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ns(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);G(e,0,0,r)}function rs(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function is(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const K=fs(/[A-Za-z]/),q=fs(/[\dA-Za-z]/),as=fs(/[#-'*+\--9=?A-Z^-~]/);function os(e){return e!==null&&(e<32||e===127)}const ss=fs(/\d/),cs=fs(/[\dA-Fa-f]/),ls=fs(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function X(e){return e===-2||e===-1||e===32}const us=fs(/\p{P}|\p{S}/u),ds=fs(/\s/);function fs(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ps(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&q(e.charCodeAt(n+1))&&q(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return X(r)?(e.enter(n),s(r)):t(r)}function s(r){return X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const ms={tokenize:hs};function hs(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return J(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const gs={tokenize:vs},_s={tokenize:ys};function vs(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return G(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_s,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(_s,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return J(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;G(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ys(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function bs(e){if(e===null||Y(e)||ds(e))return 1;if(us(e))return 2}function xs(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Ss={name:`attention`,resolveAll:Cs,tokenize:ws};function Cs(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ts(d,-c),Ts(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Qo(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Qo(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Qo(l,xs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Qo(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Qo(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,G(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ws(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=bs(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=bs(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ts(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Es={name:`autolink`,tokenize:Ds};function Ds(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return K(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||q(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||q(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||os(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):as(t)?(e.consume(t),l):n(t)}function u(e){return q(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||q(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Os={partial:!0,tokenize:ks};function ks(e,t,n){return r;function r(t){return X(t)?Z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||J(e)?t(e):n(e)}}const As={continuation:{tokenize:Ms},exit:Ns,name:`blockQuote`,tokenize:js};function js(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ms(e,t,n){let r=this;return i;function i(t){return X(t)?Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(As,t,n)(r)}}function Ns(e){e.exit(`blockQuote`)}const Ps={name:`characterEscape`,tokenize:Fs};function Fs(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ls(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Is={name:`characterReference`,tokenize:Ls};function Ls(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=q,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=cs,u):(e.enter(`characterReferenceValue`),a=7,o=ss,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===q&&!Zo(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const Rs={partial:!0,tokenize:Vs},zs={concrete:!0,name:`codeFenced`,tokenize:Bs};function Bs(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||J(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Rs,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||J(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&X(t)?Z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||J(t)?e.check(Rs,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||J(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),X(t)?Z(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),X(t)?Z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||J(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Vs(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Hs={name:`codeIndented`,tokenize:Ws},Us={partial:!0,tokenize:Gs};function Ws(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):J(t)?e.attempt(Us,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||J(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Gs(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):J(e)?i(e):n(e)}}const Ks={name:`codeText`,previous:Js,resolve:qs,tokenize:Ys};function qs(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Js(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ys(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||J(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Xs=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Zs(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Zs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Zs(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Zs(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Zs(this.left,t.reverse())}}}};function Zs(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Qs(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Xs(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,$s(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return G(e,0,1/0,u.slice(0)),!l}function $s(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const ec={resolve:nc,tokenize:rc},tc={partial:!0,tokenize:ic};function nc(e){return Qs(e),e}function rc(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):J(t)?e.check(tc,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ic(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,a,`linePrefix`)}function a(i){if(i===null||J(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ac(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||os(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||J(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Y(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||os(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function oc(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||
285
285
  /* c8 ignore next 3 */
286
286
  l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):J(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||J(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function sc(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||J(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function cc(e,t){let n;return r;function r(i){return J(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):X(i)?Z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const lc={name:`definition`,tokenize:dc},uc={partial:!0,tokenize:fc};function dc(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return oc.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=is(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Y(t)?cc(e,l)(t):l(t)}function l(t){return ac(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(uc,d,d)(t)}function d(t){return X(t)?Z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||J(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function fc(e,t,n){return r;function r(t){return Y(t)?cc(e,i)(t):n(t)}function i(t){return sc(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return X(t)?Z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||J(e)?t(e):n(e)}}const pc={name:`hardBreakEscape`,tokenize:mc};function mc(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return J(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const hc={name:`headingAtx`,resolve:gc,tokenize:_c};function gc(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},G(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function _c(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Y(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||J(n)?(e.exit(`atxHeading`),t(n)):X(n)?Z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Y(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const vc=/* @__PURE__ */ `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(`.`),yc=[`pre`,`script`,`style`,`textarea`],bc={concrete:!0,name:`htmlFlow`,resolveTo:Cc,tokenize:wc},xc={partial:!0,tokenize:Ec},Sc={partial:!0,tokenize:Tc};function Cc(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wc(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):K(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):K(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return K(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Y(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&yc.includes(l)?(i=1,r.interrupt?t(s):O(s)):vc.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||q(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||K(t)?(e.consume(t),b):X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):X(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||J(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Y(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||J(t)?O(t):X(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),I):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):J(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(xc,te,k)(t)):t===null||J(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Sc,A,te)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||J(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return yc.includes(n)?(e.consume(t),I):O(t)}return K(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),I):t===45&&i===2?(e.consume(t),F):O(t)}function I(t){return t===null||J(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),I)}function te(n){return e.exit(`htmlFlow`),t(n)}}function Tc(e,t,n){let r=this;return i;function i(t){return J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Ec(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Os,t,n)}}const Dc={name:`htmlText`,tokenize:Oc};function Oc(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):K(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):K(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):J(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):J(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):J(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):J(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return K(t)?(e.consume(t),S):n(t)}function S(t){return t===45||q(t)?(e.consume(t),S):C(t)}function C(t){return J(t)?(o=C,N(t)):X(t)?(e.consume(t),C):M(t)}function w(t){return t===45||q(t)?(e.consume(t),w):t===47||t===62||Y(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||K(t)?(e.consume(t),E):J(t)?(o=T,N(t)):X(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):J(t)?(o=D,N(t)):X(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):J(t)?(o=O,N(t)):X(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):J(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Y(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Y(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return X(t)?Z(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}const kc={name:`labelEnd`,resolveAll:Nc,resolveTo:Pc,tokenize:Fc},Ac={tokenize:Ic},jc={tokenize:Lc},Mc={tokenize:Rc};function Nc(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&G(e,0,e.length,n),e}function Pc(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Qo(s,e.slice(a+1,a+r+3)),s=Qo(s,[[`enter`,u,t]]),s=Qo(s,xs(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Qo(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Qo(s,e.slice(o+1)),s=Qo(s,[[`exit`,c,t]]),G(e,a,e.length,s),e}function Fc(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(is(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ac,u,o?u:d)(t):t===91?e.attempt(jc,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Mc,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Ic(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Y(t)?cc(e,a)(t):a(t)}function a(t){return t===41?u(t):ac(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Y(t)?cc(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?sc(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Y(t)?cc(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Lc(e,t,n){let r=this;return i;function i(t){return oc.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(is(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Rc(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const zc={name:`labelStartImage`,resolveAll:kc.resolveAll,tokenize:Bc};function Bc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){
@@ -340,5 +340,5 @@ if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r)
340
340
  `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const Jg={tokenize:Xg,concrete:!0,name:`mathFlow`},Yg={tokenize:Zg,partial:!0};function Xg(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Z(e,l,`whitespace`)(t))}function l(t){return t===null||J(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(Yg,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Z(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):J(t)?e.attempt(Yg,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||J(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Z(e,c,`whitespace`)(t))}function c(r){return r===null||J(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function Zg(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Qg(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:$g,previous:e_,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||J(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function $g(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function e_(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function t_(e){return{flow:{36:Jg},text:{36:Qg(e)}}}const n_={};function r_(e){let t=this,n=e||n_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(t_(n)),a.push(Kg()),o.push(qg(n))}const i_=(function(e){if(e==null)return l_;if(typeof e==`string`)return s_(e);if(typeof e==`object`)return Array.isArray(e)?a_(e):o_(e);if(typeof e==`function`)return c_(e);throw Error(`Expected function, string, or object as test`)});function a_(e){let t=[],n=-1;for(;++n<e.length;)t[n]=i_(e[n]);return c_(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function o_(e){return c_(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function s_(e){return c_(t);function t(t){return t&&t.type===e}}function c_(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function l_(){return!0}function u_(e){return e}const d_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=i_(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+u_(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=f_(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function f_(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const p_=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),d_(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}});function m_(){return e=>{p_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\^/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`superscript`,data:{hName:`sup`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)}),p_(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\~/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`subscript`,data:{hName:`sub`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)})}}const h_=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],g_=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,__=/`[^`\n]*`/g,v_=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,y_=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function b_(e){return h_.some(t=>e.startsWith(t))}function x_(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&b_(t.slice(1,n).trim()))return e}let n=t.match(y_)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return b_(r)?`<${r}>${i}`:e}function S_(e){return e.replace(g_,(e,t,n,r)=>`${t}${x_(n)}${r}`)}function C_(e){let t=``,n=0;for(let r of e.matchAll(__))t+=S_(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=S_(e.slice(n)),t}function w_(e){if(!e||!h_.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(v_))t+=C_(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=C_(e.slice(n)),t}const T_=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,E_=/^\w+/;function D_(e){return e?.includes(`:::`)?e.replace(T_,(e,t,n)=>{let r=n.trim(),i=E_.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const O_=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,k_=/`[^`\n]*`/g,A_=/\\\$/g,j_=/\\[^\s]/,M_=/[{}]/,N_=/[_^][\w{]/,P_=/^[a-zA-Z]$/,F_=/^[a-zA-Z]\s*=/,I_=/^\s/,L_=/\s$/,R_=/[+*/-]$/,z_=/\^[+-]$/,B_=/^\d[\d,]*(?:\.\d+)?[kKmMbB]?[)\]*_,;:.!?]+\s+[a-zA-Z]{2,}(?!\w)/,V_=/^\d/;function H_(e){return j_.test(e)||M_.test(e)||N_.test(e)||P_.test(e)||F_.test(e)}function U_(e){return I_.test(e)||L_.test(e)||R_.test(e)&&!z_.test(e)?!0:W_(e)}function W_(e){return B_.test(e)?!0:V_.test(e)&&G_(e)}function G_(e){let t=0;for(let n of e)if(n===`(`||n===`[`?t++:(n===`)`||n===`]`)&&t--,t<0)return!0;return t!==0}function K_(e){let t=[];for(let n=0;n<e.length;n++)if(e[n]===`$`&&!(n>0&&e[n-1]===`\\`)){if(n+1<e.length&&e[n+1]===`$`){n++;continue}n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)}return t}function q_(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
341
341
  `)?null:r}const J_={currency:`\\$`,escapedInLatex:`\\text{\\textdollar}`};function Y_(e,t){let n=K_(e);if(n.length<2)return e;let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a=Array(n.length-1);for(let t=0;t<n.length-1;t++)a[t]=q_(e,n[t],n[t+1]);let o=[];for(let e=0;e<n.length-1;e++){if(r.has(e))continue;let t=a[e];t!==null&&H_(t)&&!W_(t)&&(r.add(e),r.add(e+1),o.push([n[e],n[e+1]]))}let s=0;for(;s<n.length;){if(r.has(s)){s++;continue}let e=s+1;for(;e<n.length&&r.has(e);)e++;if(e>=n.length)break;if(e>s+1){i.add(n[s]),s++;continue}let t=a[s];if(t===null){s++;continue}U_(t)&&(i.add(n[s]),i.add(n[e])),r.add(s),r.add(e),s=e+1}for(let e=0;e<n.length;e++)r.has(e)||e+1<n.length&&r.has(e+1)&&i.add(n[e]);if(i.size===0&&o.length===0)return e;let c=[],l=0,u=Array.from(i).sort((e,t)=>e-t),d=0,f=0;for(;d<u.length||f<o.length;){let n=d<u.length?u[d]:1/0;if(n<(f<o.length?o[f][0]:1/0))n>l&&c.push(e.slice(l,n)),c.push(t.currency),l=n+1,d++;else{let[n,r]=o[f];n>l&&c.push(e.slice(l,n));let i=e.slice(n,r+1);for(c.push(i.replace(A_,t.escapedInLatex)),l=r+1;d<u.length&&u[d]<=r;)d++;f++}}return l<e.length&&c.push(e.slice(l)),c.join(``)}function X_(e,t){let n=[],r=0;for(let i of e.matchAll(k_))n.push(Y_(e.slice(r,i.index),t)),n.push(i[0]),r=i.index+i[0].length;return n.push(Y_(e.slice(r),t)),n.join(``)}function Z_(e,t){let n=[],r=0;for(let i of e.matchAll(O_))n.push(X_(e.slice(r,i.index),t)),n.push(i[0]),r=i.index+i[0].length;return n.push(X_(e.slice(r),t)),n.join(``)}function Q_(e){return e?.includes(`$`)?Z_(e,J_):e}const $_=[[8352,8384],[57344,63743]];function ev(e){for(let[t,n]of $_)for(let r=t;r<=n;r++){let t=String.fromCharCode(r);if(!e.includes(t))return t}}function tv(e){if(!e?.includes(`$`))return{markdown:e};let t=ev(e);return t?{markdown:Z_(e,{currency:t,escapedInLatex:`\\${t}`}),mask:t}:{markdown:e}}const nv={note:`md-callout-info`,tip:`md-callout-info`,warning:`md-callout-attention`,important:`md-callout-attention`,caution:`md-callout-destructive`},rv={note:`Note`,tip:`Tip`,warning:`Warning`,important:`Important`,caution:`Caution`};function iv(){return(e,t)=>{Wu(e,(e,n,r)=>{if(e.type===`textDirective`){let i=e.position?.start.offset,a=e.position?.end.offset;if(r&&n!==void 0&&i!==void 0&&a!==void 0){let o={type:`text`,value:t.toString().slice(i,a),position:e.position};r.children[n]=o}return Vu}if(e.type!==`containerDirective`&&e.type!==`leafDirective`)return;let i=e;i.data||={};let a=i.data,o=i.attributes||{},s=i.name;if(s===`pagebreak`){a.hName=`hr`,a.hProperties={className:`md-pagebreak`};return}if(s===`columns`){a.hName=`div`,a.hProperties={className:`md-columns`};return}if(s===`column`){a.hName=`div`;let e={className:`md-column`};o.width&&(e.style=`flex-basis:${o.width};flex-grow:0;flex-shrink:0`),a.hProperties=e;return}if(s in nv){a.hName=`div`,a.hProperties={className:`md-callout ${nv[s]}`,"data-callout-type":s};let e=rv[s];if(e&&i.children){let t={type:`paragraph`,data:{hName:`p`,hProperties:{className:`md-callout-title`}},children:[{type:`text`,value:e}]};i.children.unshift(t)}return}a.hName=`div`,a.hProperties={className:`md-${s}`,...Object.fromEntries(Object.entries(o).filter(([e])=>e!==`class`))},o.class&&(a.hProperties.className+=` ${o.class}`)})}}const av=[`value`,`url`,`title`,`alt`];function ov({mask:e}){let t=`\\${e}`;return n=>{Wu(n,n=>{let r=n;if(r.type===`inlineMath`){if(typeof r.value!=`string`)return;let e=r.value.split(t).join(`\\text{\\textdollar}`);r.value=e;for(let t of r.data?.hChildren??[])t.type===`text`&&(t.value=e);return}for(let t of av){let n=r[t];typeof n==`string`&&(r[t]=n.split(e).join(`$`))}})}}const sv=/(?:^|[^\\])\$/,cv=[];let lv,uv;function dv(){return uv||=import(`rehype-katex`).then(({default:e})=>(lv=e,e)),uv}function fv(e){let t=w.useMemo(()=>sv.test(e),[e]),[n,r]=w.useState(()=>lv);return w.useEffect(()=>{if(!t||n)return;let e=!1;return dv().then(t=>{e||r(()=>t)}).catch(e=>{console.error(`Failed to load KaTeX; math will render unstyled`,e)}),()=>{e=!0}},[t,n]),w.useMemo(()=>n?[n]:cv,[n])}const pv=[`artifact:`,`image:`,`store:`,`document:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`];function mv(e){return pv.some(t=>e.startsWith(t))?e:Kd(e)}function hv(){return e=>{Wu(e,`html`,(e,t,n)=>{let r=e,i=n;if(typeof r.value==`string`&&/<!--[\s\S]*?-->/.test(r.value)&&i?.children&&typeof t==`number`)return i.children.splice(t,1),[Vu,t]})}}const gv=Li();function _v({children:e,components:n,remarkPlugins:r=[],removeComments:i=!0,artifactRunId:a,onArtifactOpen:o,className:s,codeClassName:c,inlineCodeClassName:l,linkClassName:u,imageClassName:d,onProposalSelect:f,onProposalSubmit:p,preserveSourcePositions:m=!1}){let h=Ie(),{markdown:g,mask:_}=w.useMemo(()=>m?tv(e):{markdown:D_(w_(Q_(e)))},[e,m]),v=w.useMemo(()=>{let e=[Bg,Hp,iv,Ug,Ef,m_,r_,..._?[[ov,{mask:_}]]:[],...r];return i&&e.push(hv),e},[r,i,_]),y=fv(g),b=w.useMemo(()=>({handlers:{...wf}}),[]),x=w.useMemo(()=>{let e=n||{},r=e.code,i=e.a,s=e.img,f=({node:e,className:n,children:i,...a})=>{let o=/language-([\w-]+)/.exec(n||``),s=!o,u=o?o[1]:``;if(!s&&u){if(h){let e=h.getComponent(u);if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}if(Ii(u)){let e=String(i||``).trim();return t(Fi,{code:e,language:u})}let e=gv[u];if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}return typeof r==`function`?t(r,{node:e,className:n,...a,children:i}):t(`code`,{...a,className:s?`px-1.5 py-0.5 rounded ${l||``}`:` ${c||``}`,children:i})},p=e=>{let{node:n,href:r,children:s,...c}=e;return t(Xi,{node:n,href:r,className:u,artifactRunId:a,onArtifactOpen:o,ExistingLink:typeof i==`function`?i:void 0,...c,children:s})},m=e=>{let{node:n,src:r,alt:i,title:o,...c}=e;return o?t(Hi,{src:r,alt:i,caption:o,className:d,artifactRunId:a}):t(Wi,{node:n,src:r,alt:i,className:d,artifactRunId:a,ExistingImg:typeof s==`function`?s:void 0,...c})};return{...e,code:f,a:p,img:m}},[n,a,o,h,c,l,u,d]),S=t(Ne,{artifactRunId:a,onProposalSelect:f,onProposalSubmit:p,MarkdownRenderer:_v,children:t(Hd,{remarkPlugins:v,rehypePlugins:y,remarkRehypeOptions:b,components:x,urlTransform:mv,children:g})});return s?t(`div`,{className:`md-content ${s}`,children:S}):t(`div`,{className:`md-content`,children:S})}const $=e=>e.chain(),vv=e=>e.can().chain();function yv(e){let[,t]=I(0);N(()=>{if(!e)return;let n=()=>t(e=>e+1);return e.on(`transaction`,n),e.on(`selectionUpdate`,n),()=>{e.off(`transaction`,n),e.off(`selectionUpdate`,n)}},[e])}const bv=e=>e.preventDefault();function xv(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`c-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Sv(e){let{from:t,to:n}=e.state.selection;if(t>=n)return null;let r=e.state.doc.textBetween(t,n,`
342
342
  `,` `).trim();if(!r)return null;let i=e.state.doc.resolve(t),a=`paragraph`;for(let e=i.depth;e>=0;e--){let t=i.node(e).type.name;if(t===`heading`){a=`heading`;break}if(t===`codeBlock`||t===`vertesiaCodeBlock`){a=`code block`;break}if(t===`blockquote`){a=`quote`;break}if(t===`listItem`||t===`taskItem`){a=`list item`;break}if(t===`table`){a=`table`;break}}return{blockLabel:a,quote:r,from:t,to:n}}function Cv(e){let t=e.length,n=e.map((e,t)=>`${t+1}. On the ${e.blockLabel} “${e.quote}”:\n ${e.comment}`);return[`I've left ${t} comment${t===1?``:`s`} on the document:`,``,...n,``,`Please revise the document to address each comment, preserving everything else.`].join(`
343
- `)}function wv(e,t){return{contextElement:e.view.dom,getBoundingClientRect:()=>{try{let n=e.view.coordsAtPos(t.to),r=Math.max(1,n.bottom-n.top);return new DOMRect(n.right,n.top,1,r)}catch{return e.view.dom.getBoundingClientRect()}}}}function Tv(e){try{return e.view.dom.closest(`[role="dialog"]`)??void 0}catch{return}}function Ev({editor:e,selection:r,composing:i,draft:a,onStart:o,onDraftChange:c,onCancel:l,onAdd:u}){let{t:d}=S(),f=b(),p=P(()=>Tv(e)??f,[e,f]),{refs:m,floatingStyles:h}=ye({placement:`right-start`,strategy:`fixed`,middleware:[_e(8),ge({fallbackPlacements:[`left-start`,`bottom-start`]}),ve({padding:12})],whileElementsMounted:he}),g=P(()=>wv(e,r),[e,r]);return N(()=>{m.setPositionReference(g)},[g,m]),t(me,{root:p,children:t(`div`,{ref:m.setFloating,style:h,className:`pointer-events-auto z-100`,children:i?n(`div`,{role:`dialog`,"aria-label":d(`agent.commentOnSelection`),className:`w-80 max-w-[calc(100vw-1.5rem)] space-y-2 rounded-lg border border-mixer-muted/25 bg-popover p-3 text-popover-foreground shadow-lg`,children:[n(`div`,{className:`line-clamp-2 text-xs text-muted`,children:[t(`span`,{className:`font-medium text-foreground`,children:d(`agent.commentingOn`)}),` `,n(`span`,{className:`italic`,children:[`“`,r.quote,`”`]})]}),t(_,{value:a,onChange:e=>c(e.target.value),placeholder:d(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),l();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u())}}),n(`div`,{className:`flex justify-end gap-2`,children:[t(s,{variant:`outline`,size:`sm`,onClick:l,children:d(`store.cancelEdit`)}),t(s,{size:`sm`,onClick:u,disabled:!a.trim(),children:d(`agent.addComment`)})]})]}):t(v,{description:d(`agent.commentOnSelection`),asChild:!0,children:t(s,{variant:`secondary`,size:`sm`,onMouseDown:bv,onClick:o,"aria-label":d(`agent.commentOnSelection`),className:`size-9 rounded-full p-0 shadow-md`,children:t(_r,{className:`size-4`})})})})})}function Dv({icon:e,label:n,active:r=!1,disabled:i=!1,onClick:a}){return t(s,{variant:`ghost`,size:`sm`,"aria-label":n,title:n,"aria-pressed":r,disabled:i,onMouseDown:bv,onClick:a,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,r&&`bg-muted text-foreground`),children:t(e,{className:`size-4`})})}function Ov(){return t(`div`,{className:`mx-0.5 h-5 w-px shrink-0 bg-mixer-muted/30`,"aria-hidden":!0})}function kv({onSend:e,hasUnsentChanges:r,isSending:i,disabled:a}){let{t:o}=S();return n(s,{variant:r?`primary`:`ghost`,size:`sm`,className:y(`h-8 gap-1.5`,!r&&`text-muted`),onMouseDown:bv,onClick:()=>void e(),disabled:a||!r||i,children:[i?t(g,{size:`sm`}):t(kr,{className:`size-3.5`}),o(`agent.sendChangesToAgent`)]})}function Av({editor:r,className:i,editable:a=!0,onSendComment:o,onSendChangesToAgent:f,hasUnsentChanges:p=!1,isSendingChanges:m=!1,sendChangesDisabled:h=!1,toolbarStatus:g}){let{t:_}=S(),v=x();yv(r);let[b,C]=I(!1),[w,T]=I(``),[E,D]=I(null),[O,k]=I(null),[A,M]=I([]),[ee,P]=I(!1),[te,ne]=I(!1),re=F(null);N(()=>{if(!r||!o)return;let e=()=>{let e=Sv(r);k(e),e&&(re.current=e)};return e(),r.on(`selectionUpdate`,e),r.on(`transaction`,e),()=>{r.off(`selectionUpdate`,e),r.off(`transaction`,e)}},[r,o]);let ie=j(()=>{let e=re.current;if(!e){v({status:`info`,title:_(`agent.selectTextToComment`),duration:2500});return}D(e),T(``),C(!0)},[_,v]),ae=j(()=>{C(!1),D(null),T(``)},[]),oe=j(()=>{let e=w.trim();E&&e&&(M(t=>[...t,{id:xv(),...E,comment:e}]),C(!1),D(null),T(``),P(!0))},[w,E]),se=j(e=>{M(t=>t.filter(t=>t.id!==e))},[]),ce=j(async()=>{if(o&&A.length!==0&&!te){ne(!0);try{await o(Cv(A)),M([]),P(!1)}finally{ne(!1)}}},[te,o,A]);if(!r)return null;let le=[1,2,3].find(e=>r.isActive(`heading`,{level:e})),ue=_(le===1?`richText.heading1`:le===2?`richText.heading2`:le===3?`richText.heading3`:`richText.paragraph`),de=r.isActive(`table`),fe=E??O;return n(e,{children:[n(`div`,{role:`toolbar`,"aria-label":_(`richText.blockStyle`),className:y(`flex min-h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-b border-mixer-muted/25 px-1.5 py-1`,i),children:[t(Dv,{icon:Lr,label:_(`richText.undo`),disabled:!a||!vv(r).focus().undo().run(),onClick:()=>$(r).focus().undo().run()}),t(Dv,{icon:Dr,label:_(`richText.redo`),disabled:!a||!vv(r).focus().redo().run(),onClick:()=>$(r).focus().redo().run()}),t(Ov,{}),n(c,{children:[t(d,{asChild:!0,children:n(s,{variant:`ghost`,size:`sm`,disabled:!a,onMouseDown:bv,className:`h-8 shrink-0 gap-1 px-2 text-xs font-medium text-foreground hover:bg-muted/60`,children:[ue,t(Gn,{className:`size-3 opacity-60`})]})}),n(l,{align:`start`,children:[t(u,{onClick:()=>$(r).focus().setParagraph().run(),children:_(`richText.paragraph`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:1}).run(),children:_(`richText.heading1`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:2}).run(),children:_(`richText.heading2`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:3}).run(),children:_(`richText.heading3`)})]})]}),t(Ov,{}),t(Dv,{icon:zn,label:_(`richText.bold`),active:r.isActive(`bold`),disabled:!a,onClick:()=>$(r).focus().toggleBold().run()}),t(Dv,{icon:ar,label:_(`richText.italic`),active:r.isActive(`italic`),disabled:!a,onClick:()=>$(r).focus().toggleItalic().run()}),t(Dv,{icon:Nr,label:_(`richText.strike`),active:r.isActive(`strike`),disabled:!a,onClick:()=>$(r).focus().toggleStrike().run()}),t(Dv,{icon:qn,label:_(`richText.inlineCode`),active:r.isActive(`code`),disabled:!a,onClick:()=>$(r).focus().toggleCode().run()}),t(Ov,{}),t(Dv,{icon:dr,label:_(`richText.bulletList`),active:r.isActive(`bulletList`),disabled:!a,onClick:()=>$(r).focus().toggleBulletList().run()}),t(Dv,{icon:lr,label:_(`richText.orderedList`),active:r.isActive(`orderedList`),disabled:!a,onClick:()=>$(r).focus().toggleOrderedList().run()}),t(Dv,{icon:Tr,label:_(`richText.blockquote`),active:r.isActive(`blockquote`),disabled:!a,onClick:()=>$(r).focus().toggleBlockquote().run()}),t(Dv,{icon:jr,label:_(`richText.codeBlock`),active:r.isActive(`codeBlock`),disabled:!a,onClick:()=>$(r).focus().toggleCodeBlock().run()}),t(Ov,{}),t(Dv,{icon:Cr,label:_(`richText.horizontalRule`),disabled:!a,onClick:()=>$(r).focus().setHorizontalRule().run()}),n(c,{children:[t(d,{asChild:!0,children:t(s,{variant:`ghost`,size:`sm`,disabled:!a,"aria-label":_(`richText.tableActions`),title:_(de?`richText.tableActions`:`richText.table`),onMouseDown:bv,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,de&&`bg-muted`),children:t(Fr,{className:`size-4`})})}),t(l,{align:`start`,children:de?n(e,{children:[t(u,{onClick:()=>$(r).focus().addRowBefore().run(),children:_(`richText.addRowAbove`)}),t(u,{onClick:()=>$(r).focus().addRowAfter().run(),children:_(`richText.addRowBelow`)}),t(u,{onClick:()=>$(r).focus().deleteRow().run(),children:_(`richText.deleteRow`)}),t(u,{onClick:()=>$(r).focus().addColumnBefore().run(),children:_(`richText.addColumnLeft`)}),t(u,{onClick:()=>$(r).focus().addColumnAfter().run(),children:_(`richText.addColumnRight`)}),t(u,{onClick:()=>$(r).focus().deleteColumn().run(),children:_(`richText.deleteColumn`)}),t(u,{onClick:()=>$(r).focus().deleteTable().run(),children:_(`richText.deleteTable`)})]}):t(u,{onClick:()=>$(r).focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:_(`richText.table`)})})]}),o||f?n(`div`,{className:`ms-auto flex shrink-0 items-center gap-1 ps-1`,children:[A.length>0?n(e,{children:[n(s,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs text-muted`,onClick:()=>P(e=>!e),children:[_(`agent.comments`),` (`,A.length,`)`]}),n(s,{size:`sm`,className:`h-8`,onClick:()=>void ce(),disabled:te,children:[t(kr,{className:`me-1 size-4`}),_(`agent.sendToAgent`)]})]}):null,f?n(e,{children:[g,t(kv,{onSend:f,hasUnsentChanges:p,isSending:m,disabled:h})]}):null]}):null]}),o&&fe?t(Ev,{editor:r,selection:fe,composing:b,draft:w,onStart:ie,onDraftChange:T,onCancel:ae,onAdd:oe}):null,ee&&A.length>0?t(`ul`,{className:`relative z-101 max-h-48 shrink-0 space-y-1.5 overflow-y-auto border-b border-mixer-muted/15 bg-background px-3 py-2`,children:A.map(e=>n(`li`,{className:`flex items-start gap-2 rounded-md border border-mixer-muted/20 bg-muted/10 px-2 py-1.5`,children:[n(`div`,{className:`min-w-0 flex-1`,children:[n(`div`,{className:`truncate text-[11px] italic text-muted`,children:[`“`,e.quote,`”`]}),t(`div`,{className:`whitespace-pre-wrap text-xs text-foreground`,children:e.comment})]}),t(s,{variant:`ghost`,size:`sm`,"aria-label":_(`agent.deleteComment`),title:_(`agent.deleteComment`),className:`size-6 shrink-0 p-0 text-muted`,onClick:()=>se(e.id),children:t(zr,{className:`size-3.5`})})]},e.id))}):null]})}const jv=Li();function Mv({code:e,language:n}){let r=Ie(),i=n?r?.getComponent(n):void 0,a=n?jv[n]:void 0,o=n?.startsWith(`expand:`)?Fi:i??a;return o?t(o,{code:e,language:n}):null}function Nv({src:e,alt:n,title:r}){let{artifactRunId:i}=Pe();return r?t(Hi,{src:e,alt:n,caption:r,artifactRunId:i}):t(Wi,{src:e,alt:n,artifactRunId:i})}function Pv({href:e,title:n,children:r}){let{artifactRunId:i}=Pe();return t(Xi,{href:e,artifactRunId:i,children:t(`span`,{title:n,children:r})})}function Fv({raw:e}){let{artifactRunId:n}=Pe();return t(_v,{artifactRunId:n,children:e})}const Iv={codeBlock:Mv,image:Nv,link:Pv,opaqueBlock:Fv};function Lv({artifactRunId:e,...n}){return t(Ne,{artifactRunId:e,MarkdownRenderer:_v,children:t(a,{...n,...Iv})})}function Rv({artifactRunId:e,className:i,contentClassName:a,editorClassName:o,onEditor:s,...c}){let[l,u]=I(null),d=j(e=>{u(e),s?.(e)},[s]);return t(Ne,{artifactRunId:e,MarkdownRenderer:_v,children:n(`div`,{className:y(`overflow-hidden rounded-md border border-mixer-muted/30 bg-background`,i),children:[t(Av,{editor:l,editable:c.editable!==!1}),t(r,{...c,...Iv,onEditor:d,contentClassName:y(`max-h-80 overflow-auto`,a),editorClassName:y(`vprose prose-sm min-h-24 max-w-none px-3 py-2 outline-none`,o)})]})})}function zv({artifactRunId:e,className:r,contentClassName:a,editorClassName:c,onEditor:l,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g=!1,isSendingChanges:v=!1,sendChangesDisabled:b=!1,toolbarStatus:x,...C}){let{t:w}=S(),[T,E]=I(null),D=j(e=>{E(e),l?.(e)},[l]),[O,k]=I(()=>o(C.value)===`lossy`?`choose`:`rich-text`);return n(Ne,{artifactRunId:e,MarkdownRenderer:_v,children:[(O===`choose`?`source`:O)===`rich-text`?n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[t(Av,{editor:T,editable:C.editable!==!1,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g,isSendingChanges:v,sendChangesDisabled:b,toolbarStatus:x}),t(i,{...C,...Iv,onEditor:D,ariaLabel:C.ariaLabel??w(`richText.documentEditor`),className:`flex min-h-0 flex-1 flex-col`,contentClassName:y(`min-h-0 flex-1 overflow-auto`,a),editorClassName:y(`vprose prose-sm mx-auto min-h-full w-full max-w-5xl px-6 py-5 outline-none`,c)})]}):n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[d?n(`div`,{className:`flex min-h-10 shrink-0 items-center justify-end gap-1 border-b border-mixer-muted/25 px-1.5 py-1`,children:[x,t(kv,{onSend:d,hasUnsentChanges:g,isSending:v,disabled:b})]}):null,t(_,{value:C.value,onChange:e=>C.onChange?.(e.target.value),onFocus:()=>C.onFocusChange?.(!0),onBlur:()=>C.onFocusChange?.(!1),disabled:C.editable===!1,"aria-label":w(`richText.markdownSourceEditor`),className:y(`vertesia-markdown-document-editor-content min-h-0 flex-1 resize-none rounded-none`,`border-0 px-6 py-5 font-mono text-sm leading-6 outline-none focus-visible:ring-0`,a,c)})]}),n(f,{isOpen:O===`choose`,onClose:()=>k(`source`),className:`sm:max-w-lg`,disableCloseOnClickOutside:!0,children:[t(h,{children:w(`richText.sourceCompatibilityWarningTitle`)}),t(p,{children:t(`p`,{className:`text-sm text-muted`,children:w(`richText.sourceCompatibilityWarningDescription`)})}),n(m,{align:`right`,children:[t(s,{variant:`outline`,onClick:()=>k(`source`),children:w(`richText.editMarkdownSource`)}),t(s,{variant:`secondary`,onClick:()=>k(`rich-text`),children:w(`richText.continueRichText`)})]})]})]})}export{Rv as VertesiaMarkdownComponentEditor,zv as VertesiaMarkdownDocumentEditor,Lv as VertesiaMarkdownRichTextEditor,Iv as vertesiaRichTextRenderers};
343
+ `)}function wv(e,t){return{contextElement:e.view.dom,getBoundingClientRect:()=>{try{let n=e.view.coordsAtPos(t.to),r=Math.max(1,n.bottom-n.top);return new DOMRect(n.right,n.top,1,r)}catch{return e.view.dom.getBoundingClientRect()}}}}function Tv(e){try{return e.view.dom.closest(`[role="dialog"]`)??void 0}catch{return}}function Ev({editor:e,selection:r,composing:i,draft:a,onStart:o,onDraftChange:c,onCancel:l,onAdd:u}){let{t:d}=S(),f=b(),p=P(()=>Tv(e)??f,[e,f]),{refs:m,floatingStyles:h}=ye({placement:`right-start`,strategy:`fixed`,middleware:[_e(8),ge({fallbackPlacements:[`left-start`,`bottom-start`]}),ve({padding:12})],whileElementsMounted:he}),g=P(()=>wv(e,r),[e,r]);return N(()=>{m.setPositionReference(g)},[g,m]),t(me,{root:p,children:t(`div`,{ref:m.setFloating,style:h,className:`pointer-events-auto z-100`,children:i?n(`div`,{role:`dialog`,"aria-label":d(`agent.commentOnSelection`),className:`w-80 max-w-[calc(100vw-1.5rem)] space-y-2 rounded-lg border border-mixer-muted/25 bg-popover p-3 text-popover-foreground shadow-lg`,children:[n(`div`,{className:`line-clamp-2 text-xs text-muted`,children:[t(`span`,{className:`font-medium text-foreground`,children:d(`agent.commentingOn`)}),` `,n(`span`,{className:`italic`,children:[`“`,r.quote,`”`]})]}),t(_,{value:a,onChange:e=>c(e.target.value),placeholder:d(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),l();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u())}}),n(`div`,{className:`flex justify-end gap-2`,children:[t(s,{variant:`outline`,size:`sm`,onClick:l,children:d(`store.cancelEdit`)}),t(s,{size:`sm`,onClick:u,disabled:!a.trim(),children:d(`agent.addComment`)})]})]}):t(v,{description:d(`agent.commentOnSelection`),asChild:!0,children:t(s,{variant:`secondary`,size:`sm`,onMouseDown:bv,onClick:o,"aria-label":d(`agent.commentOnSelection`),className:`size-9 rounded-full p-0 shadow-md`,children:t(_r,{className:`size-4`})})})})})}function Dv({icon:e,label:n,active:r=!1,disabled:i=!1,onClick:a}){return t(s,{variant:`ghost`,size:`sm`,"aria-label":n,title:n,"aria-pressed":r,disabled:i,onMouseDown:bv,onClick:a,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,r&&`bg-muted text-foreground`),children:t(e,{className:`size-4`})})}function Ov(){return t(`div`,{className:`mx-0.5 h-5 w-px shrink-0 bg-mixer-muted/30`,"aria-hidden":!0})}function kv({onSend:e,hasUnsentChanges:r,isSending:i,disabled:a}){let{t:o}=S();return n(s,{variant:r?`primary`:`ghost`,size:`sm`,className:y(`h-8 gap-1.5`,!r&&`text-muted`),onMouseDown:bv,onClick:()=>void e(),disabled:a||!r||i,children:[i?t(g,{size:`sm`}):t(kr,{className:`size-3.5`}),o(`agent.sendChangesToAgent`)]})}function Av({editor:r,className:i,editable:a=!0,onSendComment:o,onSendChangesToAgent:f,hasUnsentChanges:p=!1,isSendingChanges:m=!1,sendChangesDisabled:h=!1,toolbarStatus:g}){let{t:_}=S(),v=x();yv(r);let[b,C]=I(!1),[w,T]=I(``),[E,D]=I(null),[O,k]=I(null),[A,M]=I([]),[ee,P]=I(!1),[te,ne]=I(!1),re=F(null);N(()=>{if(!r||!o)return;let e=()=>{let e=Sv(r);k(e),e&&(re.current=e)};return e(),r.on(`selectionUpdate`,e),r.on(`transaction`,e),()=>{r.off(`selectionUpdate`,e),r.off(`transaction`,e)}},[r,o]);let ie=j(()=>{let e=re.current;if(!e){v({status:`info`,title:_(`agent.selectTextToComment`),duration:2500});return}D(e),T(``),C(!0)},[_,v]),ae=j(()=>{C(!1),D(null),T(``)},[]),oe=j(()=>{let e=w.trim();E&&e&&(M(t=>[...t,{id:xv(),...E,comment:e}]),C(!1),D(null),T(``),P(!0))},[w,E]),se=j(e=>{M(t=>t.filter(t=>t.id!==e))},[]),ce=j(async()=>{if(o&&A.length!==0&&!te){ne(!0);try{await o(Cv(A)),M([]),P(!1)}finally{ne(!1)}}},[te,o,A]);if(!r)return null;let le=[1,2,3].find(e=>r.isActive(`heading`,{level:e})),ue=_(le===1?`richText.heading1`:le===2?`richText.heading2`:le===3?`richText.heading3`:`richText.paragraph`),de=r.isActive(`table`),fe=E??O;return n(e,{children:[n(`div`,{role:`toolbar`,"aria-label":_(`richText.blockStyle`),className:y(`flex min-h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-b border-mixer-muted/25 px-1.5 py-1`,i),children:[t(Dv,{icon:Lr,label:_(`richText.undo`),disabled:!a||!vv(r).focus().undo().run(),onClick:()=>$(r).focus().undo().run()}),t(Dv,{icon:Dr,label:_(`richText.redo`),disabled:!a||!vv(r).focus().redo().run(),onClick:()=>$(r).focus().redo().run()}),t(Ov,{}),n(c,{children:[t(d,{asChild:!0,children:n(s,{variant:`ghost`,size:`sm`,disabled:!a,onMouseDown:bv,className:`h-8 shrink-0 gap-1 px-2 text-xs font-medium text-foreground hover:bg-muted/60`,children:[ue,t(Gn,{className:`size-3 opacity-60`})]})}),n(l,{align:`start`,children:[t(u,{onClick:()=>$(r).focus().setParagraph().run(),children:_(`richText.paragraph`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:1}).run(),children:_(`richText.heading1`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:2}).run(),children:_(`richText.heading2`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:3}).run(),children:_(`richText.heading3`)})]})]}),t(Ov,{}),t(Dv,{icon:zn,label:_(`richText.bold`),active:r.isActive(`bold`),disabled:!a,onClick:()=>$(r).focus().toggleBold().run()}),t(Dv,{icon:ar,label:_(`richText.italic`),active:r.isActive(`italic`),disabled:!a,onClick:()=>$(r).focus().toggleItalic().run()}),t(Dv,{icon:Nr,label:_(`richText.strike`),active:r.isActive(`strike`),disabled:!a,onClick:()=>$(r).focus().toggleStrike().run()}),t(Dv,{icon:qn,label:_(`richText.inlineCode`),active:r.isActive(`code`),disabled:!a,onClick:()=>$(r).focus().toggleCode().run()}),t(Ov,{}),t(Dv,{icon:pr,label:_(`richText.bulletList`),active:r.isActive(`bulletList`),disabled:!a,onClick:()=>$(r).focus().toggleBulletList().run()}),t(Dv,{icon:lr,label:_(`richText.orderedList`),active:r.isActive(`orderedList`),disabled:!a,onClick:()=>$(r).focus().toggleOrderedList().run()}),t(Dv,{icon:Tr,label:_(`richText.blockquote`),active:r.isActive(`blockquote`),disabled:!a,onClick:()=>$(r).focus().toggleBlockquote().run()}),t(Dv,{icon:jr,label:_(`richText.codeBlock`),active:r.isActive(`codeBlock`),disabled:!a,onClick:()=>$(r).focus().toggleCodeBlock().run()}),t(Ov,{}),t(Dv,{icon:Cr,label:_(`richText.horizontalRule`),disabled:!a,onClick:()=>$(r).focus().setHorizontalRule().run()}),n(c,{children:[t(d,{asChild:!0,children:t(s,{variant:`ghost`,size:`sm`,disabled:!a,"aria-label":_(`richText.tableActions`),title:_(de?`richText.tableActions`:`richText.table`),onMouseDown:bv,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,de&&`bg-muted`),children:t(Fr,{className:`size-4`})})}),t(l,{align:`start`,children:de?n(e,{children:[t(u,{onClick:()=>$(r).focus().addRowBefore().run(),children:_(`richText.addRowAbove`)}),t(u,{onClick:()=>$(r).focus().addRowAfter().run(),children:_(`richText.addRowBelow`)}),t(u,{onClick:()=>$(r).focus().deleteRow().run(),children:_(`richText.deleteRow`)}),t(u,{onClick:()=>$(r).focus().addColumnBefore().run(),children:_(`richText.addColumnLeft`)}),t(u,{onClick:()=>$(r).focus().addColumnAfter().run(),children:_(`richText.addColumnRight`)}),t(u,{onClick:()=>$(r).focus().deleteColumn().run(),children:_(`richText.deleteColumn`)}),t(u,{onClick:()=>$(r).focus().deleteTable().run(),children:_(`richText.deleteTable`)})]}):t(u,{onClick:()=>$(r).focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:_(`richText.table`)})})]}),o||f?n(`div`,{className:`ms-auto flex shrink-0 items-center gap-1 ps-1`,children:[A.length>0?n(e,{children:[n(s,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs text-muted`,onClick:()=>P(e=>!e),children:[_(`agent.comments`),` (`,A.length,`)`]}),n(s,{size:`sm`,className:`h-8`,onClick:()=>void ce(),disabled:te,children:[t(kr,{className:`me-1 size-4`}),_(`agent.sendToAgent`)]})]}):null,f?n(e,{children:[g,t(kv,{onSend:f,hasUnsentChanges:p,isSending:m,disabled:h})]}):null]}):null]}),o&&fe?t(Ev,{editor:r,selection:fe,composing:b,draft:w,onStart:ie,onDraftChange:T,onCancel:ae,onAdd:oe}):null,ee&&A.length>0?t(`ul`,{className:`relative z-101 max-h-48 shrink-0 space-y-1.5 overflow-y-auto border-b border-mixer-muted/15 bg-background px-3 py-2`,children:A.map(e=>n(`li`,{className:`flex items-start gap-2 rounded-md border border-mixer-muted/20 bg-muted/10 px-2 py-1.5`,children:[n(`div`,{className:`min-w-0 flex-1`,children:[n(`div`,{className:`truncate text-[11px] italic text-muted`,children:[`“`,e.quote,`”`]}),t(`div`,{className:`whitespace-pre-wrap text-xs text-foreground`,children:e.comment})]}),t(s,{variant:`ghost`,size:`sm`,"aria-label":_(`agent.deleteComment`),title:_(`agent.deleteComment`),className:`size-6 shrink-0 p-0 text-muted`,onClick:()=>se(e.id),children:t(zr,{className:`size-3.5`})})]},e.id))}):null]})}const jv=Li();function Mv({code:e,language:n}){let r=Ie(),i=n?r?.getComponent(n):void 0,a=n?jv[n]:void 0,o=n?.startsWith(`expand:`)?Fi:i??a;return o?t(o,{code:e,language:n}):null}function Nv({src:e,alt:n,title:r}){let{artifactRunId:i}=Pe();return r?t(Hi,{src:e,alt:n,caption:r,artifactRunId:i}):t(Wi,{src:e,alt:n,artifactRunId:i})}function Pv({href:e,title:n,children:r}){let{artifactRunId:i}=Pe();return t(Xi,{href:e,artifactRunId:i,children:t(`span`,{title:n,children:r})})}function Fv({raw:e}){let{artifactRunId:n}=Pe();return t(_v,{artifactRunId:n,children:e})}const Iv={codeBlock:Mv,image:Nv,link:Pv,opaqueBlock:Fv};function Lv({artifactRunId:e,...n}){return t(Ne,{artifactRunId:e,MarkdownRenderer:_v,children:t(a,{...n,...Iv})})}function Rv({artifactRunId:e,className:i,contentClassName:a,editorClassName:o,onEditor:s,...c}){let[l,u]=I(null),d=j(e=>{u(e),s?.(e)},[s]);return t(Ne,{artifactRunId:e,MarkdownRenderer:_v,children:n(`div`,{className:y(`overflow-hidden rounded-md border border-mixer-muted/30 bg-background`,i),children:[t(Av,{editor:l,editable:c.editable!==!1}),t(r,{...c,...Iv,onEditor:d,contentClassName:y(`max-h-80 overflow-auto`,a),editorClassName:y(`vprose prose-sm min-h-24 max-w-none px-3 py-2 outline-none`,o)})]})})}function zv({artifactRunId:e,className:r,contentClassName:a,editorClassName:c,onEditor:l,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g=!1,isSendingChanges:v=!1,sendChangesDisabled:b=!1,toolbarStatus:x,...C}){let{t:w}=S(),[T,E]=I(null),D=j(e=>{E(e),l?.(e)},[l]),[O,k]=I(()=>o(C.value)===`lossy`?`choose`:`rich-text`);return n(Ne,{artifactRunId:e,MarkdownRenderer:_v,children:[(O===`choose`?`source`:O)===`rich-text`?n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[t(Av,{editor:T,editable:C.editable!==!1,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g,isSendingChanges:v,sendChangesDisabled:b,toolbarStatus:x}),t(i,{...C,...Iv,onEditor:D,ariaLabel:C.ariaLabel??w(`richText.documentEditor`),className:`flex min-h-0 flex-1 flex-col`,contentClassName:y(`min-h-0 flex-1 overflow-auto`,a),editorClassName:y(`vprose prose-sm mx-auto min-h-full w-full max-w-5xl px-6 py-5 outline-none`,c)})]}):n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[d?n(`div`,{className:`flex min-h-10 shrink-0 items-center justify-end gap-1 border-b border-mixer-muted/25 px-1.5 py-1`,children:[x,t(kv,{onSend:d,hasUnsentChanges:g,isSending:v,disabled:b})]}):null,t(_,{value:C.value,onChange:e=>C.onChange?.(e.target.value),onFocus:()=>C.onFocusChange?.(!0),onBlur:()=>C.onFocusChange?.(!1),disabled:C.editable===!1,"aria-label":w(`richText.markdownSourceEditor`),className:y(`vertesia-markdown-document-editor-content min-h-0 flex-1 resize-none rounded-none`,`border-0 px-6 py-5 font-mono text-sm leading-6 outline-none focus-visible:ring-0`,a,c)})]}),n(f,{isOpen:O===`choose`,onClose:()=>k(`source`),className:`sm:max-w-lg`,disableCloseOnClickOutside:!0,children:[t(h,{children:w(`richText.sourceCompatibilityWarningTitle`)}),t(p,{children:t(`p`,{className:`text-sm text-muted`,children:w(`richText.sourceCompatibilityWarningDescription`)})}),n(m,{align:`right`,children:[t(s,{variant:`outline`,onClick:()=>k(`source`),children:w(`richText.editMarkdownSource`)}),t(s,{variant:`secondary`,onClick:()=>k(`rich-text`),children:w(`richText.continueRichText`)})]})]})]})}export{Rv as VertesiaMarkdownComponentEditor,zv as VertesiaMarkdownDocumentEditor,Lv as VertesiaMarkdownRichTextEditor,Iv as vertesiaRichTextRenderers};
344
344
  //# sourceMappingURL=vertesia-ui-rich-text.js.map