markstream-react 0.0.56-beta.4 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +17 -20
  2. package/dist/Tooltip-Bs7FyYvs.js +189 -0
  3. package/dist/codeBlockExtraProps-C_3No_qp.js +8 -0
  4. package/dist/{index-BQgUvQrW.js → index-uI922Np4.js} +46 -44
  5. package/dist/index.css +1 -1
  6. package/dist/index.d.ts +1 -3
  7. package/dist/index.js +1 -1
  8. package/dist/index.px.css +1 -1
  9. package/dist/index.tailwind.css +1 -1
  10. package/dist/markstream-react.css +1 -1
  11. package/dist/next.d.ts +67 -126
  12. package/dist/next.js +1 -1
  13. package/dist/server.d.ts +66 -122
  14. package/dist/server.js +1 -1
  15. package/dist/tailwind.cjs +1 -1
  16. package/dist/tailwind.js +1 -1
  17. package/dist/types/components/CodeBlockNode/PreCodeNode.d.ts +1 -1
  18. package/dist/types/components/CodeBlockNode/codeTypography.d.ts +4 -3
  19. package/dist/types/components/CodeBlockNode/streamDiffs.d.ts +2 -0
  20. package/dist/types/components/NodeRenderer/preloadStreamDiffs.d.ts +1 -0
  21. package/dist/types/index.d.ts +1 -3
  22. package/dist/types/next.d.ts +0 -5
  23. package/dist/types/server-renderer/index.d.ts +0 -2
  24. package/dist/types/server.d.ts +0 -2
  25. package/dist/types/types/component-props.d.ts +53 -66
  26. package/dist/types/types.d.ts +13 -24
  27. package/dist/types/utils/languageIcon.d.ts +1 -1
  28. package/package.json +20 -30
  29. package/dist/Tooltip-DygdyBfV.js +0 -205
  30. package/dist/codeBlockExtraProps-B08PlQGP.js +0 -8
  31. package/dist/types/components/CodeBlockNode/monaco.d.ts +0 -1
  32. package/dist/types/components/CodeBlockNode/monacoThemeRegistry.d.ts +0 -7
  33. package/dist/types/components/CodeBlockNode/monacoThemeScheduler.d.ts +0 -4
  34. package/dist/types/components/MarkdownCodeBlockNode/MarkdownCodeBlockNode.d.ts +0 -34
  35. package/dist/types/components/NodeRenderer/preloadMonaco.d.ts +0 -1
