@dmrlzz/davecode 0.0.0-stage → 0.4.0

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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -2
  3. package/bin/davecode.js +2 -0
  4. package/dist/ChatApp-BO7QMBWD.js +1045 -0
  5. package/dist/ChatApp-BO7QMBWD.js.map +1 -0
  6. package/dist/RunnerView-A7JSPUW5.js +18 -0
  7. package/dist/RunnerView-A7JSPUW5.js.map +1 -0
  8. package/dist/account-UGNLJPQ4.js +23 -0
  9. package/dist/account-UGNLJPQ4.js.map +1 -0
  10. package/dist/accounts-NM7IWP53.js +37 -0
  11. package/dist/accounts-NM7IWP53.js.map +1 -0
  12. package/dist/budget-INAW6FXD.js +115 -0
  13. package/dist/budget-INAW6FXD.js.map +1 -0
  14. package/dist/chat-U4QJQ7M6.js +359 -0
  15. package/dist/chat-U4QJQ7M6.js.map +1 -0
  16. package/dist/chunk-3Q2KCXLN.js +9608 -0
  17. package/dist/chunk-3Q2KCXLN.js.map +1 -0
  18. package/dist/chunk-5LKOJBUL.js +20 -0
  19. package/dist/chunk-5LKOJBUL.js.map +1 -0
  20. package/dist/chunk-7XVXEO7U.js +23 -0
  21. package/dist/chunk-7XVXEO7U.js.map +1 -0
  22. package/dist/chunk-CWBVNS3L.js +731 -0
  23. package/dist/chunk-CWBVNS3L.js.map +1 -0
  24. package/dist/chunk-DZ2FDABF.js +1614 -0
  25. package/dist/chunk-DZ2FDABF.js.map +1 -0
  26. package/dist/chunk-FRFSJMN4.js +79 -0
  27. package/dist/chunk-FRFSJMN4.js.map +1 -0
  28. package/dist/chunk-GE22VBCY.js +200 -0
  29. package/dist/chunk-GE22VBCY.js.map +1 -0
  30. package/dist/chunk-GHDOUII5.js +144 -0
  31. package/dist/chunk-GHDOUII5.js.map +1 -0
  32. package/dist/chunk-GZJ6JSO7.js +213 -0
  33. package/dist/chunk-GZJ6JSO7.js.map +1 -0
  34. package/dist/chunk-IC3TDONV.js +12 -0
  35. package/dist/chunk-IC3TDONV.js.map +1 -0
  36. package/dist/chunk-MC7RIPL7.js +116 -0
  37. package/dist/chunk-MC7RIPL7.js.map +1 -0
  38. package/dist/chunk-MOK5D3XJ.js +114 -0
  39. package/dist/chunk-MOK5D3XJ.js.map +1 -0
  40. package/dist/chunk-PGPXE6LF.js +20 -0
  41. package/dist/chunk-PGPXE6LF.js.map +1 -0
  42. package/dist/chunk-QA3O6RA2.js +81 -0
  43. package/dist/chunk-QA3O6RA2.js.map +1 -0
  44. package/dist/chunk-ROIUTNQV.js +20 -0
  45. package/dist/chunk-ROIUTNQV.js.map +1 -0
  46. package/dist/chunk-SF5ZEAP4.js +105 -0
  47. package/dist/chunk-SF5ZEAP4.js.map +1 -0
  48. package/dist/chunk-Z6NQDJEN.js +180 -0
  49. package/dist/chunk-Z6NQDJEN.js.map +1 -0
  50. package/dist/config-YEAPBMBX.js +158 -0
  51. package/dist/config-YEAPBMBX.js.map +1 -0
  52. package/dist/dashboard/assets/Accounts-CeVyX4a3.js +1 -0
  53. package/dist/dashboard/assets/Badge-CGY6DgGx.js +55 -0
  54. package/dist/dashboard/assets/Callout-DauCk_cW.js +1 -0
  55. package/dist/dashboard/assets/Field-OXMnT9Tb.js +1 -0
  56. package/dist/dashboard/assets/Goals-DH-KDh8M.js +1 -0
  57. package/dist/dashboard/assets/Library-C15szLjZ.js +1 -0
  58. package/dist/dashboard/assets/Markdown-Xhao3sgL.js +69 -0
  59. package/dist/dashboard/assets/Panel-Du40pM7n.js +1 -0
  60. package/dist/dashboard/assets/RoutesPage-Cj1OelGO.js +4 -0
  61. package/dist/dashboard/assets/Runner-BK1-ZF7h.js +1 -0
  62. package/dist/dashboard/assets/Settings-C1nzQQhe.js +1 -0
  63. package/dist/dashboard/assets/Switch-bwtIJ00H.js +1 -0
  64. package/dist/dashboard/assets/Tasks-x4s8IiPG.js +2 -0
  65. package/dist/dashboard/assets/Traffic-CV7TaTid.js +1 -0
  66. package/dist/dashboard/assets/Workspace-DAL-MBc0.js +1 -0
  67. package/dist/dashboard/assets/arrow-up-goM9r-I9.js +1 -0
  68. package/dist/dashboard/assets/forms-DtpfI65-.js +1 -0
  69. package/dist/dashboard/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  70. package/dist/dashboard/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  71. package/dist/dashboard/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  72. package/dist/dashboard/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  73. package/dist/dashboard/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  74. package/dist/dashboard/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  75. package/dist/dashboard/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  76. package/dist/dashboard/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  77. package/dist/dashboard/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  78. package/dist/dashboard/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  79. package/dist/dashboard/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  80. package/dist/dashboard/assets/index-BCi-Vuvh.js +104 -0
  81. package/dist/dashboard/assets/index-CcJFhc98.css +2 -0
  82. package/dist/dashboard/assets/task-errors-B2pgjUGN.js +1 -0
  83. package/dist/dashboard/assets/trash-BVojETtF.js +1 -0
  84. package/dist/dashboard/favicon.svg +1 -0
  85. package/dist/dashboard/github.svg +1 -0
  86. package/dist/dashboard/index.html +31 -0
  87. package/dist/dist-RRQGUBL3.js +379 -0
  88. package/dist/dist-RRQGUBL3.js.map +1 -0
  89. package/dist/doctor-MQYK44S2.js +279 -0
  90. package/dist/doctor-MQYK44S2.js.map +1 -0
  91. package/dist/goal-6NUX4AIT.js +302 -0
  92. package/dist/goal-6NUX4AIT.js.map +1 -0
  93. package/dist/index.js +399 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/init-AXYIWAB3.js +194 -0
  96. package/dist/init-AXYIWAB3.js.map +1 -0
  97. package/dist/prompts-TZ7UC42M.js +219 -0
  98. package/dist/prompts-TZ7UC42M.js.map +1 -0
  99. package/dist/run-QRTLHFB3.js +376 -0
  100. package/dist/run-QRTLHFB3.js.map +1 -0
  101. package/dist/runner-state-QFU3LJVJ.js +17 -0
  102. package/dist/runner-state-QFU3LJVJ.js.map +1 -0
  103. package/dist/runtime.js +18 -0
  104. package/dist/runtime.js.map +1 -0
  105. package/dist/start-O5I5TSO2.js +285 -0
  106. package/dist/start-O5I5TSO2.js.map +1 -0
  107. package/dist/status-LEA3RVUX.js +25 -0
  108. package/dist/status-LEA3RVUX.js.map +1 -0
  109. package/dist/tasks-XOTVICVZ.js +184 -0
  110. package/dist/tasks-XOTVICVZ.js.map +1 -0
  111. package/package.json +73 -3
