@inkeep/open-knowledge 0.79.4 → 0.79.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -6
- package/dist/constants-BEf1XIUh.mjs +1 -0
- package/dist/{dist-Dci-h_mV.mjs → dist-Cyu0_4Hk.mjs} +1 -1
- package/dist/{dist-CeD-QmMk.mjs → dist-Wp7q1s6Y.mjs} +1 -1
- package/dist/index.mjs +100 -100
- package/dist/{init-PYX9s0p3.mjs → init-BXSnMRNn.mjs} +2 -2
- package/dist/init-DI8UoMhu.mjs +1 -0
- package/dist/{launch-json-removal-DE_lefaT.mjs → launch-json-removal-DG3VHJW8.mjs} +1 -1
- package/dist/{loader-SBH7CBDL.mjs → loader-CW3vZLfr.mjs} +1 -1
- package/dist/loader-kQgl8Ken.mjs +1 -0
- package/dist/{md-manager-BGnqyqi1-BWyJhS5F.mjs → md-manager-BGnqyqi1-6BkNojVX.mjs} +83 -83
- package/dist/{open-browser-CmAzRurP.mjs → open-browser-DDm3O1M4.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-CWqZ8sv1.mjs +1 -0
- package/dist/{preview-CYBCI8OL.mjs → preview-D6tlpOxM.mjs} +1 -1
- package/dist/public/assets/{ActivityModeContent-CwiUBgGI.js → ActivityModeContent-CeBcQFCd.js} +1 -1
- package/dist/public/assets/AddPropertiesButton-D1fXN-bI.js +2 -0
- package/dist/public/assets/{AgentDiffPane-DCr3QWvF.js → AgentDiffPane-Brbw0TOW.js} +1 -1
- package/dist/public/assets/{AgentIconCluster-CqUXZZMo.js → AgentIconCluster-D5LuHNJO.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-CGvXydlP.js → AgentThreadClientBinder-BREHoaJm.js} +1 -1
- package/dist/public/assets/{BugReportHistory-BQMbH-qH.js → BugReportHistory-CIMi5_6m.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-BRdfOcWv.js → BugReportHistoryDialog-H9GGUGCO.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-Cg1vR5eO.js +3 -0
- package/dist/public/assets/{ConsentDialogBody-DWjU5hm4.js → ConsentDialogBody-RuHQ8kCe.js} +1 -1
- package/dist/public/assets/{DeleteConfirmationDialog-CJJ8Xo5u.js → DeleteConfirmationDialog-CVqSXQKX.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-BGdnGPRv.js → DiffViewBoundary-BUckV1Hg.js} +1 -1
- package/dist/public/assets/DocumentContext-Dje4W6Tq.js +39 -0
- package/dist/public/assets/{EditorModeToggle-CUFvhR2v.js → EditorModeToggle-BTZXEw1G.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DfwumFEb.js → EnableSyncConfirmDialog-DNgMbG5z.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-CylNX2Db.js → ExcalidrawDocEditor-D3fwgav-.js} +1 -1
- package/dist/public/assets/FeedbackForm-8Yd_nPUy.js +1 -0
- package/dist/public/assets/{GraphPanel-BQaGu4a5.js → GraphPanel-Cgsq6_qd.js} +2 -2
- package/dist/public/assets/{ImageAttachments-mkcDupGd.js → ImageAttachments-C04JociC.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DSya0fK3.js → ImportSkillDialog-BIHxaSfk.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BsTgh8nL.js → LintConfigEditor-Bya7uzkK.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-C27b2LjY.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-CVIYFnTZ.js → ManagedArtifactProperties-DoBik8-u.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-634q13Qg.js → MermaidDocEditor-CSxeUQT3.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-D8HsZbz2.js → OpenInAgentMenuItem-bGK86cMV.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-B_AEbfI7.js → PropertyDisplayRow-Cfs6EKb5.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-Cg6tPVU5.js → RegisteredAgentIcon-COLTpZlS.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-ABNMdMUU.js → ReportBugDialogBody-BkGwTD2A.js} +2 -2
- package/dist/public/assets/{ReportBugMenuTrigger-DRki3qOn.js → ReportBugMenuTrigger-vKKMJLl7.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-D6Ve-pbq.js → SchemaConfigEditor-CSShwmSs.js} +1 -1
- package/dist/public/assets/{SessionsHost-BqU3aWOR.js → SessionsHost-Dm1Jg-f5.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-UKT3bDul.js → SettingsDialogBody-QkzJLzTo.js} +4 -4
- package/dist/public/assets/{ShareBranchSwitchDialog-DE7uyxww.js → ShareBranchSwitchDialog-BKliAbKT.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-D8d3_-15.js → ShareReceiveDialog-C8W-qIpG.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-Bx29cMNb.js → ShareReceiveMissDialog-C_2GVlU-.js} +1 -1
- package/dist/public/assets/{SkillCostValue-gdZ-CbVJ.js → SkillCostValue-Canu7ulO.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-Bd94eiPC.js → SkillEditBanner-CqgwduJW.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-ho4FUABV.js → SkillForkDialog-ClFI3xs3.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-DpmMcdPv.js → SkillInstallMenu-ChAQsGBS.js} +2 -2
- package/dist/public/assets/{SkillOriginInline-DmEjQplu.js → SkillOriginInline-CcM-SmxG.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-miZURo1o.js → SkillToolbarControls-BQuUG6ql.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CUfeiKej.js → SlidesToolbarControls-Cl_VdpJK.js} +1 -1
- package/dist/public/assets/{SourceEditor-DCGr3Oun.js → SourceEditor-C7lxPRhs.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DDye0ppp.js → TerminalPanel-DOTUMJ92.js} +3 -3
- package/dist/public/assets/{TerminalWindowApp-QDFQJvJI.js → TerminalWindowApp-DDIHpnVX.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Dy2g4z9H.js → TextDocEditor-vRH4H4kl.js} +1 -1
- package/dist/public/assets/ThreadView-BIyJmhDy.js +24 -0
- package/dist/public/assets/{TimelineDiffPane-9-8JYbua.js → TimelineDiffPane-ChgcNI55.js} +1 -1
- package/dist/public/assets/{agent-connection-status-BTfitB3U.js → agent-connection-status-DAZgLioE.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CIg70qGh.js → auth-state-cache-BtZLDON0.js} +3 -3
- package/dist/public/assets/{bug-report-send-manager-BCkcP5rY.js → bug-report-send-manager-BFol9sa2.js} +1 -1
- package/dist/public/assets/chunk-BO2N2NFS-or1uZCel.js +82 -0
- package/dist/public/assets/{client-version-DA4kJKPj.js → client-version-Cnqrk3vb.js} +1 -1
- package/dist/public/assets/{comment-chips-Cnc9lZ6c.js → comment-chips-R5ZB_k6x.js} +1 -1
- package/dist/public/assets/config-provider-BT2aKaOH.js +4 -0
- package/dist/public/assets/{css-color-to-hex-B54xiLpY.js → css-color-to-hex-CceC2fgU.js} +1 -1
- package/dist/public/assets/{diagnostic-breadcrumb-BUuIuodI.js → diagnostic-breadcrumb-DU0H47R5.js} +1 -1
- package/dist/public/assets/{dist-bQ5kvrpa.js → dist-BS18tPvg.js} +114 -110
- package/dist/public/assets/dist-Dv7C_sDf.js +50 -0
- package/dist/public/assets/{doc-paths-BKrv1Wyo.js → doc-paths-wf1Zwihi.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-CaLoly49.js → doc-undo-manager-Cqbvym-_.js} +1 -1
- package/dist/public/assets/{documents-events-j9AAd1Uc.js → documents-events-CJhE88yE.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BqzkXC53.js → file-tree-adapter-DEH021-T.js} +1 -1
- package/dist/public/assets/{file-tree-utils-B3QHZLn9.js → file-tree-utils-BepVdPY2.js} +1 -1
- package/dist/public/assets/{folder-config-api-DBYtfk4T.js → folder-config-api-BTtUsUJc.js} +1 -1
- package/dist/public/assets/{highlighted-body-OFNGDK62-jrcgBfTw.js → highlighted-body-OFNGDK62-B7E5UTmI.js} +1 -1
- package/dist/public/assets/{index-B4DpftwC.js → index-CAIB8eyt.js} +18 -18
- package/dist/public/assets/{lint-config-client-C26s8yTI.js → lint-config-client-BrKjdAjt.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DYxq-YWd.js → markdownlint-rule-browser-D0dNFiig.js} +1 -1
- package/dist/public/assets/mermaid-GHXKKRXX-DuRPZW34.js +1 -0
- package/dist/public/assets/navigation-targets-CGmNW6bP.js +1 -0
- package/dist/public/assets/{page-list-cache-DP24ij3W.js → page-list-cache-3qGG2z03.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-ru8vEtq1.js → pending-receive-nav-store-BskNCNiC.js} +1 -1
- package/dist/public/assets/{preferred-session-events-Dhjm0Z1H.js → preferred-session-events-Bc1TL2i6.js} +1 -1
- package/dist/public/assets/{progress-ChqYJ_wo.js → progress-AwYHrf79.js} +3 -3
- package/dist/public/assets/{project-paths-CDhA3hJy.js → project-paths-0QKXK535.js} +1 -1
- package/dist/public/assets/{prop-types-BWPMh-sI.js → prop-types-DasLWSYV.js} +1 -1
- package/dist/public/assets/{receive-store-CU33mRR1.js → receive-store-C5Ksy1p_.js} +1 -1
- package/dist/public/assets/{selection-context-4lSNiVN-.js → selection-context-H4vqiY2e.js} +1 -1
- package/dist/public/assets/{sign-in-terminal-events-MVTdgKtV.js → sign-in-terminal-events-BYXamHPu.js} +1 -1
- package/dist/public/assets/{skill-scope-B73Ci61z.js → skill-scope-BkSXs9Lm.js} +1 -1
- package/dist/public/assets/{skills-api-BazLRy2N.js → skills-api-Cvk5ZT2-.js} +1 -1
- package/dist/public/assets/{src-C5n8TKJq.js → src-DlAxJG0V.js} +1 -1
- package/dist/public/assets/{startup-marks-c2tjYHWa.js → startup-marks-JBqTw7J_.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BQX-_Adc.js → tag-pill-input-D_fOpV0N.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BJZ9PSpW.js → target-navigation-intent-5WXmlPf2.js} +1 -1
- package/dist/public/assets/{telemetry-startup-BS9CaXrj.js → telemetry-startup-D5sYTu6V.js} +1 -1
- package/dist/public/assets/{terminal-command-events-BQFgUjko.js → terminal-command-events-LkibGwt_.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-Dmdb2rMF.js → terminal-launch-events-Dsvg1rhG.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-BA6DIKLO.js → terminal-telemetry-Bo0-Yp4s.js} +1 -1
- package/dist/public/assets/{thread-client-BS8GJcoK.js → thread-client-DvgdAVjP.js} +1 -1
- package/dist/public/assets/typing-burst-detector-DrY0SFdC.js +8 -0
- package/dist/public/assets/{uninstall-DXJMPkVq.js → uninstall-B58SWk1Q.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CngLVlKx.js → use-activity-panel-D1pvB6Wv.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-DgBG2Y3l.js → use-apply-config-language-CZtlTwIe.js} +1 -1
- package/dist/public/assets/{use-collab-url-4KL8XQXU.js → use-collab-url-DdeZ1MQX.js} +1 -1
- package/dist/public/assets/{use-conflicts-BNUZnjy-.js → use-conflicts-ZQRJMYhG.js} +1 -1
- package/dist/public/assets/{use-git-sync-status-BnU8yWA0.js → use-git-sync-status-OS-MtdFB.js} +1 -1
- package/dist/public/assets/{use-installed-clis-SziirqY4.js → use-installed-clis-2859cFNj.js} +2 -2
- package/dist/public/assets/{use-live-xterm-theme-CFX30um3.js → use-live-xterm-theme-X4_1Rmea.js} +1 -1
- package/dist/public/assets/{use-open-skill-B-WzAe13.js → use-open-skill-qv-IT5XV.js} +1 -1
- package/dist/public/assets/{use-settings-route-C4w2E5xi.js → use-settings-route--nlw92BG.js} +1 -1
- package/dist/public/assets/{use-skill-origin-C2zSJntJ.js → use-skill-origin-CIxELV6T.js} +1 -1
- package/dist/public/assets/{use-skills-BZixx2iF.js → use-skills--ee80y05.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Dd55GJPP.js → use-terminal-enabled-B7prYGJS.js} +1 -1
- package/dist/public/assets/use-timeline-entry-diff-BL5ro6fp.js +5 -0
- package/dist/public/assets/{use-workspace-CchUoI6W.js → use-workspace-C-p6QNEA.js} +1 -1
- package/dist/public/index.html +60 -60
- package/dist/public/uninstall.html +4 -4
- package/dist/{registry-probes-Dege_xbr.mjs → registry-probes-BSdh2-L9.mjs} +1 -1
- package/dist/{removal-file-path-CVCUJzdD.mjs → removal-file-path-BALteFlB.mjs} +1 -1
- package/dist/{repair-launch-json-B9YcmXBD.mjs → repair-launch-json-pGAuTlOK.mjs} +1 -1
- package/dist/{repair-mcp-configs-BM8NXaJm.mjs → repair-mcp-configs-ftbi6UC9.mjs} +1 -1
- package/dist/src-BHZQdiOx.mjs +1 -0
- package/dist/{src-B5SmbFF9.mjs → src-asn3WOqI.mjs} +1 -1
- package/dist/{start-CtAMwLgE.mjs → start-CbwQ9yxP.mjs} +3 -3
- package/dist/start-D7vARZEC.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-C6wMiGgw.mjs +0 -1
- package/dist/init-D6ZJF6PV.mjs +0 -1
- package/dist/loader-CNWGHRCV.mjs +0 -1
- package/dist/preview-Ch3iH9hA.mjs +0 -1
- package/dist/public/assets/AddPropertiesButton-B5wgFBcs.js +0 -2
- package/dist/public/assets/CodeMirrorPropInput-CjC1gT00.js +0 -3
- package/dist/public/assets/DocumentContext-Dlldf3A6.js +0 -39
- package/dist/public/assets/FeedbackForm-B2kRhtsR.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DCWlX1Qg.js +0 -1
- package/dist/public/assets/ThreadView-e6Emlmew.js +0 -21
- package/dist/public/assets/chunk-BO2N2NFS-CrYfkrUQ.js +0 -103
- package/dist/public/assets/config-provider-owr5M3NH.js +0 -4
- package/dist/public/assets/lib-CPkc7nK4.js +0 -29
- package/dist/public/assets/mermaid-GHXKKRXX-BZXWx43A.js +0 -1
- package/dist/public/assets/navigation-targets-35tMAsBB.js +0 -1
- package/dist/public/assets/typing-burst-detector-BEdXQddD.js +0 -8
- package/dist/public/assets/use-timeline-entry-diff-D9Fyk7np.js +0 -5
- package/dist/src-DsMWEyve.mjs +0 -1
- package/dist/start-sCxyzBNh.mjs +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./highlighted-body-OFNGDK62-B7E5UTmI.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{t as a}from"./react-dom-DPxgxlDT.js";import{n as o,t as s}from"./bundle-mjs-SHeFpKGC.js";import{$ as c,B as l,G as u,H as d,J as f,Q as p,U as m,V as h,W as g,at as _,d as v,et as y,i as b,n as x,nt as S,o as C,p as w,rt as T,t as ee,tt as E}from"./dist-Dv7C_sDf.js";import{c as D,d as te,f as ne,i as re,l as ie,n as ae,o as oe,t as se,u as O}from"./html-void-elements-zEl0KGqf.js";var k=e(i(),1),A={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function ce({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=A.indicator,imageBlockPolicy:c=A.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=he(e,t,n,r,i,a,o,s,c);fe(l),m(l,u)}}function j(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function le(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var ue=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),M=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function de(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=j(e,n);if(!o||M.has(o.protocol)||!(ue.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=le(e);return o&&t.some(e=>{let t=j(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function fe(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)fe(t)}}var N=Symbol(`node-seen`);function pe(e,t,n){return t===A.remove?{type:`remove`}:t===A.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function me(e,t,n){if(t===A.remove)return{type:`remove`};if(t===A.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var he=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[N])return!0;if(u.tagName===`a`){let n=de(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[N]=!0,m(u,l),f&&typeof d==`number`){let e=pe(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[g,d];f.children[d]=e.element}return g}else return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=de(u.properties.src,n,e,r,!0,i);if(t===null){if(u[N]=!0,m(u,l),f&&typeof d==`number`){let e=me(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[g,d];f.children[d]=e.element}return g}else return u.properties.src=t,!0}return!0};return l},ge={},_e={}.hasOwnProperty,ve=ae(`type`,{handlers:{root:be,element:Te,text:Ce,comment:we,doctype:Se}});function ye(e,t){let n=(t||ge).space;return ve(e,n===`svg`?O:ie)}function be(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=De(e.children,n,t),Oe(e,n),n}function xe(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=De(e.children,n,t),Oe(e,n),n}function Se(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return Oe(e,t),t}function Ce(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return Oe(e,t),t}function we(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return Oe(e,t),t}function Te(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=O);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&_e.call(e.properties,a)){let t=Ee(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:T[o],childNodes:[],parentNode:null};return s.childNodes=De(e.children,s,r),Oe(e,s),e.tagName===`template`&&e.content&&(s.content=xe(e.content,r)),s}function Ee(e,t,n){let r=te(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?D(n):oe(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=T[r.space]}return i}function De(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=ve(e[r],n);a.parentNode=t,i.push(a)}return i}function Oe(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var ke=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Ae=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),je={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Me(e,t){let n=Ke(e),r=ae(`type`,{handlers:{root:Pe,element:Fe,text:Ie,comment:ze,doctype:Le,raw:Be},unknown:Ve}),i={parser:n?new p(je):p.getFragmentParser(void 0,je),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),He(i,h());let a=S(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&m(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Ne(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Pe(e,t){Ne(e.children,t)}function Fe(e,t){We(e,t),Ne(e.children,t),Ge(e,t)}function Ie(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:E.CHARACTER,chars:e.value,location:qe(e)};He(t,h(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Le(e,t){let n={type:E.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:qe(e)};He(t,h(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Re(e,t){t.stitches=!0;let n=Je(e);`children`in e&&`children`in n&&(n.children=Me({type:`root`,children:e.children},t.options).children),ze({type:`comment`,value:{stitch:n}},t)}function ze(e,t){let n=e.value,r={type:E.COMMENT,data:n,location:qe(e)};He(t,h(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Be(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ue(t,h(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(ke,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function Ve(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Re(n,t);else{let e=``;throw Ae.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function He(e,t){Ue(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=c.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function Ue(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function We(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===c.PLAINTEXT)return;He(t,h(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:T.html;i===T.html&&n===`svg`&&(i=T.svg);let a=ye({...e,children:[]},{space:i===T.svg?`svg`:`html`}),o={type:E.START_TAG,tagName:n,tagID:y(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:qe(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ge(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&se.includes(n)||t.parser.tokenizer.state===c.PLAINTEXT)return;He(t,l(e));let r={type:E.END_TAG,tagName:n,tagID:y(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:qe(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===c.RCDATA||t.parser.tokenizer.state===c.RAWTEXT||t.parser.tokenizer.state===c.SCRIPT_DATA)&&(t.parser.tokenizer.state=c.DATA)}function Ke(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function qe(e){let t=h(e)||{line:void 0,column:void 0,offset:void 0},n=l(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Je(e){return`children`in e?f({...e,children:[]}):f(e)}function Ye(e){return function(t,n){return Me(t,{...e,file:n})}}var P=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],F={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...P,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...P],h2:[[`className`,`sr-only`]],img:[...P,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...P,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...P],table:[...P],ul:[...P,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},I={}.hasOwnProperty;function Xe(e,t){let n={type:`root`,children:[]},r=Ze({schema:t?{...F,...t}:F,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Ze(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Qe(e,n);case`doctype`:return $e(e,n);case`element`:return et(e,n);case`root`:return tt(e,n);case`text`:return nt(e,n);default:}}}function Qe(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return lt(r,t),r}}function $e(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return lt(e,t),e}}function et(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=rt(e,t.children),i=it(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&I.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return lt(o,t),o}function tt(e,t){let n={type:`root`,children:rt(e,t.children)};return lt(n,t),n}function nt(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return lt(n,t),n}function rt(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Ze(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function it(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&I.call(r,n)?r[n]:void 0,o=r&&I.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(I.call(s,l)){let t=s[l],n=at(e,ut(a,l),l,t);n??=at(e,ut(o,l),l,t),n!=null&&(c[l]=n)}if(i&&I.call(i,n)){let e=i[n];for(l in e)I.call(e,l)&&!I.call(c,l)&&(c[l]=e[l])}return c}function at(e,t,n,r){return t?Array.isArray(r)?ot(e,t,n,r):st(e,t,n,r):void 0}function ot(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=st(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function st(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&ct(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function ct(e,t,n){let r=e.schema.protocols&&I.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function lt(e,t){let n=d(t);t.data&&(e.data=f(t.data)),n&&(e.position=n)}function ut(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function dt(e){return function(t){return Xe(t,e)}}var ft=t(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
3
|
+
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function ee(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function E(){var e=[];w(e);for(var t;t=ee();)t!==!1&&(e.push(t),w(e));return e}return C(),E()}function _(e){return e?e.replace(l,p):p}t.exports=g})),pt=t((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(ft());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),mt=t((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))}})),ht=e(t(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(pt()),r=mt();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}))(),1),gt={}.hasOwnProperty,_t=new Map,vt=/[A-Z]/g,yt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),bt=new Set([`td`,`th`]),xt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function St(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=Nt(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=Mt(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`?O:ie,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ct(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ct(e,t,n){if(t.type===`element`)return wt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Tt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Dt(e,t,n);if(t.type===`mdxjsEsm`)return Et(e,t);if(t.type===`root`)return Ot(e,t,n);if(t.type===`text`)return kt(e,t)}function wt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=O,e.schema=i),e.ancestors.push(t);let a=zt(e,t.tagName,!1),o=Pt(e,t),s=It(e,t);return yt.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!re(e):!0})),At(e,o,a,t),jt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tt(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)}Bt(e,t.position)}function Et(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bt(e,t.position)}function Dt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=O,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:zt(e,t.name,!0),o=Ft(e,t),s=It(e,t);return At(e,o,a,t),jt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ot(e,t,n){let r={};return jt(r,It(e,t)),e.create(t,e.Fragment,r,n)}function kt(e,t){return t.value}function At(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Mt(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 Nt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=h(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 Pt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&>.call(t.properties,i)){let a=Lt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&bt.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 Ft(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 Bt(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 Bt(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function It(e,t){let n=[],r=-1,i=e.passKeys?new Map:_t;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=Ct(e,a,o);s!==void 0&&n.push(s)}return n}function Lt(e,t,n){let r=te(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?D(n):oe(n)),r.property===`style`){let t=typeof n==`object`?n:Rt(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Vt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ne[r.property]||r.property:r.attribute,n]}}function Rt(e,t){try{return(0,ht.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new _("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=xt+`#cannot-parse-style-attribute`,r}}function zt(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=b(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=b(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return gt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bt(e)}function Bt(e,t){let n=new _("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=xt+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Vt(e){let t={},n;for(n in e)gt.call(e,n)&&(t[Ht(n)]=e[n]);return t}function Ht(e){let t=e.replace(vt,Ut);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ut(e){return`-`+e.toLowerCase()}var Wt={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`]},L=r(),Gt=e(a(),1);function Kt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R=Kt();function qt(e){R=e}var z={exec:()=>null};function B(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(V.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Jt=(()=>{try{return!0}catch{return!1}})(),V={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Yt=/^(?:[ \t]*(?:\n|$))+/,Xt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$t=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,en=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,tn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nn=B(tn).replace(/bull/g,en).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),rn=B(tn).replace(/bull/g,en).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),an=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,on=/^[^\n]+/,sn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,cn=B(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,sn).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ln=B(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,en).getRegex(),un=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,dn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fn=B(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,dn).replace(`tag`,un).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pn=B(an).replace(`hr`,Qt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,un).getRegex(),mn={blockquote:B(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,pn).getRegex(),code:Xt,def:cn,fences:Zt,heading:$t,hr:Qt,html:fn,lheading:nn,list:ln,newline:Yt,paragraph:pn,table:z,text:on},hn=B(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Qt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,un).getRegex(),gn={...mn,lheading:rn,table:hn,paragraph:B(an).replace(`hr`,Qt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,hn).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,un).getRegex()},_n={...mn,html:B(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,dn).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:B(an).replace(`hr`,Qt).replace(`heading`,` *#{1,6} *[^
|
|
4
|
+
]`).replace(`lheading`,nn).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},vn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bn=/^( {2,}|\\)\n(?!\s*$)/,xn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,H=/[\p{P}\p{S}]/u,Sn=/[\s\p{P}\p{S}]/u,Cn=/[^\s\p{P}\p{S}]/u,wn=B(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Sn).getRegex(),Tn=/(?!~)[\p{P}\p{S}]/u,En=/(?!~)[\s\p{P}\p{S}]/u,Dn=/(?:[^\s\p{P}\p{S}]|~)/u,On=B(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Jt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),kn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,An=B(kn,`u`).replace(/punct/g,H).getRegex(),jn=B(kn,`u`).replace(/punct/g,Tn).getRegex(),Mn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Nn=B(Mn,`gu`).replace(/notPunctSpace/g,Cn).replace(/punctSpace/g,Sn).replace(/punct/g,H).getRegex(),Pn=B(Mn,`gu`).replace(/notPunctSpace/g,Dn).replace(/punctSpace/g,En).replace(/punct/g,Tn).getRegex(),Fn=B(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Cn).replace(/punctSpace/g,Sn).replace(/punct/g,H).getRegex(),In=B(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,H).getRegex(),Ln=B(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Cn).replace(/punctSpace/g,Sn).replace(/punct/g,H).getRegex(),Rn=B(/\\(punct)/,`gu`).replace(/punct/g,H).getRegex(),zn=B(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Bn=B(dn).replace(`(?:-->|$)`,`-->`).getRegex(),Vn=B(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Bn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Un=B(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Hn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Wn=B(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Hn).replace(`ref`,sn).getRegex(),Gn=B(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,sn).getRegex(),Kn=B(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Wn).replace(`nolink`,Gn).getRegex(),qn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Jn={_backpedal:z,anyPunctuation:Rn,autolink:zn,blockSkip:On,br:bn,code:yn,del:z,delLDelim:z,delRDelim:z,emStrongLDelim:An,emStrongRDelimAst:Nn,emStrongRDelimUnd:Fn,escape:vn,link:Un,nolink:Gn,punctuation:wn,reflink:Wn,reflinkSearch:Kn,tag:Vn,text:xn,url:z},Yn={...Jn,link:B(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Hn).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Hn).getRegex()},Xn={...Jn,emStrongRDelimAst:Pn,emStrongLDelim:jn,delLDelim:In,delRDelim:Ln,url:B(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,qn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:B(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,qn).getRegex()},Zn={...Xn,br:B(bn).replace(`{2,}`,`*`).getRegex(),text:B(Xn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Qn={normal:mn,gfm:gn,pedantic:_n},$n={normal:Jn,gfm:Xn,breaks:Zn,pedantic:Yn},er={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},tr=e=>er[e];function U(e,t){if(t){if(V.escapeTest.test(e))return e.replace(V.escapeReplace,tr)}else if(V.escapeTestNoEncode.test(e))return e.replace(V.escapeReplaceNoEncode,tr);return e}function nr(e){try{e=encodeURI(e).replace(V.percentDecode,`%`)}catch{return null}return e}function rr(e,t){let n=e.replace(V.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(V.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(V.slashPipe,`|`);return n}function ir(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ar(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function or(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function sr(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function cr(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
5
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
6
|
+
`)}var lr=class{options;rules;lexer;constructor(e){this.options=e||R}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:ir(e,`
|
|
7
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=cr(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ir(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ir(t[0],`
|
|
8
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ir(t[0],`
|
|
9
|
+
`).split(`
|
|
10
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
11
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
12
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
13
|
+
${s}`:s,r=r?`${r}
|
|
14
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
15
|
+
`+e.join(`
|
|
16
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
17
|
+
`+e.join(`
|
|
18
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
19
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=or(t[2].split(`
|
|
20
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
21
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
22
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
23
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
24
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
25
|
+
`+l}u=!l.trim(),r+=p+`
|
|
26
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=rr(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
27
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(rr(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
28
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=ir(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ar(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),sr(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return sr(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},W=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R,this.options.tokenizer=this.options.tokenizer||new lr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:V,block:Qn.normal,inline:$n.normal};this.options.pedantic?(t.block=Qn.pedantic,t.inline=$n.pedantic):this.options.gfm&&(t.block=Qn.gfm,this.options.breaks?t.inline=$n.breaks:t.inline=$n.gfm),this.tokenizer.rules=t}static get rules(){return{block:Qn,inline:$n}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(V.carriageReturn,`
|
|
29
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(V.tabCharGlobal,` `).replace(V.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
30
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
31
|
+
`)?``:`
|
|
32
|
+
`)+r.raw,n.text+=`
|
|
33
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
34
|
+
`)?``:`
|
|
35
|
+
`)+r.raw,n.text+=`
|
|
36
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
37
|
+
`)?``:`
|
|
38
|
+
`)+r.raw,a.text+=`
|
|
39
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
40
|
+
`)?``:`
|
|
41
|
+
`)+r.raw,n.text+=`
|
|
42
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},ur=class{options;parser;constructor(e){this.options=e||R}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(V.notSpaceStart)?.[0],i=e.replace(V.endingNewline,``)+`
|
|
43
|
+
`;return r?`<pre><code class="language-`+U(r)+`">`+(n?i:U(i,!0))+`</code></pre>
|
|
44
|
+
`:`<pre><code>`+(n?i:U(i,!0))+`</code></pre>
|
|
45
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
46
|
+
${this.parser.parse(e)}</blockquote>
|
|
47
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
48
|
+
`}hr(e){return`<hr>
|
|
49
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
50
|
+
`+r+`</`+i+`>
|
|
51
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
52
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
53
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
54
|
+
<thead>
|
|
55
|
+
`+t+`</thead>
|
|
56
|
+
`+r+`</table>
|
|
57
|
+
`}tablerow({text:e}){return`<tr>
|
|
58
|
+
${e}</tr>
|
|
59
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
60
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${U(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=nr(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+U(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=nr(e);if(i===null)return U(n);e=i;let a=`<img src="${e}" alt="${U(n)}"`;return t&&(a+=` title="${U(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:U(e.text)}},dr=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},G=class e{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new ur,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dr}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},fr=class{options;block;constructor(e){this.options=e||R}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?W.lex:W.lexInline}provideParser(e=this.block){return e?G.parse:G.parseInline}},K=new class{defaults=Kt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=G;Renderer=ur;TextRenderer=dr;Lexer=W;Tokenizer=lr;Hooks=fr;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ur(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new lr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new fr;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];fr.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&fr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return W.lex(e,t??this.defaults)}parser(e,t){return G.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?W.lex:W.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?G.parse:G.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?W.lex:W.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?G.parse:G.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
61
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+U(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function q(e,t){return K.parse(e,t)}q.options=q.setOptions=function(e){return K.setOptions(e),q.defaults=K.defaults,qt(q.defaults),q},q.getDefaults=Kt,q.defaults=R,q.use=function(...e){return K.use(...e),q.defaults=K.defaults,qt(q.defaults),q},q.walkTokens=function(e,t){return K.walkTokens(e,t)},q.parseInline=K.parseInline,q.Parser=G,q.parser=G.parse,q.Renderer=ur,q.TextRenderer=dr,q.Lexer=W,q.lexer=W.lex,q.Tokenizer=lr,q.Hooks=fr,q.parse=q,q.options,q.setOptions,q.use,q.walkTokens,q.parseInline,G.parse,W.lex;var pr=300,mr=`300px`,hr=500;function gr(e={}){let{immediate:t=!1,debounceDelay:n=pr,rootMargin:r=mr,idleTimeout:i=hr}=e,[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(null),u=(0,k.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,k.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,k.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,k.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var _r=/\s/,vr=/^\s+$/,yr=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),br=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,xr=e=>e.some(e=>br(e)&&yr.has(e.tagName)),Sr=e=>{let t=[],n=``,r=!1;for(let i of e){let e=_r.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},Cr=e=>{let t=[],n=``;for(let r of e)_r.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},wr=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${a}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},Tr=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&`children`in a))return;if(xr(t))return g;let o=a,s=o.children.indexOf(e);if(s===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let l=n.sep===`char`?Cr(c):Sr(c),u=r.prevContentLength,d=l.map(e=>{let t=i.count;if(i.count+=e.length,vr.test(e))return{type:`text`,value:e};let r=u>0&&t<u,a=r?0:i.newIndex++*n.stagger;return wr(e,n.animation,n.duration,n.easing,r,a)});return o.children.splice(s,1,...d),s+d.length},Er=0;function Dr(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40},n={prevContentLength:0,lastRenderCharCount:0},r=Er++,i=()=>e=>{let r={count:0,newIndex:0};u(e,`text`,(e,i)=>Tr(e,i,t,n,r)),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,`name`,{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.prevContentLength=e},getLastRenderCharCount(){let e=n.lastRenderCharCount;return n.lastRenderCharCount=0,e}}}Dr();var Or=(0,k.createContext)(!1),kr=()=>(0,k.useContext)(Or),Ar=(...e)=>s(o(e)),jr=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Mr=e=>e?(...t)=>jr(e,s(o(t))):Ar,J=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Nr=(0,k.createContext)(Ar),Y=()=>(0,k.useContext)(Nr),Pr=Ar(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),Fr=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},Ir=(0,k.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...o})=>{let s=Y(),c=(0,k.useMemo)(()=>s(Pr),[s]),l=(0,k.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,Fr(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,L.jsx)(`div`,{className:s(r,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,...o,children:(0,L.jsx)(`pre`,{className:s(r,`bg-[var(--sdm-bg,inherit]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]`),style:l,children:(0,L.jsx)(`code`,{className:a?s(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((e,t)=>(0,L.jsx)(`span`,{className:a?c:void 0,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
62
|
+
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,L.jsx)(`span`,{className:s(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Lr=({className:e,language:t,style:n,isIncomplete:r,...i})=>(0,L.jsx)(`div`,{className:Y()(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i}),Rr=(0,k.createContext)({code:``}),zr=()=>(0,k.useContext)(Rr),Br=({language:e})=>{let t=Y();return(0,L.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,L.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},Vr=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
63
|
+
`;)t--;return e.slice(0,t)},Hr=(0,k.lazy)(()=>n(()=>import(`./highlighted-body-OFNGDK62-B7E5UTmI.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1,2,3]),import.meta.url)),Ur=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=Y(),l=(0,k.useMemo)(()=>Vr(e),[e]),u=(0,k.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
|
|
64
|
+
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[l]);return(0,L.jsx)(Rr.Provider,{value:{code:e},children:(0,L.jsxs)(Lr,{isIncomplete:i,language:t,children:[(0,L.jsx)(Br,{language:t}),r?(0,L.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,L.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,L.jsx)(k.Suspense,{fallback:(0,L.jsx)(Ir,{className:n,language:t,lineNumbers:o,result:u,startLine:a,...s}),children:(0,L.jsx)(Hr,{className:n,code:l,language:t,lineNumbers:o,raw:u,startLine:a,...s})})]})})},Wr={CheckIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,L.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,L.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,L.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,L.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},Gr=(0,k.createContext)(Wr),Kr=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1},qr=({icons:e,children:t})=>{let n=(0,k.useRef)(e),r=(0,k.useRef)(e?{...Wr,...e}:Wr);Kr(n.current,e)||(n.current=e,r.current=e?{...Wr,...e}:Wr);let i=r.current;return(0,L.jsx)(Gr.Provider,{value:i,children:t})},X=()=>(0,k.useContext)(Gr),Jr={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},Yr=(0,k.createContext)(Jr),Z=()=>(0,k.useContext)(Yr),Xr=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=Y(),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(0),{code:d}=zr(),{isAnimating:f}=(0,k.useContext)($),p=Z(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,k.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=X(),_=c?g.CheckIcon:g.CopyIcon;return(0,L.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,L.jsx)(_,{size:14})})},Zr={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},Qr=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=Y(),{code:c}=zr(),{isAnimating:l}=(0,k.useContext)($),u=Z(),d=X(),f=a??c,p=`file.${n&&n in Zr?Zr[n]:`txt`}`;return(0,L.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{J(p,f,`text/plain`),e?.()}catch(e){t?.(e)}},title:u.downloadFile,type:`button`,...o,children:r??(0,L.jsx)(d.DownloadIcon,{size:14})})},$r=()=>{let{Loader2Icon:e}=X(),t=Y();return(0,L.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,L.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,L.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,L.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},ei=/\.[^/.]+$/,ti=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...o})=>{let{DownloadIcon:s}=X(),c=Y(),l=(0,k.useRef)(null),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(!1),m=Z(),h=o.width!=null||o.height!=null,g=(u||h)&&!f,_=f&&!h;(0,k.useEffect)(()=>{let e=l.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;d(t),p(!t)}},[]);let v=(0,k.useCallback)(e=>{d(!0),p(!1),i?.(e)},[i]),y=(0,k.useCallback)(e=>{d(!1),p(!0),a?.(e)},[a]),b=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(ei,``)}.${i}`}J(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,L.jsxs)(`div`,{className:c(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,L.jsx)(`img`,{alt:r,className:c(`max-w-full rounded-lg`,_&&`hidden`,t),"data-streamdown":`image`,onError:y,onLoad:v,ref:l,src:n,...o}),_&&(0,L.jsx)(`span`,{className:c(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:m.imageNotAvailable}),(0,L.jsx)(`div`,{className:c(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`)}),g&&(0,L.jsx)(`button`,{className:c(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:b,title:m.downloadImage,type:`button`,children:(0,L.jsx)(s,{size:14})})]}):null},ni=0,ri=()=>{ni+=1,ni===1&&(document.body.style.overflow=`hidden`)},ii=()=>{ni=Math.max(0,ni-1),ni===0&&(document.body.style.overflow=``)},ai=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=X(),c=Y(),[l,u]=(0,k.useState)(!1),d=Z(),f=(0,k.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,k.useCallback)(()=>{r(),n()},[r,n]);return(0,k.useEffect)(()=>{if(t){ri();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),ii()}}},[t,n]),t?(0,L.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,L.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,L.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,L.jsx)(s,{size:16})}),(0,L.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,L.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,L.jsx)(o,{size:20}),(0,L.jsx)(`span`,{children:d.openExternalLink})]}),(0,L.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,L.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,L.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,L.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(i,{size:14}),(0,L.jsx)(`span`,{children:d.copied})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(a,{size:14}),(0,L.jsx)(`span`,{children:d.copyLink})]})}),(0,L.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,L.jsx)(o,{size:14}),(0,L.jsx)(`span`,{children:d.openLink})]})]})]})}):null},oi=(0,k.createContext)(null),si=()=>(0,k.useContext)(oi),ci=()=>si()?.code??null,li=()=>si()?.mermaid??null,ui=e=>{var t;let n=si();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},di=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),fi=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=Y(),[s,c]=(0,k.useState)(!1),l=(0,k.useRef)(null),{isAnimating:u}=(0,k.useContext)($),d=X(),f=li(),p=Z(),m=async t=>{try{if(t===`mmd`){J(`diagram.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!f){a?.(Error(`Mermaid plugin not available`));return}let n=f.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){J(`diagram.svg`,l,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){J(`diagram.png`,await di(l),`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,L.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,L.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:p.downloadDiagram,type:`button`,children:t??(0,L.jsx)(d.DownloadIcon,{size:14})}),s?(0,L.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,L.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`svg`),title:p.downloadDiagramAsSvg,type:`button`,children:p.mermaidFormatSvg}),(0,L.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`png`),title:p.downloadDiagramAsPng,type:`button`,children:p.mermaidFormatPng}),(0,L.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`mmd`),title:p.downloadDiagramAsMmd,type:`button`,children:p.mermaidFormatMmd})]}):null]})},pi=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=X(),c=Y(),[l,u]=(0,k.useState)(!1),{isAnimating:d,controls:f}=(0,k.useContext)($),p=Z(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),h=()=>{u(!l)};return(0,k.useEffect)(()=>{if(l){ri();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),ii()}}},[l]),(0,k.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:h,title:p.viewFullscreen,type:`button`,...a,children:(0,L.jsx)(o,{size:14})}),l?(0,Gt.createPortal)((0,L.jsxs)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),onClick:h,onKeyDown:e=>{e.key===`Escape`&&h()},role:`button`,tabIndex:0,children:[(0,L.jsx)(`button`,{className:c(`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:h,title:p.exitFullscreen,type:`button`,children:(0,L.jsx)(s,{size:20})}),(0,L.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,L.jsx)(io,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},mi=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},hi=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===`
|
|
65
|
+
`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
|
|
66
|
+
`)},gi=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
67
|
+
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
68
|
+
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
69
|
+
`)},_i=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},vi=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>_i(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?_i(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>_i(e)).join(` | `)} |`,i+=1;return r.join(`
|
|
70
|
+
`)},yi=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Y(),[o,s]=(0,k.useState)(!1),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(null),d=(0,k.useRef)(0),{isAnimating:f}=(0,k.useContext)($),p=Z(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=mi(t),o=({csv:hi,tsv:gi,md:vi}[e]||vi)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=X(),g=c?h.CheckIcon:h.CopyIcon;return(0,L.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,L.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,L.jsx)(g,{height:14,width:14})}),o?(0,L.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,L.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,L.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,L.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},bi=({children:e,className:t,onDownload:n,onError:r})=>{let i=Y(),[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),{isAnimating:c}=(0,k.useContext)($),l=Z(),u=X(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=mi(t),a=e===`csv`?hi(i):vi(i);J(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,L.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,L.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,L.jsx)(u.DownloadIcon,{size:14})}),a?(0,L.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,L.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,L.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},xi=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=X(),o=Y(),[s,c]=(0,k.useState)(!1),{isAnimating:l}=(0,k.useContext)($),u=Z(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,k.useEffect)(()=>{if(s){ri();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),ii()}}},[s]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,L.jsx)(i,{size:14})}),s?(0,Gt.createPortal)((0,L.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,L.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,L.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,L.jsx)(yi,{}):null,r?(0,L.jsx)(bi,{}):null,(0,L.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,L.jsx)(a,{size:20})})]}),(0,L.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,L.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},Si=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=Y(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,L.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,L.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,L.jsx)(yi,{}):null,l?(0,L.jsx)(bi,{}):null,u?(0,L.jsx)(xi,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,L.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,L.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},Ci=/startLine=(\d+)/,wi=/\bnoLineNumbers\b/,Ti=(0,k.lazy)(()=>n(()=>import(`./mermaid-GHXKKRXX-DuRPZW34.js`).then(e=>({default:e.Mermaid})),[],import.meta.url)),Ei=/language-([^\s]+)/;function Di(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function Q(e,t){return e.className===t.className&&Di(e.node,t.node)}var Oi=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,ki=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Ai=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},ji=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Mi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`ol`,{className:Y()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>Q(e,t));Mi.displayName=`MarkdownOl`;var Ni=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`li`,{className:Y()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&Di(e.node,t.node));Ni.displayName=`MarkdownLi`;var Pi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`ul`,{className:Y()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>Q(e,t));Pi.displayName=`MarkdownUl`;var Fi=(0,k.memo)(({className:e,node:t,...n})=>(0,L.jsx)(`hr`,{className:Y()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>Q(e,t));Fi.displayName=`MarkdownHr`;var Ii=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`span`,{className:Y()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>Q(e,t));Ii.displayName=`MarkdownStrong`;var Li=(0,k.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Y(),{linkSafety:o}=(0,k.useContext)($),[s,c]=(0,k.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,k.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,k.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,k.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,L.jsx)(ai,{...p})]}):(0,L.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>Q(e,t)&&e.href===t.href);Li.displayName=`MarkdownA`;var Ri=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`h1`,{className:Y()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>Q(e,t));Ri.displayName=`MarkdownH1`;var zi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`h2`,{className:Y()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>Q(e,t));zi.displayName=`MarkdownH2`;var Bi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`h3`,{className:Y()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>Q(e,t));Bi.displayName=`MarkdownH3`;var Vi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`h4`,{className:Y()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>Q(e,t));Vi.displayName=`MarkdownH4`;var Hi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`h5`,{className:Y()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>Q(e,t));Hi.displayName=`MarkdownH5`;var Ui=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`h6`,{className:Y()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>Q(e,t));Ui.displayName=`MarkdownH6`;var Wi=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,k.useContext)($);return(0,L.jsx)(Si,{className:t,showControls:Oi(i,`table`),showCopy:ki(i,`copy`),showDownload:ki(i,`download`),showFullscreen:ki(i,`fullscreen`),...r,children:e})},(e,t)=>Q(e,t));Wi.displayName=`MarkdownTable`;var Gi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`thead`,{className:Y()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>Q(e,t));Gi.displayName=`MarkdownThead`;var Ki=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`tbody`,{className:Y()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>Q(e,t));Ki.displayName=`MarkdownTbody`;var qi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`tr`,{className:Y()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>Q(e,t));qi.displayName=`MarkdownTr`;var Ji=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`th`,{className:Y()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>Q(e,t));Ji.displayName=`MarkdownTh`;var Yi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`td`,{className:Y()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>Q(e,t));Yi.displayName=`MarkdownTd`;var Xi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`blockquote`,{className:Y()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>Q(e,t));Xi.displayName=`MarkdownBlockquote`;var Zi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`sup`,{className:Y()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>Q(e,t));Zi.displayName=`MarkdownSup`;var Qi=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,L.jsx)(`sub`,{className:Y()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>Q(e,t));Qi.displayName=`MarkdownSub`;var $i=(0,k.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,k.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,k.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,k.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,k.isValidElement)(e))return e;if(e.type===Mi){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,L.jsx)(`section`,{className:t,...r,children:i}):null}return(0,L.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>Q(e,t));$i.displayName=`MarkdownSection`;var ea=(0,k.memo)(({node:e,className:t,children:n,...r})=>{let i=Y(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,k.useContext)($),l=li(),u=kr(),d=(t?.match(Ei))?.at(1)??``,f=ui(d);if(a)return(0,L.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(Ci),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&wi.test(p))&&c!==!1,v=``;if((0,k.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,L.jsx)(k.Suspense,{fallback:(0,L.jsx)($r,{}),children:(0,L.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=Oi(s,`mermaid`),n=ji(s,`download`),r=ji(s,`copy`),a=ji(s,`fullscreen`),c=ji(s,`panZoom`),l=e&&(n||r||a);return(0,L.jsx)(k.Suspense,{fallback:(0,L.jsx)($r,{}),children:(0,L.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,L.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,L.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,L.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,L.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,L.jsx)(fi,{chart:v,config:o?.config}):null,r?(0,L.jsx)(Xr,{code:v}):null,a?(0,L.jsx)(pi,{chart:v,config:o?.config}):null]})}):null,(0,L.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,L.jsx)(Ti,{chart:v,config:o?.config,showControls:c})})]})})}let y=Oi(s,`code`),b=Ai(s,`download`),x=Ai(s,`copy`);return(0,L.jsx)(Ur,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,L.jsxs)(L.Fragment,{children:[b?(0,L.jsx)(Qr,{code:v,language:d}):null,x?(0,L.jsx)(Xr,{}):null]}):null})},(e,t)=>e.className===t.className&&Di(e.node,t.node));ea.displayName=`MarkdownCode`;var ta=(0,k.memo)(ti,(e,t)=>e.className===t.className&&Di(e.node,t.node));ta.displayName=`MarkdownImg`;var na=(0,k.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,k.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,L.jsx)(L.Fragment,{children:e})}return(0,L.jsx)(`p`,{...n,children:e})},(e,t)=>Q(e,t));na.displayName=`MarkdownParagraph`;var ra={ol:Mi,li:Ni,ul:Pi,hr:Fi,strong:Ii,a:Li,h1:Ri,h2:zi,h3:Bi,h4:Vi,h5:Hi,h6:Ui,table:Wi,thead:Gi,tbody:Ki,tr:qi,th:Ji,td:Yi,blockquote:Xi,code:ea,img:ta,pre:({children:e})=>(0,k.isValidElement)(e)?(0,k.cloneElement)(e,{"data-block":`true`}):e,sup:Zi,sub:Qi,p:na,section:$i},ia=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,aa=/\p{L}/u;function oa(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(ia.test(e))return`rtl`;if(aa.test(e))return`ltr`}return`ltr`}var sa=/^[ \t]{0,3}(`{3,}|~{3,})/,ca=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,la=e=>{let t=e.split(`
|
|
71
|
+
`),n=null,r=0;for(let e of t){let t=sa.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},ua=e=>{let t=e.split(`
|
|
72
|
+
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&ca.test(t))return!0}return!1},da=()=>e=>{m(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},fa=[],pa={allowDangerousHtml:!0},ma=new WeakMap,ha=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=ma.get(e);n||(n=e.name,ma.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=ma.get(r);e||(e=r.name,ma.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},ga=e=>{let t=_a(e),n=e.children||``;return wa(t.runSync(t.parse(n),n),e)},_a=e=>{let t=ha.get(e);if(t)return t;let n=ya(e);return ha.set(e,n),n},va=e=>e.some(e=>Array.isArray(e)?e[0]===Ye:e===Ye),ya=e=>{let t=e.rehypePlugins||fa,n=e.remarkPlugins||fa,r=va(t)?n:[...n,da],i=e.remarkRehypeOptions?{...pa,...e.remarkRehypeOptions}:pa;return v().use(C).use(r).use(x,i).use(t)},ba=e=>e,xa=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},Sa=(e,t)=>{for(let n in Wt)if(Object.hasOwn(Wt,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=Wt[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},Ca=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},wa=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||ba;m(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return xa(c,s,a,e.value),s;if(e.type===`element`&&(Sa(e,t),Ca(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return St(e,{Fragment:L.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:L.jsx,jsxs:L.jsxs,passKeys:!0,passNode:!0})},Ta=/\[\^[\w-]{1,200}\](?!:)/,Ea=/\[\^[\w-]{1,200}\]:/,Da=/<(\w+)[\s>]/,Oa=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),ka=new Map,Aa=new Map,ja=e=>{let t=e.toLowerCase(),n=ka.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return ka.set(t,r),r},Ma=e=>{let t=e.toLowerCase(),n=Aa.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return Aa.set(t,r),r},Na=(e,t)=>{if(Oa.has(t.toLowerCase()))return 0;let n=e.match(ja(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},Pa=(e,t)=>{let n=e.match(Ma(t));return n?n.length:0},Fa=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},Ia=e=>{let t=Ta.test(e),n=Ea.test(e);if(t||n)return[e];let r=W.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=Na(t,e),o=Pa(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(Da);if(e){let n=e[1];Na(t,n)>Pa(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(Fa(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},La=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>{if(!n.includes(`
|
|
73
|
+
|
|
74
|
+
`))return t+n+r;let i=n.replace(/\n\n/g,`
|
|
75
|
+
<!---->
|
|
76
|
+
`);return`${t}${(i.startsWith(`
|
|
77
|
+
`)?``:`
|
|
78
|
+
`)+i+(i.endsWith(`
|
|
79
|
+
`)?``:`
|
|
80
|
+
`)}${r}
|
|
81
|
+
|
|
82
|
+
`})}return n},Ra=/([\\`*_~[\]|])/g,za=e=>e.replace(Ra,`\\$1`),Ba=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+za(n).replace(/\n\n/g,` `)+r)}return n},Va=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(Va).join(``):``,Ha=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));m(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=Va(e);e.children=t?[{type:`text`,value:t}]:[]}})},Ua=()=>e=>{m(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},Wa=/^[ \t]*<[\w!/?-]/,Ga=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,Ka=e=>typeof e!=`string`||e.length===0||!Wa.test(e)?e:e.replace(Ga,`$1`),qa={...F,protocols:{...F.protocols,href:[...F.protocols?.href??[],`tel`]},attributes:{...F.attributes,code:[...F.attributes?.code??[],`metastring`]}},Ja={raw:Ye,sanitize:[dt,qa],harden:[ce,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},Ya={gfm:[w,{}],codeMeta:Ua},Xa=Object.values(Ja),Za=Object.values(Ya),Qa={block:` ▋`,circle:` ●`},$a=[`github-light`,`github-dark`],eo={enabled:!0},$=(0,k.createContext)({shikiTheme:$a,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:eo}),to=(0,k.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{if(o){let e=o.getLastRenderCharCount();o.setPrevContentLength(e)}let c=typeof e==`string`&&n?Ka(e):e,l=(0,L.jsx)(ga,{...s,children:c});return(0,L.jsx)(Or.Provider,{value:i,children:a?(0,L.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});to.displayName=`Block`;var no=(0,k.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=Xa,remarkPlugins:s=Za,className:c,shikiTheme:l=$a,mermaid:u,controls:d=!0,isAnimating:f=!1,animated:p,BlockComponent:m=to,parseMarkdownIntoBlocksFn:h=Ia,caret:g,plugins:_,remend:v,linkSafety:y=eo,lineNumbers:b=!0,allowedTags:x,literalTagContent:S,translations:C,icons:w,prefix:T,onAnimationStart:E,onAnimationEnd:D,...te})=>{let ne=(0,k.useId)(),[re,ie]=(0,k.useTransition)(),ae=(0,k.useMemo)(()=>Mr(T),[T]),oe=(0,k.useRef)(null),se=(0,k.useRef)(E),O=(0,k.useRef)(D);se.current=E,O.current=D,(0,k.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=oe.current;if(oe.current=f,i===null){f&&((e=se.current)==null||e.call(se));return}f&&!i?(n=se.current)==null||n.call(se):!f&&i&&((r=O.current)==null||r.call(O))},[f,t]);let A=(0,k.useMemo)(()=>x?Object.keys(x):[],[x]),ce=(0,k.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?ee(e,v):e;return S&&S.length>0&&(n=Ba(n,S)),A.length>0&&(n=La(n,A)),n},[e,t,r,v,A,S]),j=(0,k.useMemo)(()=>h(ce),[ce,h]),[le,ue]=(0,k.useState)(j);(0,k.useEffect)(()=>{t===`streaming`&&!pe?ie(()=>{ue(j)}):ue(j)},[j,t]);let M=t===`streaming`?le:j,de=(0,k.useMemo)(()=>n===`auto`?M.map(oa):void 0,[M,n]),fe=(0,k.useMemo)(()=>M.map((e,t)=>`${ne}-${t}`),[M.length,ne]),N=(0,k.useMemo)(()=>p===!0?`true`:p?JSON.stringify(p):``,[p]),pe=(0,k.useMemo)(()=>N?N===`true`?Dr():Dr(p):null,[N]),me=(0,k.useMemo)(()=>({shikiTheme:(_?.code)?.getThemes()??l,controls:d,isAnimating:f,lineNumbers:b,mode:t,mermaid:u,linkSafety:y}),[l,d,f,b,t,u,y,_?.code]),he=(0,k.useMemo)(()=>({...Jr,...C}),[(0,k.useMemo)(()=>C?JSON.stringify(C):``,[C])]),ge=(0,k.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...ra,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,k.createElement)(t,n):null:(0,k.createElement)(e,n)}return n},[a]),_e=(0,k.useMemo)(()=>{let e=[];return _!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsBefore]),e=[...e,...s],_!=null&&_.cjk&&(e=[...e,..._.cjk.remarkPluginsAfter]),_!=null&&_.math&&(e=[...e,_.math.remarkPlugin]),e},[s,_?.math,_?.cjk]),ve=(0,k.useMemo)(()=>{let e=o;if(x&&Object.keys(x).length>0&&o===Xa){let t={...qa,tagNames:[...qa.tagNames??[],...Object.keys(x)],attributes:{...qa.attributes,...x}};e=[Ja.raw,[dt,t],Ja.harden]}return S&&S.length>0&&(e=[...e,[Ha,S]]),_!=null&&_.math&&(e=[...e,_.math.rehypePlugin]),pe&&f&&(e=[...e,pe.rehypePlugin]),e},[o,_?.math,pe,f,x,S]),ye=(0,k.useMemo)(()=>{if(!f||M.length===0)return!1;let e=M.at(-1);return la(e)||ua(e)},[f,M]),be=(0,k.useMemo)(()=>g&&f&&!ye?{"--streamdown-caret":`"${Qa[g]}"`}:void 0,[g,f,ye]);return t===`static`?(0,L.jsx)(Yr.Provider,{value:he,children:(0,L.jsx)(oi.Provider,{value:_??null,children:(0,L.jsx)($.Provider,{value:me,children:(0,L.jsx)(qr,{icons:w,children:(0,L.jsx)(Nr.Provider,{value:ae,children:(0,L.jsx)(`div`,{className:ae(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?oa(ce):n,children:(0,L.jsx)(ga,{components:ge,rehypePlugins:ve,remarkPlugins:_e,...te,children:ce})})})})})})}):(0,L.jsx)(Yr.Provider,{value:he,children:(0,L.jsx)(oi.Provider,{value:_??null,children:(0,L.jsx)($.Provider,{value:me,children:(0,L.jsx)(qr,{icons:w,children:(0,L.jsx)(Nr.Provider,{value:ae,children:(0,L.jsxs)(`div`,{className:ae(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,g&&!ye?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:be,children:[M.length===0&&g&&f&&(0,L.jsx)(`span`,{}),M.map((e,t)=>{let a=t===M.length-1,o=f&&a&&la(e);return(0,L.jsx)(m,{animatePlugin:pe,components:ge,content:e,dir:de?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:ve,remarkPlugins:_e,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...te},fe[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);no.displayName=`Streamdown`;var ro=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=X(),d=Y(),f=(0,k.useRef)(null),p=(0,k.useRef)(null),[m,h]=(0,k.useState)(o),[g,_]=(0,k.useState)({x:0,y:0}),[v,y]=(0,k.useState)(!1),[b,x]=(0,k.useState)({x:0,y:0}),[S,C]=(0,k.useState)({x:0,y:0}),w=(0,k.useCallback)(e=>{h(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),T=(0,k.useCallback)(()=>{w(i)},[w,i]),ee=(0,k.useCallback)(()=>{w(-i)},[w,i]),E=(0,k.useCallback)(()=>{h(o),_({x:0,y:0})},[o]),D=(0,k.useCallback)(e=>{e.preventDefault(),w(e.deltaY>0?-i:i)},[w,i]),te=(0,k.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;y(!0),x({x:e.clientX,y:e.clientY}),C(g);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[g]),ne=(0,k.useCallback)(e=>{if(!v)return;e.preventDefault();let t=e.clientX-b.x,n=e.clientY-b.y;_({x:S.x+t,y:S.y+n})},[v,b,S]),re=(0,k.useCallback)(e=>{y(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,k.useEffect)(()=>{let e=f.current;if(e)return e.addEventListener(`wheel`,D,{passive:!1}),()=>{e.removeEventListener(`wheel`,D)}},[D]),(0,k.useEffect)(()=>{let e=p.current;if(e&&v)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,ne,{passive:!1}),e.addEventListener(`pointerup`,re),e.addEventListener(`pointercancel`,re),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,ne),e.removeEventListener(`pointerup`,re),e.removeEventListener(`pointercancel`,re)}},[v,ne,re]),(0,L.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:f,style:{cursor:v?`grabbing`:`grab`},children:[a?(0,L.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,L.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m>=r,onClick:T,title:`Zoom in`,type:`button`,children:(0,L.jsx)(l,{size:16})}),(0,L.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:m<=n,onClick:ee,title:`Zoom out`,type:`button`,children:(0,L.jsx)(u,{size:16})}),(0,L.jsx)(`button`,{className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:E,title:`Reset zoom and pan`,type:`button`,children:(0,L.jsx)(c,{size:16})})]}):null,(0,L.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:te,ref:p,role:`application`,style:{transform:`translate(${g.x}px, ${g.y}px) scale(${m})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},io=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=Y(),[o,s]=(0,k.useState)(null),[c,l]=(0,k.useState)(!1),[u,d]=(0,k.useState)(``),[f,p]=(0,k.useState)(``),[m,h]=(0,k.useState)(0),{mermaid:g}=(0,k.useContext)($),_=li(),v=g?.errorComponent,{shouldRender:y,containerRef:b}=gr({immediate:r});if((0,k.useEffect)(()=>{if(y){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){f||u||s(e instanceof Error?e.message:`Failed to render Mermaid chart`)}finally{l(!1)}})()}},[e,n,m,y,_]),!(y||u||f))return(0,L.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:b});if(c&&!u&&!f)return(0,L.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:b,children:(0,L.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,L.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,L.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return v?(0,L.jsx)(`div`,{ref:b,children:(0,L.jsx)(v,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,L.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:b,children:[(0,L.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,L.jsxs)(`details`,{className:a(`mt-2`),children:[(0,L.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,L.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let x=u||f;return(0,L.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:b,children:(0,L.jsx)(ro,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,L.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:x},role:`img`})})})};export{$ as a,no as i,Ya as n,io as o,ci as r,Ir as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Un as e,Wn as t}from"./dist-
|
|
1
|
+
import{Un as e,Wn as t}from"./dist-BS18tPvg.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.79.0`}?.VITE_APP_VERSION??`0.0.0-unknown`;function r(){return e({kind:`web`,runtimeVersion:n})}function i(){return t({kind:`web`,runtimeVersion:n})}export{r as n,i as r,n as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Fr as t,In as n,Pr as r,Qn as i,Vr as a,Xn as o,di as s,ii as c,si as l}from"./DocumentContext-Dlldf3A6.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-HKX9wT1K.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import{Jn as v,Or as y,ia as b,lr as x,qn as S,ur as C}from"./dist-bQ5kvrpa.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{t as ee}from"./createLucideIcon-B6ULg5PN.js";import{Mt as te}from"./CodeMirrorPropInput-CjC1gT00.js";import{t as ne}from"./x-BcfoD9-8.js";import{f as re}from"./doc-paths-BKrv1Wyo.js";var E=ee(`message-square`,[[`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`}]]),D=f(),ie=`var(--ok-comment-hue, rgb(37 99 235))`,ae={fill:.22,line:.7},O={fill:.45,line:1},oe=.45;function k(e){return`color-mix(in srgb,${ie} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?O:ae;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${k(n)}`,`box-shadow:inset 0 -2px 0 ${k(r)}`,``].join(`;`)}function A(e){return e.map(e=>e.id??`·`).join(`|`)}function ce(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function j(e,t){return e.id===null||e.id===t}function M(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>j(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:ce(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&A(a.covering)===A(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var N=`data-comment-reveal`;function P(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function F(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${P(e)}"]`)}function le(e){let t=F(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){F(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function I(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${P(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=L(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),de(n),!0}return!1}function L(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function de(e){e.style.setProperty(`--comment-reveal-fill`,k(oe)),e.setAttribute(N,`true`);let t=()=>{e.removeAttribute(N),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function R(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=S(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function z(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:y(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:y(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=b(t.length);return c-s>l?null:{start:s,end:c}}function V(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function H(e,t,n){if(t.length===0)return null;let r=z(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=y(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||y(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||C(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=C(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function fe(e,t,n){return{prefix:v(e,Math.max(0,t-U),t),suffix:v(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=R(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=R(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var pe=220,me=24;function he(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-pe;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+me)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,r,i){let a=te(e);if(!a)return!1;let o=K(a.dom);if(!o)return n(r,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=he({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return n(r,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var ge=1e4,_e=80,ve=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let n=!1,a=null,c=null,l=-1,u=()=>{let i=o(e.docName);if(!i||i.isDestroyed)return!1;if(n||(n=!0,r(e.threadId)),e.quote===``)return a===null&&(a=Date.now(),t(e.threadId)),!0;let s=i.state.doc.content.size;return(c===null||s!==l)&&(c=W(i.state.doc,e.quote,e.context),l=s),!c||!J(i,c,e.docName,{instant:!0})?!1:(a===null&&(a=Date.now(),t(e.threadId)),!0)};s(`comments`),u(),o(e.docName)===null&&window.location.assign(re(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Y)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&a!==null&&Date.now()-a>=ve&&f()},h=i(m),g=window.setInterval(m,_e),_=window.setTimeout(()=>{a===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},ge);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function be(){return c().length}function xe(){let e=(0,D.c)(4),t=c(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=a(e)?.docName;t!==void 0&&n.set(t,(n.get(t)??0)+1)}e[0]=t,e[1]=n}else n=e[1];let r;return e[2]===n?r=e[3]:(r=[...n].map(Se),e[2]=n,e[3]=r),r}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,D.c)(26),{count:n,docs:r,onDismiss:i}=e,a;t[0]===r?a=t[1]:(a=r===void 0?[]:r,t[0]=r,t[1]=a);let o=a,{_:s}=d();if(n===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=s({id:`2zvUIK`}),t[3]=s,t[4]=l);let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(E,{className:`size-3`}),t[5]=f):f=t[5];let v;t[6]!==n||t[7]!==o.length?(v=o.length>1?(0,X.jsx)(u,{id:`5TmrYN`,values:{0:o.length,count:n}}):(0,X.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[6]=n,t[7]=o.length,t[8]=v):v=t[8];let y;t[9]!==l||t[10]!==v?(y=(0,X.jsx)(h,{asChild:!0,children:(0,X.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":l,onClick:Te,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[f,v]})}),t[9]=l,t[10]=v,t[11]=y):y=t[11];let b;t[12]===o?b=t[13]:(b=(0,X.jsx)(g,{className:`max-w-64`,children:o.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:o.map(we)}):(0,X.jsx)(u,{id:`2zvUIK`})}),t[12]=o,t[13]=b);let x;t[14]!==y||t[15]!==b?(x=(0,X.jsxs)(_,{children:[y,b]}),t[14]=y,t[15]=b,t[16]=x):x=t[16];let S;t[17]===s?S=t[18]:(S=s({id:`pFRz_E`}),t[17]=s,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(ne,{className:`size-3`}),t[19]=C):C=t[19];let w;t[20]!==i||t[21]!==S?(w=(0,X.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":S,onClick:i,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:C}),t[20]=i,t[21]=S,t[22]=w):w=t[22];let T;return t[23]!==w||t[24]!==x?(T=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:c,children:[x,w]}),t[23]=w,t[24]=x,t[25]=T):T=t[25],T}function we(e){return(0,X.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,X.jsx)(`span`,{className:`truncate`,children:Z(e.docName)})]},e.docName)}function Te(){return l()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Q(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function Ee(e){ye({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{I({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=De)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var De=30;function Oe(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function ke(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Ae(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function je(e){if(!e.repeats)return null;let t=ke(e.prefix),n=Ae(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Me(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Fr as t,In as n,Pr as r,Qn as i,Vr as a,Xn as o,di as s,ii as c,si as l}from"./DocumentContext-Dje4W6Tq.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-HKX9wT1K.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import{Jn as v,Or as y,aa as b,lr as x,qn as S,ur as C}from"./dist-BS18tPvg.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{t as ee}from"./createLucideIcon-B6ULg5PN.js";import{Mt as te}from"./CodeMirrorPropInput-Cg1vR5eO.js";import{t as ne}from"./x-BcfoD9-8.js";import{f as re}from"./doc-paths-wf1Zwihi.js";var E=ee(`message-square`,[[`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`}]]),D=f(),ie=`var(--ok-comment-hue, rgb(37 99 235))`,ae={fill:.22,line:.7},O={fill:.45,line:1},oe=.45;function k(e){return`color-mix(in srgb,${ie} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?O:ae;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${k(n)}`,`box-shadow:inset 0 -2px 0 ${k(r)}`,``].join(`;`)}function A(e){return e.map(e=>e.id??`·`).join(`|`)}function ce(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function j(e,t){return e.id===null||e.id===t}function M(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>j(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:ce(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&A(a.covering)===A(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var N=`data-comment-reveal`;function P(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function F(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${P(e)}"]`)}function le(e){let t=F(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){F(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function I(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${P(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=L(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),de(n),!0}return!1}function L(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function de(e){e.style.setProperty(`--comment-reveal-fill`,k(oe)),e.setAttribute(N,`true`);let t=()=>{e.removeAttribute(N),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function R(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=S(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function z(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:y(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:y(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=b(t.length);return c-s>l?null:{start:s,end:c}}function V(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function H(e,t,n){if(t.length===0)return null;let r=z(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=y(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||y(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||C(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=C(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function fe(e,t,n){return{prefix:v(e,Math.max(0,t-U),t),suffix:v(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=R(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=R(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var pe=220,me=24;function he(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-pe;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+me)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,r,i){let a=te(e);if(!a)return!1;let o=K(a.dom);if(!o)return n(r,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=he({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return n(r,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var ge=1e4,_e=80,ve=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let n=!1,a=null,c=null,l=-1,u=()=>{let i=o(e.docName);if(!i||i.isDestroyed)return!1;if(n||(n=!0,r(e.threadId)),e.quote===``)return a===null&&(a=Date.now(),t(e.threadId)),!0;let s=i.state.doc.content.size;return(c===null||s!==l)&&(c=W(i.state.doc,e.quote,e.context),l=s),!c||!J(i,c,e.docName,{instant:!0})?!1:(a===null&&(a=Date.now(),t(e.threadId)),!0)};s(`comments`),u(),o(e.docName)===null&&window.location.assign(re(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Y)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&a!==null&&Date.now()-a>=ve&&f()},h=i(m),g=window.setInterval(m,_e),_=window.setTimeout(()=>{a===null&&w.error(n?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},ge);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function be(){return c().length}function xe(){let e=(0,D.c)(4),t=c(),n;if(e[0]!==t){n=new Map;for(let e of t){let t=a(e)?.docName;t!==void 0&&n.set(t,(n.get(t)??0)+1)}e[0]=t,e[1]=n}else n=e[1];let r;return e[2]===n?r=e[3]:(r=[...n].map(Se),e[2]=n,e[3]=r),r}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,D.c)(26),{count:n,docs:r,onDismiss:i}=e,a;t[0]===r?a=t[1]:(a=r===void 0?[]:r,t[0]=r,t[1]=a);let o=a,{_:s}=d();if(n===0)return null;let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=s({id:`2zvUIK`}),t[3]=s,t[4]=l);let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(E,{className:`size-3`}),t[5]=f):f=t[5];let v;t[6]!==n||t[7]!==o.length?(v=o.length>1?(0,X.jsx)(u,{id:`5TmrYN`,values:{0:o.length,count:n}}):(0,X.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[6]=n,t[7]=o.length,t[8]=v):v=t[8];let y;t[9]!==l||t[10]!==v?(y=(0,X.jsx)(h,{asChild:!0,children:(0,X.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":l,onClick:Te,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[f,v]})}),t[9]=l,t[10]=v,t[11]=y):y=t[11];let b;t[12]===o?b=t[13]:(b=(0,X.jsx)(g,{className:`max-w-64`,children:o.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:o.map(we)}):(0,X.jsx)(u,{id:`2zvUIK`})}),t[12]=o,t[13]=b);let x;t[14]!==y||t[15]!==b?(x=(0,X.jsxs)(_,{children:[y,b]}),t[14]=y,t[15]=b,t[16]=x):x=t[16];let S;t[17]===s?S=t[18]:(S=s({id:`pFRz_E`}),t[17]=s,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(ne,{className:`size-3`}),t[19]=C):C=t[19];let w;t[20]!==i||t[21]!==S?(w=(0,X.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":S,onClick:i,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:C}),t[20]=i,t[21]=S,t[22]=w):w=t[22];let T;return t[23]!==w||t[24]!==x?(T=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:c,children:[x,w]}),t[23]=w,t[24]=x,t[25]=T):T=t[25],T}function we(e){return(0,X.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,X.jsx)(`span`,{className:`truncate`,children:Z(e.docName)})]},e.docName)}function Te(){return l()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Q(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function Ee(e){ye({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{I({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=De)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var De=30;function Oe(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function ke(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Ae(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function je(e){if(!e.repeats)return null;let t=ke(e.prefix),n=Ae(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Me(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|
|
2
2
|
`))i.push(` > ${e}`);i.push(``),i.push(` ${e.body.trim()}`)}e.anchorLost&&(i.push(``),i.push(n===``?` (Note: \`${e.propertyKey}\` is no longer in this document's frontmatter — it was renamed or removed since the comment was written. Do not apply this to a different property; if you cannot tell what it now refers to, say so instead of guessing.)`:` (Note: that text is no longer in \`${e.propertyKey}\` — the value was edited, reshaped, or removed since the comment was written. Do not apply this to a different property or a different part of the value; if you cannot tell what it now refers to, say so instead of guessing.)`));return}i.push(`${t+1}. In \`${e.docName}\`, on this passage:`),i.push(``);for(let t of e.quote.split(`
|
|
3
3
|
`))i.push(` > ${t}`);i.push(``),i.push(` ${e.body.trim()}`);let n=je(e);n!==null&&(i.push(``),i.push(` ${n}`)),e.anchorLost&&(i.push(``),i.push(` (Note: this passage is no longer in the document — it was edited or removed since the comment was written. Do not apply this to a different passage; if you cannot tell what it now refers to, say so instead of guessing.)`))}),n&&n.markdown.trim().length>0){i.push(``),i.push(`Also in scope, selected in \`${n.docName}\` (not a comment):`),i.push(``);for(let e of n.markdown.trim().split(`
|
|
4
4
|
`))i.push(`> ${e}`)}return i.join(`
|