@@ -0,0 +1,8 @@
1
+ import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import r,{useMemo as a}from"react";import{normalizeCustomHtmlTagName as l,hasCustomHtmlComponents as o,tokenizeHtml as s,BLOCKED_HTML_TAGS as i,isHtmlTagHardBlocked as c,isHtmlTagBlocked as h,sanitizeHtmlAttrs as u,isCustomHtmlComponentTag as d,convertHtmlAttrsToProps as m,getHtmlTagFromContent as p}from"stream-markdown-parser";const v=/* @__PURE__ */new Set(["table","code_block","html_block","blockquote","list","list_item","definition_list","footnote","footnote_reference","footnote_anchor","admonition","thematic_break","math_block","thinking","vmr_container"]);function f(e){if(Array.isArray(e)&&0!==e.length)return e.reduce((e,[t,n])=>t?(e["for"===t?"htmlFor":"class"===t?"className":t]=null==n||n,e):e,{})}function g(t,n,r,a){if(!Array.isArray(t)||0===t.length)return null;const l=[];for(let o=0;o<t.length;o++){const s=t[o];if(s){if("label_open"===s.type){const i=[];for(o++;o<t.length;){const e=t[o];if("label_close"===(null==e?void 0:e.type))break;e&&i.push(e),o++}const c=`${r}-label-${o}`;l.push(
2
+ /* @__PURE__ */e("label",{...f(s.attrs),children:g(i,n,`${c}-child`,a)},c));continue}"label_close"!==s.type&&l.push(a(s,`${r}-${o}`,n))}}return l}function w(n,r,a,l){/* @__PURE__ */
3
+ return e(t,{children:g(n,r,`${a}-inline`,l)})}const x=!1,y="__global__",k="__MARKSTREAM_REACT_CUSTOM_COMPONENTS_STORE__",b=(()=>{const e=globalThis;if(e[k])return e[k];const t={scopedComponents:{},revision:0,listeners:/* @__PURE__ */new Set};return e[k]=t,t})();function N(){b.revision++;for(const e of Array.from(b.listeners))try{e()}catch{}}function C(e){return b.listeners.add(e),()=>{b.listeners.delete(e)}}function M(){return b.revision}function $(e,t){"string"==typeof e?b.scopedComponents[e]={...t||{}}:b.scopedComponents[y]={...e},N()}function _(e){const t=b.scopedComponents[y]||{};if(!e)return t;const n=b.scopedComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?{...t,...n}:t:n}function H(e){if(e===y)throw new Error("removeCustomComponents: cannot delete global mapping; call clearGlobalCustomComponents instead.");delete b.scopedComponents[e],N()}function B(){delete b.scopedComponents[y],N()}function z(e){return null==e?void 0:e.markstreamDisplay}function A(e,t){return e.markstreamDisplay=t,e}function j(e){return e}function S(e){return e}function L(e){if(!e)return{};const t={};for(const[n,r]of Object.entries(e)){const e=l(n);e&&(t[e]=r)}return t}function V(e,t,n){if(x)for(const r of Object.keys(e))t[r]&&!n.has(r)&&(n.add(r),console.warn(`[markstream-react] "${r}" was provided in both streamingComponents and htmlComponents. The streamingComponents entry will be used for parser-backed rendering.`))}const O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',T='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>';let q=null,E=null,P=null;const F=/* @__PURE__ */new Set;function K(e){q=null!=e?e:null}const Z={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",d2lang:"d2",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"},I={"":T,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:T,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:O,csharp:O,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'};function W(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[r]=n.split(":");return r.toLowerCase()}(e);return null!=(t=Z[n])?t:n}function D(e){const t=W(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"shell":return"zsh";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}async function G(){return E||(P||(P=import("./languageIconExtended-DRR7G3nV.js").then(e=>(E=e.EXTENDED_LANGUAGE_ICON_MAP,function(){for(const e of F)try{e()}catch{}}(),E)).catch(()=>null)),P)}async function R(){await G()}function U(e){return F.add(e),()=>{F.delete(e)}}function J(e){if(q){const t=q(e);if(null!=t&&""!==t)return t}const t=W(e),n=I[t];if(n)return n;return(null==E?void 0:E[t])||(G(),'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>')}const X={javascript:"JavaScript",typescript:"TypeScript",jsx:"JSX",tsx:"TSX",shell:"Shell",powershell:"PowerShell",plain:"Text",text:"Text",markdown:"Markdown",json:"JSON",python:"Python",ruby:"Ruby",go:"Go",java:"Java",kotlin:"Kotlin",c:"C",cpp:"C++",csharp:"C#",php:"PHP",sql:"SQL",yaml:"YAML",xml:"XML",rust:"Rust",scss:"SCSS",vue:"Vue",html:"HTML",css:"CSS",svg:"SVG",mermaid:"Mermaid",d2:"D2",ada:"Ada",applescript:"AppleScript",assembly:"Assembly",clojure:"Clojure",cobol:"COBOL",crystal:"Crystal",dart:"Dart",dlang:"D",docker:"Docker",dockerfile:"Dockerfile",elixir:"Elixir",erlang:"Erlang",fortran:"Fortran",groovy:"Groovy",haskell:"Haskell",julia:"Julia",lisp:"Lisp",lua:"Lua",nim:"Nim",objectivec:"Objective-C",objectivecpp:"Objective-C++",ocaml:"OCaml",perl:"Perl",prolog:"Prolog",r:"R",scala:"Scala",solidity:"Solidity",svelte:"Svelte",swift:"Swift",terraform:"Terraform",vbnet:"VB.NET"},Q=12;function Y(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:void 0}function ee(e,t){var n,r,a;const l=null!=(r=null!=(n=Y(null==e?void 0:e.fontSize))?n:Y(t))?r:12,o=null!=(a=Y(null==e?void 0:e.lineHeight))?a:12===l?18:Math.max(12,Math.round(1.5*l));return{fontFamily:"string"==typeof(null==e?void 0:e.fontFamily)&&e.fontFamily.trim()?e.fontFamily.trim():'"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace',fontSize:l,lineHeight:o}}function te(e){var t;return String(null!=(t=String(null!=e?e:"").split(/\s+/g)[0])?t:"").split(":")[0].toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}function ne(e){const t=String(null!=e?e:"");return t?t.split(/\r\n|\n|\r/):[]}function re(e){return e.startsWith("-")&&!e.startsWith("---")}function ae(e){return e.startsWith("+")&&!e.startsWith("+++")}function le(e,t){return n=e[t],!(0===String(null!=n?n:"").trim().length)||t<e.length-1;var n}function oe(e,t,n,r,a={}){const l=0===String(null!=e?e:"").trim().length;return{code:e,empty:l,kind:l&&"hunk"!==t&&!a.preserveBlankKind?"context":t,key:n,number:r}}function se(e,t){const n=ne(e),r=ne(t),a=function(e,t){const n=e.length,r=t.length;if((n+1)*(r+1)>15e5)return null;const a=r+1,l=new Uint16Array((n+1)*(r+1));for(let c=n-1;c>=0;c--)for(let n=r-1;n>=0;n--){const r=c*a+n;e[c]===t[n]?l[r]=l[(c+1)*a+n+1]+1:l[r]=Math.max(l[(c+1)*a+n],l[c*a+n+1])}const o=[];let s=0,i=0;for(;s<n&&i<r;)e[s]===t[i]?(o.push({originalIndex:s,modifiedIndex:i}),s++,i++):l[(s+1)*a+i]>=l[s*a+i+1]?s++:i++;return o}(n,r);if(a){const e=[];let t=0,l=0;for(const o of a){for(;t<o.originalIndex;)e.push(oe(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:le(n,t)})),t++;for(;l<o.modifiedIndex;)e.push(oe(r[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:le(r,l)})),l++;e.push(oe(r[o.modifiedIndex],"context",`inline-context-source-${o.originalIndex}-${o.modifiedIndex}`,o.modifiedIndex+1)),t=o.originalIndex+1,l=o.modifiedIndex+1}for(;t<n.length;)e.push(oe(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:le(n,t)})),t++;for(;l<r.length;)e.push(oe(r[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:le(r,l)})),l++;return e}const l=[];let o=0,s=n.length-1,i=r.length-1;for(;o<=s&&o<=i&&n[o]===r[o];)l.push(oe(r[o],"context",`inline-prefix-${o}`,o+1)),o++;const c=[];for(;s>=o&&i>=o&&n[s]===r[i];)c.unshift(oe(r[i],"context",`inline-suffix-${i}`,i+1)),s--,i--;for(let h=o;h<=s;h++)l.push(oe(n[h],"removed",`inline-removed-source-${h}`,"",{preserveBlankKind:le(n,h)}));for(let h=o;h<=i;h++)l.push(oe(r[h],"added",`inline-added-source-${h}`,h+1,{preserveBlankKind:le(r,h)}));return l.concat(c)}function ie(e,t=!1,n=te(null==e?void 0:e.language)){const r=(a=null==e?void 0:e.code,String(null!=a?a:"").split(/\r\n|\n|\r/));var a;if(!function(e,t,n){const r=e.some(e=>re(e)),a=e.some(e=>ae(e));return r&&a||function(e,t){var n,r,a;if("diff"===t)return!0;const l=null!=(a=null==(r=String(null!=(n=null==e?void 0:e.raw)?n:"").split(/\r?\n/,1)[0])?void 0:r.trim())?a:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(l)}(t,n)&&(r||a)}(r,e,n)&&function(e){return null!=(null==e?void 0:e.originalCode)||null!=(null==e?void 0:e.updatedCode)}(e)){if(t)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:se(null==e?void 0:e.originalCode,null==e?void 0:e.updatedCode)}];const n=ne(null==e?void 0:e.originalCode),r=ne(null==e?void 0:e.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:n.map((e,t)=>oe(e,r[t]===e?"context":"removed",`original-${t}`,t+1,{preserveBlankKind:le(n,t)}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:r.map((e,t)=>oe(e,n[t]===e?"context":"added",`modified-${t}`,t+1,{preserveBlankKind:le(r,t)}))}]}if(t){const e=function(e){let t=1;return e.map((e,n)=>e.startsWith("@@")?oe(e,"hunk",`inline-hunk-${n}`,""):re(e)?oe(e.slice(1),"removed",`inline-removed-${n}`,"",{preserveBlankKind:!0}):ae(e)?oe(e.slice(1),"added",`inline-added-${n}`,t++,{preserveBlankKind:!0}):oe(e.startsWith(" ")?e.slice(1):e,"context",`inline-context-${n}`,t++))}(r);return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:e}]}const l=[],o=[];let s=1,i=1;for(const[c,h]of r.entries())if(h.startsWith("@@"))l.push(oe(h,"hunk",`original-hunk-${c}`,"")),o.push(oe(h,"hunk",`modified-hunk-${c}`,""));else if(re(h))l.push(oe(h.slice(1),"removed",`original-removed-${c}`,s++,{preserveBlankKind:!0}));else if(ae(h))o.push(oe(h.slice(1),"added",`modified-added-${c}`,i++,{preserveBlankKind:!0}));else{const e=h.startsWith(" ")?h.slice(1):h;l.push(oe(e,"context",`original-context-${c}`,s++)),o.push(oe(e,"context",`modified-context-${c}`,i++))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:l},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:o}]}function ce({node:r,className:l,diffInline:o,showLineNumbers:s,style:i}){const c=a(()=>te(null==r?void 0:r.language),[r]),h=`language-${c}`,u=c?`Code block: ${c}`:"Code block",d=!0===s&&!0===(null==r?void 0:r.diff),m=a(()=>d?ie(r,!0===o,c):[],[o,d,r,c]),p=a(()=>function(e){var t,n;if(!0===(null==e?void 0:e.diff))return String(null!=(t=null==e?void 0:e.code)?t:"");const r=String(null!=(n=null==e?void 0:e.code)?n:"");return!0===(null==e?void 0:e.loading)?r:r.replace(/\r\n$|\n$|\r$/,"")}(r),[r]),v=a(()=>function(e){let t=1;for(let n=0;n<e.length;n++)"\n"===e[n]?t++:"\r"===e[n]&&(t++,"\n"===e[n+1]&&n++);return t}(p),[p]),f=a(()=>{let e="";for(let t=1;t<=v;t++)e+=`${e?"\n":""}${t}`;return e},[v]),g=a(()=>{if(!0===s&&!d)return{"--markstream-pre-line-number-width":`${Math.max(2,String(v).length)}ch`,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}},[d,s,v]),w=a(()=>{const e=!0===(null==l?void 0:l.split(/\s+/).includes("code-fallback-plain")),t=e?ee():{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:16,lineHeight:28},n=e?function(e,t=8){return{top:t,bottom:t}}(0,d?0:8):{top:0,bottom:0};return{"--markstream-pre-line-number-top":`${n.top}px`,fontFamily:t.fontFamily,fontSize:`${t.fontSize}px`,lineHeight:`${t.lineHeight}px`,paddingBottom:`${n.bottom}px`,paddingTop:`${n.top}px`,tabSize:e?4:2,...i,...g}},[l,d,g,i]);/* @__PURE__ */
4
+ return e("pre",{className:[h,l,s?"markstream-pre--line-numbers":"",d?"markstream-pre--diff-preview":"",d&&o?"markstream-pre--diff-inline":""].filter(Boolean).join(" "),style:w,"aria-busy":!0===(null==r?void 0:r.loading),"aria-label":u,"data-language":c,"data-markstream-line-numbers":s?"1":void 0,"data-markstream-pre":"1",tabIndex:0,children:d?/* @__PURE__ */e("code",{translate:"no",className:"markstream-pre__diff-code",children:m.map(t=>/* @__PURE__ */e("span",{className:["markstream-pre__diff-pane",t.className].join(" "),children:t.lines.map(t=>/* @__PURE__ */n("span",{className:["markstream-pre__diff-line",`markstream-pre__diff-line--${t.kind}`,t.empty?"markstream-pre__diff-line--empty":""].filter(Boolean).join(" "),children:[
5
+ /* @__PURE__ */e("span",{className:"markstream-pre__diff-rail","aria-hidden":"true"}),
6
+ /* @__PURE__ */e("span",{className:"markstream-pre__diff-number","aria-hidden":"true",children:t.number}),
7
+ /* @__PURE__ */e("span",{className:"markstream-pre__diff-content",children:/* @__PURE__ */e("span",{className:"markstream-pre__diff-content-inner",children:t.code})})]},t.key))},t.key))}):/* @__PURE__ */n(t,{children:[s&&/* @__PURE__ */e("span",{className:"markstream-pre__line-numbers","aria-hidden":"true",children:/* @__PURE__ */e("span",{className:"markstream-pre__line-numbers-text",children:f})}),
8
+ /* @__PURE__ */e("code",{translate:"no",className:"markstream-pre__code",children:p})]})})}function he(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function ue(e){const t={...e};if(Object.prototype.hasOwnProperty.call(t,"class")&&(t.className=t.class,delete t.class),Object.prototype.hasOwnProperty.call(t,"for")&&(t.htmlFor=t.for,delete t.for),"string"==typeof t.style){const e=function(e){const t=e.trim();if(!t)return;const n={};for(const r of t.split(";")){const e=r.trim();if(!e)continue;const t=e.indexOf(":");if(-1===t)continue;const a=he(e.slice(0,t).trim()),l=e.slice(t+1).trim();a&&(n[a]=l)}return Object.keys(n).length?n:void 0}(t.style);e?t.style=e:delete t.style}return t}const de=s,me=u;function pe(e,t){return d(e,t)}function ve(e,t){return o(e,t)}function fe(e,t,n=!1){const r=Object.entries(null!=t?t:{}),a=r.length>0?r.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${a} />`:`<${e}${a}>`}function ge(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function we(e,t){var n,r;return(null==(n=t.nodeComponents)?void 0:n[e])||(null==(r=t.nodeComponents)?void 0:r[e.toLowerCase()])}function xe(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return String(e);if(Array.isArray(e))return e.map(xe).join("");if(!r.isValidElement(e))return"";const t=e;if("string"!=typeof t.type)return xe(t.props.children);const n=Object.entries(t.props).filter(([e,t])=>"children"!==e&&"key"!==e&&"ref"!==e&&null!=t&&"boolean"!=typeof t).map(([e,t])=>` ${"className"===e?"class":e}="${String(t)}"`).join("");return`<${t.type}${n}>${xe(t.props.children)}</${t.type}>`}function ye(e){return Object.entries(e).map(([e,t])=>[e,""===t?null:t])}function ke(e){var t,n;const r=e.sourceNode,a=!0!==(null==(t=e.ctx)?void 0:t.final)&&(!1===(null==(n=e.ctx)?void 0:n.final)||Boolean(null==r?void 0:r.loading));return{loading:a,autoClosed:a||Boolean(null==r?void 0:r.autoClosed)}}function be(e,t,n){return function(e,t){var n,r;return Boolean((null==(n=t.propComponents)?void 0:n[e])||(null==(r=t.propComponents)?void 0:r[e.toLowerCase()]))}(e,n)?m(t):t}function Ne(e,t,n,a,o,s,i,c=ke(o)){const h=l(e),u=null!=s?s:function(e){return e.map(xe).join("")}(n),d={type:h,tag:h,attrs:ye(t),content:u,raw:null!=i?i:`${fe(e,t)}${u}</${e}>`,loading:c.loading,autoClosed:c.autoClosed};if(o.ctx&&o.renderNode)return o.renderNode(d,a,o.ctx);const m=we(e,o);return m?r.createElement(m,{key:a,node:d}):null}function Ce(e,t,n="safe",a={}){var l,o,s;if(!e)return[];if("escape"===n)return[e];try{const u=de(e);let d=0;const m=null!=(l=a.keyPrefix)?l:"ms-html",p=[],v=[];for(const e of u){if("text"===e.type){if(p.length>0&&p[p.length-1].hardBlocked)continue;(p.length>0?p[p.length-1].children:v).push(null!=(o=e.content)?o:""),p.length>0&&p[p.length-1].sourceParts.push(null!=(s=e.content)?s:"");continue}if("self_closing"===e.type){const l=e.attrs||{},o=fe(e.tagName,l,!0),s=pe(e.tagName,t),u=Boolean(we(e.tagName,a));if(i.has(e.tagName.toLowerCase())||!s&&!u&&c(e.tagName,n))continue;if(!s&&!u&&h(e.tagName,n)){(p.length>0?p[p.length-1].children:v).push(o),p.length>0&&p[p.length-1].sourceParts.push(o);continue}const f=me(l,n,e.tagName),g=f.key,w=null!=g&&""!==g?g:`${m}-${d++}`,x=s?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0,y=p.length>0?p[p.length-1].children:v;if(u)y.push(Ne(e.tagName,l,[],w,a,"",o,{loading:!1,autoClosed:!1}));else if(x){const t=be(e.tagName,f,a);y.push(r.createElement(x,{...t,key:w}))}else y.push(r.createElement(e.tagName,{...ue(f),key:w,suppressHydrationWarning:!0}));p.length>0&&p[p.length-1].sourceParts.push(o);continue}if("tag_open"===e.type){const r=p.length>0&&p[p.length-1].hardBlocked,l=pe(e.tagName,t),o=Boolean(we(e.tagName,a));p.push({tagName:e.tagName,children:[],attrs:e.attrs,sourceParts:[],customComponent:l||o,hardBlocked:r||i.has(e.tagName.toLowerCase())||!l&&!o&&c(e.tagName,n),softBlocked:!r&&!l&&!o&&h(e.tagName,n)});continue}const l=e.tagName.toLowerCase();let u=-1;for(let e=p.length-1;e>=0;e--)if(p[e].tagName.toLowerCase()===l){u=e;break}if(-1!==u)for(;p.length>u;){const e=p.pop();if(!e)continue;const o=e.sourceParts.join(""),s=`${fe(e.tagName,e.attrs)}${o}</${e.tagName}>`;let i;if(e.hardBlocked)i=null;else if(e.softBlocked)i=[fe(e.tagName,e.attrs),...e.children,`</${e.tagName}>`];else{const c=me(e.attrs||{},n,e.tagName),h=c.key,u=null!=h&&""!==h?h:`${m}-${d++}`,p=e.customComponent?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0;if(Boolean(we(e.tagName,a))){const t=e.tagName.toLowerCase()===l?{loading:!1,autoClosed:!1}:ke(a);i=Ne(e.tagName,e.attrs||{},e.children,u,a,o,s,t)}else i=p?r.createElement(p,{...be(e.tagName,c,a),key:u},...e.children):r.createElement(e.tagName,{...ue(c),key:u,suppressHydrationWarning:!0},...e.children)}p.length>0?ge(p[p.length-1].children,i):ge(v,i),p.length>0&&!e.hardBlocked&&p[p.length-1].sourceParts.push(s)}}for(;p.length>0;){const e=p.pop();if(!e||e.hardBlocked)continue;const l=e.sourceParts.join(""),o=`${fe(e.tagName,e.attrs)}${l}`;if(e.softBlocked){ge(v,[fe(e.tagName,e.attrs),...e.children,`</${e.tagName}>`]),p.length>0&&p[p.length-1].sourceParts.push(o);continue}const s=me(e.attrs||{},n,e.tagName),i=s.key,c=null!=i&&""!==i?i:`${m}-${d++}`,h=e.customComponent?t[e.tagName]||t[e.tagName.toLowerCase()]:void 0;let u;u=Boolean(we(e.tagName,a))?Ne(e.tagName,e.attrs||{},e.children,c,a,l,o,ke(a)):h?r.createElement(h,{...be(e.tagName,s,a),key:c},...e.children):r.createElement(e.tagName,{...ue(s),key:c,suppressHydrationWarning:!0},...e.children),v.push(u),p.length>0&&p[p.length-1].sourceParts.push(o)}return v}catch{return null}}function Me(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function $e(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function _e(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function He(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}function Be(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function ze(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),r=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const r=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==r?void 0:r[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===r?220+28*n:"sequencediagram"===r?180+26*n:"classdiagram"===r||"statediagram"===r||"erdiagram"===r?180+24*n:"flowchart"===r||"graph"===r?170+28*n:200+22*n}function Ae(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function je(e,t,n){var r,a;const o=l(e.type),s=(null!=n?n:[]).map(e=>l(e)).filter(Boolean),i="html_inline"===o||"html_block"===o;if(!i&&!s.includes(o))return null;const c=i?l(e.tag)||p(e.content):l(e.tag)||o;if(!c)return null;const h=s.includes(c),u=null!=(a=null!=(r=t[c])?r:t[o])?a:null,d=h||i?u:null;return{tag:c,isWhitelisted:h,component:d,display:z(d)}}function Se(e,t,n){var r;return"block"===(null==(r=je(e,t,n))?void 0:r.display)}const Le=/* @__PURE__ */new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Ve(e,t={}){var n;const r={},a=new Set(null!=(n=t.omit)?n:[]);if(!e||"object"!=typeof e)return r;const l=Object.getOwnPropertyDescriptors(e);for(const[o,s]of Object.entries(l))Le.has(o)||a.has(o)||s.enumerable&&"value"in s&&(r[o]=s.value);return r}export{H as A,v as B,w as C,g as D,ee as E,je as F,D as G,me as H,$ as I,K as J,C as K,U as L,f as M,de as N,V as O,ce as P,A as Q,Ae as a,B as b,_e as c,Q as d,S as e,j as f,$e as g,ze as h,Ve as i,z as j,M as k,_ as l,J as m,ve as n,pe as o,Se as p,X as q,L as r,ue as s,He as t,W as u,Ce as v,Be as w,Me as x,R as y,Y as z};
@@ -1,11 +1,11 @@
1
- import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{normalizeShikiLanguage as r}from"markstream-core";import l from"react";import{normalizeCustomHtmlTagName as o,NON_STRUCTURING_HTML_TAGS as i,isHtmlTagBlocked as a,sanitizeHtmlTokenAttrs as d,convertHtmlAttrsToProps as c,tokenAttrsToRecord as s,sanitizeImageSrc as u,sanitizeHtmlAttrs as m,shouldOpenLinkInNewTab as h,mergeCustomHtmlTags as p,getMarkdown as g,parseMarkdownToStructure as y,stripCustomHtmlWrapper as f,shouldRenderUnknownHtmlTagAsText as x}from"stream-markdown-parser";import{u as k,E as v,D as w,l as N,w as b,s as S,Q as $,B as K,q as _,P as B,N as T,G as C,t as P,v as I,i as A,x as D,a as H,h as E,y as M,c as L,g as W}from"./codeBlockExtraProps-B08PlQGP.js";let O,j=!1;function q(e,n,t){const r=k(e);if(!r)return null;if(globalThis.__MARKSTREAM_REACT_DISABLE_SYNC_KATEX__)return null;const l=function(){if(O)return O;if(j)return null;j=!0;try{const e=function(){try{const e=Reflect.get(globalThis,"process"),n="function"==typeof(null==e?void 0:e.getBuiltinModule)?e.getBuiltinModule("module"):null;return"function"==typeof(null==n?void 0:n.createRequire)?n.createRequire(import.meta.url):null}catch{return null}}();if(!e)return null;const n=e("katex");try{e("katex/contrib/mhchem")}catch{}return O=n,O}catch{return null}}();if(!l)return null;try{return l.renderToString(r,{displayMode:n,throwOnError:t})}catch{return null}}const R=g();function F(t,r,l){var o,i;const a=function(e){var n;return String(null!=(n=String(null!=e?e:"").split(/\s+/g)[0])?n:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}(r.language),d=String(null!=(i=null!=(o=r.code)?o:r.raw)?i:""),c=function(e){const n=I(String(null!=e?e:""));return n&&"plaintext"!==n?n.charAt(0).toUpperCase()+n.slice(1):"Text"}(r.language);/* @__PURE__ */
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{normalizeShikiLanguage as r}from"markstream-core";import l from"react";import{normalizeCustomHtmlTagName as o,NON_STRUCTURING_HTML_TAGS as i,isHtmlTagBlocked as a,sanitizeHtmlTokenAttrs as d,convertHtmlAttrsToProps as c,tokenAttrsToRecord as s,sanitizeImageSrc as u,sanitizeHtmlAttrs as m,shouldOpenLinkInNewTab as h,mergeCustomHtmlTags as p,getMarkdown as g,parseMarkdownToStructure as y,stripCustomHtmlWrapper as f,shouldRenderUnknownHtmlTagAsText as x}from"stream-markdown-parser";import{t as k,D as v,C as w,l as N,v as b,r as S,O as $,B,p as K,P as _,M as T,F as C,s as P,u as I,i as A,w as D,a as H,h as E,x as M,c as L,g as O}from"./codeBlockExtraProps-C_3No_qp.js";let W,j=!1;function q(e,n,t){const r=k(e);if(!r)return null;if(globalThis.__MARKSTREAM_REACT_DISABLE_SYNC_KATEX__)return null;const l=function(){if(W)return W;if(j)return null;j=!0;try{const e=function(){try{const e=Reflect.get(globalThis,"process"),n="function"==typeof(null==e?void 0:e.getBuiltinModule)?e.getBuiltinModule("module"):null;return"function"==typeof(null==n?void 0:n.createRequire)?n.createRequire(import.meta.url):null}catch{return null}}();if(!e)return null;const n=e("katex");try{e("katex/contrib/mhchem")}catch{}return W=n,W}catch{return null}}();if(!l)return null;try{return l.renderToString(r,{displayMode:n,throwOnError:t})}catch{return null}}const R=g();function F(t,r,l){var o,i;const a=function(e){var n;return String(null!=(n=String(null!=e?e:"").split(/\s+/g)[0])?n:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}(r.language),d=String(null!=(i=null!=(o=r.code)?o:r.raw)?i:""),c=function(e){const n=I(String(null!=e?e:""));return n&&"plaintext"!==n?n.charAt(0).toUpperCase()+n.slice(1):"Text"}(r.language);/* @__PURE__ */
2
2
  return e("div",{className:`${t} ${t}--ssr`,"data-ssr-fallback":l.fallback,children:[!1!==l.showHeader&&/* @__PURE__ */n("div",{className:`${t}__header`,children:/* @__PURE__ */n("span",{className:`${t}__language`,children:c})}),
3
- /* @__PURE__ */n("div",{className:`${t}__body`,children:/* @__PURE__ */n("pre",{className:`language-${a}`,"aria-busy":!0===r.loading,"aria-label":`Code block: ${a}`,"data-language":a,tabIndex:0,children:/* @__PURE__ */n("code",{translate:"no",children:d})})})]})}function z(e,n,t,r,o={}){var i,a,d,c,s,u;const m=A(r.codeBlockProps);return l.createElement(e,{key:t,node:n,loading:Boolean(n.loading),stream:r.codeBlockStream,customId:r.customId,isDark:r.isDark,darkTheme:null==(i=r.codeBlockThemes)?void 0:i.darkTheme,lightTheme:null==(a=r.codeBlockThemes)?void 0:a.lightTheme,themes:null==(d=r.codeBlockThemes)?void 0:d.themes,langs:null==(c=r.codeBlockThemes)?void 0:c.langs,minWidth:null==(s=r.codeBlockThemes)?void 0:s.minWidth,maxWidth:null==(u=r.codeBlockThemes)?void 0:u.maxWidth,onCopy:r.events.onCopy,...m,...o,ctx:r,renderNode:Ee,indexKey:t,typewriter:r.typewriter,fade:r.fade})}function U(e,n,t,r,o={}){return l.createElement(e,{key:t,node:n,isDark:r.isDark,...o})}function G(e){const{node:t,children:r}=e;/* @__PURE__ */
4
- return n("span",{className:"text-node whitespace-pre-wrap break-words"+(t.center?" text-node-center":""),children:null!=r?r:t.content})}function Q(e){var n;return"text"===(null==e?void 0:e.type)&&""===String(null!=(n=null==e?void 0:e.content)?n:"").trim()}function V(e,t,r,o){const i=e.filter(e=>!Q(e)),a=i.length>0&&i.every(e=>"image"===e.type||function(e){var n;const t=function(e){return"link"===(null==e?void 0:e.type)&&Array.isArray(null==e?void 0:e.children)?e.children.filter(e=>!Q(e)):[]}(e);return 1===t.length&&"image"===(null==(n=t[0])?void 0:n.type)}(e));if(!a||i.length<=1)return v(e,r,o,t);const d=[];for(let n=0;n<e.length;n++){const t=e[n];if(!Q(t)){d.push(t);continue}const r=d.length>0,l=e.slice(n+1).some(e=>!Q(e));r&&l&&d.push({...t,content:" ",raw:" "})}return d.map((e,i)=>{var d;return a&&Q(e)?/* @__PURE__ */n(l.Fragment,{children:String(null!=(d=null==e?void 0:e.content)?d:"")},`${o}-${i}`):t(e,`${o}-${i}`,r)})}function X(e){var r,o,i,a;const{node:d,ctx:c,renderNode:s,indexKey:u,children:m}=e;if(!c||!s)/* @__PURE__ */
3
+ /* @__PURE__ */n("div",{className:`${t}__body`,children:/* @__PURE__ */n("pre",{className:`language-${a}`,"aria-busy":!0===r.loading,"aria-label":`Code block: ${a}`,"data-language":a,tabIndex:0,children:/* @__PURE__ */n("code",{translate:"no",children:d})})})]})}function z(e,n,t,r,o={}){var i,a,d,c,s;const u=A(r.codeBlockProps);return l.createElement(e,{key:t,node:n,loading:Boolean(n.loading),stream:r.codeBlockStream,customId:r.customId,isDark:r.isDark,darkTheme:null==(i=r.codeBlockThemes)?void 0:i.darkTheme,lightTheme:null==(a=r.codeBlockThemes)?void 0:a.lightTheme,themes:null==(d=r.codeBlockThemes)?void 0:d.themes,minWidth:null==(c=r.codeBlockThemes)?void 0:c.minWidth,maxWidth:null==(s=r.codeBlockThemes)?void 0:s.maxWidth,onCopy:r.events.onCopy,...u,codeBlockOptions:r.codeBlockOptions,...o,ctx:r,renderNode:He,indexKey:t,typewriter:r.typewriter,fade:r.fade})}function U(e,n,t,r,o={}){return l.createElement(e,{key:t,node:n,isDark:r.isDark,...o})}function V(e){const{node:t,children:r}=e;/* @__PURE__ */
4
+ return n("span",{className:"text-node whitespace-pre-wrap break-words"+(t.center?" text-node-center":""),children:null!=r?r:t.content})}function X(e){var n;return"text"===(null==e?void 0:e.type)&&""===String(null!=(n=null==e?void 0:e.content)?n:"").trim()}function Y(e,t,r,o){const i=e.filter(e=>!X(e)),a=i.length>0&&i.every(e=>"image"===e.type||function(e){var n;const t=function(e){return"link"===(null==e?void 0:e.type)&&Array.isArray(null==e?void 0:e.children)?e.children.filter(e=>!X(e)):[]}(e);return 1===t.length&&"image"===(null==(n=t[0])?void 0:n.type)}(e));if(!a||i.length<=1)return v(e,r,o,t);const d=[];for(let n=0;n<e.length;n++){const t=e[n];if(!X(t)){d.push(t);continue}const r=d.length>0,l=e.slice(n+1).some(e=>!X(e));r&&l&&d.push({...t,content:" ",raw:" "})}return d.map((e,i)=>{var d;return a&&X(e)?/* @__PURE__ */n(l.Fragment,{children:String(null!=(d=null==e?void 0:e.content)?d:"")},`${o}-${i}`):t(e,`${o}-${i}`,r)})}function G(e){var r,o,i,a;const{node:d,ctx:c,renderNode:s,indexKey:u,children:m}=e;if(!c||!s)/* @__PURE__ */
5
5
  return n("p",{dir:"auto",className:"paragraph-node",children:m});const h=null!=(r=d.children)?r:[],p={...null!=(o=c.customComponents)?o:N(c.customId),...null!=(i=c.htmlComponents)?i:{},...null!=(a=c.streamingComponents)?a:{}},g=[],y=[],f=()=>{if(!y.length)return;const e=g.length;g.push(
6
- /* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:V(y.slice(),s,c,`${String(null!=u?u:"paragraph")}-${e}`)},`${String(null!=u?u:"paragraph")}-inline-${e}`)),y.length=0};return h.forEach((e,t)=>{var r;const o="escape"!==(null!=(r=c.htmlPolicy)?r:"safe")||"html_inline"!==e.type&&"html_block"!==e.type;K.has(e.type)||o&&_(e,p,c.customHtmlTags)?(f(),g.push(
7
- /* @__PURE__ */n(l.Fragment,{children:s(e,`${String(null!=u?u:"paragraph")}-block-${t}`,c)},`${String(null!=u?u:"paragraph")}-block-${t}`))):y.push(e)}),f(),g.length?/* @__PURE__ */n(t,{children:g}):/* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:V(h,s,c,String(null!=u?u:"paragraph"))})}function Y(e){const{node:t,ctx:r,renderNode:l,indexKey:o,children:i}=e,a=Math.min(6,Math.max(1,Number(t.level)||1)),d=`h${a}`,c=null==t?void 0:t.attrs,{class:s,className:u,style:m,...h}=null!=c?c:{},p=["heading-node","font-semibold",`heading-${a}`,s,u].filter(Boolean).join(" ");/* @__PURE__ */
8
- return n(d,{dir:"auto",className:p,..."object"==typeof m&&null!=m?{style:m}:{},...h,children:null!=i?i:r&&l?v(t.children,r,String(null!=o?o:`heading-${a}`),l):null})}function J(e){const{node:t,ctx:r,renderNode:l,indexKey:o,children:i}=e;/* @__PURE__ */
6
+ /* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:Y(y.slice(),s,c,`${String(null!=u?u:"paragraph")}-${e}`)},`${String(null!=u?u:"paragraph")}-inline-${e}`)),y.length=0};return h.forEach((e,t)=>{var r;const o="escape"!==(null!=(r=c.htmlPolicy)?r:"safe")||"html_inline"!==e.type&&"html_block"!==e.type;B.has(e.type)||o&&K(e,p,c.customHtmlTags)?(f(),g.push(
7
+ /* @__PURE__ */n(l.Fragment,{children:s(e,`${String(null!=u?u:"paragraph")}-block-${t}`,c)},`${String(null!=u?u:"paragraph")}-block-${t}`))):y.push(e)}),f(),g.length?/* @__PURE__ */n(t,{children:g}):/* @__PURE__ */n("p",{dir:"auto",className:"paragraph-node",children:Y(h,s,c,String(null!=u?u:"paragraph"))})}function J(e){const{node:t,ctx:r,renderNode:l,indexKey:o,children:i}=e,a=Math.min(6,Math.max(1,Number(t.level)||1)),d=`h${a}`,c=null==t?void 0:t.attrs,{class:s,className:u,style:m,...h}=null!=c?c:{},p=["heading-node","font-semibold",`heading-${a}`,s,u].filter(Boolean).join(" ");/* @__PURE__ */
8
+ return n(d,{dir:"auto",className:p,..."object"==typeof m&&null!=m?{style:m}:{},...h,children:null!=i?i:r&&l?v(t.children,r,String(null!=o?o:`heading-${a}`),l):null})}function Q(e){const{node:t,ctx:r,renderNode:l,indexKey:o,children:i}=e;/* @__PURE__ */
9
9
  return n("blockquote",{className:"blockquote-node",dir:"auto",cite:t.cite,children:null!=i?i:r&&l?v(t.children,r,String(null!=o?o:"blockquote"),l):null})}function Z(e){const{node:t,ctx:r,renderNode:l,value:o,indexKey:i,children:a}=e;/* @__PURE__ */
10
10
  return n("li",{className:"list-item pl-1.5 my-2",dir:"auto",value:null==o?void 0:o,children:null!=a?a:r&&l?v(t.children,r,String(null!=i?i:"list-item"),l):null})}function ee(e){var t;const{node:r,ctx:l,renderNode:o,indexKey:i}=e,a=r.ordered?"ol":"ul",d=r.ordered&&r.start?r.start:void 0,c=l&&N(l.customId).list_item||Z;/* @__PURE__ */
11
11
  return n(a,{className:r.ordered?"list-node my-5 pl-[calc(13/8*1em)] list-decimal":"list-node my-5 pl-[calc(13/8*1em)] list-disc max-lg:my-[calc(4/3*1em)] max-lg:pl-[calc(14/9*1em)]",start:d,children:null==(t=r.items)?void 0:t.map((e,t)=>{var a;/* @__PURE__ */
@@ -38,48 +38,50 @@ return n("sup",{className:"superscript-node",children:null!=r?r:l&&o?v(t.childre
38
38
  return n("br",{})}function fe(e){/* @__PURE__ */
39
39
  return n("hr",{className:"thematic-break-node"})}function xe(e){const{node:t,children:r}=e;/* @__PURE__ */
40
40
  return n("code",{className:"inline-code inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full",children:null!=r?r:t.code})}function ke(t){var r,l,o,i,a,d,c,s,u;const{node:p,ctx:g,renderNode:y,indexKey:f}=t,x=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",k=null!=(r=t.animationOpacity)?r:.35,w=Math.max(.12,Math.min(.5*k,k)),N={"--link-color":null!=(l=t.color)?l:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":x,"--underline-opacity":String(k),"--underline-rest-opacity":String(w),"--underline-duration":`${null!=(i=t.animationDuration)?i:1.6}s`,"--underline-timing":null!=(a=t.animationTiming)?a:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(d=t.animationIteration)?d:"infinite"},b=m({href:String(null!=(c=p.href)?c:"")}).href,S="string"==typeof p.title&&p.title.trim().length>0?p.title:String(null!=b?b:""),$=h(b);return p.loading?/* @__PURE__ */n("span",{className:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":"false",style:N,children:/* @__PURE__ */e("span",{className:"link-text-wrapper relative inline-flex",children:[
41
- /* @__PURE__ */n("span",{className:"leading-[normal] link-text",children:/* @__PURE__ */n(G,{node:{type:"text",content:String(null!=(s=p.text)?s:"")},ctx:g,indexKey:`${String(null!=f?f:"link")}-loading`,typewriter:t.typewriter})}),
42
- /* @__PURE__ */n("span",{className:"link-loading-indicator","aria-hidden":"true"})]})}):/* @__PURE__ */n("a",{className:"link-node",href:b||void 0,title:S,"aria-label":`Link: ${S}`,target:$?"_blank":void 0,rel:$?"noopener noreferrer":void 0,style:N,children:g&&y?v(p.children,g,String(null!=f?f:"link"),y):/* @__PURE__ */n(G,{node:{type:"text",content:String(null!=(u=p.text)?u:"")},ctx:g,indexKey:`${String(null!=f?f:"link")}-fallback`,typewriter:t.typewriter})})}function ve(e){var t,r,l,o,i;const a=e,d=u(a.node.src)||u(a.fallbackSrc);return d?/* @__PURE__ */n("img",{src:d,alt:String(null!=(r=null!=(t=a.node.alt)?t:a.node.title)?r:""),title:String(null!=(o=null!=(l=a.node.title)?l:a.node.alt)?o:""),className:"image-node__img is-loaded",loading:!1===a.lazy?"eager":"lazy",decoding:"async",tabIndex:0,"aria-label":null!=(i=a.node.alt)?i:"Preview image"}):null}function we(e){/* @__PURE__ */
43
- return n(B,{...e})}function Ne(e){return F("code-block-node",e.node,{showHeader:e.showHeader,fallback:"code-block"})}function be(e){return F("markdown-code-block-node",e.node,{showHeader:e.showHeader,fallback:"markdown-code-block"})}function Se(e){return F("mermaid-block-node",e.node,{showHeader:e.showHeader,fallback:"mermaid"})}function $e(e){return F("d2-block-node",e.node,{showHeader:e.showHeader,fallback:"d2"})}function Ke(e){return F("infographic-block-node",e.node,{showHeader:e.showHeader,fallback:"infographic"})}function _e({node:e}){var t,r,l;const o=q(String(null!=(t=e.content)?t:""),!0,Boolean(e.loading));/* @__PURE__ */
44
- return n("div",o?{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{dangerouslySetInnerHTML:{__html:o}})}:{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function Be({node:e}){var t,r,l;const o="$$"===e.markup,i=q(String(null!=(t=e.content)?t:""),o,Boolean(e.loading));/* @__PURE__ */
45
- return n("span",i?{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",dangerouslySetInnerHTML:{__html:i}})}:{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function Te(e){const{node:t}=e;/* @__PURE__ */
46
- return n("span",{className:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabIndex:0,"data-reference-id":t.id,children:t.id})}function Ce(e){var r,u,m,h,p,g,y,f,x,k,w,S,$,K,_,B,C,I,A,D,H,E,M,L,W,O,j;const q=String(null!=(u=null==(r=e.node)?void 0:r.tag)?u:"").trim().toLowerCase(),R=o(q),F=Array.isArray(null==(m=e.node)?void 0:m.children)?e.node.children:[],z=R?null==(p=null==(h=e.ctx)?void 0:h.htmlComponents)?void 0:p[R]:void 0;if(F.length>0&&q&&!i.has(q)&&!a(q,null!=(y=null==(g=e.ctx)?void 0:g.htmlPolicy)?y:"safe")&&e.ctx&&e.renderNode){const n=v(F,e.ctx,`${String(null!=(f=e.indexKey)?f:"html-block")}-structured`,e.renderNode);if(z){const t=d(null!=(k=null==(x=e.node)?void 0:x.attrs)?k:null,null!=(S=null==(w=e.ctx)?void 0:w.htmlPolicy)?S:"safe",R);return l.createElement(z,c(s(t)),n)}return l.createElement(q,function(e,n="safe",t){const r={...P(T(d(null!=e?e:void 0,n,t))||{})},l="string"==typeof r.className?r.className.trim():"";return r.className=l?`html-block-node ${l}`:"html-block-node",r}(null!=(K=null==($=e.node)?void 0:$.attrs)?K:null,null!=(B=null==(_=e.ctx)?void 0:_.htmlPolicy)?B:"safe",q),n)}const U={...null!=(I=null==(C=e.ctx)?void 0:C.customComponents)?I:N(e.customId),...null!=(D=null==(A=e.ctx)?void 0:A.htmlComponents)?D:{}},G=b(String(null!=(H=e.node.content)?H:""),U,null!=(M=null==(E=e.ctx)?void 0:E.htmlPolicy)?M:"safe",{ctx:e.ctx,keyPrefix:String(null!=(L=e.indexKey)?L:"html-block"),nodeComponents:null==(W=e.ctx)?void 0:W.streamingComponents,propComponents:null==(O=e.ctx)?void 0:O.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});/* @__PURE__ */
47
- return n(t,null==G?{children:String(null!=(j=e.node.content)?j:"")}:{children:G})}function Pe(e){var r,i,u,m,h,p,g,y,f,x,k,w,S,$,K,_,B,T,C;const P=null!=(i=null==(r=e.ctx)?void 0:r.htmlPolicy)?i:"safe",I=String(null!=(m=null==(u=e.node)?void 0:u.tag)?m:"").trim().toLowerCase(),A=o(I),D=Array.isArray(null==(h=e.node)?void 0:h.children)?e.node.children:[],H=A?null==(g=null==(p=e.ctx)?void 0:p.htmlComponents)?void 0:g[A]:void 0;if(D.length>0&&I&&"escape"!==P&&!a(I,P)&&e.ctx&&e.renderNode&&H){const n=v(D,e.ctx,`${String(null!=(y=e.indexKey)?y:"html-inline")}-structured`,e.renderNode),t=d(null!=(x=null==(f=e.node)?void 0:f.attrs)?x:null,P,A);return l.createElement(H,c(s(t)),n)}const E={...null!=(w=null==(k=e.ctx)?void 0:k.customComponents)?w:N(e.customId),...null!=($=null==(S=e.ctx)?void 0:S.htmlComponents)?$:{}},M=b(String(null!=(K=e.node.content)?K:""),E,P,{ctx:e.ctx,keyPrefix:String(null!=(_=e.indexKey)?_:"html-inline"),nodeComponents:null==(B=e.ctx)?void 0:B.streamingComponents,propComponents:null==(T=e.ctx)?void 0:T.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});/* @__PURE__ */
48
- return n(t,null==M?{children:String(null!=(C=e.node.content)?C:"")}:{children:M})}function Ie(e){const{node:t,ctx:r,renderNode:o,indexKey:i}=e,a=t.attrs?Array.isArray(t.attrs)?T(t.attrs):t.attrs:void 0;/* @__PURE__ */
49
- return n("div",{className:`vmr-container vmr-container-${t.name}`,...a,children:r&&o&&Array.isArray(t.children)?t.children.map((e,t)=>/* @__PURE__ */n(l.Fragment,{children:o(e,`${String(null!=i?i:"vmr-container")}-${t}`,r)},`${String(null!=i?i:"vmr-container")}-${t}`)):null})}function Ae(e){return null}function De(e){return null}function He(n){const{node:t}=n;/* @__PURE__ */
50
- return e("div",{className:"unknown-node text-sm text-gray-500 italic",children:["Unsupported node type:"," ",String(null==t?void 0:t.type)]})}function Ee(e,t,i){var a,u,m,h,p,g,y,k,w;const b=null!=(a=i.customComponents)?a:N(i.customId),S=null!=(u=i.streamingComponents)?u:{},$=null!=(m=i.htmlComponents)?m:{},K=function(e){if("html_block"===e.type||"html_inline"===e.type)return"";const n=o(e.type),t=o(e.tag);return n&&t&&n===t?n:""}(e),_=K?S[K]:null,B=K&&!_?$[K]:null,T="code_block"===e.type?null:b[e.type];if(_)return l.createElement(_,{key:t,node:e,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade});if(B)return function(e,n,t,r,o){var i,a,u;const m=d(null!=(i=n.attrs)?i:void 0,null!=(a=r.htmlPolicy)?a:"safe",o),h=c(s(m)),p=Array.isArray(n.children)?v(n.children,r,`${String(t)}-html`,Ee):null!=(u=n.content)?u:null;return l.createElement(e,{...h,key:t},p)}(B,e,t,i,K);if(T)return l.createElement(T,{key:t,node:e,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade});if("html_block"===e.type||"html_inline"===e.type){const r={...b,...S},o=C(e,r,i.customHtmlTags),a=null!=(h=null==o?void 0:o.tag)?h:"",d=null!=(p=null==o?void 0:o.isWhitelisted)&&p,c=null!=(g=null==o?void 0:o.component)?g:null;if(d&&c){const n={...e,type:a,tag:a,content:f(e.content,a)};return l.createElement(c,{key:t,node:n,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade})}const s=String(null!=(k=null!=(y=e.content)?y:e.raw)?k:"");if(!d&&x(s,a))return"html_inline"===e.type?/* @__PURE__ */n(G,{node:{type:"text",content:s,raw:s},ctx:i,indexKey:t,typewriter:i.typewriter},t):/* @__PURE__ */n(X,{node:{type:"paragraph",children:[{type:"text",content:s,raw:s}],raw:s},ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t)}switch(e.type){case"text":/* @__PURE__ */
51
- return n(G,{node:e,ctx:i,indexKey:t,typewriter:i.typewriter},t);case"text_special":/* @__PURE__ */
52
- return n(G,{node:{type:"text",content:null!=(w=e.content)?w:"",center:e.center},ctx:i,indexKey:t,typewriter:i.typewriter},t);case"paragraph":/* @__PURE__ */
53
- return n(X,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"heading":/* @__PURE__ */
54
- return n(Y,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"blockquote":/* @__PURE__ */
55
- return n(J,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"list":/* @__PURE__ */
56
- return n(ee,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"list_item":/* @__PURE__ */
57
- return n(Z,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"table":/* @__PURE__ */
58
- return n(ne,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"definition_list":/* @__PURE__ */
59
- return n(te,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"footnote":/* @__PURE__ */
60
- return n(re,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"footnote_reference":/* @__PURE__ */
41
+ /* @__PURE__ */n("span",{className:"leading-[normal] link-text",children:/* @__PURE__ */n(V,{node:{type:"text",content:String(null!=(s=p.text)?s:"")},ctx:g,indexKey:`${String(null!=f?f:"link")}-loading`,typewriter:t.typewriter})}),
42
+ /* @__PURE__ */n("span",{className:"link-loading-indicator","aria-hidden":"true"})]})}):/* @__PURE__ */n("a",{className:"link-node",href:b||void 0,title:S,"aria-label":`Link: ${S}`,target:$?"_blank":void 0,rel:$?"noopener noreferrer":void 0,style:N,children:g&&y?v(p.children,g,String(null!=f?f:"link"),y):/* @__PURE__ */n(V,{node:{type:"text",content:String(null!=(u=p.text)?u:"")},ctx:g,indexKey:`${String(null!=f?f:"link")}-fallback`,typewriter:t.typewriter})})}function ve(e){var t,r,l,o,i;const a=e,d=u(a.node.src)||u(a.fallbackSrc);return d?/* @__PURE__ */n("img",{src:d,alt:String(null!=(r=null!=(t=a.node.alt)?t:a.node.title)?r:""),title:String(null!=(o=null!=(l=a.node.title)?l:a.node.alt)?o:""),className:"image-node__img is-loaded",loading:!1===a.lazy?"eager":"lazy",decoding:"async",tabIndex:0,"aria-label":null!=(i=a.node.alt)?i:"Preview image"}):null}function we(e){/* @__PURE__ */
43
+ return n(_,{...e})}function Ne(e){return F("code-block-node",e.node,{showHeader:e.showHeader,fallback:"code-block"})}function be(e){return F("mermaid-block-node",e.node,{showHeader:e.showHeader,fallback:"mermaid"})}function Se(e){return F("d2-block-node",e.node,{showHeader:e.showHeader,fallback:"d2"})}function $e(e){return F("infographic-block-node",e.node,{showHeader:e.showHeader,fallback:"infographic"})}function Be({node:e}){var t,r,l;const o=q(String(null!=(t=e.content)?t:""),!0,Boolean(e.loading));/* @__PURE__ */
44
+ return n("div",o?{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{dangerouslySetInnerHTML:{__html:o}})}:{className:"math-block text-center overflow-x-auto relative min-h-[40px]",children:/* @__PURE__ */n("div",{children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function Ke({node:e}){var t,r,l;const o="$$"===e.markup,i=q(String(null!=(t=e.content)?t:""),o,Boolean(e.loading));/* @__PURE__ */
45
+ return n("span",i?{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",dangerouslySetInnerHTML:{__html:i}})}:{className:"math-inline-wrapper",children:/* @__PURE__ */n("span",{className:"math-inline",children:String(null!=(l=null!=(r=e.raw)?r:e.content)?l:"")})})}function _e(e){const{node:t}=e;/* @__PURE__ */
46
+ return n("span",{className:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabIndex:0,"data-reference-id":t.id,children:t.id})}function Te(e){var r,u,m,h,p,g,y,f,x,k,w,S,$,B,K,_,C,I,A,D,H,E,M,L,O,W,j;const q=String(null!=(u=null==(r=e.node)?void 0:r.tag)?u:"").trim().toLowerCase(),R=o(q),F=Array.isArray(null==(m=e.node)?void 0:m.children)?e.node.children:[],z=R?null==(p=null==(h=e.ctx)?void 0:h.htmlComponents)?void 0:p[R]:void 0;if(F.length>0&&q&&!i.has(q)&&!a(q,null!=(y=null==(g=e.ctx)?void 0:g.htmlPolicy)?y:"safe")&&e.ctx&&e.renderNode){const n=v(F,e.ctx,`${String(null!=(f=e.indexKey)?f:"html-block")}-structured`,e.renderNode);if(z){const t=d(null!=(k=null==(x=e.node)?void 0:x.attrs)?k:null,null!=(S=null==(w=e.ctx)?void 0:w.htmlPolicy)?S:"safe",R);return l.createElement(z,c(s(t)),n)}return l.createElement(q,function(e,n="safe",t){const r={...P(T(d(null!=e?e:void 0,n,t))||{})},l="string"==typeof r.className?r.className.trim():"";return r.className=l?`html-block-node ${l}`:"html-block-node",r}(null!=(B=null==($=e.node)?void 0:$.attrs)?B:null,null!=(_=null==(K=e.ctx)?void 0:K.htmlPolicy)?_:"safe",q),n)}const U={...null!=(I=null==(C=e.ctx)?void 0:C.customComponents)?I:N(e.customId),...null!=(D=null==(A=e.ctx)?void 0:A.htmlComponents)?D:{}},V=b(String(null!=(H=e.node.content)?H:""),U,null!=(M=null==(E=e.ctx)?void 0:E.htmlPolicy)?M:"safe",{ctx:e.ctx,keyPrefix:String(null!=(L=e.indexKey)?L:"html-block"),nodeComponents:null==(O=e.ctx)?void 0:O.streamingComponents,propComponents:null==(W=e.ctx)?void 0:W.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});/* @__PURE__ */
47
+ return n(t,null==V?{children:String(null!=(j=e.node.content)?j:"")}:{children:V})}function Ce(e){var r,i,u,m,h,p,g,y,f,x,k,w,S,$,B,K,_,T,C;const P=null!=(i=null==(r=e.ctx)?void 0:r.htmlPolicy)?i:"safe",I=String(null!=(m=null==(u=e.node)?void 0:u.tag)?m:"").trim().toLowerCase(),A=o(I),D=Array.isArray(null==(h=e.node)?void 0:h.children)?e.node.children:[],H=A?null==(g=null==(p=e.ctx)?void 0:p.htmlComponents)?void 0:g[A]:void 0;if(D.length>0&&I&&"escape"!==P&&!a(I,P)&&e.ctx&&e.renderNode&&H){const n=v(D,e.ctx,`${String(null!=(y=e.indexKey)?y:"html-inline")}-structured`,e.renderNode),t=d(null!=(x=null==(f=e.node)?void 0:f.attrs)?x:null,P,A);return l.createElement(H,c(s(t)),n)}const E={...null!=(w=null==(k=e.ctx)?void 0:k.customComponents)?w:N(e.customId),...null!=($=null==(S=e.ctx)?void 0:S.htmlComponents)?$:{}},M=b(String(null!=(B=e.node.content)?B:""),E,P,{ctx:e.ctx,keyPrefix:String(null!=(K=e.indexKey)?K:"html-inline"),nodeComponents:null==(_=e.ctx)?void 0:_.streamingComponents,propComponents:null==(T=e.ctx)?void 0:T.htmlComponents,renderNode:e.renderNode,sourceNode:e.node});/* @__PURE__ */
48
+ return n(t,null==M?{children:String(null!=(C=e.node.content)?C:"")}:{children:M})}function Pe(e){const{node:t,ctx:r,renderNode:o,indexKey:i}=e,a=t.attrs?Array.isArray(t.attrs)?T(t.attrs):t.attrs:void 0;/* @__PURE__ */
49
+ return n("div",{className:`vmr-container vmr-container-${t.name}`,...a,children:r&&o&&Array.isArray(t.children)?t.children.map((e,t)=>/* @__PURE__ */n(l.Fragment,{children:o(e,`${String(null!=i?i:"vmr-container")}-${t}`,r)},`${String(null!=i?i:"vmr-container")}-${t}`)):null})}function Ie(e){return null}function Ae(e){return null}function De(n){const{node:t}=n;/* @__PURE__ */
50
+ return e("div",{className:"unknown-node text-sm text-gray-500 italic",children:["Unsupported node type:"," ",String(null==t?void 0:t.type)]})}function He(e,t,i){var a,u,m,h,p,g,y,k,w;const b=null!=(a=i.customComponents)?a:N(i.customId),S=null!=(u=i.streamingComponents)?u:{},$=null!=(m=i.htmlComponents)?m:{},B=function(e){if("html_block"===e.type||"html_inline"===e.type)return"";const n=o(e.type),t=o(e.tag);return n&&t&&n===t?n:""}(e),K=B?S[B]:null,_=B&&!K?$[B]:null,T="code_block"===e.type?null:b[e.type];if(K)return l.createElement(K,{key:t,node:e,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter,fade:i.fade});if(_)return function(e,n,t,r,o){var i,a,u;const m=d(null!=(i=n.attrs)?i:void 0,null!=(a=r.htmlPolicy)?a:"safe",o),h=c(s(m)),p=Array.isArray(n.children)?v(n.children,r,`${String(t)}-html`,He):null!=(u=n.content)?u:null;return l.createElement(e,{...h,key:t},p)}(_,e,t,i,B);if(T)return l.createElement(T,{key:t,node:e,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter,fade:i.fade});if("html_block"===e.type||"html_inline"===e.type){const r={...b,...S},o=C(e,r,i.customHtmlTags),a=null!=(h=null==o?void 0:o.tag)?h:"",d=null!=(p=null==o?void 0:o.isWhitelisted)&&p,c=null!=(g=null==o?void 0:o.component)?g:null;if(d&&c){const n={...e,type:a,tag:a,content:f(e.content,a)};return l.createElement(c,{key:t,node:n,customId:i.customId,isDark:i.isDark,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter,fade:i.fade})}const s=String(null!=(k=null!=(y=e.content)?y:e.raw)?k:"");if(!d&&x(s,a))return"html_inline"===e.type?/* @__PURE__ */n(V,{node:{type:"text",content:s,raw:s},ctx:i,indexKey:t,typewriter:i.typewriter},t):/* @__PURE__ */n(G,{node:{type:"paragraph",children:[{type:"text",content:s,raw:s}],raw:s},ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t)}switch(e.type){case"text":/* @__PURE__ */
51
+ return n(V,{node:e,ctx:i,indexKey:t,typewriter:i.typewriter},t);case"text_special":/* @__PURE__ */
52
+ return n(V,{node:{type:"text",content:null!=(w=e.content)?w:"",center:e.center},ctx:i,indexKey:t,typewriter:i.typewriter},t);case"paragraph":/* @__PURE__ */
53
+ return n(G,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"heading":/* @__PURE__ */
54
+ return n(J,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"blockquote":/* @__PURE__ */
55
+ return n(Q,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"list":/* @__PURE__ */
56
+ return n(ee,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"list_item":/* @__PURE__ */
57
+ return n(Z,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"table":/* @__PURE__ */
58
+ return n(ne,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"definition_list":/* @__PURE__ */
59
+ return n(te,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"footnote":/* @__PURE__ */
60
+ return n(re,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"footnote_reference":/* @__PURE__ */
61
61
  return n(le,{node:e},t);case"footnote_anchor":/* @__PURE__ */
62
62
  return n(oe,{node:e},t);case"admonition":/* @__PURE__ */
63
- return n(ie,{node:e,ctx:i,renderNode:Ee,indexKey:t,isDark:i.isDark,typewriter:i.typewriter},t);case"hardbreak":/* @__PURE__ */
63
+ return n(ie,{node:e,ctx:i,renderNode:He,indexKey:t,isDark:i.isDark,typewriter:i.typewriter},t);case"hardbreak":/* @__PURE__ */
64
64
  return n(ye,{node:e,typewriter:i.typewriter},t);case"link":/* @__PURE__ */
65
- return n(ke,{node:e,ctx:i,renderNode:Ee,indexKey:t,isDark:i.isDark,showTooltip:"boolean"==typeof i.showTooltips?i.showTooltips:void 0,typewriter:i.typewriter},t);case"image":/* @__PURE__ */
65
+ return n(ke,{node:e,ctx:i,renderNode:He,indexKey:t,isDark:i.isDark,showTooltip:"boolean"==typeof i.showTooltips?i.showTooltips:void 0,typewriter:i.typewriter},t);case"image":/* @__PURE__ */
66
66
  return n(ve,{node:e},t);case"inline_code":/* @__PURE__ */
67
- return n(xe,{node:e,ctx:i,indexKey:t,typewriter:i.typewriter},t);case"code_block":return function(e,t,l,o){var i,a,d,c,s,u,m;const h=String((null==e?void 0:e.language)||"").trim(),p=h?String(null!=(i=h.split(/\s+/)[0])?i:"").split(":")[0].toLowerCase():"",g=I(p),y=function(e,n){const t=n.trim().toLowerCase();if(!t)return null;for(const l of[t,I(t),r(t)]){const n=l&&e[l];if(n)return n}return null}(o,p);if("mermaid"===g){const r=function(e,n){var t,r;const l={...n.mermaidProps||{}};return null==D(l.estimatedPreviewHeightPx)&&(l.estimatedPreviewHeightPx=H(E(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===l.maxHeight?null:null!=(r=D(l.maxHeight))?r:void 0)),l}(e,l),i=y||o.mermaid;return i?U(i,e,t,l,r):/* @__PURE__ */n(Se,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...r},t)}if("infographic"===g){const r=function(e,n){var t,r;const l={...n.infographicProps||{}};return null==M(l.estimatedPreviewHeightPx)&&(l.estimatedPreviewHeightPx=L(W(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===l.maxHeight?null:null!=(r=M(l.maxHeight))?r:void 0)),l}(e,l),i=y||o.infographic;return i?U(i,e,t,l,r):/* @__PURE__ */n(Ke,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...r},t)}if("d2"===g||"d2lang"===g){const r=y||o.d2;return r?U(r,e,t,l,l.d2Props||{}):/* @__PURE__ */n($e,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...l.d2Props||{}},t)}if(y)return z(y,e,t,l);const f=o.code_block;return f?z(f,e,t,l):l.renderCodeBlocksAsPre?/* @__PURE__ */n(we,{node:e,monacoOptions:null==(a=l.codeBlockThemes)?void 0:a.monacoOptions,showLineNumbers:!0===(null==(d=l.codeBlockProps)?void 0:d.showLineNumbers)},t):/* @__PURE__ */n(Ne,{node:e,loading:Boolean(e.loading),stream:l.codeBlockStream,monacoOptions:null==(c=l.codeBlockThemes)?void 0:c.monacoOptions,themes:null==(s=l.codeBlockThemes)?void 0:s.themes,minWidth:null==(u=l.codeBlockThemes)?void 0:u.minWidth,maxWidth:null==(m=l.codeBlockThemes)?void 0:m.maxWidth,isDark:l.isDark,...A(l.codeBlockProps,{omit:["langs"]})},t)}(e,t,i,b);case"strong":/* @__PURE__ */
68
- return n(ce,{node:e,children:v(e.children,i,`${String(t)}-strong`,Ee)},t);case"emphasis":/* @__PURE__ */
69
- return n(se,{node:e,children:v(e.children,i,`${String(t)}-em`,Ee)},t);case"strikethrough":/* @__PURE__ */
70
- return n(ue,{node:e,children:v(e.children,i,`${String(t)}-strike`,Ee)},t);case"highlight":/* @__PURE__ */
71
- return n(me,{node:e,children:v(e.children,i,`${String(t)}-highlight`,Ee)},t);case"insert":/* @__PURE__ */
72
- return n(he,{node:e,children:v(e.children,i,`${String(t)}-insert`,Ee)},t);case"subscript":/* @__PURE__ */
73
- return n(pe,{node:e,children:v(e.children,i,`${String(t)}-sub`,Ee)},t);case"superscript":/* @__PURE__ */
74
- return n(ge,{node:e,children:v(e.children,i,`${String(t)}-sup`,Ee)},t);case"checkbox":case"checkbox_input":/* @__PURE__ */
67
+ return n(xe,{node:e,ctx:i,indexKey:t,typewriter:i.typewriter},t);case"code_block":return function(e,t,l,o){var i,a,d,c,s,u,m,h,p;const g=String((null==e?void 0:e.language)||"").trim(),y=g?String(null!=(i=g.split(/\s+/)[0])?i:"").split(":")[0].toLowerCase():"",f=I(y),x=function(e,n){const t=n.trim().toLowerCase();if(!t)return null;for(const l of[t,I(t),r(t)]){const n=l&&e[l];if(n)return n}return null}(o,y);if("mermaid"===f){const r=function(e,n){var t,r;const l={...n.mermaidProps||{}};return null==D(l.estimatedPreviewHeightPx)&&(l.estimatedPreviewHeightPx=H(E(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===l.maxHeight?null:null!=(r=D(l.maxHeight))?r:void 0)),l}(e,l),i=x||o.mermaid;return i?U(i,e,t,l,r):/* @__PURE__ */n(be,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...r},t)}if("infographic"===f){const r=function(e,n){var t,r;const l={...n.infographicProps||{}};return null==M(l.estimatedPreviewHeightPx)&&(l.estimatedPreviewHeightPx=L(O(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===l.maxHeight?null:null!=(r=M(l.maxHeight))?r:void 0)),l}(e,l),i=x||o.infographic;return i?U(i,e,t,l,r):/* @__PURE__ */n($e,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...r},t)}if("d2"===f||"d2lang"===f){const r=x||o.d2;return r?U(r,e,t,l,l.d2Props||{}):/* @__PURE__ */n(Se,{node:e,isDark:l.isDark,loading:Boolean(e.loading),...l.d2Props||{}},t)}if(x)return z(x,e,t,l);const k=o.code_block;if(k)return z(k,e,t,l);if(l.renderCodeBlocksAsPre){const r=null==(a=l.codeBlockProps)?void 0:a.showLineNumbers,o=null==(d=l.codeBlockOptions)?void 0:d.disableLineNumbers,i=null==(c=l.codeBlockOptions)?void 0:c.overflow;/* @__PURE__ */
68
+ return n(we,{node:e,style:i?{whiteSpace:"scroll"===i?"pre":"pre-wrap"}:void 0,showLineNumbers:"boolean"==typeof r?r:"boolean"==typeof o&&!o},t)}/* @__PURE__ */
69
+ return n(Ne,{node:e,loading:Boolean(e.loading),stream:l.codeBlockStream,themes:null==(s=l.codeBlockThemes)?void 0:s.themes,darkTheme:null==(u=l.codeBlockThemes)?void 0:u.darkTheme,lightTheme:null==(m=l.codeBlockThemes)?void 0:m.lightTheme,minWidth:null==(h=l.codeBlockThemes)?void 0:h.minWidth,maxWidth:null==(p=l.codeBlockThemes)?void 0:p.maxWidth,isDark:l.isDark,...A(l.codeBlockProps),codeBlockOptions:l.codeBlockOptions},t)}(e,t,i,b);case"strong":/* @__PURE__ */
70
+ return n(ce,{node:e,children:v(e.children,i,`${String(t)}-strong`,He)},t);case"emphasis":/* @__PURE__ */
71
+ return n(se,{node:e,children:v(e.children,i,`${String(t)}-em`,He)},t);case"strikethrough":/* @__PURE__ */
72
+ return n(ue,{node:e,children:v(e.children,i,`${String(t)}-strike`,He)},t);case"highlight":/* @__PURE__ */
73
+ return n(me,{node:e,children:v(e.children,i,`${String(t)}-highlight`,He)},t);case"insert":/* @__PURE__ */
74
+ return n(he,{node:e,children:v(e.children,i,`${String(t)}-insert`,He)},t);case"subscript":/* @__PURE__ */
75
+ return n(pe,{node:e,children:v(e.children,i,`${String(t)}-sub`,He)},t);case"superscript":/* @__PURE__ */
76
+ return n(ge,{node:e,children:v(e.children,i,`${String(t)}-sup`,He)},t);case"checkbox":case"checkbox_input":/* @__PURE__ */
75
77
  return n(ae,{node:e,typewriter:i.typewriter},t);case"emoji":/* @__PURE__ */
76
78
  return n(de,{node:e,typewriter:i.typewriter},t);case"thematic_break":/* @__PURE__ */
77
79
  return n(fe,{node:e},t);case"math_inline":/* @__PURE__ */
78
- return n(Be,{node:e},t);case"math_block":/* @__PURE__ */
79
- return n(_e,{node:e},t);case"reference":/* @__PURE__ */
80
- return n(Te,{node:e,ctx:i,typewriter:i.typewriter},t);case"html_block":/* @__PURE__ */
81
- return n(Ce,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade,customId:i.customId},t);case"html_inline":/* @__PURE__ */
82
- return n(Pe,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter,fade:i.fade,customId:i.customId},t);case"vmr_container":/* @__PURE__ */
83
- return n(Ie,{node:e,ctx:i,renderNode:Ee,indexKey:t,typewriter:i.typewriter},t);case"label_open":case"label_close":return null;default:/* @__PURE__ */
84
- return n(He,{node:e},t)}}function Me(e){var t,r,l;const o=N(e.customId),i=S(e.streamingComponents),a=S(e.htmlComponents);$(i,a,/* @__PURE__ */new Set);const d=null!=(t=e.parseOptions)?t:{},c=null!=(r=d.customHtmlTags)?r:[],s=p(e.customHtmlTags,Array.isArray(c)?c:[],Object.keys(i)),u=e.customId?`server-renderer-${e.customId}`:"server-renderer",m=s.length>0?g(u,{customHtmlTags:s}):g(u),h=e.customMarkdownIt?e.customMarkdownIt(m):m,f=null!=(l=e.final)?l:d.final,x=null==f&&0===s.length?d:{...d,...null!=f?{final:f}:{},...s.length>0?{customHtmlTags:s}:{}},k=Array.isArray(e.nodes)&&e.nodes.length?e.nodes.map(e=>({...e})):e.content?y(e.content,null!=h?h:R,x):[],v=null!=e.indexKey?String(e.indexKey):"markdown-renderer",w=function(e,n,t,r,l,o,i){var a;return{customId:e.customId,final:i,customComponents:n,customHtmlTags:o,htmlPolicy:null!=(a=e.htmlPolicy)?a:"safe",isDark:e.isDark,indexKey:l,typewriter:e.typewriter,fade:e.fade,showTooltips:e.showTooltips,streamingComponents:t,htmlComponents:r,renderCodeBlocksAsPre:e.renderCodeBlocksAsPre,codeBlockStream:e.codeBlockStream,codeBlockProps:{..."boolean"==typeof e.showTooltips?{showTooltips:e.showTooltips}:{},...e.codeBlockProps||{}},mermaidProps:{...e.mermaidProps||{}},d2Props:{...e.d2Props||{}},infographicProps:{...e.infographicProps||{}},codeBlockThemes:{themes:e.themes,langs:e.langs,darkTheme:e.codeBlockDarkTheme,lightTheme:e.codeBlockLightTheme,monacoOptions:e.codeBlockMonacoOptions,minWidth:e.codeBlockMinWidth,maxWidth:e.codeBlockMaxWidth},events:{onCopy:e.onCopy,onHandleArtifactClick:e.onHandleArtifactClick}}}(e,o,i,a,v,s,f);/* @__PURE__ */
85
- return n("div",{className:"markstream-react markdown-renderer"+(e.isDark?" dark":""),"data-custom-id":e.customId,children:k.map((e,t)=>/* @__PURE__ */n("div",{className:"node-slot","data-node-index":t,"data-node-type":e.type,children:/* @__PURE__ */n("div",{className:"node-content",children:Ee(e,`${v}-${t}`,w)})},`${v}-${t}`))})}export{ie as A,J as B,ae as C,$e as D,de as E,He as F,Ee as G,ye as H,ve as I,ke as L,be as M,Me as N,X as P,Te as R,ue as S,ne as T,Ie as V,Ne as a,te as b,se as c,oe as d,re as e,le as f,Y as g,me as h,Ce as i,Pe as j,De as k,Ke as l,xe as m,he as n,Z as o,ee as p,_e as q,Be as r,Se as s,we as t,ce as u,pe as v,ge as w,G as x,fe as y,Ae as z};
80
+ return n(Ke,{node:e},t);case"math_block":/* @__PURE__ */
81
+ return n(Be,{node:e},t);case"reference":/* @__PURE__ */
82
+ return n(_e,{node:e,ctx:i,typewriter:i.typewriter},t);case"html_block":/* @__PURE__ */
83
+ return n(Te,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter,fade:i.fade,customId:i.customId},t);case"html_inline":/* @__PURE__ */
84
+ return n(Ce,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter,fade:i.fade,customId:i.customId},t);case"vmr_container":/* @__PURE__ */
85
+ return n(Pe,{node:e,ctx:i,renderNode:He,indexKey:t,typewriter:i.typewriter},t);case"label_open":case"label_close":return null;default:/* @__PURE__ */
86
+ return n(De,{node:e},t)}}function Ee(e){var t,r,l;const o=N(e.customId),i=S(e.streamingComponents),a=S(e.htmlComponents);$(i,a,/* @__PURE__ */new Set);const d=null!=(t=e.parseOptions)?t:{},c=null!=(r=d.customHtmlTags)?r:[],s=p(e.customHtmlTags,Array.isArray(c)?c:[],Object.keys(i)),u=e.customId?`server-renderer-${e.customId}`:"server-renderer",m=s.length>0?g(u,{customHtmlTags:s}):g(u),h=e.customMarkdownIt?e.customMarkdownIt(m):m,f=null!=(l=e.final)?l:d.final,x=null==f&&0===s.length?d:{...d,...null!=f?{final:f}:{},...s.length>0?{customHtmlTags:s}:{}},k=Array.isArray(e.nodes)&&e.nodes.length?e.nodes.map(e=>({...e})):e.content?y(e.content,null!=h?h:R,x):[],v=null!=e.indexKey?String(e.indexKey):"markdown-renderer",w=function(e,n,t,r,l,o,i){var a;return{customId:e.customId,final:i,customComponents:n,customHtmlTags:o,htmlPolicy:null!=(a=e.htmlPolicy)?a:"safe",isDark:e.isDark,indexKey:l,typewriter:e.typewriter,fade:e.fade,showTooltips:e.showTooltips,streamingComponents:t,htmlComponents:r,renderCodeBlocksAsPre:e.renderCodeBlocksAsPre,codeBlockStream:e.codeBlockStream,codeBlockOptions:e.codeBlockOptions,codeBlockProps:{..."boolean"==typeof e.showTooltips?{showTooltips:e.showTooltips}:{},...e.codeBlockProps||{}},mermaidProps:{...e.mermaidProps||{}},d2Props:{...e.d2Props||{}},infographicProps:{...e.infographicProps||{}},codeBlockThemes:{themes:e.themes,darkTheme:e.codeBlockDarkTheme,lightTheme:e.codeBlockLightTheme,minWidth:e.codeBlockMinWidth,maxWidth:e.codeBlockMaxWidth},events:{onCopy:e.onCopy,onHandleArtifactClick:e.onHandleArtifactClick}}}(e,o,i,a,v,s,f);/* @__PURE__ */
87
+ return n("div",{className:"markstream-react markdown-renderer"+(e.isDark?" dark":""),"data-custom-id":e.customId,children:k.map((e,t)=>/* @__PURE__ */n("div",{className:"node-slot","data-node-index":t,"data-node-type":e.type,children:/* @__PURE__ */n("div",{className:"node-content",children:He(e,`${v}-${t}`,w)})},`${v}-${t}`))})}export{ie as A,Q as B,ae as C,Se as D,de as E,De as F,ye as H,ve as I,ke as L,Be as M,Ee as N,G as P,_e as R,ue as S,ne as T,Pe as V,Ne as a,te as b,se as c,oe as d,re as e,le as f,J as g,me as h,Te as i,Ce as j,Ae as k,$e as l,xe as m,he as n,Z as o,ee as p,Ke as q,be as r,we as s,ce as t,pe as u,ge as v,V as w,fe as x,Ie as y,He as z};