@@ -0,0 +1 @@
1
+ import{c as e,i as t,s as n,t as r,u as i}from"./Panel-Du40pM7n.js";import{A as a,U as o,W as s,x as c}from"./index-BCi-Vuvh.js";import{n as l}from"./Field-OXMnT9Tb.js";var u=i(e(),1),d=[{id:`ponytail`,name:`Ponytail`,kind:`Guidance`,url:`https://github.com/DietrichGebert/ponytail`,description:`Reuse what exists and keep implementations small. Useful for avoiding unnecessary code; it does not supply an art direction.`,access:`Repository; review license before reuse`},{id:`anti-slop`,name:`Anti Slop`,kind:`Guidance`,url:`https://github.com/miqdadbadjuber/anti-slop`,description:`Review recurring generic patterns in interface design, copy and generated code.`,access:`Repository; review license before reuse`},{id:`impeccable`,name:`Impeccable`,kind:`Guidance`,url:`https://github.com/pbakaus/impeccable`,description:`Design guidance for defining a product direction and refining the finished interface.`,access:`Repository; review license before reuse`},{id:`anti-ui-slop`,name:`Anti UI Slop`,kind:`Guidance`,url:`https://github.com/tuanphung2005/anti-ui-slop`,description:`A separate UI-focused ruleset. Compare its constraints with your brief rather than combining conflicting rules.`,access:`Repository; review license before reuse`},{id:`shadcn`,name:`shadcn/ui`,kind:`Components`,url:`https://github.com/shadcn-ui/ui`,description:`Own and adapt the component source. Start from accessible building blocks and make them fit your identity.`,access:`MIT component library`},{id:`radix`,name:`Radix Primitives`,kind:`Components`,url:`https://github.com/radix-ui/primitives`,description:`Accessible interaction primitives for dialogs, menus and other complex interface behaviors.`,access:`MIT component library`},{id:`motion`,name:`Motion`,kind:`Components`,url:`https://github.com/motiondivision/motion`,description:`Animation for React and JavaScript. Use motion to explain a change, with a reduced-motion alternative.`,access:`MIT library; optional paid products are separate`},{id:`r3f`,name:`React Three Fiber`,kind:`Components`,url:`https://github.com/pmndrs/react-three-fiber`,description:`A React renderer for Three.js. Consider it when a real 3D experience serves the idea.`,access:`MIT library; assets have their own licenses`},{id:`awwwards`,name:`Awwwards`,kind:`Inspiration`,url:`https://www.awwwards.com/`,description:`Explore expressive websites and the studios behind them. Study composition and interaction, then create your own interpretation.`,access:`Reference gallery; artwork is not licensed for copying`},{id:`siteinspire`,name:`Siteinspire`,kind:`Inspiration`,url:`https://www.siteinspire.com/`,description:`Find references by style, type and subject instead of starting from the same SaaS template.`,access:`Reference gallery; artwork is not licensed for copying`},{id:`freight`,name:`Studio Freight`,kind:`Inspiration`,url:`https://studiofreight.com/`,description:`A studio reference for thoughtful digital identity and web experiences.`,access:`Studio portfolio; reference only`},{id:`hf`,name:`Hugging Face Spaces`,kind:`AI tools`,url:`https://huggingface.co/spaces`,description:`Discover interactive AI demos. Check each Space, model license and compute requirements before using it in your project.`,access:`Availability, model licenses and costs vary`}];function f(e){return`Help me create a distinctive interface for this project. Use ${e.name} (${e.url}) as a reference if you can access it. Its purpose: ${e.description}\n\nFirst identify the audience, intended outcome and existing design system. Propose a specific visual direction and a short design brief: typography, palette, composition, imagery, interaction and mobile behavior. Preserve the project stack, cover loading/empty/error states, and verify the rendered result. Use references as inspiration and respect their licenses. Do not claim to have read, installed or connected a resource without checking. Explain any external dependency before adding it.`}var p=n(),m=[`All`,`Guidance`,`Components`,`Inspiration`,`AI tools`];function h(){let[e,n]=(0,u.useState)(`All`),[i,h]=(0,u.useState)(``),g=d.filter(t=>(e===`All`||t.kind===e)&&`${t.name} ${t.description}`.toLowerCase().includes(i.toLowerCase()));return(0,p.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,p.jsx)(r,{title:`Creative library`,description:`Find a direction before you build. A curated starting point for people with ideas, with guidance, components and real design references.`}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(`fieldset`,{className:`flex flex-wrap gap-1`,"aria-label":`Resource category`,children:m.map(r=>(0,p.jsx)(t,{variant:r===e?`primary`:`ghost`,onClick:()=>n(r),"aria-pressed":r===e,children:r},r))}),(0,p.jsxs)(`label`,{htmlFor:`creative-search`,className:`relative ml-auto w-full max-w-xs`,children:[(0,p.jsx)(`span`,{className:`sr-only`,children:`Find a creative resource`}),(0,p.jsx)(a,{"aria-hidden":!0,className:`absolute top-2.5 left-2.5 size-3.5 text-muted`}),(0,p.jsx)(l,{id:`creative-search`,value:i,onChange:e=>h(e.target.value),placeholder:`Find a resource…`,className:`pl-8`})]})]}),(0,p.jsx)(`div`,{className:`grid gap-x-8 md:grid-cols-2 xl:grid-cols-3`,children:g.map(e=>(0,p.jsxs)(`article`,{className:`flex flex-col items-start border-t border-line py-6`,children:[(0,p.jsx)(`p`,{className:`text-[12px] text-accent-text`,children:e.kind}),(0,p.jsx)(`h2`,{className:`mt-3 text-[21px] font-medium tracking-tight text-fg`,children:e.name}),(0,p.jsx)(`p`,{className:`mt-3 max-w-sm flex-1 text-[13px] leading-6 text-muted`,children:e.description}),(0,p.jsx)(`p`,{className:`mt-4 text-[11px] leading-5 text-muted`,children:e.access}),(0,p.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-4`,children:[(0,p.jsx)(t,{size:`sm`,onClick:()=>c(`/?brief=${encodeURIComponent(f(e))}`),children:`Use in a goal`}),(0,p.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[12px] text-fg-2 hover:text-fg`,children:[`Visit source`,(0,p.jsx)(s,{"aria-hidden":!0,className:`size-3`})]})]})]},e.id))}),g.length===0&&(0,p.jsx)(`p`,{role:`status`,className:`py-8 text-[13px] text-muted`,children:`No resources match. Try another name or category.`}),(0,p.jsxs)(`div`,{className:`flex gap-3 border-t border-line pt-5 text-[12px] leading-6 text-muted`,children:[(0,p.jsx)(o,{"aria-hidden":!0,className:`mt-1 size-4 shrink-0`}),(0,p.jsx)(`p`,{children:`These are curated references, not installed plugins. “Use in a goal” prepares a brief for your agent; it does not run code, fetch a site or connect an account. DaveCode includes its own design-quality guidance by default. Third-party resources keep their own licenses and access requirements.`})]})]})}export{h as Library};
@@ -0,0 +1,69 @@
1
+ import{a as e,c as t,o as n,s as r,u as i}from"./Panel-Du40pM7n.js";var a={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};a.node;var o=n(a);function s(e,t){this.v=e,this.k=t}function c(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){if(Array.isArray(e))return e}function u(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function d(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(e,t){return l(e)||u(e,t)||p(e,t)||d()}function p(e,t){if(e){if(typeof e==`string`)return c(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function m(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,c=o instanceof s;Promise.resolve(c?o.v:o).then(function(n){if(c){var s=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(s,n);n=e[s](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}m.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},m.prototype.next=function(e){return this._invoke(`next`,e)},m.prototype.throw=function(e){return this._invoke(`throw`,e)},m.prototype.return=function(e){return this._invoke(`return`,e)};var ee=Object.entries,te=Object.setPrototypeOf,ne=Object.isFrozen,re=Object.getPrototypeOf,ie=Object.getOwnPropertyDescriptor,h=Object.freeze,g=Object.seal,ae=Object.create,oe=typeof Reflect<`u`&&Reflect,_=oe.apply,se=oe.construct;h||=function(e){return e},g||=function(e){return e},_||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},se||=function(e){return new e(...[...arguments].slice(1))};var ce=C(Array.prototype.forEach);Array.prototype.indexOf;var le=C(Array.prototype.lastIndexOf),ue=C(Array.prototype.pop),de=C(Array.prototype.push);Array.prototype.slice;var fe=C(Array.prototype.splice),pe=Array.isArray,me=C(String.prototype.toLowerCase),he=C(String.prototype.toString),ge=C(String.prototype.match),_e=C(String.prototype.replace),ve=C(String.prototype.indexOf),ye=C(String.prototype.trim),be=C(Number.prototype.toString),xe=C(Boolean.prototype.toString),Se=typeof BigInt>`u`?null:C(BigInt.prototype.toString),v=typeof Symbol>`u`?null:C(Symbol.prototype.toString),y=C(Object.prototype.hasOwnProperty),b=C(Object.prototype.toString),x=C(RegExp.prototype.test),S=Ce(TypeError);function C(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return _(e,t,n)}}function Ce(e){return function(){return se(e,[...arguments])}}function w(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:me;if(te&&te(e,null),!pe(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ne(t)||(t[r]=e),i=e)}e[i]=!0}return e}function we(e){for(let t=0;t<e.length;t++)y(e,t)||(e[t]=null);return e}function T(e){let t=ae(null);for(let r of ee(e)){var n=f(r,2);let i=n[0],a=n[1];y(e,i)&&(t[i]=pe(a)?we(a):a&&typeof a==`object`&&a.constructor===Object?T(a):a)}return t}function Te(e){switch(typeof e){case`string`:return e;case`number`:return be(e);case`boolean`:return xe(e);case`bigint`:return Se?Se(e):`0`;case`symbol`:return v?v(e):`Symbol()`;case`undefined`:return b(e);case`function`:case`object`:{if(e===null)return b(e);let t=e,n=E(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:b(e)}return b(e)}default:return b(e)}}function E(e,t){for(;e!==null;){let n=ie(e,t);if(n){if(n.get)return C(n.get);if(typeof n.value==`function`)return C(n.value)}e=re(e)}function n(){return null}return n}function Ee(e){try{return x(e,``),!0}catch{return!1}}var De=h(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Oe=h(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ke=h([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ae=h([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),je=h(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Me=h([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ne=h([`#text`]),Pe=h(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Fe=h(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ie=h(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Le=h([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Re=g(/{{[\w\W]*|^[\w\W]*}}/g),ze=g(/<%[\w\W]*|^[\w\W]*%>/g),Be=g(/\${[\w\W]*/g),Ve=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),He=g(/^aria-[\-\w]+$/),Ue=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),We=g(/^(?:\w+script|data):/i),Ge=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ke=g(/^html$/i),qe=g(/^[a-z][.\w]*(-[.\w]+)+$/i),Je=g(/<[/\w!]/g),Ye=g(/<[/\w]/g),Xe=g(/<\/no(script|embed|frames)/i),Ze=g(/\/>/i),D={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qe=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],$e=h(w({},Qe)),et=function(){let e={};return ce(Qe,t=>{e[t]=g(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),h(e)}(),tt=function(){return typeof window>`u`?null:window},nt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},rt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},O=function(e,t,n,r){return y(e,t)&&pe(e[t])?w(r.base?T(r.base):{},e[t],r.transform):n},it=function(e,t,n){let r=y(e,t)?e[t]:void 0;return r&&typeof r==`object`?T(r):n()};function at(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tt(),t=e=>at(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==D.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=E(d,`cloneNode`),p=E(d,`remove`),m=E(d,`removeAttributeNode`),te=E(d,`nextSibling`),ne=E(d,`childNodes`),re=E(d,`parentNode`),ie=E(d,`shadowRoot`),oe=E(d,`attributes`),_=o&&o.prototype?E(o.prototype,`nodeType`):null,se=o&&o.prototype?E(o.prototype,`nodeName`):null,be=o&&o.prototype?E(o.prototype,`ownerDocument`):null,xe=function(e){return _?_(e):e.nodeType},Se=function(e){return se?se(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,b=``,C,Ce=!1,we=0,Qe=function(){if(we>0)throw S(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ot=function(e){Qe(),we++;try{return v.createHTML(e)}finally{we--}},st=function(e){Qe(),we++;try{return v.createScriptURL(e)}finally{we--}},ct=function(){return Ce||=(C=nt(u,i),!0),C},lt=n,k=lt.implementation,A=lt.createNodeIterator,j=lt.createDocumentFragment,ut=lt.getElementsByTagName,M=r.importNode,N=rt();t.isSupported=typeof ee==`function`&&typeof re==`function`&&k&&k.createHTMLDocument!==void 0;let dt=Re,ft=ze,pt=Be,mt=Ve,ht=He,gt=We,_t=Ge,vt=qe,yt=Ue,P=null,bt=w({},[...De,...Oe,...ke,...je,...Ne]),F=null,xt=w({},[...Pe,...Fe,...Ie,...Le]),I=Object.seal(ae(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),L=null,St=null,R=Object.seal(ae(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ct=!0,wt=!0,Tt=!1,Et=!0,z=!1,Dt=!0,Ot=!1,kt=!1,At=null,jt=null,B=!1,V=!1,H=!1,Mt=!1,Nt=!0,Pt=!1,Ft=`user-content-`,It=!0,Lt=!1,U={},Rt=null,zt=w({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Bt=null,Vt=w({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ht=null,Ut=w({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Wt=`http://www.w3.org/1998/Math/MathML`,Gt=`http://www.w3.org/2000/svg`,W=`http://www.w3.org/1999/xhtml`,Kt=W,qt=!1,Jt=null,Yt=w({},[Wt,Gt,W],he),Xt=h([`mi`,`mo`,`mn`,`ms`,`mtext`]),Zt=w({},Xt),Qt=h([`annotation-xml`]),$t=w({},Qt),en=w({},[`title`,`style`,`font`,`a`,`script`]),tn=null,nn=[`application/xhtml+xml`,`text/html`],G=null,rn=null,an=n.createElement(`form`),on=function(e){return e instanceof RegExp||e instanceof Function},sn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rn&&rn===e)return;e&&typeof e==`object`||(e={}),e=T(e),tn=nn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,G=tn===`application/xhtml+xml`?he:me,P=O(e,`ALLOWED_TAGS`,bt,{transform:G}),F=O(e,`ALLOWED_ATTR`,xt,{transform:G}),Jt=O(e,`ALLOWED_NAMESPACES`,Yt,{transform:he}),Ht=O(e,`ADD_URI_SAFE_ATTR`,Ut,{transform:G,base:Ut}),Bt=O(e,`ADD_DATA_URI_TAGS`,Vt,{transform:G,base:Vt}),Rt=O(e,`FORBID_CONTENTS`,zt,{transform:G}),L=O(e,`FORBID_TAGS`,T({}),{transform:G}),St=O(e,`FORBID_ATTR`,T({}),{transform:G}),U=y(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?T(e.USE_PROFILES):e.USE_PROFILES:!1,Ct=e.ALLOW_ARIA_ATTR!==!1,wt=e.ALLOW_DATA_ATTR!==!1,Tt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Et=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=e.SAFE_FOR_TEMPLATES||!1,Dt=e.SAFE_FOR_XML!==!1,Ot=e.WHOLE_DOCUMENT||!1,V=e.RETURN_DOM||!1,H=e.RETURN_DOM_FRAGMENT||!1,Mt=e.RETURN_TRUSTED_TYPE||!1,B=e.FORCE_BODY||!1,Nt=e.SANITIZE_DOM!==!1,Pt=e.SANITIZE_NAMED_PROPS||!1,It=e.KEEP_CONTENT!==!1,Lt=e.IN_PLACE||!1,yt=Ee(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ue,Kt=typeof e.NAMESPACE==`string`?e.NAMESPACE:W,Zt=it(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>w({},Xt)),$t=it(e,`HTML_INTEGRATION_POINTS`,()=>w({},Qt));let t=it(e,`CUSTOM_ELEMENT_HANDLING`,()=>ae(null));if(I=ae(null),y(t,`tagNameCheck`)&&on(t.tagNameCheck)&&(I.tagNameCheck=t.tagNameCheck),y(t,`attributeNameCheck`)&&on(t.attributeNameCheck)&&(I.attributeNameCheck=t.attributeNameCheck),y(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(I.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),g(I),z&&(wt=!1),H&&(V=!0),U&&(P=w({},Ne),F=ae(null),U.html===!0&&(w(P,De),w(F,Pe)),U.svg===!0&&(w(P,Oe),w(F,Fe),w(F,Le)),U.svgFilters===!0&&(w(P,ke),w(F,Fe),w(F,Le)),U.mathMl===!0&&(w(P,je),w(F,Ie),w(F,Le))),R.tagCheck=null,R.attributeCheck=null,y(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:pe(e.ADD_TAGS)&&(P===bt&&(P=T(P)),w(P,e.ADD_TAGS,G))),y(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:pe(e.ADD_ATTR)&&(F===xt&&(F=T(F)),w(F,e.ADD_ATTR,G))),y(e,`ADD_FORBID_CONTENTS`)&&pe(e.ADD_FORBID_CONTENTS)&&(Rt===zt&&(Rt=T(Rt)),w(Rt,e.ADD_FORBID_CONTENTS,G)),It&&(P[`#text`]=!0),Ot&&w(P,[`html`,`head`,`body`]),P.table&&(w(P,[`tbody`]),delete L.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{b=ot(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,b=``):(v===void 0&&(v=ct()),v&&typeof b==`string`&&(b=ot(``)));h&&h(e),rn=e},cn=w({},[...Oe,...ke,...Ae]),ln=w({},[...je,...Me]),un=function(e,t,n){return t.namespaceURI===W?e===`svg`:t.namespaceURI===Wt?e===`svg`&&(n===`annotation-xml`||Zt[n]):!!cn[e]},dn=function(e,t,n){return t.namespaceURI===W?e===`math`:t.namespaceURI===Gt?e===`math`&&$t[n]:!!ln[e]},fn=function(e,t,n){return t.namespaceURI===Gt&&!$t[n]||t.namespaceURI===Wt&&!Zt[n]?!1:!ln[e]&&(en[e]||!cn[e])},pn=function(e){let t=re(e);t&&t.tagName||(t={namespaceURI:Kt,tagName:`template`});let n=me(e.tagName),r=me(t.tagName);return Jt[e.namespaceURI]?e.namespaceURI===Gt?un(n,t,r):e.namespaceURI===Wt?dn(n,t,r):e.namespaceURI===W?fn(n,t,r):!!(tn===`application/xhtml+xml`&&Jt[e.namespaceURI]):!1},K=function(e){de(t.removed,{element:e});try{re(e).removeChild(e)}catch{if(p(e),!re(e))throw S(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},mn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},q=function(e){_n(e);let t=ne(e);if(t){let e=[];ce(t,t=>{de(e,t)}),ce(e,e=>{try{p(e)}catch{}})}let n=oe(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&mn(e,r,i)}},hn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}de(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(V||H)try{K(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},gn=function(e){let t=oe(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||F[G(i)]||mn(e,r,i)}},_n=function(e){let t=[e];for(;t.length>0;){let e=t.pop();xe(e)===D.element&&gn(e);let n=ne(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},J=function(e,t){return Dt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},vn=function(e){if(!Dt)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=xe(e);if(n===D.processingInstruction||n===D.comment&&x(Ye,e.data)){try{p(e)}catch{}continue}if(n===D.element){let t=e,n=G(Se(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&J(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=ne(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},yn=function(e){let t=null,r=null;if(B)e=`<remove></remove>`+e;else{let t=ge(e,/^[\r\n\t ]+/);r=t&&t[0]}tn===`application/xhtml+xml`&&Kt===W&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?ot(e):e;if(Kt===W)try{t=new l().parseFromString(i,tn)}catch{}if(!t||!t.documentElement){t=k.createDocument(Kt,`template`,null);try{t.documentElement.innerHTML=qt?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Kt===W?ut.call(t,Ot?`html`:`body`)[0]:Ot?t.documentElement:a},bn=function(e){let t=be?be(e):e.ownerDocument;return A.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},xn=function(e){return e=_e(e,dt,` `),e=_e(e,ft,` `),e=_e(e,pt,` `),e},Sn=function(e){e.normalize();let t=be?be(e):e.ownerDocument,n=A.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=xn(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ce(i,e=>{wn(e.content)&&Sn(e.content)})},Cn=function(e){let t=se?se(e):null;return typeof t!=`string`||G(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==oe(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==_(e)||e.childNodes!==ne(e)},wn=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return _(e)===D.documentFragment}catch{return!1}},Y=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return typeof _(e)==`number`}catch{return!1}};function X(e,n,r){e.length!==0&&ce(e,e=>{e.call(t,n,r,rn)})}let Tn=function(e,t){return!!(Dt&&e.hasChildNodes()&&!Y(e.firstElementChild)&&x(Je,e.textContent)&&x(Je,e.innerHTML)||Dt&&e.namespaceURI===W&&$e[t]&&(Y(e.firstElementChild)||typeof e.textContent==`string`&&x(et[t],e.textContent))||e.nodeType===D.processingInstruction||Dt&&e.nodeType===D.comment&&x(Ye,e.data))},En=function(e,t){return e instanceof RegExp?x(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Z=function(e,t,n){if(!L[t]&&An(t)&&En(I.tagNameCheck,t))return!1;if(It&&!Rt[t]){let t=re(e),r=ne(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return K(e),!0},Dn=function(e,t,n,r){return e.length===0?t:t===n||t===r?T(t):t},Q=function(e,t){return e===t||re(e)!==null?!1:(Lt&&_n(e),!0)},$=function(e,n){if(X(N.beforeSanitizeElements,e,null),Q(e,n))return!0;if(Cn(e))return K(e),!0;let r=G(Se(e));if(P=Dn(N.uponSanitizeElement,P,bt,At),X(N.uponSanitizeElement,e,{tagName:r,allowedTags:P}),Q(e,n))return!0;if(Tn(e,r))return K(e),!0;if(L[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!P[r]){let t=Z(e,r,n);return t===!1&&(X(N.afterSanitizeElements,e,null),Q(e,n))?!0:t}if(xe(e)===D.element&&!pn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&x(Xe,e.innerHTML))return K(e),!0;if(z&&e.nodeType===D.text){let n=xn(e.textContent);e.textContent!==n&&(de(t.removed,{element:e.cloneNode()}),e.textContent=n)}return X(N.afterSanitizeElements,e,null),Q(e,n)},On=function(e,t,r){if(St[t]||J(t,e)||Nt&&(t===`id`||t===`name`)&&(r in n||r in an))return!1;let i=F[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);return wt&&x(mt,t)||Ct&&x(ht,t)?!0:i?Ht[t]||x(yt,_e(r,_t,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ve(r,`data:`)===0&&Bt[e]||Tt&&!x(gt,_e(r,_t,``))?!0:!r:An(e)&&En(I.tagNameCheck,e)&&En(I.attributeNameCheck,t,e)||t===`is`&&I.allowCustomizedBuiltInElements&&En(I.tagNameCheck,r)},kn=w({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[me(e)]&&x(vt,e)},jn=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ot(r);case`TrustedScriptURL`:return st(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Cn(e)||(K(e),!1)}catch{return hn(t,e),!1}},Nn=function(e,n){if(X(N.beforeSanitizeAttributes,e,null),Q(e,n))return;let r=e.attributes;if(!r||Cn(e))return;F=Dn(N.uponSanitizeAttribute,F,xt,jt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},a=r.length,o=G(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=G(s),d=l,f=s===`value`?d:ye(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,X(N.uponSanitizeAttribute,e,i),f=i.attrValue,Pt&&(u===`id`||u===`name`)&&ve(f,Ft)!==0&&(hn(s,e,n),f=Ft+f,p=!0),Dt&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&ge(f,`href`)?hn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Et&&x(Ze,f)?hn(s,e,n):(z&&(f=xn(f)),On(o,u,f)?(f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&ue(t.removed)):hn(s,e,n)):hn(s,e,n))}X(N.afterSanitizeAttributes,e,null),Q(e,n)},Pn=function(e){let t=null,n=bn(e);for(X(N.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(X(N.uponSanitizeShadowNode,t,null),$(t,e),Nn(t,e),wn(t.content)&&Pn(t.content),xe(t)===D.element){let e=ie(t);wn(e)&&(Fn(e),Pn(e))}X(N.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=xe(n)===D.element,i=ne(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=se?se(n):null;if(typeof e==`string`&&G(e)===`template`){let e=n.content;wn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ie(n);wn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(qt=!e,qt&&(e=`<!-->`),typeof e!=`string`&&!Y(e)&&(e=Te(e),typeof e!=`string`))throw S(`dirty is not a string, aborting`);if(!t.isSupported)return e;kt?(P=At,F=jt):sn(n),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(P=T(P)),N.uponSanitizeAttribute.length>0&&(F=T(F)),t.removed=[];let c=Lt&&typeof e!=`string`&&Y(e);if(c){vn(e);let t=Se(e);if(typeof t==`string`){let n=G(t);if(!P[n]||L[n])throw q(e),S(`root node is forbidden and cannot be sanitized in-place`)}if(Cn(e))throw q(e),S(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw q(e),t}}else if(Y(e))i=yn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===D.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!V&&!z&&!Ot&&e.indexOf(`<`)===-1)return v&&Mt?ot(e):e;if(i=yn(e),!i)return V?null:Mt?b:``}i&&B&&K(i.firstChild);let l=c?e:i;try{let e=bn(l);for(;o=e.nextNode();)$(o,l),Nn(o,l),wn(o.content)&&Pn(o.content)}catch(n){throw c&&(q(e),ce(t.removed,e=>{e.element&&_n(e.element)})),n}if(c){let n=!1;if(ce(t.removed,t=>{t.element&&(t.element===e&&(n=!0),_n(t.element))}),n)throw S(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return z&&Sn(e),e}if(V){if(z&&Sn(i),H)for(s=j.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(F.shadowroot||F.shadowrootmode)&&(s=M.call(r,s,!0)),s}let u=Ot?i.outerHTML:i.innerHTML;return Ot&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&x(Ke,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+u),z&&(u=xn(u)),v&&Mt?ot(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(e),kt=!0,At=P,jt=F},t.clearConfig=function(){rn=null,kt=!1,At=null,jt=null,v=C,b=``},t.isValidAttribute=function(e,t,n){rn||sn({});let r=G(e),i=G(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&y(N,e)&&de(N[e],t)},t.removeHook=function(e,t){if(y(N,e)){if(t!==void 0){let n=le(N[e],t);return n===-1?void 0:fe(N[e],n,1)[0]}return ue(N[e])}},t.removeHooks=function(e){y(N,e)&&(N[e]=[])},t.removeAllHooks=function(){N=rt()},t}var ot=at();function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ct=st();function lt(e){ct=e}var k={exec:()=>null};function A(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function j(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(M.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ut=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),M={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,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:A(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:A(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:A(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:A(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:A(e=>RegExp(`^ {0,${e}}(?:</?(?:${I})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:A(e=>RegExp(`^ {0,${e}}>`))},N=/^(?:[ \t]*(?:\n|$))+/,dt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ft=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,mt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ht=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_t=j(gt).replace(/bull/g,ht).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),vt=j(gt).replace(/bull/g,ht).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,P=/^[^\n]+/,bt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,F=j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,bt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xt=j(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ht).getRegex(),I=`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`,L=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,St=j(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,L).replace(`tag`,I).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),R=e=>j(yt).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex(),Ct=R(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),wt=R(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Tt={blockquote:j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,wt).getRegex(),code:dt,def:F,fences:ft,heading:mt,hr:pt,html:St,lheading:_t,list:xt,newline:N,paragraph:Ct,table:k,text:P},Et=j(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex(),z={...Tt,lheading:vt,table:Et,paragraph:j(yt).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Et).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex()},Dt={...Tt,html:j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,L).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:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:j(yt).replace(`hr`,pt).replace(`heading`,` *#{1,6} *[^
4
+ ]`).replace(`lheading`,_t).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ot=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,At=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,jt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B=/[\p{P}\p{S}]/u,V=/[\s\p{P}\p{S}]/u,H=/[^\s\p{P}\p{S}]/u,Mt=j(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,V).getRegex(),Nt=/[\p{Pi}\p{Ps}"']/u,Pt=/(?!~)[\p{P}\p{S}]/u,Ft=/(?!~)[\s\p{P}\p{S}]/u,It=/(?:[^\s\p{P}\p{S}]|~)/u,Lt=j(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ut?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),U=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Rt=j(U,`u`).replace(/punct/g,B).getRegex(),zt=j(U,`u`).replace(/punct/g,Pt).getRegex(),Bt=j(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Nt).replace(/punct/g,B).getRegex(),Vt=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Ht=j(Vt,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Ut=j(Vt,`gu`).replace(/notPunctSpace/g,It).replace(/punctSpace/g,Ft).replace(/punct/g,Pt).getRegex(),Wt=j(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Gt=j(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),W=j(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Kt=j(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,B).getRegex(),qt=j(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Jt=j(/\\(punct)/,`gu`).replace(/punct/g,B).getRegex(),Yt=j(/^<(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(),Xt=j(L).replace(`(?:-->|$)`,`-->`).getRegex(),Zt=j(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Xt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qt=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,$t=j(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Qt).getRegex(),en=j(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,$t).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tn=j(/^!?\[(label)\]\[(ref)\]/).replace(`label`,$t).replace(`ref`,bt).getRegex(),nn=j(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,bt).getRegex(),G=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,rn=j(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Qt).getRegex(),an=j(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,j(/^!?\[(label)\]\[(ref)\]/).replace(`label`,rn).replace(`ref`,G).getRegex()).replace(`nolink`,j(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,G).getRegex()).getRegex(),on=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sn=j(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),cn={_backpedal:k,anyPunctuation:Jt,autolink:Yt,blockSkip:Lt,br:At,code:kt,del:k,delLDelim:k,delRDelim:k,emStrongLDelim:Rt,emStrongRDelimAst:Ht,emStrongRDelimUnd:Gt,escape:Ot,link:en,nolink:nn,punctuation:Mt,reflink:tn,reflinkSearch:an,tag:Zt,text:jt,url:k},ln={...cn,emStrongLDelim:Bt,emStrongRDelimAst:Wt,emStrongRDelimUnd:W,link:j(/^!?\[(label)\]\((.*?)\)/).replace(`label`,$t).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,$t).getRegex()},un={...cn,emStrongRDelimAst:Ut,emStrongLDelim:zt,delLDelim:Kt,delRDelim:qt,url:j(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,sn).replace(`protocol`,on).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:j(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,on).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},dn={...un,br:j(At).replace(`{2,}`,`*`).getRegex(),text:j(un.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},fn={normal:Tt,gfm:z,pedantic:Dt},pn={normal:cn,gfm:un,breaks:dn,pedantic:ln},K={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},mn=e=>K[e];function q(e,t){if(t){if(M.escapeTest.test(e))return e.replace(M.escapeReplace,mn)}else if(M.escapeTestNoEncode.test(e))return e.replace(M.escapeReplaceNoEncode,mn);return e}function hn(e){return e.replace(M.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function gn(e){try{e=encodeURI(e).replace(M.percentDecode,`%`)}catch{return null}return e}function _n(e,t){let n=e.replace(M.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(M.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(M.slashPipe,`|`);return n}function J(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 vn(e){let t=e.split(`
5
+ `),n=t.length-1;for(;n>=0&&M.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
6
+ `)}function yn(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function bn(e,t){if(e.indexOf(t[0])===-1&&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 xn(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 Sn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function Cn(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
7
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
8
+ `)}function wn(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var Y=class{options;rules;lexer;constructor(e){this.options=e||ct}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=this.options.pedantic?t[0]:vn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Cn(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=J(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:J(t[0],`
9
+ `),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:J(t[0],`
10
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=J(t[0],`
11
+ `).split(`
12
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;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(`
13
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
14
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
15
+ ${s}`:s,r=r?`${r}
16
+ ${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=e.join(`
17
+ `),o=t.raw+`
18
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
19
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
20
+ ${d.join(`
21
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
22
+ `+e.join(`
23
+ `),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(`
24
+ `)}}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=t[2].split(`
25
+ `,1)[0],l=t[1].length,u=this.options.pedantic?xn(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>xn(e,l)),d=e.split(`
26
+ `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
27
+ `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
28
+ `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
29
+ `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
30
+ `+d}f=!d.trim(),r+=l+`
31
+ `,e=e.substring(l.length+1),u=m.slice(p)}}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,[]),!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))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.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 n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.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=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}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){let e=vn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&bn(t[2],`()`)!==-1)return;let e=yn(t[1]).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:J(t[0],`
32
+ `),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=_n(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
33
+ `):[],a={type:`table`,raw:J(t[0],`
34
+ `),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(_n(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:J(t[0],`
35
+ `),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)===`
36
+ `?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){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&wn(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=J(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=bn(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 i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Sn(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.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 r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&wn(e,n[1],r,this.rules))return;let i=t[yn((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Sn(n,i,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 i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,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,autolink:!0,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,autolink:!0,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:e?t[0]:hn(t[0]),escaped:e}}}},X=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ct,this.options.tokenizer=this.options.tokenizer||new Y,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:M,block:fn.normal,inline:pn.normal};this.options.pedantic?(t.block=fn.pedantic,t.inline=pn.pedantic):this.options.gfm&&(t.block=fn.gfm,t.inline=this.options.breaks?pn.breaks:pn.gfm),this.tokenizer.rules=t}static get rules(){return{block:fn,inline:pn}}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(M.carriageReturn,`
37
+ `),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){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(M.tabCharGlobal,` `).replace(M.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
38
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
39
+ `)?``:`
40
+ `)+i.raw,n.text+=`
41
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
42
+ `)?``:`
43
+ `)+i.raw,n.text+=`
44
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=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&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
45
+ `)?``:`
46
+ `)+i.raw,r.text+=`
47
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
48
+ `)?``:`
49
+ `)+i.raw,n.text+=`
50
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,yn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,yn(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=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&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Tn=class{options;parser;constructor(e){this.options=e||ct}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(M.notSpaceStart)?.[0],i=e?e.replace(M.endingNewline,``)+`
51
+ `:``;return r?`<pre><code class="language-`+q(r)+`">`+(n?i:q(i,!0))+`</code></pre>
52
+ `:`<pre><code>`+(n?i:q(i,!0))+`</code></pre>
53
+ `}blockquote({tokens:e}){return`<blockquote>
54
+ ${this.parser.parse(e)}</blockquote>
55
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
56
+ `}hr(e){return`<hr>
57
+ `}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+`>
58
+ `+r+`</`+i+`>
59
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
60
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
61
+ `}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>
62
+ <thead>
63
+ `+t+`</thead>
64
+ `+r+`</table>
65
+ `}tablerow({text:e}){return`<tr>
66
+ ${e}</tr>
67
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
68
+ `}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>${q(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?q(n,!0):this.parser.parseInline(r),o=gn(e);if(o===null)return a;e=q(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+q(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=gn(e);if(i===null)return q(n);e=i;let a=`<img src="${q(e)}" alt="${q(n)}"`;return t&&(a+=` title="${q(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:q(e.text)}},En=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}},Z=class e{options;renderer;textRenderer;constructor(e){this.options=e||ct,this.options.renderer=this.options.renderer||new Tn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new En}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`,`checkbox`,`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`,`checkbox`,`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}},Dn=class{options;block;constructor(e){this.options=e||ct}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?X.lex:X.lexInline}provideParser(e=this.block){return e?Z.parse:Z.parseInline}},Q=new class{defaults=st();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Z;Renderer=Tn;TextRenderer=En;Lexer=X;Tokenizer=Y;Hooks=Dn;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 Tn(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 Y(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 Dn;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];t[r]=Dn.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Dn.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)}:(...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 X.lex(e,t??this.defaults)}parser(e,t){return Z.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?X.lex:X.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?Z.parse:Z.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?X.lex:X.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?Z.parse:Z.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+=`
69
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+q(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,lt($.defaults),$},$.getDefaults=st,$.defaults=ct;function On(...e){return Q.use(...e),$.defaults=Q.defaults,lt($.defaults),$}$.use=On,$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=Z,$.parser=Z.parse,$.Renderer=Tn,$.TextRenderer=En,$.Lexer=X,$.lexer=X.lex,$.Tokenizer=Y,$.Hooks=Dn,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,Z.parse,X.lex;var kn=i(t(),1),An=r();function jn({source:t,className:n}){let r=(0,kn.useMemo)(()=>{let e=$.parse(t,{async:!1,gfm:!0,breaks:!1});return ot.sanitize(e,{USE_PROFILES:{html:!0}})},[t]);return(0,An.jsx)(`div`,{className:e(`prose-dc`,n),dangerouslySetInnerHTML:{__html:r}})}export{o as n,jn as t};
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function te(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ne(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else te(ne.bind(null,e))}var re={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ne,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=te,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),f=o(((e,t)=>{t.exports=d()})),p=c(u(),1),m=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function h(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:m(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var g=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},_=e=>{let t=g(e);return t.charAt(0).toUpperCase()+t.slice(1)},v=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),y={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function b(e){return e!=null}function x(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??y.width,a=e.size??e.height??y.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?v(...c):v(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??y[`stroke-width`])*Number(e.size??e.width??y.width)/Number(t.size??t.width??y.width):t.strokeWidth??y[`stroke-width`];return[`svg`,{...Object.entries(y).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&b(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&b(t.width)&&{[r(`width`)]:t.width},...`height`in t&&b(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function S(e,t={}){return x(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var C=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},w=(0,p.createContext)({}),T=()=>(0,p.useContext)(w),E=(0,p.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:y=`currentColor`,className:b=``}=T()??{},x=!!c||C(d),[w,E,D=[]]=S(u,{color:e??y,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:v(b,s),hasA11yProp:x,attributes:d});return(0,p.createElement)(w,{ref:f,...E},[...D.map(([e,t])=>(0,p.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function D(e,t=[],n=[]){let r=typeof e==`string`?h(e,t,n):e,i=(0,p.forwardRef)(({className:e,...t},n)=>(0,p.createElement)(E,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=_(r.name)),i}function O(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=O(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function k(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=O(e))&&(r&&(r+=` `),r+=t);return r}var ee=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},A=(e,t)=>({classGroupId:e,validator:t}),j=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),M=`-`,N=[],P=`arbitrary..`,F=e=>{let t=ne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return te(e);let n=e.split(M);return I(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ee(i,t):t:i||N}return n[e]||N}}},I=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=I(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(M):e.slice(t).join(M),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},te=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?P+r:void 0})(),ne=e=>{let{theme:t,classGroups:n}=e;return re(n,t)},re=(e,t)=>{let n=j();for(let r in e){let i=e[r];L(i,n,r,t)}return n},L=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];R(i,t,n,r)}},R=(e,t,n,r)=>{typeof e==`string`?ie(e,t,n):typeof e==`function`?ae(e,t,n,r):z(e,t,n,r)},ie=(e,t,n)=>{let r=e===``?t:oe(t,e);r.classGroupId=n},ae=(e,t,n,r)=>{se(e)?L(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(A(n,e)))},z=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];L(o,oe(t,a),n,r)}},oe=(e,t)=>{let n=e,r=t.split(M),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=j(),n.nextPart.set(t,i)),n=i}return n},se=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ce=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},B=`!`,V=`:`,le=[],ue=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),de=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===V){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(B)?(c=s.slice(0,-1),l=!0):s.startsWith(B)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ue(t,l,c,u)};if(t){let e=t+V,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ue(le,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},fe=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},pe=e=>({cache:ce(e.cacheSize),parseClassName:de(e),sortModifiers:fe(e),postfixLookupClassGroupIds:me(e),...F(e)}),me=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},he=/\s+/,ge=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(he),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+B:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},_e=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ve(n))&&(i&&(i+=` `),i+=r);return i},ve=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ve(e[r]))&&(n&&(n+=` `),n+=t);return n},ye=(e,...t)=>{let n,r,i,a,o=o=>(n=pe(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ge(e,n);return i(e,a),a};return a=o,(...e)=>a(_e(...e))},be=[],H=e=>{let t=t=>t[e]||be;return t.isThemeGetter=!0,t.themeKey=e,t},xe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Se=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ce=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,we=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Te=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,De=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Oe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,U=e=>Ce.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),G=e=>!!e&&Number.isInteger(Number(e)),ke=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),K=e=>we.test(e),Ae=()=>!0,je=e=>Te.test(e)&&!Ee.test(e),Me=()=>!1,Ne=e=>De.test(e),Pe=e=>Oe.test(e),Fe=e=>!q(e)&&!Y(e),Ie=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Le=e=>X(e,$e,Me),q=e=>xe.test(e),J=e=>X(e,et,je),Re=e=>X(e,tt,W),ze=e=>X(e,rt,Ae),Be=e=>X(e,nt,Me),Ve=e=>X(e,Ze,Me),He=e=>X(e,Qe,Pe),Ue=e=>X(e,it,Ne),Y=e=>Se.test(e),We=e=>Z(e,et),Ge=e=>Z(e,nt),Ke=e=>Z(e,Ze),qe=e=>Z(e,$e),Je=e=>Z(e,Qe),Ye=e=>Z(e,it,!0),Xe=e=>Z(e,rt,!0),X=(e,t,n)=>{let r=xe.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Z=(e,t,n=!1)=>{let r=Se.exec(e);return r?r[1]?t(r[1]):n:!1},Ze=e=>e===`position`||e===`percentage`,Qe=e=>e===`image`||e===`url`,$e=e=>e===`length`||e===`size`||e===`bg-size`,et=e=>e===`length`,tt=e=>e===`number`,nt=e=>e===`family-name`,rt=e=>e===`number`||e===`weight`,it=e=>e===`shadow`,at=()=>{let e=H(`color`),t=H(`font`),n=H(`text`),r=H(`font-weight`),i=H(`tracking`),a=H(`leading`),o=H(`breakpoint`),s=H(`container`),c=H(`spacing`),l=H(`radius`),u=H(`shadow`),d=H(`inset-shadow`),f=H(`text-shadow`),p=H(`drop-shadow`),m=H(`blur`),h=H(`perspective`),g=H(`aspect`),_=H(`ease`),v=H(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,q,c],T=()=>[U,`full`,`auto`,...w()],E=()=>[G,`none`,`subgrid`,Y,q],D=()=>[`auto`,{span:[`full`,G,Y,q]},G,Y,q],O=()=>[G,`auto`,Y,q],k=()=>[`auto`,`min`,`max`,`fr`,Y,q],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[U,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[s,U,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[U,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,Y,q],I=()=>[...b(),Ke,Ve,{position:[Y,q]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,qe,Le,{size:[Y,q]}],re=()=>[ke,We,J],L=()=>[``,`none`,`full`,l,Y,q],R=()=>[``,W,We,J],ie=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[W,ke,Ke,Ve],oe=()=>[``,`none`,m,Y,q],se=()=>[`none`,W,Y,q],ce=()=>[`none`,W,Y,q],B=()=>[W,Y,q],V=()=>[U,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[K],breakpoint:[K],color:[Ae],container:[K],"drop-shadow":[K],ease:[`in`,`out`,`in-out`],font:[Fe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[K],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[K],shadow:[K],spacing:[`px`,W],text:[K],"text-shadow":[K],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,U,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[Ie],columns:[{columns:[W,`auto`,q,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[G,`auto`,Y,q]}],basis:[{basis:[U,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,U,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,W,Y,q]}],shrink:[{shrink:[``,W,Y,q]}],order:[{order:[G,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,We,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xe,ze]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ke,q]}],"font-family":[{font:[Ge,Be,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[W,`none`,Y,Re]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ie(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[W,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[G,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},G,Y,q],radial:[``,Y,q],conic:[``,G,Y,q]},Je,He]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ie(),`hidden`,`none`]}],"divide-style":[{divide:[...ie(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ie(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,Y,q]}],"outline-w":[{outline:[``,W,We,J]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`inner`,`none`,u,Ye,Ue]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ye,Ue]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[W,J]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Ye,Ue]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[W,Y,q]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:oe()}],brightness:[{brightness:[W,Y,q]}],contrast:[{contrast:[W,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ye,Ue]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,W,Y,q]}],"hue-rotate":[{"hue-rotate":[W,Y,q]}],invert:[{invert:[``,W,Y,q]}],saturate:[{saturate:[W,Y,q]}],sepia:[{sepia:[``,W,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[W,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[W,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,W,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[W,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[W,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[W,Y,q]}],animate:[{animate:[`none`,v,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":[`translate-none`],zoom:[{zoom:[G,Y,q]}],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[W,We,J,Re]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},ot=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(Q(e,`cacheSize`,t),Q(e,`prefix`,n),Q(e,`experimentalParseClassName`,r),st(e.theme,a.theme),st(e.classGroups,a.classGroups),st(e.conflictingClassGroups,a.conflictingClassGroups),st(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Q(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),Q(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),ct(e.theme,i.theme),ct(e.classGroups,i.classGroups),ct(e.conflictingClassGroups,i.conflictingClassGroups),ct(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),lt(e,i,`postfixLookupClassGroups`),lt(e,i,`orderSensitiveModifiers`),e),Q=(e,t,n)=>{n!==void 0&&(e[t]=n)},st=(e,t)=>{if(t)for(let n in t)Q(e,n,t[n])},ct=(e,t)=>{if(t)for(let n in t)lt(e,t,n)},lt=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},ut=((e,...t)=>typeof e==`function`?ye(at,e,...t):ye(()=>ot(at(),e),...t))({extend:{classGroups:{"font-size":[{text:[`2xs`]}]}}});function dt(...e){return ut(k(e))}var $=f(),ft={primary:`bg-accent text-accent-fg hover:brightness-110 active:brightness-95 border border-transparent font-medium`,secondary:`bg-raised text-fg border border-line-strong hover:bg-hover hover:border-faint/60`,ghost:`text-fg-2 border border-transparent hover:bg-hover hover:text-fg`,danger:`bg-err-soft text-err border border-err/30 hover:bg-err/20`},pt={sm:`h-7 gap-1.5 px-2.5 text-[12px]`,md:`h-8 gap-2 px-3 text-[13px]`},mt=(0,p.forwardRef)(function({variant:e=`secondary`,size:t=`md`,icon:n,iconOnly:r,loading:i,className:a,children:o,disabled:s,type:c=`button`,...l},u){return(0,$.jsxs)(`button`,{ref:u,type:c,disabled:s||i,"aria-busy":i||void 0,className:dt(`inline-flex shrink-0 items-center justify-center rounded-md whitespace-nowrap select-none`,`transition-[background-color,border-color,color,filter,transform] duration-150 ease-snappy`,`active:scale-[0.98] disabled:pointer-events-none disabled:opacity-45`,ft[e],pt[t],r&&(t===`sm`?`w-7 px-0`:`w-8 px-0`),a),...l,children:[i?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 animate-spin rounded-full border-[1.5px] border-current border-r-transparent`}):n?(0,$.jsx)(n,{"aria-hidden":!0,className:`size-3.5 shrink-0`,strokeWidth:1.75}):null,!r&&o]})});function ht({className:e,...t}){return(0,$.jsx)(`section`,{className:dt(`flex min-w-0 flex-col rounded-lg border border-line bg-panel`,e),...t})}function gt({title:e,id:t,meta:n,actions:r,className:i}){return(0,$.jsxs)(`header`,{className:dt(`flex min-h-10 flex-wrap items-center gap-x-3 gap-y-1 border-b border-line px-3.5 py-2`,i),children:[(0,$.jsx)(`h2`,{id:t,className:`text-[13px] font-medium text-fg`,children:e}),n&&(0,$.jsx)(`div`,{className:`text-[12px] text-muted`,children:n}),r&&(0,$.jsx)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:r})]})}function _t({title:e,description:t,actions:n}){return(0,$.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-6 gap-y-3 pb-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h1`,{className:`text-[17px] font-semibold tracking-tight text-fg`,children:e}),t&&(0,$.jsx)(`p`,{className:`mt-0.5 text-[13px] text-muted`,children:t})]}),n&&(0,$.jsx)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:n})]})}export{dt as a,u as c,mt as i,o as l,ht as n,D as o,gt as r,f as s,_t as t,c as u};
@@ -0,0 +1,4 @@
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-Du40pM7n.js";import{$ as l,D as u,I as d,O as f,Q as p,at as m,et as h,ft as g,it as _,n as v,nt as y,ot as b,p as x,rt as S,st as C,t as w,tt as T,yt as E}from"./Badge-CGY6DgGx.js";import{t as D}from"./arrow-up-goM9r-I9.js";import{t as O}from"./Callout-DauCk_cW.js";import{n as k,t as A}from"./task-errors-B2pgjUGN.js";import{t as j}from"./trash-BVojETtF.js";import{C as M,N,S as P,b as F,c as I,d as L,i as R,j as z,o as B,p as V,u as H,w as U,y as W}from"./index-BCi-Vuvh.js";import{n as G,r as K,t as q}from"./Field-OXMnT9Tb.js";var J={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};J.node;var Y=i(J),X=c(t(),1),Z=o();function Q({open:e,onClose:t,routes:n,defaultRoute:r}){return(0,Z.jsx)(I,{open:e,onClose:t,title:`Edit routes`,description:(0,Z.jsxs)(Z.Fragment,{children:[`Saved to the global `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`~/.davecode/config.json`}),` and applied to the router immediately.`]}),width:`w-[min(680px,100vw)]`,children:e&&(0,Z.jsx)($,{routes:n,defaultRoute:r,onDone:t})})}function $({routes:t,defaultRoute:r,onDone:i}){let a=x(),o=u(),s=d(),c=a.data??[],[f,g]=(0,X.useState)(()=>S(t,r)),[v,b]=(0,X.useState)(!1),[C,w]=(0,X.useState)(null),E=(0,X.useMemo)(()=>m(f,c),[f,c]),D=p(f,t,r),k=(0,X.useMemo)(()=>{let e=new Map;for(let t of o.data??[]){if(t.owned_by===`davecode`)continue;let n=t.owned_by,r=`${n}/`,i=e.get(n)??[];i.push(t.id.startsWith(r)?t.id.slice(r.length):t.id),e.set(n,i)}return e},[o.data]),M=(e,t)=>g(n=>({...n,routes:n.routes.map(n=>n.key===e?t(n):n)})),P=(e,t,n)=>M(e,e=>({...e,targets:e.targets.map(e=>e.key===t?{...e,...n}:e)})),F=()=>g(e=>{let t=h(y(e.routes));return{routes:[...e.routes,t],defaultKey:e.defaultKey??t.key}}),I=e=>g(t=>{let n=t.routes.filter(t=>t.key!==e);return{routes:n,defaultKey:t.defaultKey===e?n[0]?.key??null:t.defaultKey}});return(0,Z.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),b(!0),w(null),E.valid)try{let e=await s.mutateAsync(_(f));W({tone:`ok`,title:`Routes saved`,description:`${e.routes.length} route${e.routes.length===1?``:`s`}, default davecode/${e.defaultRoute}`}),e.shadowedByProject&&W({tone:`info`,title:`This project overrides routes`,description:`The project .davecode/config.json also sets routing and wins after a restart.`}),i()}catch(e){w(A(e))}},noValidate:!0,className:`flex flex-col gap-4`,children:[f.routes.length===0&&(0,Z.jsxs)(`p`,{className:`rounded-md border border-dashed border-line-strong px-3 py-6 text-center text-[12px] text-muted`,children:[`No routes. Clients can still call `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`provider/model`}),` ids directly. Add a route to expose `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`davecode/<name>`}),`.`]}),f.routes.map(t=>{let r=E.byRoute[t.key],i=f.defaultKey===t.key,a=v;return(0,Z.jsxs)(`section`,{"aria-label":`Route ${t.name||`unnamed`}`,className:e(`flex flex-col gap-3 rounded-lg border bg-raised p-3`,i?`border-accent/50`:`border-line`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(q,{label:`Name`,error:a?r?.name:null,className:`min-w-0 flex-1`,children:({id:e,describedBy:n,invalid:r})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-muted`,children:`davecode/`}),(0,Z.jsx)(G,{id:e,value:t.name,onChange:e=>M(t.key,t=>({...t,name:e.target.value})),"aria-describedby":n,"aria-invalid":r||void 0,spellCheck:!1,autoCapitalize:`off`,className:`font-mono`})]})}),(0,Z.jsxs)(`label`,{className:`mt-6 flex shrink-0 cursor-pointer items-center gap-1.5 text-[12px] text-fg-2`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:`default-route`,checked:i,onChange:()=>g(e=>({...e,defaultKey:t.key})),className:`size-3.5 accent-accent`}),`Default`]}),(0,Z.jsx)(n,{variant:`ghost`,size:`sm`,iconOnly:!0,icon:j,"aria-label":`Remove route ${t.name||`unnamed`}`,onClick:()=>I(t.key),className:`mt-6 text-err hover:bg-err-soft hover:text-err`})]}),(0,Z.jsx)(q,{label:`Description`,children:({id:e,describedBy:n})=>(0,Z.jsx)(G,{id:e,value:t.description,onChange:e=>M(t.key,t=>({...t,description:e.target.value})),"aria-describedby":n,placeholder:`When to use this route`})}),(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`legend`,{className:`mb-1 text-[12px] font-medium text-fg-2`,children:[`Targets`,` `,(0,Z.jsx)(`span`,{className:`font-normal text-muted`,children:`tried in order, then fail over`})]}),a&&r?.targets&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:r.targets}),(0,Z.jsx)(`ol`,{className:`flex flex-col gap-2`,children:t.targets.map((e,n)=>(0,Z.jsx)(ee,{index:n,count:t.targets.length,target:e,accounts:c,models:k.get(e.provider)??[],error:a?r?.target[e.key]:void 0,onChange:n=>P(t.key,e.key,n),onMove:e=>M(t.key,t=>({...t,targets:l(t.targets,n,e)})),onRemove:()=>M(t.key,t=>({...t,targets:t.targets.filter(t=>t.key!==e.key)}))},e.key))}),(0,Z.jsx)(n,{size:`sm`,variant:`secondary`,icon:N,className:`self-start`,onClick:()=>M(t.key,e=>({...e,targets:[...e.targets,T(e.targets.at(-1)?.provider)]})),children:`Add target`})]})]},t.key)}),v&&E.defaultRoute&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:E.defaultRoute}),(0,Z.jsx)(n,{variant:`secondary`,icon:N,className:`self-start`,onClick:F,children:`Add route`}),C&&(0,Z.jsx)(O,{tone:`err`,title:`Could not save the routes`,children:C}),(0,Z.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center justify-end gap-2 border-t border-line bg-panel px-5 py-3`,children:[!D&&(0,Z.jsx)(`span`,{className:`mr-auto text-[12px] text-muted`,children:`No changes`}),(0,Z.jsx)(n,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,Z.jsx)(n,{type:`submit`,variant:`primary`,loading:s.isPending,disabled:!D,children:`Save routes`})]})]})}function ee({index:e,count:t,target:r,accounts:i,models:a,error:o,onChange:s,onMove:c,onRemove:l}){let u=`models-${r.key}`,d=i.filter(e=>e.provider===r.provider),f=r.accountId&&!i.some(e=>e.id===r.accountId);return(0,Z.jsxs)(`li`,{className:`flex items-start gap-2 rounded-md border border-line bg-panel p-2`,children:[(0,Z.jsx)(`span`,{className:`mt-1.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line-strong bg-raised font-mono text-[11px] text-fg-2`,children:e+1}),(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-1 gap-2 sm:grid-cols-2`,children:[(0,Z.jsx)(q,{label:`Provider`,children:({id:e})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(V,{provider:r.provider,size:`sm`}),(0,Z.jsx)(K,{id:e,value:r.provider,onChange:e=>{let t=e.target.value;s({provider:t,...i.find(e=>e.id===r.accountId)?.provider===t?{}:{accountId:``}})},children:b.map(e=>(0,Z.jsx)(`option`,{value:e,children:C(e).label},e))})]})}),(0,Z.jsx)(q,{label:`Model`,error:o?.model,children:({id:e,describedBy:t,invalid:n})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(G,{id:e,list:u,value:r.model,onChange:e=>s({model:e.target.value}),"aria-describedby":t,"aria-invalid":n||void 0,spellCheck:!1,autoCapitalize:`off`,placeholder:`claude-sonnet-5-5`,className:`font-mono`}),(0,Z.jsx)(`datalist`,{id:u,children:a.map(e=>(0,Z.jsx)(`option`,{value:e},e))})]})}),(0,Z.jsx)(q,{label:`Account`,error:o?.accountId,className:`sm:col-span-2`,children:({id:e,describedBy:t,invalid:n})=>(0,Z.jsxs)(K,{id:e,value:r.accountId,onChange:e=>s({accountId:e.target.value}),"aria-describedby":t,"aria-invalid":n||void 0,children:[(0,Z.jsx)(`option`,{value:``,children:`Balanced across matching accounts`}),f&&(0,Z.jsxs)(`option`,{value:r.accountId,children:[r.accountId,` (missing)`]}),d.map(e=>(0,Z.jsxs)(`option`,{value:e.id,children:[`Pinned to `,e.label,` (`,e.id,`)`]},e.id))]})})]}),(0,Z.jsxs)(`div`,{className:`mt-1 flex shrink-0 flex-col gap-0.5`,children:[(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:D,"aria-label":`Move target ${e+1} up`,disabled:e===0,onClick:()=>c(e-1)}),(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:Y,"aria-label":`Move target ${e+1} down`,disabled:e===t-1,onClick:()=>c(e+1)}),(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:U,"aria-label":`Remove target ${e+1}`,onClick:l})]})]})}function te(e,t){return t.filter(t=>{if(e.accountId)return t.id===e.accountId;if(t.provider!==e.provider)return!1;let n=t.config.models;return!Array.isArray(n)||n.length===0||n.includes(e.model)})}function ne(){let e=f(),{params:t}=M(),i=t.get(`edit`)===`1`,o=x(),c=u(),l=E(),d=o.data??[],p=`${l.gatewayUrl||`http://127.0.0.1:4040`}/v1`,m=e.data?.defaultRoute??`auto`,h=(0,X.useMemo)(()=>{let e=c.data??[];return{total:e.length,routes:e.filter(e=>e.owned_by===`davecode`).length}},[c.data]),_=`curl ${p}/chat/completions \\
2
+ -H "Content-Type: application/json" \\
3
+ -H "Authorization: Bearer $DAVECODE_TOKEN" \\
4
+ -d '{"model": "davecode/${m}", "messages": [{"role": "user", "content": "Hello"}]}'`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(s,{title:`Routes`,description:(0,Z.jsxs)(Z.Fragment,{children:[`Exposed to clients as`,` `,(0,Z.jsx)(`code`,{className:`font-mono text-fg-2`,children:`davecode/<route>`}),`. Targets are tried in order; the router fails over down the list before the first byte.`]}),actions:(0,Z.jsxs)(Z.Fragment,{children:[c.data&&(0,Z.jsxs)(w,{mono:!0,children:[h.total,` models · `,h.routes,` routes on /v1/models`]}),(0,Z.jsx)(n,{variant:`primary`,icon:k,disabled:!e.data,onClick:()=>P(`edit`,`1`),children:`Edit routes`})]})}),e.isError&&(0,Z.jsx)(O,{tone:`err`,title:`Could not load routes`,children:g(e.error)}),e.isPending?(0,Z.jsx)(r,{children:(0,Z.jsx)(B,{rows:6})}):(e.data?.routes.length??0)===0?(0,Z.jsx)(r,{children:(0,Z.jsx)(R,{icon:z,title:`No routes configured`,description:`Until you add one, clients can call provider/model ids directly. Routes are saved to ~/.davecode/config.json.`,action:(0,Z.jsx)(n,{variant:`primary`,icon:N,onClick:()=>P(`edit`,`1`),children:`Add a route`})})}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:e.data?.routes.map(e=>(0,Z.jsxs)(r,{"aria-labelledby":`route-${e.name}`,children:[(0,Z.jsx)(a,{id:`route-${e.name}`,title:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-mono`,children:[`davecode/`,e.name,(0,Z.jsx)(H,{value:`davecode/${e.name}`,label:`Copy davecode/${e.name}`})]}),actions:e.name===m?(0,Z.jsx)(w,{tone:`accent`,children:`default`}):void 0}),e.description&&(0,Z.jsx)(`p`,{className:`px-3.5 pt-3 text-[12px] text-muted`,children:e.description}),(0,Z.jsx)(`ol`,{className:`flex flex-col p-3.5`,children:e.targets.map((t,n)=>{let r=te(t,d),i=r.filter(e=>e.enabled&&e.status!==`disabled`);return(0,Z.jsxs)(`li`,{className:`relative flex gap-3 pb-3 last:pb-0`,children:[n<e.targets.length-1&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-7 bottom-0 left-[11px] w-px bg-line-strong`}),(0,Z.jsx)(`span`,{className:`z-10 flex size-6 shrink-0 items-center justify-center rounded-full border border-line-strong bg-raised font-mono text-[11px] text-fg-2`,children:n+1}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-md border border-line bg-raised px-2.5 py-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(V,{provider:t.provider,size:`sm`}),(0,Z.jsxs)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:[t.provider,`/`,t.model]}),i.length===0&&(0,Z.jsx)(w,{tone:`err`,className:`ml-auto`,children:`no usable account`})]}),(0,Z.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-muted`,children:[(0,Z.jsx)(`span`,{children:t.accountId?`pinned to`:`balanced · ${C(t.provider).label}`}),r.length===0&&(0,Z.jsx)(`span`,{className:`text-faint`,children:`no matching account`}),r.map(e=>(0,Z.jsxs)(F,{to:`/accounts?account=${encodeURIComponent(e.id)}`,className:`inline-flex items-center gap-1.5 text-fg-2 hover:text-fg`,children:[(0,Z.jsx)(v,{tone:L[e.status]}),e.label,(0,Z.jsxs)(`span`,{className:`sr-only`,children:[`(`,e.status,`)`]})]},e.id))]})]})]},`${t.provider}/${t.model}/${t.accountId??``}`)})})]},e.name))}),(0,Z.jsx)(Q,{open:i&&!!e.data,onClose:()=>P(`edit`,null),routes:e.data?.routes??[],defaultRoute:m}),(0,Z.jsxs)(r,{"aria-labelledby":`usage-title`,children:[(0,Z.jsx)(a,{id:`usage-title`,title:`Use a route`,meta:`any OpenAI-compatible client`,actions:(0,Z.jsx)(H,{value:_,label:`Copy snippet`})}),(0,Z.jsx)(`pre`,{className:`overflow-x-auto p-3.5 font-mono text-[12px] leading-5 text-fg-2`,children:_})]})]})}export{ne as RoutesPage};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-Du40pM7n.js";import{A as l,B as u,N as d,V as f,ft as p,j as m,o as h,pt as g,r as _,t as v}from"./Badge-CGY6DgGx.js";import{t as y}from"./Callout-DauCk_cW.js";import{A as b,F as x,H as S,P as C,V as w,_ as T,a as E,b as D,h as O,k,l as A,s as ee,y as j,z as M}from"./index-BCi-Vuvh.js";var N={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};N.node;var P=i(N),F={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};F.node;var I=i(F),L={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};L.node;var R=i(L),z={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};z.node;var B=i(z),V=c(t(),1),H=o(),U=[`debug`,`info`,`warn`,`error`],W={debug:`text-muted`,info:`text-info`,warn:`text-warn`,error:`text-err`};function G(e){return e.level===`error`?`text-err`:e.level===`warn`?`text-warn`:e.message.startsWith(`$ `)?`text-fg`:e.message.startsWith(`✓`)?`text-ok`:e.message.startsWith(`→`)?`text-info`:e.level===`debug`?`text-muted`:`text-fg-2`}function K({lines:t,onClear:n,className:r}){let[i,a]=(0,V.useState)(()=>new Set([`info`,`warn`,`error`])),[o,s]=(0,V.useState)(`runner`),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(!0),[f,p]=(0,V.useState)(!0),m=(0,V.useRef)(null),h=(0,V.useMemo)(()=>{let e={debug:0,info:0,warn:0,error:0};for(let n of t)(o===`all`||n.source===`runner`)&&(e[n.level]+=1);return e},[t,o]),g=c.trim().toLowerCase(),v=(0,V.useMemo)(()=>t.filter(e=>i.has(e.level)&&(o===`all`||e.source===`runner`)&&(!g||e.message.toLowerCase().includes(g)||(e.taskId??e.scope??``).includes(g))),[t,i,o,g]);(0,V.useLayoutEffect)(()=>{let e=m.current;e&&f&&(e.scrollTop=e.scrollHeight)},[v,f]),(0,V.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<24;p(t)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]);let y=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,H.jsxs)(`section`,{"aria-label":`Runner log`,className:e(`term flex min-h-0 flex-col overflow-hidden rounded-lg border border-line bg-term`,r),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line px-3 py-2`,children:[(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log levels`}),U.map(t=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":i.has(t),onClick:()=>y(t),className:e(`inline-flex h-6 items-center gap-1.5 rounded border px-2 font-mono text-2xs uppercase transition-colors duration-150`,i.has(t)?`border-line-strong bg-hover text-fg`:`border-transparent text-faint hover:text-muted`),children:[(0,H.jsx)(`span`,{"aria-hidden":!0,className:e(`size-1.5 rounded-full bg-current`,i.has(t)&&W[t])}),t,(0,H.jsx)(`span`,{className:`tnum text-muted`,children:h[t]})]},t))]}),(0,H.jsx)(`span`,{"aria-hidden":!0,className:`h-4 w-px bg-line-strong`}),(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log source`}),[`runner`,`all`].map(t=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":o===t,onClick:()=>s(t),className:e(`h-6 rounded px-2 text-[12px] transition-colors duration-150`,o===t?`bg-hover text-fg`:`text-muted hover:text-fg-2`),children:t===`runner`?`Runner`:`All logs`},t))]}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(b,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2 size-3 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,H.jsx)(`input`,{type:`search`,"aria-label":`Filter log lines`,placeholder:`Filter`,value:c,onChange:e=>l(e.target.value),className:`h-6 w-32 rounded border border-line-strong bg-transparent pr-2 pl-6 font-mono text-[11px] text-fg placeholder:text-faint focus-visible:border-accent focus-visible:outline-none`,"data-filter-input":!0})]}),(0,H.jsx)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>d(e=>!e),"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:e(`inline-flex size-6 items-center justify-center rounded`,u?`bg-hover text-fg`:`text-muted hover:text-fg`),children:(0,H.jsx)(B,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})}),(0,H.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Clear console`,title:`Clear console`,className:`inline-flex size-6 items-center justify-center rounded text-muted hover:bg-hover hover:text-fg`,children:(0,H.jsx)(I,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})})]})]}),(0,H.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,H.jsx)(`div`,{ref:m,role:`log`,"aria-live":`off`,"aria-label":`Log lines`,tabIndex:0,className:`absolute inset-0 overflow-auto py-2 font-mono text-[12px] leading-[1.6]`,children:v.length===0?(0,H.jsx)(`p`,{className:`px-3 text-muted`,children:t.length===0?`Waiting for runner output…`:`No lines match the filters.`}):v.map(t=>(0,H.jsxs)(`div`,{className:e(`flex gap-3 px-3 hover:bg-hover/60`,u?`whitespace-pre-wrap break-words`:`whitespace-pre`,t.level===`error`&&`bg-err/[0.06]`),children:[(0,H.jsx)(`span`,{className:`tnum shrink-0 text-faint select-none`,children:_(t.ts,!0)}),(0,H.jsx)(`span`,{className:e(`w-10 shrink-0 uppercase select-none`,W[t.level]),children:t.level}),o===`all`&&(0,H.jsx)(`span`,{className:`w-16 shrink-0 truncate text-muted`,children:t.source===`runner`?`runner`:t.scope}),(0,H.jsx)(`span`,{className:e(`min-w-0`,G(t)),children:t.message})]},t.key))}),!f&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let e=m.current;e&&(e.scrollTop=e.scrollHeight),p(!0)},className:`absolute right-4 bottom-3 inline-flex animate-pop-in items-center gap-1.5 rounded-md border border-line-strong bg-raised px-2.5 py-1 text-[12px] text-fg shadow-overlay`,children:[(0,H.jsx)(P,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75}),`Jump to latest`]})]}),(0,H.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:f?``:`Autoscroll paused.`})]})}var q=[`idle`,`selecting`,`preparing`,`implementing`,`validating`,`repairing`,`merging`],J={idle:`Waiting for work`,selecting:`Picking the next unblocked task`,preparing:`Creating the task branch and loading the brain`,implementing:`Writing code through the gateway`,validating:`Running lint, typecheck and tests`,repairing:`Feeding failures back for another attempt`,merging:`Merging the task branch`,paused:`Paused; resumes at the same step`,stopped:`Stopped`,error:`Stopped on an error`},Y={idle:`neutral`,selecting:`info`,preparing:`info`,implementing:`info`,validating:`info`,repairing:`warn`,merging:`ok`,paused:`warn`,stopped:`neutral`,error:`err`},X=3;function Z(){let t=l(),i=d(),o=f(),{live:c}=u(),_=m(),b=T(1e3),[N,P]=(0,V.useState)(!1),F=g(t.error)&&t.error.status===501,I=F?void 0:t.data,L=I?.state,z=i.data?.graph.tasks.find(e=>e.id===I?.taskId),B=(0,V.useMemo)(()=>{if(!F){if(L&&q.includes(L))return L;for(let e=o.events.length-1;e>=0;e--){let t=o.events[e];if(t?.type===`runner.status`&&q.includes(t.status.state))return t.status.state}}},[F,L,o.events]),U=async e=>{try{let t=await _.mutateAsync(e);j({tone:`info`,title:`Runner ${t.state}`,description:J[t.state]})}catch(t){j({tone:`err`,title:`Could not ${e} the runner`,description:g(t)&&t.code===`runner_unavailable`?`This gateway was started without the autonomous runner.`:p(t)})}},W=L!==void 0&&![`idle`,`paused`,`stopped`,`error`].includes(L),G=!F&&(L===`idle`||L===`paused`||L===`stopped`||L===`error`),Z=I?.startedAt?(b-Date.parse(I.startedAt))/1e3:void 0,Q=I?.repairCycle??0,te=i.data?.graph.tasks.filter(e=>e.status===`SUCCESS`).length??0,$=i.data?.graph.tasks.length??0;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(s,{title:`Runner`,description:`The autonomous engineer: one task at a time, on its own branch, merged only when checks pass.`,actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{variant:`primary`,icon:C,disabled:!G||_.isPending,loading:_.isPending&&_.variables===`start`,onClick:()=>U(`start`),children:L===`paused`?`Resume`:`Start`}),(0,H.jsx)(n,{icon:x,disabled:F||!W||_.isPending,loading:_.isPending&&_.variables===`pause`,onClick:()=>U(`pause`),children:`Pause`}),(0,H.jsx)(n,{variant:`danger`,icon:k,disabled:F||L===`stopped`||L===`idle`||L===void 0||_.isPending,onClick:()=>P(!0),children:`Stop`})]})}),F&&(0,H.jsxs)(y,{tone:`warn`,title:`Runner unavailable`,children:[(0,H.jsxs)(`p`,{children:[`This gateway answered `,(0,H.jsx)(`code`,{className:`font-mono text-fg`,children:`501 runner_unavailable`}),`: it is running without the autonomous engine. Routing and the dashboard keep working; start the runner from a project directory to drive the task graph:`]}),(0,H.jsx)(A,{command:`davecode run`,className:`mt-2 max-w-sm`})]}),t.isError&&!F&&(0,H.jsx)(y,{tone:`err`,title:`Could not read the runner status`,children:p(t.error)}),(0,H.jsxs)(r,{"aria-labelledby":`machine-title`,children:[(0,H.jsx)(a,{id:`machine-title`,title:`State machine`,meta:L?J[L]:void 0,actions:L&&(0,H.jsx)(v,{tone:Y[L],dot:!0,pulse:W,children:L})}),(0,H.jsxs)(`div`,{className:`p-4`,children:[t.isPending?(0,H.jsx)(E,{className:`h-16 w-full`}):(0,H.jsx)(`ol`,{className:`flex flex-wrap items-center gap-y-3`,"aria-label":`Runner pipeline`,children:q.map((t,n)=>{let r=t===B,i=r&&W,a=B?q.indexOf(B):-1,o=a>0&&n>0&&n<a&&(t!==`repairing`||Q!==0);return(0,H.jsxs)(`li`,{className:`flex items-center`,"aria-current":r?`step`:void 0,children:[n>0&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:e(`mx-1.5 h-px w-4 sm:w-6`,o||r?`bg-fg-2/50`:`bg-line-strong`)}),(0,H.jsxs)(`span`,{className:e(`inline-flex h-7 items-center gap-1.5 rounded-full border px-3 font-mono text-[12px] transition-colors duration-200`,r?L===`paused`||L===`stopped`||t===`repairing`?`border-warn/50 bg-warn-soft text-warn`:`border-accent/60 bg-accent-soft text-accent-text shadow-[0_0_0_3px_var(--dc-accent-soft)]`:o?`border-line-strong text-fg-2`:`border-line text-faint`),children:[o&&(0,H.jsx)(w,{"aria-hidden":!0,className:`size-3`,strokeWidth:2.25}),t===`repairing`&&!o&&(0,H.jsx)(R,{"aria-hidden":!0,className:`size-3`,strokeWidth:2}),i&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse-dot rounded-full bg-current`}),t,r&&(0,H.jsxs)(`span`,{className:`sr-only`,children:[` (current`,L===t?``:`, ${L}`,`)`]})]})]},t)})}),(0,H.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[(0,H.jsx)(R,{"aria-hidden":!0,className:`mr-1 inline size-3 align-[-2px]`,strokeWidth:2}),`Failed validation loops `,(0,H.jsx)(`span`,{className:`font-mono`,children:`repairing → implementing`}),` up to `,X,` times; then the task is marked FAILED and the runner moves on.`]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1fr)_340px]`,children:[(0,H.jsxs)(r,{"aria-labelledby":`current-title`,className:`xl:order-2 xl:self-start`,children:[(0,H.jsx)(a,{id:`current-title`,title:`Current task`,meta:$?`${te}/${$} tasks done`:void 0}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[t.isPending?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{className:`h-4 w-40`}),(0,H.jsx)(E,{className:`h-4 w-56`})]}):z?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(D,{to:`/tasks?task=${encodeURIComponent(z.id)}`,className:`font-mono text-2xs text-muted hover:text-fg`,children:z.id}),(0,H.jsx)(`p`,{className:`text-[13px] leading-5 font-medium text-fg`,children:z.title})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(O,{status:z.status}),z.attempts!==void 0&&(0,H.jsxs)(v,{mono:!0,children:[`attempt `,z.attempts]})]}),(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-fg-2`,children:[(0,H.jsx)(M,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),z.branch??`davecode/task-${z.id}`]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Repair cycle`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`flex gap-1`,"aria-hidden":!0,children:Array.from({length:X},(t,n)=>(0,H.jsx)(`span`,{className:e(`h-1.5 w-5 rounded-full`,n<Q?`bg-warn`:`bg-track`)},n))}),(0,H.jsxs)(`span`,{className:`tnum font-mono text-fg`,children:[Q,`/`,X]})]})]}),Z!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Running for`}),(0,H.jsx)(`span`,{className:`tnum font-mono text-fg`,children:h(Z)})]})]}):(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[12px] text-muted`,children:[(0,H.jsx)(S,{"aria-hidden":!0,className:`size-4`,strokeWidth:1.5}),F?`No runner attached to this gateway.`:`No task in progress.`]}),I?.lastError&&(0,H.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:I.lastError})]})]}),(0,H.jsx)(K,{lines:o.logs,onClear:()=>c.clearLogs(),className:`h-[480px] xl:order-1`})]}),(0,H.jsx)(ee,{open:N,onClose:()=>P(!1),title:`Stop the runner?`,description:`The current step is abandoned. Work done so far stays on the task branch.`,footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{variant:`ghost`,onClick:()=>P(!1),children:`Keep running`}),(0,H.jsx)(n,{variant:`danger`,icon:k,onClick:()=>{P(!1),U(`stop`)},children:`Stop runner`})]}),children:z&&(0,H.jsx)(`p`,{className:`font-mono text-[12px] text-muted`,children:z.id})})]})}export{Z as Runner};
@@ -0,0 +1 @@
1
+ import{c as e,i as t,n,o as r,r as i,s as a,t as o,u as s}from"./Panel-Du40pM7n.js";import{B as c,E as l,dt as u,ft as d,gt as f,o as p,t as m,vt as h,yt as g}from"./Badge-CGY6DgGx.js";import{i as _,n as v}from"./forms-DtpfI65-.js";import{t as y}from"./Callout-DauCk_cW.js";import{I as b,L as x,O as S,U as C,t as w,v as T,y as E}from"./index-BCi-Vuvh.js";import{n as D,t as O}from"./Field-OXMnT9Tb.js";var k={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};k.node;var A=r(k),j={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};j.node;var M=r(j),N={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};N.node;var P=r(N),F=s(e(),1),I=a(),L=`https://github.com/DMRLZZ/DaveCode`;function R(){let e=g(),r=l(),{connection:a}=c(),[s,k]=(0,F.useState)(e.gatewayUrl),[j,N]=(0,F.useState)(e.token),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)(!1),[H,U]=(0,F.useState)(null),W=()=>{let e=s.trim();return e&&!_(e)?`Enter an http(s) origin such as http://127.0.0.1:4040, or leave empty.`:null},G=e=>{e.preventDefault();let t=W();z(t),!t&&(h({gatewayUrl:s.trim().replace(/\/+$/,``),token:j.trim()}),E({tone:`ok`,title:`Connection settings saved`,description:`Stored in this browser only.`}))},K=async()=>{let e=W();if(z(e),!e){V(!0),U(null);try{let e=await u({baseUrl:s.trim(),token:j.trim()}).health();U({ok:!0,text:`Connected: DaveCode ${e.version}, ${e.status}, up ${p(e.uptimeSec)}.`})}catch(e){U({ok:!1,text:d(e)})}finally{V(!1)}}},q=f();return(0,I.jsxs)(`div`,{className:`flex max-w-3xl flex-col gap-4`,children:[(0,I.jsx)(o,{title:`Settings`,description:`Preferences are stored in this browser's localStorage.`}),(0,I.jsxs)(n,{"aria-labelledby":`conn-title`,children:[(0,I.jsx)(i,{id:`conn-title`,title:`Gateway connection`}),(0,I.jsxs)(`form`,{onSubmit:G,noValidate:!0,className:`flex flex-col gap-4 p-4`,children:[(0,I.jsx)(O,{label:`Gateway URL`,error:R,hint:`Leave empty when the dashboard is served by the gateway or the Vite dev proxy (same origin).`,children:({id:e,describedBy:t,invalid:n})=>(0,I.jsx)(D,{id:e,type:`url`,value:s,placeholder:`same origin`,onChange:e=>k(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`font-mono`})}),(0,I.jsx)(O,{label:`Bearer token`,hint:`Needed when server.authToken is set. Sent as Authorization: Bearer, and as ?token= for the event stream.`,children:({id:e,describedBy:t})=>(0,I.jsx)(v,{id:e,value:j,onChange:N,placeholder:`not set`,describedBy:t})}),H&&(0,I.jsx)(y,{tone:H.ok?`info`:`err`,title:H.ok?`Gateway reachable`:`Connection failed`,children:H.text}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(t,{type:`submit`,variant:`primary`,children:`Save`}),(0,I.jsx)(t,{icon:P,onClick:K,loading:B,children:`Test connection`}),a.unauthorized&&(0,I.jsx)(m,{tone:`err`,children:`gateway returned 401`})]})]})]}),(0,I.jsxs)(n,{"aria-labelledby":`data-title`,children:[(0,I.jsx)(i,{id:`data-title`,title:`Data source`}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,I.jsx)(w,{label:`Data source`,value:e.dataMode,onChange:e=>h({dataMode:e}),options:[{value:`auto`,label:`Auto`},{value:`live`,label:`Live only`},{value:`mock`,label:`Mock data`}]}),(0,I.jsxs)(`p`,{className:`text-[12px] leading-5 text-muted`,children:[(0,I.jsx)(`strong`,{className:`font-medium text-fg-2`,children:`Auto`}),` uses the gateway and falls back to simulated data when it is unreachable, re-checking every 15 s.`,` `,(0,I.jsx)(`strong`,{className:`font-medium text-fg-2`,children:`Mock data`}),` always simulates a busy gateway, handy for demos and screenshots.`]}),q&&(0,I.jsxs)(y,{tone:`info`,children:[`Mock mode is currently forced by `,(0,I.jsx)(`code`,{className:`font-mono`,children:`?mock=1`}),` or`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`VITE_DAVECODE_MOCK=1`}),`; this setting applies once that is removed.`]})]})]}),(0,I.jsxs)(n,{"aria-labelledby":`look-title`,children:[(0,I.jsx)(i,{id:`look-title`,title:`Appearance`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,I.jsx)(w,{label:`Theme`,value:e.theme,onChange:e=>h({theme:e}),options:[{value:`dark`,label:`Dark`,icon:b},{value:`light`,label:`Light`,icon:S},{value:`system`,label:`System`,icon:M}]}),(0,I.jsx)(t,{variant:`ghost`,icon:x,onClick:T.openHelp,children:`Keyboard shortcuts`})]})]}),(0,I.jsxs)(n,{"aria-labelledby":`about-title`,children:[(0,I.jsx)(i,{id:`about-title`,title:`About`}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 text-[13px]`,children:[(0,I.jsxs)(`dl`,{className:`grid grid-cols-[120px_1fr] gap-y-1.5`,children:[(0,I.jsx)(`dt`,{className:`text-muted`,children:`Gateway`}),(0,I.jsx)(`dd`,{className:`font-mono text-fg-2`,children:r.data?`v${r.data.version} · ${r.data.status}`:a.mode===`probing`?`checking…`:`unreachable`}),(0,I.jsx)(`dt`,{className:`text-muted`,children:`Data`}),(0,I.jsx)(`dd`,{className:`text-fg-2`,children:a.mode===`mock`?`Simulated (mock mode)`:`Live gateway`}),(0,I.jsx)(`dt`,{className:`text-muted`,children:`Experimental`}),(0,I.jsxs)(`dd`,{className:`flex flex-wrap gap-1.5`,children:[(0,I.jsxs)(m,{tone:r.data?.experimental.geminiWeb?`warn`:`neutral`,mono:!0,children:[`geminiWeb `,r.data?.experimental.geminiWeb?`on`:`off`]}),(0,I.jsxs)(m,{tone:r.data?.experimental.multiAccountRotation?`warn`:`neutral`,mono:!0,children:[`multiAccountRotation `,r.data?.experimental.multiAccountRotation?`on`:`off`]})]})]}),(0,I.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:[[`README`,`${L}#readme`],[`Architecture`,`${L}/blob/main/docs/ARCHITECTURE.md`],[`HTTP API`,`${L}/blob/main/docs/API.md`]].map(([e,t])=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex h-7 items-center gap-1.5 rounded-md border border-line px-2.5 text-[12px] text-fg-2 transition-colors duration-150 hover:border-line-strong hover:text-fg`,children:[(0,I.jsx)(C,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75}),e,(0,I.jsx)(A,{"aria-hidden":!0,className:`size-3 text-muted`,strokeWidth:1.75}),(0,I.jsx)(`span`,{className:`sr-only`,children:`(opens in a new tab)`})]})},e))})]})]})]})}export{R as Settings};
@@ -0,0 +1 @@
1
+ import{a as e,o as t,s as n}from"./Panel-Du40pM7n.js";var r={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};r.node;var i=t(r),a=n();function o({checked:t,onChange:n,label:r,disabled:i,className:o}){return(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":r,disabled:i,onClick:e=>{e.stopPropagation(),n(!t)},className:e(`relative inline-flex h-[18px] w-8 shrink-0 items-center rounded-full border transition-colors duration-150 ease-snappy`,t?`border-accent bg-accent`:`border-line-strong bg-track`,`disabled:cursor-not-allowed disabled:opacity-45`,o),children:(0,a.jsx)(`span`,{"aria-hidden":!0,className:e(`inline-block size-3 rounded-full shadow-sm transition-transform duration-150 ease-snappy`,t?`translate-x-[15px] bg-accent-fg`:`translate-x-[2px] bg-fg-2`)})})}export{i as n,o as t};
@@ -0,0 +1,2 @@
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-Du40pM7n.js";import{G as l,H as u,J as d,K as f,L as p,N as m,S as h,U as g,W as _,X as v,Y as y,Z as b,b as x,d as S,ft as C,k as w,m as T,q as E,t as D}from"./Badge-CGY6DgGx.js";import{n as O,t as k}from"./Markdown-Xhao3sgL.js";import{t as A}from"./Callout-DauCk_cW.js";import{n as ee,t as j}from"./task-errors-B2pgjUGN.js";import{t as M}from"./trash-BVojETtF.js";import{A as te,B as ne,C as re,N,P as ie,S as P,a as ae,c as oe,g as F,h as I,i as se,m as L,o as ce,s as le,t as R,u as ue,w as de,y as z,z as B}from"./index-BCi-Vuvh.js";import{i as V,n as H,t as U}from"./Field-OXMnT9Tb.js";var W={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};W.node;var fe=i(W),G={name:`kanban`,size:24,node:[[`path`,{d:`M5 3v14`,key:`9nsxs2`}],[`path`,{d:`M12 3v8`,key:`1h2ygw`}],[`path`,{d:`M19 3v18`,key:`1sk56x`}]]};G.node;var pe=i(G),K={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};K.node;var me=i(K),q={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};q.node;var he=i(q),J=c(t(),1),ge={nodeWidth:220,nodeHeight:60,gapX:64,gapY:16,padding:16,sweeps:4,direction:`LR`};function Y(e,t={}){let n={...ge,...t},r=new Map(e.map(e=>[e.id,e])),i=[],a=[],o=new Map;for(let t of e){let e=[];for(let n of t.dependsOn)r.has(n)?e.push(n):i.push({task:t.id,dependsOn:n});o.set(t.id,e)}let s=new Map,c=new Set,l=e=>{let t=s.get(e);if(t!==void 0)return t;c.add(e);let n=0,r=[];for(let t of o.get(e)??[])c.has(t)?a.push({from:t,to:e}):(r.push(t),n=Math.max(n,l(t)+1));return o.set(e,r),c.delete(e),s.set(e,n),n};for(let t of e)l(t.id);let u=e.length?Math.max(...s.values())+1:0,d=Array.from({length:u},()=>[]),f=[...e].sort((e,t)=>(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id));for(let e of f)d[s.get(e.id)??0]?.push(e.id);let p=new Map;for(let[e,t]of o)for(let n of t)p.set(n,[...p.get(n)??[],e]);let m=new Map,h=()=>{for(let e of d)e.forEach((e,t)=>{m.set(e,t)})};h();let g=(e,t)=>{let n=(t??[]).map(e=>m.get(e)).filter(e=>e!==void 0);return n.length?n.reduce((e,t)=>e+t,0)/n.length:m.get(e)??0};for(let e=0;e<n.sweeps;e++){for(let e=1;e<d.length;e++){let t=d[e];t&&(t.sort((e,t)=>g(e,o.get(e))-g(t,o.get(t))),h())}for(let e=d.length-2;e>=0;e--){let t=d[e];t&&(t.sort((e,t)=>g(e,p.get(e))-g(t,p.get(t))),h())}}let _=n.direction===`TB`,v=Math.max(0,...d.map(e=>e.length)),y=_?n.nodeWidth:n.nodeHeight,b=_?n.gapX:n.gapY,x=_?n.nodeHeight:n.nodeWidth,S=_?n.gapY:n.gapX,C=v*y+Math.max(0,v-1)*b,w=u*x+Math.max(0,u-1)*S,T=n.padding*2+(_?C:w),E=n.padding*2+(_?w:C),D=[],O=new Map;d.forEach((e,t)=>{let r=e.length*y+Math.max(0,e.length-1)*b,i=n.padding+(C-r)/2;e.forEach((e,r)=>{let a=n.padding+t*(x+S),o=i+r*(y+b),s=_?o:a,c=_?a:o;O.set(e,{x:s,y:c}),D.push({id:e,layer:t,order:r,x:s,y:c})})});let k=[];for(let t of e){let e=O.get(t.id);if(e)for(let r of o.get(t.id)??[]){let i=O.get(r);if(!i)continue;let a;if(_){let t=i.x+n.nodeWidth/2,r=i.y+n.nodeHeight,o=e.x+n.nodeWidth/2,s=e.y,c=Math.max(20,(s-r)/2);a=`M${t},${r} C${t},${r+c} ${o},${s-c} ${o},${s}`}else{let t=i.x+n.nodeWidth,r=i.y+n.nodeHeight/2,o=e.x,s=e.y+n.nodeHeight/2,c=Math.max(24,(o-t)/2);a=`M${t},${r} C${t+c},${r} ${o-c},${s} ${o},${s}`}k.push({from:r,to:t.id,path:a})}}return{nodes:D,edges:k,width:T,height:E,layers:u,missing:i,cycleEdges:a}}function _e(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=new Set,i=e=>{let a=n.get(e);if(a)return a;let o=t.get(e);if(!o)return`waiting`;let s={SUCCESS:`done`,IN_PROGRESS:`running`,FAILED:`failed`,PENDING:null}[o.status];if(!s){if(r.has(e))return`waiting`;r.add(e);let n=o.dependsOn.filter(e=>t.has(e)).map(i);r.delete(e),s=n.some(e=>e===`failed`||e===`blocked`)?`blocked`:n.every(e=>e===`done`)?`ready`:`waiting`}return n.set(e,s),s};for(let t of e)i(t.id);return n}function ve(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Map;for(let t of e)for(let e of t.dependsOn)r.set(e,[...r.get(e)??[],t.id]);let i=(e,t)=>{let n=new Set,r=[...t(e)];for(;r.length;){let e=r.pop();e===void 0||n.has(e)||(n.add(e),r.push(...t(e)))}return n};return{up:i(t,e=>n.get(e)?.dependsOn??[]),down:i(t,e=>r.get(e)??[])}}var X=o();function ye({task:e,tasks:t,readiness:r,onSelect:i,onClose:a,onEdit:o}){let s=p(),c=h(),l=w(),[u,d]=(0,J.useState)(!1),[f,m]=(0,J.useState)(null),g=(t,n)=>s.mutate({id:e.id,patch:{status:t}},{onSuccess:()=>z({tone:`ok`,title:n,description:e.id}),onError:e=>z({tone:`err`,title:`Could not ${n.toLowerCase()}`,description:j(e)})}),_=()=>l.mutate(e.id,{onSuccess:()=>z({tone:`info`,title:`Runner started`,description:e.id}),onError:e=>z({tone:`err`,title:`Could not start the runner`,description:j(e)})}),v=()=>c.mutate(e.id,{onSuccess:()=>{z({tone:`ok`,title:`Task deleted`,description:e.id}),d(!1),a()},onError:e=>m(j(e))}),b=new Map(t.map(e=>[e.id,e])),x=t.filter(t=>t.dependsOn.includes(e.id)),C=e.status===`SUCCESS`;return(0,X.jsxs)(`article`,{"aria-labelledby":`task-title`,className:`flex flex-col gap-4 p-4`,children:[(0,X.jsxs)(`header`,{className:`flex items-start gap-2`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`p`,{className:`flex items-center gap-1 font-mono text-2xs text-muted`,children:[e.id,(0,X.jsx)(ue,{value:e.id,label:`Copy task id`,className:`size-5`})]}),(0,X.jsx)(`h3`,{id:`task-title`,className:`mt-0.5 text-[15px] leading-5 font-semibold tracking-tight text-fg`,children:e.title})]}),(0,X.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Close task details`,className:`-mr-1 inline-flex size-7 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg`,children:(0,X.jsx)(de,{"aria-hidden":!0,className:`size-4`,strokeWidth:1.75})})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,X.jsx)(I,{status:e.status}),r===`ready`&&(0,X.jsx)(D,{tone:`ok`,children:`ready to run`}),r===`blocked`&&(0,X.jsx)(D,{tone:`err`,children:`blocked by a failed dependency`}),e.priority!==void 0&&(0,X.jsxs)(D,{mono:!0,children:[`priority `,e.priority]}),e.attempts!==void 0&&(0,X.jsxs)(D,{mono:!0,children:[`attempt `,e.attempts]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[r===`ready`&&(0,X.jsx)(n,{size:`sm`,variant:`primary`,icon:ie,loading:l.isPending,onClick:_,children:`Run now`}),y(e.status).map(e=>(0,X.jsx)(n,{size:`sm`,variant:e.variant,disabled:s.isPending,onClick:()=>g(e.to,e.label),children:e.label},e.to)),(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,X.jsx)(n,{size:`sm`,variant:`ghost`,icon:ee,onClick:o,children:`Edit`}),(0,X.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:M,"aria-label":`Delete task ${e.id}`,onClick:()=>{m(null),d(!0)},className:`text-err hover:bg-err-soft hover:text-err`})]})]}),e.branch&&(0,X.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-fg-2`,children:[(0,X.jsx)(B,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),e.branch]}),e.description&&(0,X.jsx)(`p`,{className:`text-[13px] leading-5 text-fg-2`,children:e.description}),e.acceptance&&e.acceptance.length>0&&(0,X.jsxs)(`section`,{"aria-labelledby":`acc-title`,children:[(0,X.jsx)(`h4`,{id:`acc-title`,className:`eyebrow mb-1.5`,children:`Acceptance criteria`}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.acceptance.map(e=>(0,X.jsxs)(`li`,{className:`flex items-start gap-2 text-[13px] leading-5 text-fg-2`,children:[C?(0,X.jsx)(ne,{"aria-label":`met`,className:`mt-0.5 size-3.5 shrink-0 text-ok`,strokeWidth:1.75}):(0,X.jsx)(fe,{"aria-label":`not verified yet`,className:`mt-0.5 size-3.5 shrink-0 text-faint`,strokeWidth:1.75}),e]},e))})]}),e.notes&&(0,X.jsxs)(`section`,{"aria-labelledby":`notes-title`,children:[(0,X.jsx)(`h4`,{id:`notes-title`,className:`eyebrow mb-1.5`,children:`Notes`}),(0,X.jsx)(`p`,{className:`rounded-md border border-line bg-raised p-2.5 text-[12px] leading-5 text-fg-2`,children:e.notes})]}),(0,X.jsxs)(`section`,{"aria-labelledby":`deps-title`,className:`grid grid-cols-2 gap-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{id:`deps-title`,className:`eyebrow mb-1.5`,children:`Depends on`}),(0,X.jsx)(Z,{ids:e.dependsOn,byId:b,onSelect:i})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{className:`eyebrow mb-1.5`,children:`Unblocks`}),(0,X.jsx)(Z,{ids:x.map(e=>e.id),byId:b,onSelect:i})]})]}),e.updatedAt&&(0,X.jsxs)(`p`,{className:`text-2xs text-muted`,children:[`Updated `,S(Date.parse(e.updatedAt))]}),(0,X.jsxs)(le,{open:u,onClose:()=>d(!1),title:`Delete ${e.id}?`,description:x.length>0?`Other tasks depend on this one, so the gateway will refuse until those dependencies are removed.`:`The task is removed from TASK_GRAPH.json. Its branch and any merged work stay in git.`,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(n,{variant:`ghost`,onClick:()=>d(!1),children:`Keep task`}),(0,X.jsx)(n,{variant:`danger`,icon:M,loading:c.isPending,onClick:v,children:`Delete task`})]}),children:[(0,X.jsx)(`p`,{className:`truncate text-[13px] text-fg-2`,children:e.title}),x.length>0&&(0,X.jsxs)(`p`,{className:`mt-2 font-mono text-[12px] text-muted`,children:[`Needed by `,x.map(e=>e.id).join(`, `)]}),f&&(0,X.jsx)(A,{tone:`err`,title:`Could not delete the task`,className:`mt-3`,children:f})]})]})}function Z({ids:e,byId:t,onSelect:n}){return e.length===0?(0,X.jsx)(`p`,{className:`text-[12px] text-faint`,children:`None`}):(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>{let r=t.get(e);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`flex w-full min-w-0 items-center gap-1.5 rounded px-1 py-0.5 text-left font-mono text-[12px] text-fg-2 hover:bg-hover hover:text-fg`,children:[r?(0,X.jsx)(F,{status:r.status}):(0,X.jsx)(`span`,{className:`text-err`,children:`?`}),(0,X.jsx)(`span`,{className:`truncate`,children:e})]})},e)})})}var Q=204,$=56,be={SUCCESS:`stroke-ok/50`,IN_PROGRESS:`stroke-info/70`,FAILED:`stroke-err/70`,PENDING:`stroke-line-strong`},xe={SUCCESS:`border-line-strong`,IN_PROGRESS:`border-info/50 shadow-[0_0_0_3px_var(--dc-info-soft)]`,FAILED:`border-err/50`,PENDING:`border-line-strong border-dashed`};function Se({tasks:t,ready:n,selectedId:r,onSelect:i}){let a=(0,J.useMemo)(()=>Y(t,{nodeWidth:Q,nodeHeight:$,gapX:14,gapY:40,padding:20,direction:`TB`}),[t]),[o,s]=(0,J.useState)(null),c=o??r,l=(0,J.useMemo)(()=>c?ve(t,c):null,[t,c]),u=(0,J.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),d=e=>!l||e===c||l.up.has(e)||l.down.has(e),f=(e,t)=>!l||(e===c||l.up.has(e))&&(t===c||l.up.has(t))||(t===c||l.down.has(t))&&(e===c||l.down.has(e));return(0,X.jsx)(`div`,{className:`relative overflow-x-auto`,children:(0,X.jsxs)(`div`,{className:`relative mx-auto`,style:{width:a.width,height:a.height},children:[(0,X.jsxs)(`svg`,{width:a.width,height:a.height,className:`pointer-events-none absolute inset-0`,"aria-hidden":!0,children:[(0,X.jsx)(`defs`,{children:(0,X.jsx)(`marker`,{id:`dag-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,X.jsx)(`path`,{d:`M0,0 L8,4 L0,8 z`,className:`fill-faint`})})}),a.edges.map(t=>{let n=u.get(t.from),r=f(t.from,t.to);return(0,X.jsx)(`path`,{d:t.path,fill:`none`,strokeWidth:r&&l?1.75:1.25,markerEnd:`url(#dag-arrow)`,className:e(`transition-opacity duration-200`,n?be[n.status]:`stroke-line-strong`,!r&&`opacity-20`)},`${t.from}->${t.to}`)})]}),a.nodes.map(t=>{let a=u.get(t.id);if(!a)return null;let o=n.get(a.id),c=a.id===r;return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(a.id),onPointerEnter:()=>s(a.id),onPointerLeave:()=>s(null),onFocus:()=>s(a.id),onBlur:()=>s(null),"aria-pressed":c,"aria-label":`${a.id}: ${a.title}. ${a.status.toLowerCase().replace(`_`,` `)}${o===`ready`?`, ready to run`:o===`blocked`?`, blocked by a failed dependency`:``}`,className:e(`absolute flex flex-col justify-center gap-1 rounded-md border bg-panel px-2.5 text-left transition-[opacity,border-color,box-shadow,transform] duration-200 ease-snappy`,`hover:-translate-y-px hover:border-fg-2/40`,xe[a.status],c&&`border-accent shadow-[0_0_0_3px_var(--dc-accent-soft)]`,!d(a.id)&&`opacity-35`),style:{left:t.x,top:t.y,width:Q,height:$},children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(F,{status:a.status}),(0,X.jsx)(`span`,{className:`truncate font-mono text-2xs text-muted`,children:a.id}),o===`ready`&&(0,X.jsx)(`span`,{className:`ml-auto shrink-0 rounded border border-ok/30 px-1 text-[10px] leading-4 text-ok`,children:`ready`}),o===`blocked`&&(0,X.jsx)(`span`,{className:`ml-auto shrink-0 rounded border border-err/30 px-1 text-[10px] leading-4 text-err`,children:`blocked`}),a.status===`IN_PROGRESS`&&(0,X.jsx)(`span`,{className:`ml-auto shrink-0 rounded border border-info/30 px-1 text-[10px] leading-4 text-info`,children:`running`})]}),(0,X.jsx)(`span`,{className:`truncate text-[12px] leading-4 text-fg`,children:a.title})]},t.id)})]})})}function Ce({open:e,task:t,tasks:n,onClose:r}){let i=t!==void 0;return(0,X.jsx)(oe,{open:e,onClose:r,title:i?`Edit task`:`New task`,description:i?(0,X.jsx)(`span`,{className:`font-mono`,children:t.id}):`The task starts as pending and is picked up in dependency order.`,width:`w-[min(560px,100vw)]`,children:e&&(0,X.jsx)(we,{task:t,tasks:n,onDone:r},t?.id??`new`)})}function we({task:e,tasks:t,onDone:r}){let i=x(),a=p(),[o,s]=(0,J.useState)(()=>e?_(e):l()),[c,m]=(0,J.useState)(!1),[h,g]=(0,J.useState)({}),[y,S]=(0,J.useState)(null),C=i.isPending||a.isPending,w=(e,t)=>s(n=>({...n,[e]:t})),T=n=>s(r=>({...r,title:n,...!e&&!c?{id:v(d(n),t)}:{}}));return(0,X.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),S(null);let s=b(o,t,e?.id);if(g(s),!(Object.keys(s).length>0))try{if(e){let t=E(e,o);f(t)||await a.mutateAsync({id:e.id,patch:t}),z({tone:`ok`,title:`Task updated`,description:e.id})}else{let e=await i.mutateAsync(u(o));z({tone:`ok`,title:`Task created`,description:e.id})}r()}catch(e){S(j(e))}},noValidate:!0,className:`flex flex-col gap-5`,children:[(0,X.jsx)(U,{label:`Title`,required:!0,error:h.title,children:({id:e,describedBy:t,invalid:n})=>(0,X.jsx)(H,{id:e,autoFocus:!0,value:o.title,onChange:e=>T(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,placeholder:`Add the /health endpoint`})}),!e&&(0,X.jsx)(U,{label:`Id`,required:!0,error:h.id,hint:`Lowercase kebab-case. Used for the branch name and in dependencies; it cannot change later.`,children:({id:e,describedBy:t,invalid:n})=>(0,X.jsx)(H,{id:e,value:o.id,onChange:e=>{m(!0),w(`id`,e.target.value)},"aria-describedby":t,"aria-invalid":n||void 0,spellCheck:!1,autoCapitalize:`off`,className:`font-mono`})}),(0,X.jsx)(U,{label:`Description`,children:({id:e,describedBy:t})=>(0,X.jsx)(V,{id:e,value:o.description,onChange:e=>w(`description`,e.target.value),"aria-describedby":t,placeholder:`What needs to be done and why.`})}),(0,X.jsx)(U,{label:`Acceptance criteria`,hint:`One per line. The validator and judge check the result against these.`,children:({id:e,describedBy:t})=>(0,X.jsx)(V,{id:e,value:o.acceptance,onChange:e=>w(`acceptance`,e.target.value),"aria-describedby":t,placeholder:`GET /health returns 200
2
+ The route has a test`})}),(0,X.jsx)(U,{label:`Priority`,error:h.priority,hint:`Higher runs first among unblocked tasks. Empty means 0.`,className:`max-w-40`,children:({id:e,describedBy:t,invalid:n})=>(0,X.jsx)(H,{id:e,inputMode:`decimal`,value:o.priority,onChange:e=>w(`priority`,e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`tnum font-mono`})}),(0,X.jsx)(Te,{tasks:t,selfId:e?.id,value:o.dependsOn,onChange:e=>w(`dependsOn`,e),error:h.dependsOn}),e&&(0,X.jsx)(U,{label:`Notes`,hint:`Written by the runner after each attempt; edit to leave a hint.`,children:({id:e,describedBy:t})=>(0,X.jsx)(V,{id:e,value:o.notes,onChange:e=>w(`notes`,e.target.value),"aria-describedby":t})}),y&&(0,X.jsx)(A,{tone:`err`,title:e?`Could not save the task`:`Could not create the task`,children:y}),(0,X.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center justify-end gap-2 border-t border-line bg-panel px-5 py-3`,children:[(0,X.jsx)(n,{variant:`ghost`,onClick:r,children:`Cancel`}),(0,X.jsx)(n,{type:`submit`,variant:`primary`,loading:C,children:e?`Save changes`:`Create task`})]})]})}function Te({tasks:t,selfId:n,value:r,onChange:i,error:a}){let[o,s]=(0,J.useState)(``),c=(0,J.useMemo)(()=>g(t,n),[t,n]),l=new Set(t.map(e=>e.id)),u=t.length-c.length-+!!n,d=o.trim().toLowerCase(),f=c.filter(e=>!d||e.id.toLowerCase().includes(d)||e.title.toLowerCase().includes(d)),p=r.filter(e=>!l.has(e)),m=(e,t)=>i(t?[...r,e]:r.filter(t=>t!==e));return(0,X.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,"aria-describedby":a?`deps-error`:void 0,children:[(0,X.jsxs)(`legend`,{className:`mb-1.5 flex w-full items-baseline gap-2 text-[12px] font-medium text-fg-2`,children:[`Depends on`,(0,X.jsx)(`span`,{className:`tnum font-normal text-muted`,children:r.length===0?`none`:`${r.length} selected`})]}),(0,X.jsxs)(`div`,{className:`rounded-md border border-line-strong bg-bg`,children:[(0,X.jsxs)(`div`,{className:`relative border-b border-line`,children:[(0,X.jsx)(te,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,X.jsx)(`input`,{type:`search`,"aria-label":`Filter tasks`,placeholder:`Filter tasks`,value:o,onChange:e=>s(e.target.value),className:`h-8 w-full bg-transparent pr-2.5 pl-8 text-[13px] text-fg placeholder:text-faint focus-visible:outline-none`})]}),(0,X.jsxs)(`ul`,{className:`max-h-48 overflow-y-auto p-1`,children:[p.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[12px] hover:bg-hover`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>m(e,!1),className:`size-3.5 accent-accent`}),(0,X.jsx)(`span`,{className:`font-mono text-err`,children:e}),(0,X.jsx)(`span`,{className:`text-muted`,children:`unknown task, uncheck to remove`})]})},e)),f.length===0&&p.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-3 text-center text-[12px] text-faint`,children:t.length===0?`No other tasks yet.`:`No tasks match.`}),f.map(t=>{let n=r.includes(t.id);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`label`,{className:e(`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[12px] hover:bg-hover`,n&&`bg-hover/60`),children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>m(t.id,e.target.checked),className:`size-3.5 accent-accent`}),(0,X.jsx)(F,{status:t.status}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg`,children:t.title}),(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-2xs text-muted`,children:t.id})]})},t.id)})]})]}),a?(0,X.jsx)(`p`,{id:`deps-error`,role:`alert`,className:`text-[12px] leading-4 text-err`,children:a}):(0,X.jsxs)(`p`,{className:`text-[12px] leading-4 text-muted`,children:[`This task waits until every selected task is done.`,n&&u>0&&` ${u} dependent task${u===1?``:`s`} hidden: choosing them would create a cycle.`]})]})}var Ee=[`IN_PROGRESS`,`PENDING`,`FAILED`,`SUCCESS`];function De(){let e=m(),t=T(),{params:i}=re(),o=[`graph`,`board`,`list`].includes(i.get(`view`)??``)?i.get(`view`):`graph`,c=i.get(`task`),l=i.get(`panel`),u=i.get(`new`)===`1`,d=i.get(`edit`),f=e.data?.graph.tasks??[],p=(0,J.useMemo)(()=>_e(f),[f]),h=f.find(e=>e.id===c),g=f.find(e=>e.id===d),_=l??(h?`task`:`state`),v=(0,J.useMemo)(()=>Y(f),[f]),y=(0,J.useMemo)(()=>{let e={PENDING:0,IN_PROGRESS:0,SUCCESS:0,FAILED:0};for(let t of f)e[t.status]+=1;return e},[f]),b=f.length?y.SUCCESS/f.length:0,x=e=>{P(`panel`,null),P(`task`,e)},S=e.data?.project;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(s,{title:`Tasks`,description:S?(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`text-fg-2`,children:S.name}),` `,(0,X.jsxs)(`span`,{className:`font-mono text-2xs text-faint`,children:[S.root,`/.davecode/TASK_GRAPH.json`]})]}):`The project task graph the autonomous runner works through.`,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(n,{variant:`primary`,icon:N,onClick:()=>P(`new`,`1`),children:`New task`}),(0,X.jsx)(R,{label:`Task view`,value:o,onChange:e=>P(`view`,e===`graph`?null:e),options:[{value:`graph`,label:`Graph`,icon:he},{value:`board`,label:`Board`,icon:pe},{value:`list`,label:`List`,icon:me}]})]})}),e.isError&&(0,X.jsx)(A,{tone:`err`,title:`Could not load the task graph`,children:C(e.error)}),f.length>0&&(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 text-[12px]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(`div`,{className:`h-1.5 w-40 overflow-hidden rounded-full bg-track`,role:`progressbar`,"aria-label":`Tasks done`,"aria-valuemin":0,"aria-valuemax":f.length,"aria-valuenow":y.SUCCESS,children:(0,X.jsx)(`div`,{className:`h-full rounded-full bg-ok transition-[width] duration-500 ease-snappy`,style:{width:`${b*100}%`}})}),(0,X.jsxs)(`span`,{className:`tnum text-fg-2`,children:[y.SUCCESS,` of `,f.length,` done`]})]}),Ee.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted`,children:[(0,X.jsx)(F,{status:e}),L[e],` `,(0,X.jsx)(`span`,{className:`tnum text-fg-2`,children:y[e]})]},e)),v.missing.length>0&&(0,X.jsxs)(D,{tone:`warn`,children:[v.missing.length,` unknown dependencies`]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1fr)_380px]`,children:[(0,X.jsx)(r,{className:`min-h-[420px]`,children:e.isPending?(0,X.jsx)(`div`,{className:`p-4`,children:(0,X.jsx)(ae,{className:`h-[380px] w-full`})}):f.length===0?(0,X.jsx)(se,{icon:B,title:`No task graph yet`,description:`Describe the work as a DAG of tasks and the runner will pick them up in dependency order. You can also edit .davecode/TASK_GRAPH.json by hand.`,command:`davecode run`,action:(0,X.jsx)(n,{variant:`primary`,icon:N,onClick:()=>P(`new`,`1`),children:`New task`}),className:`py-20`}):o===`graph`?(0,X.jsx)(Se,{tasks:f,ready:p,selectedId:c,onSelect:x}):o===`board`?(0,X.jsx)(ke,{tasks:f,ready:p,selectedId:c,onSelect:x}):(0,X.jsx)(Ae,{tasks:f,ready:p,selectedId:c,onSelect:x})}),(0,X.jsxs)(r,{className:`xl:sticky xl:top-16 xl:max-h-[calc(100dvh-5rem)] xl:self-start`,children:[(0,X.jsx)(a,{title:(0,X.jsx)(R,{size:`sm`,label:`Side panel`,value:_,onChange:e=>P(`panel`,e),options:[...h?[{value:`task`,label:`Task`,icon:B}]:[],{value:`state`,label:`STATE.md`,icon:O},{value:`architecture`,label:`ARCHITECTURE.md`,icon:O}]})}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:_===`task`&&h?(0,X.jsx)(ye,{task:h,tasks:f,readiness:p.get(h.id),onSelect:x,onEdit:()=>P(`edit`,h.id),onClose:()=>{P(`task`,null),P(`panel`,null)}}):t.isPending?(0,X.jsx)(ce,{rows:6}):t.isError?(0,X.jsx)(`p`,{className:`p-4 text-[12px] text-err`,children:C(t.error)}):(0,X.jsx)(k,{className:`p-4`,source:(_===`architecture`?t.data?.architecture:t.data?.state)||`_This file is empty._`})})]})]}),(0,X.jsx)(Ce,{open:u,tasks:f,onClose:()=>P(`new`,null)}),(0,X.jsx)(Ce,{open:!!g,task:g,tasks:f,onClose:()=>P(`edit`,null)})]})}function Oe({r:e}){return e===`ready`?(0,X.jsx)(D,{tone:`ok`,children:`ready`}):e===`blocked`?(0,X.jsx)(D,{tone:`err`,children:`blocked`}):null}function ke({tasks:t,ready:n,selectedId:r,onSelect:i}){return(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-px overflow-x-auto bg-line sm:grid-cols-2 lg:grid-cols-4`,children:Ee.map(a=>{let o=t.filter(e=>e.status===a).sort((e,t)=>(t.priority??0)-(e.priority??0));return(0,X.jsxs)(`section`,{"aria-label":L[a],className:`flex min-w-0 flex-col bg-panel`,children:[(0,X.jsxs)(`h3`,{className:`flex items-center gap-2 border-b border-line px-3 py-2 text-[12px] font-medium text-fg-2`,children:[(0,X.jsx)(F,{status:a}),L[a],(0,X.jsx)(`span`,{className:`tnum ml-auto text-muted`,children:o.length})]}),(0,X.jsxs)(`ul`,{className:`flex flex-col gap-2 p-2`,children:[o.length===0&&(0,X.jsx)(`li`,{className:`px-1 py-3 text-center text-[12px] text-faint`,children:`Empty`}),o.map(t=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(t.id),"aria-pressed":t.id===r,className:e(`flex w-full flex-col gap-1.5 rounded-md border bg-raised p-2.5 text-left transition-colors duration-150 hover:border-fg-2/30`,t.id===r?`border-accent`:`border-line`),children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`truncate font-mono text-2xs text-muted`,children:t.id}),(0,X.jsx)(`span`,{className:`ml-auto`,children:(0,X.jsx)(Oe,{r:n.get(t.id)})})]}),(0,X.jsx)(`span`,{className:`text-[12px] leading-4 text-fg`,children:t.title}),t.dependsOn.length>0&&(0,X.jsxs)(`span`,{className:`truncate font-mono text-[10px] text-faint`,children:[`after `,t.dependsOn.join(`, `)]})]})},t.id))]})]},a)})})}function Ae({tasks:t,ready:n,selectedId:r,onSelect:i}){let a=(0,J.useMemo)(()=>new Map(Y(t).nodes.map(e=>[e.id,e.layer])),[t]),o=[...t].sort((e,t)=>(a.get(e.id)??0)-(a.get(t.id)??0)||(t.priority??0)-(e.priority??0));return(0,X.jsx)(`div`,{className:`overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-[640px] text-[12px]`,children:[(0,X.jsx)(`caption`,{className:`sr-only`,children:`Tasks in dependency order`}),(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`border-b border-line text-left text-muted`,children:[(0,X.jsx)(`th`,{scope:`col`,className:`px-3.5 py-2 font-medium`,children:`Task`}),(0,X.jsx)(`th`,{scope:`col`,className:`px-2 py-2 font-medium`,children:`Status`}),(0,X.jsx)(`th`,{scope:`col`,className:`px-2 py-2 text-right font-medium`,children:`Priority`}),(0,X.jsx)(`th`,{scope:`col`,className:`px-2 py-2 font-medium`,children:`Depends on`})]})}),(0,X.jsx)(`tbody`,{children:o.map(t=>(0,X.jsxs)(`tr`,{className:e(`border-b border-line last:border-b-0`,t.id===r&&`bg-hover/60`),children:[(0,X.jsx)(`td`,{className:`max-w-0 px-3.5 py-2`,children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(t.id),className:`block w-full min-w-0 text-left hover:underline`,children:[(0,X.jsx)(`span`,{className:`block truncate text-[13px] text-fg`,children:t.title}),(0,X.jsx)(`span`,{className:`block truncate font-mono text-2xs text-muted`,children:t.id})]})}),(0,X.jsx)(`td`,{className:`px-2 py-2`,children:(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(I,{status:t.status}),(0,X.jsx)(Oe,{r:n.get(t.id)})]})}),(0,X.jsx)(`td`,{className:`tnum px-2 py-2 text-right font-mono text-fg-2`,children:t.priority??`—`}),(0,X.jsx)(`td`,{className:`max-w-0 truncate px-2 py-2 font-mono text-2xs text-muted`,children:t.dependsOn.join(`, `)||`—`})]},t.id))})]})})}export{De as Tasks};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,i as n,n as r,o as i,s as a,t as o,u as s}from"./Panel-Du40pM7n.js";import{B as c,V as l,c as u,ct as d,f,i as p,l as m,lt as h,p as g,r as _,t as v,ut as y}from"./Badge-CGY6DgGx.js";import{A as b,C as x,F as S,G as C,P as w,S as T,V as E,c as D,i as O,o as k,p as A,t as j,u as M,w as N}from"./index-BCi-Vuvh.js";import{n as P,r as F}from"./Field-OXMnT9Tb.js";var I={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};I.node;var L=i(I),R=s(t(),1),z=a();function B({chain:t,accounts:n,className:r}){let i=t.attempts.map(e=>{let t=n.get(e.accountId)?.label??e.accountId;return e.outcome===`failed`?`${t} failed (${y(e)})`:`${t} ${e.outcome}`}).join(`, then `);return(0,z.jsxs)(`div`,{className:e(`flex min-w-0 items-center gap-1`,r),title:i,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:i}),t.attempts.map((e,r)=>(0,z.jsxs)(R.Fragment,{children:[r>0&&(0,z.jsx)(V,{attempt:t.attempts[r-1]}),(0,z.jsx)(H,{attempt:e,account:n.get(e.accountId),compact:t.attempts.length>2&&r<t.attempts.length-1})]},r))]})}function V({attempt:e}){return(0,z.jsxs)(`span`,{"aria-hidden":!0,className:`flex shrink-0 items-center gap-1 text-faint`,children:[(0,z.jsx)(`span`,{className:`h-px w-2 bg-line-strong`}),e?.outcome===`failed`&&(0,z.jsx)(`span`,{className:`rounded border border-err/30 bg-err-soft px-1 font-mono text-[10px] leading-4 text-err`,children:y(e)}),(0,z.jsx)(`span`,{className:`h-px w-2 bg-line-strong`}),(0,z.jsx)(`span`,{className:`-ml-1.5 text-[10px] leading-none`,children:`▸`})]})}function H({attempt:t,account:n,compact:r}){let i=n?.label??t.accountId;return(0,z.jsxs)(`span`,{"aria-hidden":!0,className:e(`inline-flex h-6 max-w-[180px] min-w-0 items-center gap-1.5 rounded border pr-1.5 pl-0.5 text-[12px]`,t.outcome===`failed`?`border-line text-muted`:`border-line-strong bg-raised text-fg`),children:[(0,z.jsx)(A,{provider:t.provider,size:`sm`,className:`size-[18px] border-0 bg-transparent`}),!r&&(0,z.jsx)(`span`,{className:e(`truncate`,t.outcome===`failed`&&`line-through decoration-faint`),children:i}),t.outcome===`success`&&(0,z.jsx)(E,{className:`size-3 shrink-0 text-ok`,strokeWidth:2.25}),t.outcome===`failed`&&(0,z.jsx)(N,{className:`size-3 shrink-0 text-err`,strokeWidth:2.25}),t.outcome===`pending`&&(0,z.jsx)(L,{className:`size-3 shrink-0 animate-spin text-info [animation-duration:1.6s]`,strokeWidth:2})]})}function U({chain:e}){return e.outcome===`pending`?(0,z.jsx)(v,{tone:`info`,dot:!0,pulse:!0,children:`in flight`}):e.outcome===`failed`?(0,z.jsx)(v,{tone:`err`,dot:!0,children:`failed`}):e.failovers>0?(0,z.jsxs)(v,{tone:`warn`,dot:!0,children:[`ok · `,e.failovers,` failover`,e.failovers>1?`s`:``]}):(0,z.jsx)(v,{tone:`ok`,dot:!0,children:`ok`})}function W({chain:e,accounts:t,onClose:n}){return(0,z.jsx)(D,{open:!!e,onClose:n,title:`Request`,description:e&&(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[e.requestId,(0,z.jsx)(M,{value:e.requestId,label:`Copy request id`})]}),width:`w-[min(520px,100vw)]`,children:e&&(0,z.jsx)(G,{chain:e,accounts:t})})}function G({chain:t,accounts:n}){let r=h(t),i=d(t),a=[[`Outcome`,(0,z.jsx)(U,{chain:t},`o`)],[`Model`,(0,z.jsx)(`span`,{className:`font-mono`,children:t.model||`—`},`m`)],[`Started`,(0,z.jsx)(`span`,{className:`tnum font-mono`,children:_(t.startedTs,!0)},`s`)],[`End-to-end`,(0,z.jsx)(`span`,{className:`tnum font-mono`,children:i===void 0?`—`:m(i)},`l`)],[`Tokens`,(0,z.jsxs)(`span`,{className:`tnum font-mono`,children:[u(r.prompt),` in · `,u(r.completion),` out`]},`t`)],[`Failovers`,(0,z.jsx)(`span`,{className:`tnum font-mono`,children:t.failovers},`f`)]];return(0,z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,z.jsx)(`dl`,{className:`grid grid-cols-[110px_1fr] gap-x-4 gap-y-2 text-[13px]`,children:a.map(([e,t])=>(0,z.jsxs)(`div`,{className:`contents`,children:[(0,z.jsx)(`dt`,{className:`text-muted`,children:e}),(0,z.jsx)(`dd`,{className:`min-w-0 text-fg`,children:t})]},e))}),(0,z.jsxs)(`section`,{"aria-labelledby":`attempts-title`,children:[(0,z.jsx)(`h3`,{id:`attempts-title`,className:`mb-2 text-[12px] font-medium text-fg-2`,children:`Attempts`}),(0,z.jsx)(`ol`,{className:`relative flex flex-col gap-0`,children:t.attempts.map((r,i)=>{let a=n.get(r.accountId),o=r.startedTs-t.startedTs,s=i===t.attempts.length-1;return(0,z.jsxs)(`li`,{className:`relative flex gap-3 pb-4 last:pb-0`,children:[!s&&(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-7 bottom-0 left-[11px] w-px bg-line-strong`}),(0,z.jsx)(`span`,{className:e(`z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border text-[10px] font-semibold`,r.outcome===`success`?`border-ok/40 bg-ok-soft text-ok`:r.outcome===`failed`?`border-err/40 bg-err-soft text-err`:`border-info/40 bg-info-soft text-info`),children:i+1}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-md border border-line bg-raised p-2.5`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(A,{provider:r.provider,size:`sm`}),(0,z.jsx)(`span`,{className:`truncate text-[13px] font-medium text-fg`,children:a?.label??r.accountId}),(0,z.jsx)(`span`,{className:`ml-auto`,children:r.outcome===`success`?(0,z.jsx)(v,{tone:`ok`,children:`served`}):r.outcome===`failed`?(0,z.jsxs)(v,{tone:`err`,mono:!0,children:[y(r),` `,r.errorKind]}):(0,z.jsx)(v,{tone:`info`,dot:!0,pulse:!0,children:`in flight`})})]}),(0,z.jsxs)(`p`,{className:`tnum mt-1.5 font-mono text-2xs text-muted`,children:[r.accountId,` · +`,m(o),r.latencyMs!==void 0&&` · took ${m(r.latencyMs)}`,r.outcome===`success`&&` · ${u(r.promptTokens??0)} → ${u(r.completionTokens??0)} tok`]}),r.errorMessage&&(0,z.jsx)(`p`,{className:`mt-1.5 text-[12px] text-fg-2`,children:r.errorMessage})]})]},i)})})]}),(0,z.jsxs)(`details`,{className:`rounded-md border border-line`,children:[(0,z.jsx)(`summary`,{className:`px-3 py-2 text-[12px] font-medium text-fg-2 select-none hover:text-fg`,children:`Raw chain`}),(0,z.jsx)(`pre`,{className:`max-h-80 overflow-auto border-t border-line p-3 font-mono text-2xs leading-5 text-fg-2`,children:JSON.stringify(t,null,2)})]})]})}function K(e,t){switch(t){case`ok`:return e.outcome===`success`&&e.failovers===0;case`failover`:return e.failovers>0;case`failed`:return e.outcome===`failed`;case`pending`:return e.outcome===`pending`;default:return!0}}var q=250;function J(){let t=l(),{connection:i}=c(),a=g(),{params:s}=x(),[u,y]=(0,R.useState)(``),[E,D]=(0,R.useState)(`all`),[A,M]=(0,R.useState)(``),[N,I]=(0,R.useState)(null),L=(0,R.useMemo)(()=>new Map((a.data??[]).map(e=>[e.id,e])),[a.data]),V=N??t.chains,H=N?Math.max(0,t.chains.length-N.length):0,G=(0,R.useMemo)(()=>{let e={all:0,ok:0,failover:0,failed:0,pending:0};for(let t of V)e.all+=1,K(t,`ok`)&&(e.ok+=1),K(t,`failover`)&&(e.failover+=1),K(t,`failed`)&&(e.failed+=1),K(t,`pending`)&&(e.pending+=1);return e},[V]),J=u.trim().toLowerCase(),Y=V.filter(e=>K(e,E)&&(!A||e.attempts.some(e=>e.accountId===A))&&(!J||e.requestId.toLowerCase().includes(J)||e.model.toLowerCase().includes(J)||e.attempts.some(e=>e.accountId.toLowerCase().includes(J)||(L.get(e.accountId)?.label.toLowerCase().includes(J)??!1)))).slice(0,q),X=s.get(`req`),Z=X?t.chains.find(e=>e.requestId===X):void 0,Q=t.chains.length===0&&i.mode!==`live`;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsx)(o,{title:`Traffic`,description:`Every request through /v1, with failover hops shown inline.`,actions:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[N?(0,z.jsxs)(v,{tone:`warn`,children:[`paused`,H>0&&` · ${H} new`]}):(0,z.jsx)(v,{tone:`ok`,dot:!0,pulse:!0,children:`streaming`}),(0,z.jsx)(n,{icon:N?w:S,onClick:()=>I(N?null:t.chains),"aria-pressed":!!N,children:N?`Resume`:`Pause`})]})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsxs)(`div`,{className:`relative w-full sm:w-64`,children:[(0,z.jsx)(b,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,z.jsx)(P,{type:`search`,"aria-label":`Filter requests`,placeholder:`Model, request id or account`,value:u,onChange:e=>y(e.target.value),className:`pl-8`,"data-filter-input":!0})]}),(0,z.jsx)(j,{label:`Outcome`,value:E,onChange:D,options:[{value:`all`,label:`All`,count:G.all},{value:`ok`,label:`OK`,count:G.ok},{value:`failover`,label:`Failover`,count:G.failover},{value:`failed`,label:`Failed`,count:G.failed},{value:`pending`,label:`In flight`,count:G.pending}]}),(0,z.jsxs)(F,{"aria-label":`Filter by account`,value:A,onChange:e=>M(e.target.value),className:`w-auto min-w-44`,children:[(0,z.jsx)(`option`,{value:``,children:`All accounts`}),(a.data??[]).map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,z.jsx)(r,{children:Q?(0,z.jsx)(k,{rows:8}):Y.length===0?t.chains.length===0?(0,z.jsx)(O,{icon:C,title:`No requests yet`,description:`Point any OpenAI-compatible client at the gateway and use a davecode/<route> model.`,command:`curl http://127.0.0.1:4040/v1/chat/completions -H 'content-type: application/json' -d '{"model":"davecode/auto","messages":[{"role":"user","content":"hi"}]}'`}):(0,z.jsx)(O,{icon:b,title:`No matching requests`,description:`Try a different filter.`}):(0,z.jsx)(`div`,{className:`overflow-x-auto`,children:(0,z.jsxs)(`table`,{className:`w-full min-w-[920px] text-[12px]`,children:[(0,z.jsx)(`caption`,{className:`sr-only`,children:`Recent requests, newest first`}),(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{className:`border-b border-line text-left text-muted`,children:[(0,z.jsx)(`th`,{scope:`col`,className:`w-24 px-3.5 py-2 font-medium`,children:`Time`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-24 px-2 py-2 font-medium`,children:`Request`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-40 px-2 py-2 font-medium`,children:`Model`}),(0,z.jsx)(`th`,{scope:`col`,className:`px-2 py-2 font-medium`,children:`Accounts`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-20 px-2 py-2 text-right font-medium`,children:`Latency`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-28 px-2 py-2 text-right font-medium`,children:`Tokens in → out`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-36 px-3.5 py-2 text-right font-medium`,children:`Status`})]})}),(0,z.jsx)(`tbody`,{children:Y.map(t=>{let n=h(t),r=d(t);return(0,z.jsxs)(`tr`,{onClick:()=>T(`req`,t.requestId),className:e(`animate-row-in cursor-pointer border-b border-line transition-colors duration-150 last:border-b-0 hover:bg-hover/60`,X===t.requestId&&`bg-hover/60`),children:[(0,z.jsx)(`td`,{className:`tnum px-3.5 py-2 font-mono text-muted`,children:_(t.startedTs)}),(0,z.jsx)(`td`,{className:`px-2 py-2`,children:(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),T(`req`,t.requestId)},className:`font-mono text-fg-2 hover:text-fg hover:underline focus-visible:underline`,"aria-label":`Open request ${t.requestId}`,children:f(t.requestId)})}),(0,z.jsx)(`td`,{className:`max-w-0 truncate px-2 py-2 font-mono text-fg`,children:t.model||`—`}),(0,z.jsx)(`td`,{className:`max-w-0 px-2 py-1.5`,children:(0,z.jsx)(B,{chain:t,accounts:L})}),(0,z.jsx)(`td`,{className:`tnum px-2 py-2 text-right font-mono text-fg-2`,children:r===void 0?`…`:m(r)}),(0,z.jsx)(`td`,{className:`tnum px-2 py-2 text-right font-mono text-fg-2`,children:n.prompt||n.completion?(0,z.jsxs)(z.Fragment,{children:[p(n.prompt),` `,(0,z.jsx)(`span`,{className:`text-faint`,children:`→`}),` `,p(n.completion)]}):(0,z.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,z.jsx)(`td`,{className:`px-3.5 py-2 text-right`,children:(0,z.jsx)(U,{chain:t})})]},t.requestId)})})]})})}),Y.length===q&&(0,z.jsxs)(`p`,{className:`text-center text-[12px] text-muted`,children:[`Showing the latest `,q,` requests.`]}),(0,z.jsx)(W,{chain:Z,accounts:L,onClose:()=>T(`req`,null)})]})}export{J as Traffic};
@@ -0,0 +1 @@
1
+ import{c as e,i as t,s as n,u as r}from"./Panel-Du40pM7n.js";import{B as i,C as a,M as o,N as s,T as c,ft as l,g as u,p as d,pt as f}from"./Badge-CGY6DgGx.js";import{t as p}from"./arrow-up-goM9r-I9.js";import{t as m}from"./Markdown-Xhao3sgL.js";import{t as h}from"./Callout-DauCk_cW.js";import{C as g,P as _,V as v,b as y,k as b,x}from"./index-BCi-Vuvh.js";import{GoalDetail as S,isActiveGoal as C,t as w}from"./Goals-DH-KDh8M.js";var T=r(e(),1),E=n(),D={planning:`Putting a plan together`,running:`Working on it`,reviewing:`Checking the result`,planned:`Your plan is ready`,succeeded:`Done`,failed:`Something needs attention`,cancelled:`Stopped`,budget_exhausted:`Usage limit reached`},O=[{title:`Make something`,prompt:`Help me turn an idea into something useful. First help me define who it is for and what it should do.`},{title:`Understand a project`,prompt:`Explain this project in plain language and write a short getting-started guide for someone without a technical background.`},{title:`Improve a design`,prompt:`Review this project’s interface. Propose a distinctive visual direction, explain the most useful improvements and make a plan before changing code.`}];function k(){let{params:e}=g(),{connection:n}=i(),r=c(),k=d(),A=s(),j=o(),M=a(),N=u(),P=(0,T.useRef)(null),[F,I]=(0,T.useState)(()=>(e.get(`brief`)??``).slice(0,4e3)),[L,R]=(0,T.useState)(`plan`),[z,B]=(0,T.useState)(`50000`),[V,H]=(0,T.useState)(),U=r.data??[],W=U.find(C),G=e.has(`new`)||e.has(`brief`)?void 0:U.find(t=>t.id===e.get(`goal`))??W,K=n.mode===`mock`,q=f(r.error)&&r.error.status===501,J=(k.data??[]).some(e=>e.enabled),Y=r.isPending||r.isError||k.isPending||k.isError||!J||j.isPending||!!W&&L===`work`;function X(e){e.preventDefault(),!Y&&F.trim()&&(H(void 0),j.mutate({objective:F.trim(),dryRun:L===`plan`,maxTokens:Number(z)},{onSuccess:e=>{I(``),x(`/?goal=${encodeURIComponent(e.id)}`)},onError:e=>H(l(e))}))}return(0,E.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[780px] flex-1 flex-col`,children:[K&&(0,E.jsxs)(`p`,{className:`mb-4 text-center text-[12px] text-muted`,children:[`This is a demo.`,` `,(0,E.jsx)(y,{to:`/settings`,className:`underline`,children:`Connect your device`}),` `,`to work on your files.`]}),q&&(0,E.jsxs)(h,{tone:`warn`,title:`Open a project to start`,children:[`Start DaveCode in your project folder.`,` `,(0,E.jsx)(y,{to:`/goals`,className:`underline`,children:`Setup instructions`})]}),r.isError&&!q&&(0,E.jsx)(h,{tone:`err`,title:`Could not load your work`,children:l(r.error)}),k.isError&&(0,E.jsx)(h,{tone:`err`,title:`Could not load AI connections`,children:l(k.error)}),G?(0,E.jsxs)(`div`,{className:`flex flex-1 flex-col gap-7 pb-10 pt-6`,children:[(0,E.jsx)(`div`,{className:`ml-auto max-w-[90%] rounded-2xl bg-raised px-5 py-4 text-[15px] leading-7 text-fg`,children:G.objective}),(0,E.jsxs)(`section`,{"aria-labelledby":`work-status`,className:`px-1`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,E.jsx)(`h1`,{id:`work-status`,className:`text-[19px] font-medium tracking-tight text-fg`,children:D[G.status]}),C(G)&&(0,E.jsx)(t,{size:`sm`,variant:`ghost`,icon:b,loading:N.isPending,onClick:()=>N.mutate(G.id,{onError:e=>H(l(e))}),children:`Stop`})]}),G.tasks.length>0&&(0,E.jsx)(`ol`,{className:`mt-5 flex flex-col gap-4`,children:G.tasks.map(e=>(0,E.jsxs)(`li`,{className:`flex items-start gap-3 text-[14px] leading-6 text-fg-2`,children:[e.status===`SUCCESS`?(0,E.jsx)(v,{"aria-hidden":!0,className:`mt-1 size-4 shrink-0 text-fg-2`}):(0,E.jsx)(`span`,{className:`mt-0.5 w-4 shrink-0 text-center text-muted`,"aria-hidden":!0,children:e.id===G.activeTaskId?`→`:`−`}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:e.title}),e.status===`FAILED`&&(0,E.jsx)(`p`,{className:`mt-1 text-[12px] text-err`,children:`This step needs attention.`})]})]},e.id))}),G.summary&&(0,E.jsx)(m,{source:G.summary,className:`mt-6 text-[14px]`}),G.lastError&&(0,E.jsx)(`p`,{role:`alert`,className:`mt-4 text-[13px] text-err`,children:G.lastError}),G.status===`planned`&&(0,E.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-3`,children:[(0,E.jsx)(t,{size:`sm`,variant:`primary`,icon:_,loading:M.isPending,disabled:!!W,onClick:()=>{H(void 0),M.mutate(G.id,{onError:e=>H(l(e))})},children:`Execute this plan`}),(0,E.jsx)(`span`,{className:`text-[13px] leading-6 text-muted`,children:`Runs the planned steps above without re-planning.`})]})]}),(0,E.jsxs)(`details`,{className:`text-[12px] text-muted`,children:[(0,E.jsx)(`summary`,{className:`mb-3 cursor-pointer`,children:`Task details`}),(0,E.jsx)(S,{goal:G},G.id)]})]}):(0,E.jsxs)(`section`,{className:`flex flex-1 flex-col items-center justify-center pb-8 pt-16 text-center md:pt-20`,children:[(0,E.jsx)(`h1`,{className:`text-3xl font-medium tracking-tight text-fg md:text-[38px]`,children:`What are we making?`}),(0,E.jsx)(`p`,{className:`mt-3 text-[15px] text-muted`,children:`An idea is a good place to start.`}),(0,E.jsx)(`div`,{className:`mt-8 flex flex-wrap justify-center gap-2`,children:O.map(e=>(0,E.jsx)(`button`,{type:`button`,onClick:()=>{I(e.prompt),R(`plan`),P.current?.focus()},className:`rounded-xl border border-line px-4 py-3 text-[13px] text-fg-2 transition-colors hover:border-line-strong hover:bg-hover`,children:e.title},e.title))})]}),(0,E.jsxs)(`div`,{className:`sticky bottom-0 bg-bg pb-3 pt-3`,children:[(0,E.jsxs)(`form`,{onSubmit:X,className:`rounded-2xl border border-line-strong bg-panel p-4 focus-within:border-faint`,children:[(0,E.jsx)(`label`,{htmlFor:`workspace-composer`,className:`sr-only`,children:`What would you like to do?`}),(0,E.jsx)(`textarea`,{id:`workspace-composer`,ref:P,required:!0,rows:3,maxLength:4e3,value:F,onChange:e=>I(e.target.value),placeholder:`Describe what you have in mind…`,"aria-describedby":V?`workspace-error`:void 0,className:`block w-full resize-none border-0 bg-transparent px-1 py-2 text-[15px] leading-6 text-fg outline-none placeholder:text-muted`}),(0,E.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,E.jsx)(`label`,{className:`sr-only`,htmlFor:`workspace-mode`,children:`How to start`}),(0,E.jsxs)(`select`,{id:`workspace-mode`,value:L,onChange:e=>R(e.target.value),className:`max-w-44 rounded-lg border-0 bg-transparent py-2 pr-3 text-[12px] text-fg-2 outline-accent`,children:[(0,E.jsx)(`option`,{value:`plan`,children:`Plan first`}),(0,E.jsx)(`option`,{value:`work`,children:`Plan and work`})]}),(0,E.jsxs)(`details`,{className:`relative`,children:[(0,E.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1 text-[12px] text-muted`,children:[`Options`,(0,E.jsx)(w,{"aria-hidden":!0,className:`size-3`})]}),(0,E.jsxs)(`div`,{className:`absolute bottom-9 left-0 z-10 w-56 rounded-xl border border-line-strong bg-panel p-4 shadow-overlay`,children:[(0,E.jsx)(`label`,{htmlFor:`workspace-limit`,className:`text-[12px] text-fg-2`,children:`AI usage limit`}),(0,E.jsxs)(`select`,{id:`workspace-limit`,value:z,onChange:e=>B(e.target.value),className:`mt-2 w-full rounded-md border border-line-strong bg-panel px-2 py-2 text-[12px] text-fg`,children:[(0,E.jsx)(`option`,{value:`50000`,children:`50k tokens`}),(0,E.jsx)(`option`,{value:`250000`,children:`250k tokens`}),(0,E.jsx)(`option`,{value:`1000000`,children:`1m tokens`})]}),(0,E.jsx)(`p`,{className:`mt-2 text-[11px] leading-5 text-muted`,children:`A usage limit, not a price cap.`})]})]})]}),(0,E.jsx)(t,{type:`submit`,icon:p,iconOnly:!0,"aria-label":K?`Try demo`:L===`plan`?`Make a plan`:`Start working`,variant:`primary`,disabled:Y||!F.trim(),loading:j.isPending,className:`size-9 rounded-xl`})]})]}),V&&(0,E.jsx)(`p`,{id:`workspace-error`,role:`alert`,className:`mt-2 text-[12px] text-err`,children:V}),!k.isPending&&!k.isError&&!J&&(0,E.jsxs)(`p`,{className:`mt-3 text-center text-[12px] text-muted`,children:[(0,E.jsx)(y,{to:`/accounts`,className:`underline`,children:`Connect an AI tool`}),` `,`to get started.`]}),W&&L===`work`&&(0,E.jsx)(`p`,{role:`status`,className:`mt-3 text-center text-[12px] text-muted`,children:`A task is running. You can still plan the next one.`}),(0,E.jsxs)(`p`,{className:`mt-3 text-center text-[11px] leading-5 text-muted`,children:[L===`plan`?`Planning does not execute tasks.`:`Execution can edit files and merge changes.`,A.data?.project?` Working in ${A.data.project.name}.`:``]})]})]})}export{k as Workspace};