@coralai/sps-cli 0.49.7 → 0.49.8

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.
@@ -7,4 +7,4 @@ pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5p
7
7
 
8
8
  Outdated base version: https://github.com/primer/github-syntax-light
9
9
  Current colors taken from GitHub's CSS
10
- */.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:"JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;--color-black:#000;--spacing:.25rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--radius-md:12px;--radius-lg:16px;--radius-xl:20px;--radius-2xl:1rem;--shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#fff;--color-bg-cream:#fff9f5;--color-text:#2d3748;--color-text-muted:#475569;--color-text-subtle:#64748b;--color-border-light:#e2e8f0;--color-primary:#fdbcb4;--color-secondary:#add8e6;--color-accent-mint:#98ff98;--color-accent-purple:#e6e6fa;--color-accent-yellow:#fff3b0;--color-accent-pink:#ffd1dc;--color-running:#166534;--color-running-bg:#d4f5e4;--color-stuck:#92400e;--color-stuck-bg:#ffe8cf;--color-crashed:#991b1b;--color-crashed-bg:#ffe4e6;--color-idle:#475569;--color-idle-bg:#f1f5f9;--color-cta:#22c55e;--font-heading:"Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--font-body:"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:before,:after{box-sizing:border-box}html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{font-family:var(--font-body);color:var(--color-text);background:var(--color-bg-cream);min-height:100vh;font-size:15px;line-height:1.5}h1,h2,h3,h4,h5{font-family:var(--font-heading);color:var(--color-text);letter-spacing:-.01em;margin:0;font-weight:700}:focus-visible{outline:3px solid var(--color-text);outline-offset:2px}@media(prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}}@layer components{.nb-card{background:var(--color-bg);border:3px solid var(--color-text);box-shadow:5px 5px 0 var(--color-text);border-radius:16px;padding:16px}.nb-card-interactive{cursor:pointer;transition:transform .18s ease-out,box-shadow .18s ease-out}.nb-card-interactive:hover{box-shadow:7px 7px 0 var(--color-text);transform:translate(-2px,-2px)}.nb-card-interactive:active{box-shadow:3px 3px 0 var(--color-text);transform:translate(1px,1px)}.nb-btn{border:3px solid var(--color-text);font-family:var(--font-body);color:var(--color-text);background:var(--color-bg);box-shadow:3px 3px 0 var(--color-text);-webkit-user-select:none;user-select:none;cursor:pointer;border-radius:12px;align-items:center;gap:8px;padding:10px 18px;font-size:14px;font-weight:700;line-height:20px;transition:transform .12s ease-out,box-shadow .12s ease-out;display:inline-flex}.nb-btn:hover{box-shadow:4px 4px 0 var(--color-text);transform:translate(-1px,-1px)}.nb-btn:active{box-shadow:1px 1px 0 var(--color-text);transform:translate(2px,2px)}.nb-btn-primary{background:var(--color-cta)}.nb-btn-mint{background:var(--color-accent-mint)}.nb-btn-peach{background:var(--color-primary)}.nb-btn-blue{background:var(--color-secondary)}.nb-btn-yellow{background:var(--color-accent-yellow)}.nb-btn-purple{background:var(--color-accent-purple)}.nb-btn-danger{background:var(--color-crashed)}.nb-input{border:3px solid var(--color-text);background:var(--color-bg);color:var(--color-text);font-family:var(--font-body);box-shadow:3px 3px 0 var(--color-text);border-radius:12px;padding:10px 16px;font-size:14px;font-weight:500;line-height:20px;transition:transform .12s,box-shadow .12s}.nb-input:focus{box-shadow:4px 4px 0 var(--color-text);outline:none;transform:translate(-1px,-1px)}.nb-badge{border:2px solid var(--color-text);font-family:var(--font-body);color:var(--color-text);background:var(--color-bg);border-radius:9999px;align-items:center;gap:4px;padding:4px 10px;font-size:12px;font-weight:700;line-height:16px;display:inline-flex}.nb-status{border:2px solid var(--color-text);font-family:var(--font-body);color:var(--color-text);border-radius:9999px;align-items:center;gap:5px;padding:4px 10px 4px 9px;font-size:11px;font-weight:700;line-height:16px;display:inline-flex}.nb-status:before{content:"";border:1.5px solid var(--color-text);background:currentColor;border-radius:50%;width:8px;height:8px}.prose-chat{color:var(--color-text);line-height:1.6}.prose-chat>:first-child{margin-top:0}.prose-chat>:last-child{margin-bottom:0}.prose-chat h1{font-family:var(--font-heading);margin:1em 0 .5em;font-size:1.5rem;font-weight:700}.prose-chat h2{font-family:var(--font-heading);margin:1em 0 .5em;font-size:1.25rem;font-weight:700}.prose-chat h3{font-family:var(--font-heading);margin:.8em 0 .4em;font-size:1.1rem;font-weight:700}.prose-chat h4,.prose-chat h5,.prose-chat h6{font-family:var(--font-heading);margin:.8em 0 .3em;font-weight:700}.prose-chat p{margin:.6em 0}.prose-chat ul,.prose-chat ol{margin:.6em 0;padding-left:1.6em}.prose-chat ul{list-style:outside}.prose-chat ol{list-style:decimal}.prose-chat li,.prose-chat li>ul,.prose-chat li>ol{margin:.2em 0}.prose-chat code{font-family:var(--font-mono);background:var(--color-bg-cream);border:1.5px solid var(--color-text);border-radius:4px;padding:0 4px;font-size:.9em}.prose-chat pre{background:var(--color-bg-cream);border:2px solid var(--color-text);font-family:var(--font-mono);border-radius:8px;margin:.8em 0;padding:12px;font-size:.85em;line-height:1.45;overflow-x:auto}.prose-chat pre code{font-size:inherit;background:0 0;border:0;padding:0}.prose-chat blockquote{border-left:3px solid var(--color-text);color:var(--color-text-muted);margin:.8em 0;padding-left:1em}.prose-chat table{border-collapse:collapse;border:2px solid var(--color-text);border-radius:8px;margin:.8em 0;overflow:hidden}.prose-chat th,.prose-chat td{border:1px solid var(--color-text);text-align:left;padding:6px 10px}.prose-chat th{background:var(--color-bg-cream);font-weight:700}.prose-chat a{color:var(--color-running);text-underline-offset:2px;text-decoration:underline}.prose-chat a:hover{color:var(--color-text)}.prose-chat hr{border:0;border-top:2px dashed var(--color-text);margin:1em 0}}@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.left-3{left:calc(var(--spacing) * 3)}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.row-span-1{grid-row:span 1/span 1}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-10{height:calc(var(--spacing) * 10)}.h-20{height:calc(var(--spacing) * 20)}.h-\[calc\(100vh-140px\)\]{height:calc(100vh - 140px)}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[70vh\]{max-height:70vh}.min-h-\[340px\]{min-height:340px}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-2\/3{width:66.6667%}.w-5{width:calc(var(--spacing) * 5)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[200px\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[100px_60px_1fr\]{grid-template-columns:100px 60px 1fr}.grid-cols-\[130px_1fr\]{grid-template-columns:130px 1fr}.grid-cols-\[160px_1fr\]{grid-template-columns:160px 1fr}.grid-cols-\[220px_1fr\]{grid-template-columns:220px 1fr}.grid-cols-\[240px_1fr\]{grid-template-columns:240px 1fr}.grid-cols-\[260px_1fr\]{grid-template-columns:260px 1fr}.grid-rows-\[1fr_40px\]{grid-template-rows:1fr 40px}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[2px\]{border-style:var(--tw-border-style);border-width:2px}.border-\[3px\]{border-style:var(--tw-border-style);border-width:3px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-t-\[1\.5px\]{border-top-style:var(--tw-border-style);border-top-width:1.5px}.border-t-\[3px\]{border-top-style:var(--tw-border-style);border-top-width:3px}.border-r-\[3px\]{border-right-style:var(--tw-border-style);border-right-width:3px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[var\(--color-border-light\)\]{border-color:var(--color-border-light)}.border-\[var\(--color-cta\)\]{border-color:var(--color-cta)}.border-\[var\(--color-stuck\)\]{border-color:var(--color-stuck)}.border-\[var\(--color-text\)\]{border-color:var(--color-text)}.border-transparent{border-color:#0000}.bg-\[var\(--color-accent-mint\)\]{background-color:var(--color-accent-mint)}.bg-\[var\(--color-accent-purple\)\]{background-color:var(--color-accent-purple)}.bg-\[var\(--color-accent-yellow\)\]{background-color:var(--color-accent-yellow)}.bg-\[var\(--color-bg\)\]{background-color:var(--color-bg)}.bg-\[var\(--color-bg-cream\)\]{background-color:var(--color-bg-cream)}.bg-\[var\(--color-border-light\)\]{background-color:var(--color-border-light)}.bg-\[var\(--color-crashed\)\]{background-color:var(--color-crashed)}.bg-\[var\(--color-crashed-bg\)\]{background-color:var(--color-crashed-bg)}.bg-\[var\(--color-cta\)\]{background-color:var(--color-cta)}.bg-\[var\(--color-primary\)\]{background-color:var(--color-primary)}.bg-\[var\(--color-secondary\)\]{background-color:var(--color-secondary)}.bg-\[var\(--color-stuck\)\]{background-color:var(--color-stuck)}.bg-\[var\(--color-stuck-bg\)\]{background-color:var(--color-stuck-bg)}.bg-\[var\(--color-text\)\]{background-color:var(--color-text)}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-\[family-name\:var\(--font-body\)\]{font-family:var(--font-body)}.font-\[family-name\:var\(--font-heading\)\]{font-family:var(--font-heading)}.font-\[family-name\:var\(--font-mono\)\]{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--color-bg\)\]{color:var(--color-bg)}.text-\[var\(--color-crashed\)\]{color:var(--color-crashed)}.text-\[var\(--color-running\)\]{color:var(--color-running)}.text-\[var\(--color-stuck\)\]{color:var(--color-stuck)}.text-\[var\(--color-text\)\]{color:var(--color-text)}.text-\[var\(--color-text-muted\)\]{color:var(--color-text-muted)}.text-\[var\(--color-text-subtle\)\]{color:var(--color-text-subtle)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.decoration-2{text-decoration-thickness:2px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[1px_1px_0_var\(--color-text\)\]{--tw-shadow:1px 1px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_2px_0_var\(--color-text\)\]{--tw-shadow:2px 2px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[3px_3px_0_var\(--color-text\)\]{--tw-shadow:3px 3px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[4px_4px_0_var\(--color-cta\)\]{--tw-shadow:4px 4px 0 var(--tw-shadow-color,var(--color-cta));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[5px_5px_0_var\(--color-text\)\]{--tw-shadow:5px 5px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-nb{--tw-shadow:5px 5px 0 var(--tw-shadow-color,#2d3748);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,box-shadow\]{transition-property:transform,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-\[180ms\]{--tw-duration:.18s;transition-duration:.18s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media(hover:hover){.hover\:-translate-x-0\.5:hover{--tw-translate-x:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-x-px:hover{--tw-translate-x:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-\[var\(--color-text\)\]:hover{border-color:var(--color-text)}.hover\:bg-\[var\(--color-accent-yellow\)\]:hover{background-color:var(--color-accent-yellow)}.hover\:bg-\[var\(--color-bg-cream\)\]:hover{background-color:var(--color-bg-cream)}.hover\:text-\[var\(--color-crashed\)\]:hover{color:var(--color-crashed)}.hover\:text-\[var\(--color-text\)\]:hover{color:var(--color-text)}.hover\:shadow-\[3px_3px_0_var\(--color-text\)\]:hover{--tw-shadow:3px 3px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[4px_4px_0_var\(--color-text\)\]:hover{--tw-shadow:4px 4px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[5px_5px_0_var\(--color-text\)\]:hover{--tw-shadow:5px 5px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--color-text\)\]:focus-visible{--tw-ring-color:var(--color-text)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.active\:cursor-grabbing:active{cursor:grabbing}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
10
+ */.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:"JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;--color-black:#000;--spacing:.25rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--radius-md:12px;--radius-lg:16px;--radius-xl:20px;--radius-2xl:1rem;--shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#fff;--color-bg-cream:#fff9f5;--color-text:#2d3748;--color-text-muted:#475569;--color-text-subtle:#64748b;--color-border-light:#e2e8f0;--color-primary:#fdbcb4;--color-secondary:#add8e6;--color-accent-mint:#98ff98;--color-accent-purple:#e6e6fa;--color-accent-yellow:#fff3b0;--color-accent-pink:#ffd1dc;--color-running:#166534;--color-running-bg:#d4f5e4;--color-stuck:#92400e;--color-stuck-bg:#ffe8cf;--color-crashed:#991b1b;--color-crashed-bg:#ffe4e6;--color-idle:#475569;--color-idle-bg:#f1f5f9;--color-cta:#22c55e;--font-heading:"Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--font-body:"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:before,:after{box-sizing:border-box}html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{font-family:var(--font-body);color:var(--color-text);background:var(--color-bg-cream);min-height:100vh;font-size:15px;line-height:1.5}h1,h2,h3,h4,h5{font-family:var(--font-heading);color:var(--color-text);letter-spacing:-.01em;margin:0;font-weight:700}:focus-visible{outline:3px solid var(--color-text);outline-offset:2px}@media(prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}}@layer components{.nb-card{background:var(--color-bg);border:3px solid var(--color-text);box-shadow:5px 5px 0 var(--color-text);border-radius:16px;padding:16px}.nb-card-interactive{cursor:pointer;transition:transform .18s ease-out,box-shadow .18s ease-out}.nb-card-interactive:hover{box-shadow:7px 7px 0 var(--color-text);transform:translate(-2px,-2px)}.nb-card-interactive:active{box-shadow:3px 3px 0 var(--color-text);transform:translate(1px,1px)}.nb-btn{border:3px solid var(--color-text);font-family:var(--font-body);color:var(--color-text);background:var(--color-bg);box-shadow:3px 3px 0 var(--color-text);-webkit-user-select:none;user-select:none;cursor:pointer;border-radius:12px;align-items:center;gap:8px;padding:10px 18px;font-size:14px;font-weight:700;line-height:20px;transition:transform .12s ease-out,box-shadow .12s ease-out;display:inline-flex}.nb-btn:hover{box-shadow:4px 4px 0 var(--color-text);transform:translate(-1px,-1px)}.nb-btn:active{box-shadow:1px 1px 0 var(--color-text);transform:translate(2px,2px)}.nb-btn-primary{background:var(--color-cta)}.nb-btn-mint{background:var(--color-accent-mint)}.nb-btn-peach{background:var(--color-primary)}.nb-btn-blue{background:var(--color-secondary)}.nb-btn-yellow{background:var(--color-accent-yellow)}.nb-btn-purple{background:var(--color-accent-purple)}.nb-btn-danger{background:var(--color-crashed)}.nb-input{border:3px solid var(--color-text);background:var(--color-bg);color:var(--color-text);font-family:var(--font-body);box-shadow:3px 3px 0 var(--color-text);border-radius:12px;padding:10px 16px;font-size:14px;font-weight:500;line-height:20px;transition:transform .12s,box-shadow .12s}.nb-input:focus{box-shadow:4px 4px 0 var(--color-text);outline:none;transform:translate(-1px,-1px)}.nb-badge{border:2px solid var(--color-text);font-family:var(--font-body);color:var(--color-text);background:var(--color-bg);border-radius:9999px;align-items:center;gap:4px;padding:4px 10px;font-size:12px;font-weight:700;line-height:16px;display:inline-flex}.nb-status{border:2px solid var(--color-text);font-family:var(--font-body);color:var(--color-text);border-radius:9999px;align-items:center;gap:5px;padding:4px 10px 4px 9px;font-size:11px;font-weight:700;line-height:16px;display:inline-flex}.nb-status:before{content:"";border:1.5px solid var(--color-text);background:currentColor;border-radius:50%;width:8px;height:8px}.prose-chat{color:var(--color-text);line-height:1.6}.prose-chat>:first-child{margin-top:0}.prose-chat>:last-child{margin-bottom:0}.prose-chat h1{font-family:var(--font-heading);margin:1em 0 .5em;font-size:1.5rem;font-weight:700}.prose-chat h2{font-family:var(--font-heading);margin:1em 0 .5em;font-size:1.25rem;font-weight:700}.prose-chat h3{font-family:var(--font-heading);margin:.8em 0 .4em;font-size:1.1rem;font-weight:700}.prose-chat h4,.prose-chat h5,.prose-chat h6{font-family:var(--font-heading);margin:.8em 0 .3em;font-weight:700}.prose-chat p{margin:.6em 0}.prose-chat ul,.prose-chat ol{margin:.6em 0;padding-left:1.6em}.prose-chat ul{list-style:outside}.prose-chat ol{list-style:decimal}.prose-chat li,.prose-chat li>ul,.prose-chat li>ol{margin:.2em 0}.prose-chat code{font-family:var(--font-mono);background:var(--color-bg-cream);border:1.5px solid var(--color-text);border-radius:4px;padding:0 4px;font-size:.9em}.prose-chat pre{background:var(--color-bg-cream);border:2px solid var(--color-text);font-family:var(--font-mono);border-radius:8px;margin:.8em 0;padding:12px;font-size:.85em;line-height:1.45;overflow-x:auto}.prose-chat pre code{font-size:inherit;background:0 0;border:0;padding:0}.prose-chat blockquote{border-left:3px solid var(--color-text);color:var(--color-text-muted);margin:.8em 0;padding-left:1em}.prose-chat table{border-collapse:collapse;border:2px solid var(--color-text);border-radius:8px;margin:.8em 0;overflow:hidden}.prose-chat th,.prose-chat td{border:1px solid var(--color-text);text-align:left;padding:6px 10px}.prose-chat th{background:var(--color-bg-cream);font-weight:700}.prose-chat a{color:var(--color-running);text-underline-offset:2px;text-decoration:underline}.prose-chat a:hover{color:var(--color-text)}.prose-chat hr{border:0;border-top:2px dashed var(--color-text);margin:1em 0}}@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.left-3{left:calc(var(--spacing) * 3)}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.row-span-1{grid-row:span 1/span 1}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-10{height:calc(var(--spacing) * 10)}.h-20{height:calc(var(--spacing) * 20)}.h-\[calc\(100vh-140px\)\]{height:calc(100vh - 140px)}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[70vh\]{max-height:70vh}.min-h-\[340px\]{min-height:340px}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-2\/3{width:66.6667%}.w-5{width:calc(var(--spacing) * 5)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[200px\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[100px_60px_1fr\]{grid-template-columns:100px 60px 1fr}.grid-cols-\[130px_1fr\]{grid-template-columns:130px 1fr}.grid-cols-\[160px_1fr\]{grid-template-columns:160px 1fr}.grid-cols-\[220px_1fr\]{grid-template-columns:220px 1fr}.grid-cols-\[240px_1fr\]{grid-template-columns:240px 1fr}.grid-cols-\[260px_1fr\]{grid-template-columns:260px 1fr}.grid-rows-\[1fr_40px\]{grid-template-rows:1fr 40px}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[2px\]{border-style:var(--tw-border-style);border-width:2px}.border-\[3px\]{border-style:var(--tw-border-style);border-width:3px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-t-\[1\.5px\]{border-top-style:var(--tw-border-style);border-top-width:1.5px}.border-t-\[3px\]{border-top-style:var(--tw-border-style);border-top-width:3px}.border-r-\[3px\]{border-right-style:var(--tw-border-style);border-right-width:3px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[var\(--color-border-light\)\]{border-color:var(--color-border-light)}.border-\[var\(--color-cta\)\]{border-color:var(--color-cta)}.border-\[var\(--color-stuck\)\]{border-color:var(--color-stuck)}.border-\[var\(--color-text\)\]{border-color:var(--color-text)}.border-transparent{border-color:#0000}.bg-\[var\(--color-accent-mint\)\]{background-color:var(--color-accent-mint)}.bg-\[var\(--color-accent-purple\)\]{background-color:var(--color-accent-purple)}.bg-\[var\(--color-accent-yellow\)\]{background-color:var(--color-accent-yellow)}.bg-\[var\(--color-bg\)\]{background-color:var(--color-bg)}.bg-\[var\(--color-bg-cream\)\]{background-color:var(--color-bg-cream)}.bg-\[var\(--color-border-light\)\]{background-color:var(--color-border-light)}.bg-\[var\(--color-crashed\)\]{background-color:var(--color-crashed)}.bg-\[var\(--color-crashed-bg\)\]{background-color:var(--color-crashed-bg)}.bg-\[var\(--color-cta\)\]{background-color:var(--color-cta)}.bg-\[var\(--color-primary\)\]{background-color:var(--color-primary)}.bg-\[var\(--color-secondary\)\]{background-color:var(--color-secondary)}.bg-\[var\(--color-stuck\)\]{background-color:var(--color-stuck)}.bg-\[var\(--color-stuck-bg\)\]{background-color:var(--color-stuck-bg)}.bg-\[var\(--color-text\)\]{background-color:var(--color-text)}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-\[family-name\:var\(--font-body\)\]{font-family:var(--font-body)}.font-\[family-name\:var\(--font-heading\)\]{font-family:var(--font-heading)}.font-\[family-name\:var\(--font-mono\)\]{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--color-bg\)\]{color:var(--color-bg)}.text-\[var\(--color-crashed\)\]{color:var(--color-crashed)}.text-\[var\(--color-running\)\]{color:var(--color-running)}.text-\[var\(--color-stuck\)\]{color:var(--color-stuck)}.text-\[var\(--color-text\)\]{color:var(--color-text)}.text-\[var\(--color-text-muted\)\]{color:var(--color-text-muted)}.text-\[var\(--color-text-subtle\)\]{color:var(--color-text-subtle)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.decoration-2{text-decoration-thickness:2px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[1px_1px_0_var\(--color-text\)\]{--tw-shadow:1px 1px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[2px_2px_0_var\(--color-text\)\]{--tw-shadow:2px 2px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[3px_3px_0_var\(--color-text\)\]{--tw-shadow:3px 3px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[4px_4px_0_var\(--color-cta\)\]{--tw-shadow:4px 4px 0 var(--tw-shadow-color,var(--color-cta));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[5px_5px_0_var\(--color-text\)\]{--tw-shadow:5px 5px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-nb{--tw-shadow:5px 5px 0 var(--tw-shadow-color,#2d3748);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,box-shadow\]{transition-property:transform,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-\[180ms\]{--tw-duration:.18s;transition-duration:.18s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media(hover:hover){.hover\:-translate-x-0\.5:hover{--tw-translate-x:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-x-px:hover{--tw-translate-x:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-\[var\(--color-text\)\]:hover{border-color:var(--color-text)}.hover\:bg-\[var\(--color-accent-yellow\)\]:hover{background-color:var(--color-accent-yellow)}.hover\:bg-\[var\(--color-bg-cream\)\]:hover{background-color:var(--color-bg-cream)}.hover\:text-\[var\(--color-crashed\)\]:hover{color:var(--color-crashed)}.hover\:text-\[var\(--color-text\)\]:hover{color:var(--color-text)}.hover\:shadow-\[3px_3px_0_var\(--color-text\)\]:hover{--tw-shadow:3px 3px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[4px_4px_0_var\(--color-text\)\]:hover{--tw-shadow:4px 4px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[5px_5px_0_var\(--color-text\)\]:hover{--tw-shadow:5px 5px 0 var(--tw-shadow-color,var(--color-text));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--color-text\)\]:focus-visible{--tw-ring-color:var(--color-text)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.active\:cursor-grabbing:active{cursor:grabbing}@media(min-width:40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:80rem){.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
@@ -449,7 +449,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
449
449
  ${g.join(`
450
450
  `)}`:"项目已删除。"}).then(()=>n("/projects"))},onError:y=>{l({title:"删除失败",body:y instanceof Error?y.message:String(y)})}});return m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold mb-2 text-[var(--color-crashed)]",children:"删除项目"}),m.jsxs("p",{className:"text-sm mb-4",children:["这会清理 ",m.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),"(包括所有卡片、runtime、logs)。"]}),t&&m.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f,onChange:y=>d(y.target.checked),className:"mt-0.5"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"同时清理 repo 的 .claude/"}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[t,"/.claude/"]}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"repo 本身不动,只清这个目录。"})]})]}),m.jsx("div",{className:"mb-4",children:m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsxs("span",{className:"text-sm font-bold",children:["输入项目名 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e})," 确认:"]}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:o,onChange:y=>c(y.target.value),placeholder:e})]})}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:o!==e||h.isPending,onClick:()=>h.mutate(),"aria-label":"永久删除项目",children:[h.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(gc,{size:14,strokeWidth:3}),"永久删除"]})]})}function sg(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return qt(`/api/skills${t}`)}function AO(e){return qt(`/api/skills/${encodeURIComponent(e)}`)}function OO(e,t){return qt(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Yf(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function RO(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/link`,{project:t})}function MO(e,t){return fetch(`/api/skills/${encodeURIComponent(e)}/link?project=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>{if(!n.ok)throw new Error(`${n.status}`);return n.json()})}function DO(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/freeze`,{project:t})}function LO(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/unfreeze`,{project:t})}function jO(){return Yf("/api/skills/sync")}function IO({project:e,isPending:t,onCancel:n,onCreate:r}){var k;const[l,o]=M.useState(""),[c,f]=M.useState(""),[d,h]=M.useState(new Set),y=yt({queryKey:["skills-all",e],queryFn:()=>sg(e)});M.useEffect(()=>{const _=R=>{R.key==="Escape"&&n()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n]);const v=l.trim().length>0&&l.trim().length<=200&&!t,x=_=>{const R=new Set(d);R.has(_)?R.delete(_):R.add(_),h(R)},S=()=>{v&&r({title:l.trim(),description:c.trim(),skills:[...d]})},w=((k=y.data)==null?void 0:k.data)??[];return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:m.jsxs("div",{onClick:_=>_.stopPropagation(),className:"nb-card mt-8 w-full max-w-xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:"新建卡片"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(vr,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:_=>{_.preventDefault(),S()},className:"flex flex-col gap-4 overflow-auto",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"标题 *"}),m.jsx("input",{type:"text",className:"nb-input w-full",placeholder:"例如:接入 GitHub OAuth 登录",value:l,onChange:_=>o(_.target.value),maxLength:200,autoFocus:!0,required:!0}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"写简短明了的目标(<200 字符)"})]}),m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full",style:{minHeight:120,resize:"vertical"},placeholder:"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容",value:c,onChange:_=>f(_.target.value)}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。"})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"Skills"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。"}),y.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),y.isError&&m.jsxs("p",{className:"text-xs text-[var(--color-crashed)]",children:["skill 列表加载失败,不影响创建:",y.error instanceof Error?y.error.message:String(y.error)]}),w.length>0&&m.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(_=>{const R=d.has(_.name);return m.jsx("button",{type:"button",onClick:()=>x(_.name),className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",R?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":R,children:_.name},_.name)})}),d.size>0&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["已选 ",d.size," 个:",[...d].join(", ")]})]})]}),m.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:S,disabled:!v,type:"button","aria-label":"创建卡片",children:[t?m.jsx(nn,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:13,strokeWidth:3}),"创建"]})]})]})})}function zO(e){return qt(`/api/projects/${encodeURIComponent(e)}/cards`)}function BO(e,t){return qt(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function $l(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const r=await n.text();throw new Error(`${n.status} ${n.statusText}: ${r}`)}return n.json().catch(()=>({}))}function UO(e,t){return $l(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}function FO(e,t){return $l(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function PO(e,t){const n=typeof t=="string"?{title:t}:t;return $l(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function $O(e,t,n){const r=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!r.ok){const l=await r.text();throw new Error(`${r.status}: ${l}`)}}async function qO(e,t,n){const r=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const l=await r.text();throw new Error(`${r.status}: ${l}`)}return r.json()}function HO(e){return $l(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function KO(e){return $l(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function GO(e,t){return $l(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function J1(e){const t=$n();M.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,r=new EventSource(n),l=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["cards",d.project]}),d.card&&t.setQueryData(["card",d.project,d.seq],{...t.getQueryData(["card",d.project,d.seq])??{},...d.card}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["workers",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},c=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["pipeline-status",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return r.addEventListener("card.created",l),r.addEventListener("card.updated",l),r.addEventListener("card.deleted",l),r.addEventListener("worker.updated",o),r.addEventListener("worker.added",o),r.addEventListener("worker.deleted",o),r.addEventListener("pipeline.status",c),()=>r.close()},[e,t])}const QO=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),YO=new Set(["frontend","backend","mobile","database","devops"]),VO=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),XO=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function ZO(e){return QO.has(e)?"lang":YO.has(e)?"end":VO.has(e)?"persona":XO.has(e)?"workflow":"other"}const WO={lang:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg)"};function eS({name:e}){const t=WO[ZO(e)];return m.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function tS({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return m.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function JO({card:e,onClick:t,done:n,draggable:r}){const l=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return m.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:r,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl p-3","shadow-[3px_3px_0_var(--color-text)] cursor-pointer","transition-[transform,box-shadow] duration-[180ms] ease-out","hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[5px_5px_0_var(--color-text)]","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",r?"active:cursor-grabbing":""].join(" "),children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-[11px] px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),l&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),m.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&m.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>m.jsx(eS,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>m.jsx(tS,{label:o,kind:"warn"},o))]}),m.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[m.jsx("span",{children:eR(e.updatedAt??e.createdAt)}),e.branch&&m.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function eR(e){if(!e)return"—";const t=new Date(e),n=Date.now()-t.getTime();return n<6e4?"刚才":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:t.toLocaleDateString()}function tR({label:e,bg:t,cards:n,onCardClick:r,onDropCard:l}){const[o,c]=M.useState(!1);return m.jsxs("div",{className:["flex flex-col gap-2 p-3 rounded-2xl border-[3px] min-h-[340px]","transition-all",o?"border-[var(--color-cta)] shadow-[4px_4px_0_var(--color-cta)]":"border-[var(--color-text)]"].join(" "),style:{background:t},onDragOver:f=>{!l||!f.dataTransfer.types.includes("application/x-sps-card-seq")||(f.preventDefault(),f.dataTransfer.dropEffect="move",o||c(!0))},onDragLeave:()=>c(!1),onDrop:f=>{if(c(!1),!l)return;const d=f.dataTransfer.getData("application/x-sps-card-seq"),h=Number.parseInt(d,10);Number.isFinite(h)&&(f.preventDefault(),l(h))},children:[m.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 border-b-2 border-[var(--color-text)]",children:[m.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full",children:n.length})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[n.length===0&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:"— 空 —"}),n.map(f=>m.jsx(JO,{card:f,onClick:()=>r(f),done:e==="Done",draggable:!!l},f.seq))]})]})}function vp(e){const t=e.split(`
451
451
  `),n=t.findIndex(l=>/^##\s+描述\s*$/.test(l));if(n===-1)return"";let r=t.length;for(let l=n+1;l<t.length;l++)if(/^##\s+/.test(t[l]??"")){r=l;break}return t.slice(n+1,r).join(`
452
- `).trim()}function nR({project:e,seq:t,onClose:n,onChanged:r}){const l=$n(),{confirm:o,alert:c}=si(),{data:f,isLoading:d,isError:h,error:y,refetch:g}=yt({queryKey:["card",e,t],queryFn:()=>BO(e,t)}),[v,x]=M.useState(!1),[S,w]=M.useState(""),[k,_]=M.useState(""),[R,A]=M.useState(new Set),[L,$]=M.useState([]),[T,P]=M.useState(""),I=yt({queryKey:["skills-all",e],queryFn:()=>sg(e),enabled:v});M.useEffect(()=>{v&&f&&(w(f.title),_(vp(f.body)),A(new Set(f.skills)),$([...f.labels]))},[v,f]),M.useEffect(()=>{const H=Q=>{Q.key==="Escape"&&(v?x(!1):n())};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[n,v]);const W=Pn({mutationFn:()=>{if(!f)throw new Error("no data");const H={},Q=S.trim();Q&&Q!==f.title&&(H.title=Q);const K=vp(f.body);k!==K&&(H.description=k);const le=[...R].sort(),X=[...f.skills].sort();return JSON.stringify(le)!==JSON.stringify(X)&&(H.skills=le),JSON.stringify(L)!==JSON.stringify(f.labels)&&(H.labels=L),Object.keys(H).length===0?Promise.resolve({ok:!0,noop:!0}):qO(e,t,H)},onSuccess:()=>{l.invalidateQueries({queryKey:["card",e,t]}),l.invalidateQueries({queryKey:["cards",e]}),x(!1),r()},onError:H=>{c({title:"保存失败",body:H instanceof Error?H.message:String(H)})}}),j=M.useMemo(()=>{if(!v||!f)return!1;if(S.trim()!==f.title||k!==vp(f.body))return!0;const H=[...R].sort(),Q=[...f.skills].sort();return JSON.stringify(H)!==JSON.stringify(Q)||JSON.stringify(L)!==JSON.stringify(f.labels)},[v,f,S,k,R,L]),G=H=>{const Q=new Set(R);Q.has(H)?Q.delete(H):Q.add(H),A(Q)},J=()=>{const H=T.trim();if(H){if(L.includes(H)){P("");return}$([...L,H]),P("")}},oe=H=>{$(L.filter(Q=>Q!==H))};return m.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:m.jsxs("div",{onClick:H=>H.stopPropagation(),className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[m.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&m.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),v&&m.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:"⚠ 编辑中"})]}),v?m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:S,onChange:H=>w(H.target.value),maxLength:200,"aria-label":"卡片标题"}):m.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??"加载中…"})]}),m.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!v&&f&&m.jsxs("button",{onClick:()=>x(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":"编辑卡片",children:[m.jsx(qm,{size:12,strokeWidth:2.5})," 编辑"]}),m.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":"关闭",type:"button",children:m.jsx(vr,{size:14,strokeWidth:3})})]})]}),d&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),h&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",y instanceof Error?y.message:String(y)]}),f&&m.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!v&&m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx($C,{size:14}),m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:f.branch})]}),v?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),I.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),I.data&&I.data.data.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:I.data.data.map(H=>{const Q=R.has(H.name);return m.jsx("button",{type:"button",onClick:()=>G(H.name),"aria-pressed":Q,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",Q?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:H.name},H.name)})})]}),m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[L.map(H=>m.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[H,m.jsx("button",{type:"button",onClick:()=>oe(H),className:"hover:text-[var(--color-crashed)]","aria-label":`删除 ${H}`,children:m.jsx(vr,{size:10,strokeWidth:3})})]},H)),m.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:"+ 添加 label",value:T,onChange:H=>P(H.target.value),onKeyDown:H=>{H.key==="Enter"&&!H.nativeEvent.isComposing&&(H.preventDefault(),J())}}),T&&m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:J,"aria-label":"添加 label",children:m.jsx(Xi,{size:10,strokeWidth:3})})]}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖"})]})]}):(f.skills.length>0||f.labels.length>0)&&m.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.skills.map(H=>m.jsx(eS,{name:H},H)),f.labels.map(H=>m.jsx(tS,{label:H,kind:H==="NEEDS-FIX"?"warn":"default"},H))]}),f.checklist.total>0&&m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsxs("span",{className:"font-bold text-sm",children:["检查清单 ",f.checklist.done,"/",f.checklist.total]}),m.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${f.checklist.percent}%`}})})]}),m.jsx("ul",{className:"text-sm space-y-1",children:f.checklist.items.map((H,Q)=>m.jsxs("li",{className:`flex items-start gap-2 ${H.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:H.done?"✓":"○"}),m.jsx("span",{children:H.text})]},Q))})]}),v?m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:k,onChange:H=>_(H.target.value),"aria-label":"卡片描述"}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:'只替换 "## 描述" 段的内容;检查清单和日志段不动。'})]}):f.body&&m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"正文"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:f.body.trim()||"(空)"})]}),m.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end",children:v?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{x(!1),g()},disabled:W.isPending,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>W.mutate(),disabled:!j||!S.trim()||W.isPending,"aria-label":"保存卡片修改",children:[W.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Lf,{size:14,strokeWidth:3}),"保存"]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:async()=>{try{await FO(e,t),r()}catch(H){c({title:"启动 worker 失败",body:H instanceof Error?H.message:String(H)})}},children:[m.jsx(Hm,{size:14,strokeWidth:3}),"启动 worker"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:`重置卡片 #${t}`,body:"卡片状态会回到初始,已做的 checklist 会清空。",confirm:"重置",danger:!0}))try{await UO(e,t),r(),n()}catch(Q){c({title:"重置失败",body:Q instanceof Error?Q.message:String(Q)})}},children:[m.jsx(Df,{size:14,strokeWidth:2.5}),"重置卡片"]})]})})]})]})})}function lg({current:e,onChange:t}){const[n,r]=M.useState(!1),l=M.useRef(null),{data:o}=yt({queryKey:["projects"],queryFn:bc});return M.useEffect(()=>{const c=f=>{var d;(d=l.current)!=null&&d.contains(f.target)||r(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),m.jsxs("div",{className:"relative",ref:l,children:[m.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 px-3 py-2 bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[3px_3px_0_var(--color-text)] font-[family-name:var(--font-mono)] text-sm font-bold hover:-translate-x-px hover:-translate-y-px hover:shadow-[4px_4px_0_var(--color-text)] transition-[transform,box-shadow] duration-150",onClick:()=>r(c=>!c),children:[e,m.jsx(Fm,{size:14,strokeWidth:2.5})]}),n&&o&&m.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[5px_5px_0_var(--color-text)] overflow-hidden",children:o.data.map(c=>m.jsxs("button",{type:"button",onClick:()=>{t(c.name),r(!1)},className:["w-full text-left px-4 py-2 text-sm font-semibold",c.name===e?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:c.name}),m.jsxs("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:[c.cards.total," cards"]})]},c.name))})]})}const iR=[{state:"Backlog",label:"Backlog",bg:"var(--color-accent-purple)"},{state:"Inprogress",label:"Inprogress",bg:"var(--color-accent-yellow)"},{state:"Review",label:"Review",bg:"var(--color-accent-pink)"},{state:"Done",label:"Done",bg:"var(--color-accent-mint)"}],nS="sps-console:last-board-project";function aR(){if(typeof window>"u")return null;try{return localStorage.getItem(nS)}catch{return null}}function rR(e){if(!(typeof window>"u"))try{localStorage.setItem(nS,e)}catch{}}function sR(){var Q,K,le;const[e,t]=Um(),n=e.get("project"),[r,l]=M.useState(null),[o,c]=M.useState(""),[f,d]=M.useState(()=>new Set),[h,y]=M.useState(()=>new Set),{confirm:g,alert:v}=si();J1(n);const x=yt({queryKey:["projects"],queryFn:bc}),S=yt({queryKey:["cards",n],queryFn:()=>zO(n??""),enabled:!!n}),w=$n(),k=()=>{w.invalidateQueries({queryKey:["cards",n]}),w.invalidateQueries({queryKey:["projects"]}),w.invalidateQueries({queryKey:["pipeline-status",n]})},_=X=>{t({project:X})};M.useEffect(()=>{var me;if(n){rR(n);return}const X=aR();X&&((me=x.data)!=null&&me.data.some(O=>O.name===X))&&t({project:X},{replace:!0})},[n,x.data,t]);const R=Pn({mutationFn:()=>HO(n),onSuccess:()=>{k()},onError:X=>{v({title:"启动 pipeline 失败",body:X instanceof Error?X.message:String(X)})}}),A=Pn({mutationFn:()=>KO(n),onSuccess:()=>k(),onError:X=>{v({title:"停止 pipeline 失败",body:X instanceof Error?X.message:String(X)})}}),L=Pn({mutationFn:()=>GO(n,{all:!0}),onSuccess:()=>k(),onError:X=>{v({title:"重置失败",body:X instanceof Error?X.message:String(X)})}}),[$,T]=M.useState(!1),P=Pn({mutationFn:X=>PO(n,X),onSuccess:()=>{k(),T(!1)},onError:X=>{v({title:"新建卡片失败",body:X instanceof Error?X.message:String(X)})}}),I=Pn({mutationFn:({seq:X,state:me})=>$O(n,X,me),onMutate:async({seq:X,state:me})=>{await w.cancelQueries({queryKey:["cards",n]});const O=w.getQueryData(["cards",n]);return O&&w.setQueryData(["cards",n],{...O,data:O.data.map(D=>D.seq===X?{...D,state:me}:D)}),{prev:O}},onError:(X,me,O)=>{O!=null&&O.prev&&w.setQueryData(["cards",n],O.prev),v({title:"移动卡片失败",body:X instanceof Error?X.message:String(X)})},onSettled:()=>{w.invalidateQueries({queryKey:["cards",n]})}}),W=((Q=S.data)==null?void 0:Q.data)??[],{allSkills:j,allLabels:G}=M.useMemo(()=>{const X=new Set,me=new Set;for(const O of W){for(const D of O.skills)X.add(D);for(const D of O.labels)me.add(D)}return{allSkills:[...X].sort(),allLabels:[...me].sort()}},[W]);if(!n)return m.jsxs("div",{className:"flex flex-col gap-6 max-w-4xl",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"看板"}),m.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:"选择一个项目 🎯"}),m.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:"看板按项目分。挑一个开始:"}),m.jsx("div",{className:"flex flex-wrap gap-2",children:(K=x.data)==null?void 0:K.data.map(X=>m.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>_(X.name),type:"button",children:X.name},X.name))})]})]});const J=W.filter(X=>{if(o){const me=o.toLowerCase();if(!(X.title.toLowerCase().includes(me)||X.skills.some(D=>D.toLowerCase().includes(me))||X.labels.some(D=>D.toLowerCase().includes(me))))return!1}return!(f.size>0&&!X.skills.some(O=>f.has(O))||h.size>0&&!X.labels.some(O=>h.has(O)))}),oe=(le=x.data)==null?void 0:le.data.find(X=>X.name===n),H=(oe==null?void 0:oe.pipelineStatus)==="running";return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"看板 ✨"}),m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:oe?`${oe.name} · ${oe.cards.total} cards · ${oe.workers.active} workers 活跃`:"加载中…"})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsx(lg,{current:n,onChange:_}),m.jsxs("button",{className:"nb-btn nb-btn-primary",onClick:()=>R.mutate(),disabled:H||R.isPending,type:"button","aria-label":"启动 pipeline",title:H?"pipeline 正在运行":"启动 pipeline",children:[R.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Hm,{size:14,strokeWidth:3}),"启动"]}),m.jsxs("button",{className:"nb-btn nb-btn-danger",onClick:()=>A.mutate(),disabled:!H||A.isPending,type:"button","aria-label":"停止 pipeline",title:H?"停止 pipeline":"pipeline 未在运行",children:[A.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(ZE,{size:14,strokeWidth:3}),"停止"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await g({title:"重置整个流水线",body:"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。",confirm:"重置全部",danger:!0})&&L.mutate()},disabled:L.isPending,children:[L.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:14,strokeWidth:2.5}),"重置"]}),m.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>T(!0),disabled:P.isPending,children:[P.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:14,strokeWidth:3}),"新卡片"]})]})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(yf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"搜索标题 / skill / label…",value:o,onChange:X=>c(X.target.value),"aria-label":"搜索卡片"})]}),m.jsx(Xv,{label:"skill",options:j,selected:f,onChange:d}),m.jsx(Xv,{label:"label",options:G,selected:h,onChange:y}),(o||f.size>0||h.size>0)&&m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{c(""),d(new Set),y(new Set)},type:"button","aria-label":"清空筛选",children:[m.jsx(vr,{size:11,strokeWidth:3}),"清空"]}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[m.jsx(FC,{size:12}),J.length," / ",W.length]})]}),S.isError&&m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("p",{className:"font-semibold",children:"加载卡片失败"}),m.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:S.error instanceof Error?S.error.message:String(S.error)})]}),!S.isError&&m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:iR.map(X=>m.jsx(tR,{label:X.label,bg:X.bg,cards:J.filter(lR(X.state)),onCardClick:me=>l(me.seq),onDropCard:me=>I.mutate({seq:me,state:X.state})},X.state))}),r!==null&&m.jsx(nR,{project:n,seq:r,onClose:()=>l(null),onChanged:k}),$&&m.jsx(IO,{project:n,isPending:P.isPending,onCancel:()=>T(!1),onCreate:X=>P.mutate(X)})]})}function lR(e){return t=>e==="Backlog"?t.state==="Backlog"||t.state==="Planning"||t.state==="Todo":e==="Inprogress"?t.state==="Inprogress":e==="Review"?t.state==="Review"||t.state==="QA":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Xv({label:e,options:t,selected:n,onChange:r}){const[l,o]=M.useState(!1),c=M.useRef(null);M.useEffect(()=>{if(!l)return;const y=v=>{var x;(x=c.current)!=null&&x.contains(v.target)||o(!1)},g=v=>{v.key==="Escape"&&o(!1)};return window.addEventListener("click",y),window.addEventListener("keydown",g),()=>{window.removeEventListener("click",y),window.removeEventListener("keydown",g)}},[l]);const f=y=>{const g=new Set(n);g.has(y)?g.delete(y):g.add(y),r(g)},d=t.length===0,h=n.size;return m.jsxs("div",{ref:c,className:"relative",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!d&&o(y=>!y),disabled:d,"aria-haspopup":"listbox","aria-expanded":l,"aria-label":`按 ${e} 筛选`,children:[e,h>0&&m.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:h}),m.jsx(Fm,{size:11,strokeWidth:3,className:["transition-transform",l?"rotate-180":""].join(" ")})]}),l&&m.jsxs("div",{role:"listbox",className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] max-h-64 overflow-auto nb-card p-2",style:{padding:8},children:[t.map(y=>{const g=n.has(y);return m.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",g?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("input",{type:"checkbox",checked:g,onChange:()=>f(y),className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:y})]},y)}),h>0&&m.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>r(new Set),children:"清空选择"})]})]})}function oR(e){return qt(`/api/projects/${encodeURIComponent(e)}/workers`)}function cR(e,t){return qt(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function iS(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function wf(e,t){return iS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function aS(e,t,n){return iS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function uR(){const[e,t]=Um(),n=e.get("project");J1(n);const r=$n(),[l,o]=M.useState(null),{data:c,isLoading:f,isError:d,error:h,refetch:y}=yt({queryKey:["workers",n],queryFn:()=>oR(n??""),enabled:!!n,refetchInterval:5e3});if(!n)return m.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-accent-yellow)]",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["在 URL 上加 ",m.jsx("code",{className:"bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"?project=xx"}),",或从",m.jsx(wr,{to:"/projects",className:"underline font-semibold",children:" 项目列表"})," 打开看板后跳转。"]})]});const g=(c==null?void 0:c.data)??[],v=g.filter(w=>w.state==="running").length,x=g.filter(w=>w.state==="stuck").length,S=g.filter(w=>w.state==="crashed").length;return m.jsxs("div",{className:"flex flex-col gap-4 max-w-6xl",children:[m.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[g.length," 个 slot · ",v," running · ",x," stuck · ",S," crashed"]})]}),m.jsxs("div",{className:"flex gap-3 items-center",children:[m.jsx(lg,{current:n,onChange:w=>t({project:w})}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",onClick:()=>y(),type:"button",children:[m.jsx(Df,{size:14,strokeWidth:2.5})," 刷新"]})]})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{className:"font-semibold",children:["加载失败: ",h instanceof Error?h.message:String(h)]})}),!f&&g.length===0&&m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)]",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"当前没有 worker slot。启动一次 pipeline 就会出现。"})}),g.length>0&&m.jsx("div",{className:"nb-card p-0 overflow-hidden",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)]",children:[m.jsx(Vr,{w:"70px",children:"Slot"}),m.jsx(Vr,{children:"Card"}),m.jsx(Vr,{w:"110px",children:"Status"}),m.jsx(Vr,{w:"90px",children:"Stage"}),m.jsx(Vr,{w:"90px",children:"PID"}),m.jsx(Vr,{w:"120px",children:"Runtime"}),m.jsx(Vr,{w:"260px",right:!0,children:"Action"})]})}),m.jsx("tbody",{children:g.map(w=>m.jsx(fR,{project:n,worker:w,onChange:()=>r.invalidateQueries({queryKey:["workers",n]}),onDetail:()=>o(w.slot)},w.slot))})]})}),l!==null&&m.jsx(dR,{project:n,slot:l,onClose:()=>o(null),onChange:()=>r.invalidateQueries({queryKey:["workers",n]})})]})}function Vr({children:e,w:t,right:n}){return m.jsx("th",{className:["px-4 py-3 text-left font-[family-name:var(--font-heading)] font-bold text-[12px] uppercase tracking-wider text-[var(--color-text-muted)]",n?"text-right":""].join(" "),style:t?{width:t}:void 0,children:e})}function fR({project:e,worker:t,onChange:n,onDetail:r}){const{confirm:l,alert:o}=si(),c=t.state==="idle",f=t.state==="crashed"||t.state==="stuck";return m.jsxs("tr",{className:"border-b border-dashed border-[var(--color-border-light)] last:border-0 hover:bg-[var(--color-accent-yellow)] transition-colors",children:[m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] font-bold",children:t.slot}),m.jsx("td",{className:"px-4 py-3",children:t.card?m.jsxs("span",{className:"font-semibold",children:[m.jsxs("span",{className:"inline-block px-2 py-0.5 text-xs bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full font-[family-name:var(--font-mono)] mr-2",children:["#",t.card.seq]}),t.card.title]}):m.jsx("em",{className:"text-[var(--color-text-subtle)]",children:"— 空闲 —"})}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(rS,{state:t.state})}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:t.stage||"—"}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:t.pid??"—"}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:sS(t.runtimeMs)}),m.jsxs("td",{className:"px-4 py-3 text-right space-x-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:r,type:"button","aria-label":`查看 worker-${t.slot} 详情`,children:[m.jsx(YC,{size:12,strokeWidth:2.5})," 详情"]}),f&&t.card&&m.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await l({title:`重启 worker-${t.slot}`,body:`先杀掉当前进程,然后重新 launch 到卡 #${t.card.seq}。`,confirm:"重启"})){try{await wf(e,t.slot)}catch{}try{await aS(e,t.slot,t.card.seq),n()}catch(h){o({title:"重启失败",body:h instanceof Error?h.message:String(h)})}}},type:"button",children:[m.jsx(jl,{size:12,strokeWidth:2.5})," 重启"]}),!c&&m.jsxs(m.Fragment,{children:[m.jsxs(wr,{to:`/logs?project=${encodeURIComponent(e)}&worker=${t.slot}`,className:"nb-btn",style:{display:"inline-flex",padding:"4px 10px",fontSize:11},children:[m.jsx(SA,{size:12,strokeWidth:2.5})," log"]}),m.jsxs("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await l({title:`终止 worker-${t.slot}`,body:"当前任务会被强制中断,未保存的工作可能丢失。",confirm:"终止",danger:!0})&&(await wf(e,t.slot),n())},type:"button",children:[m.jsx(e1,{size:12,strokeWidth:2.5})," 终止"]})]})]})]})}function dR({project:e,slot:t,onClose:n,onChange:r}){const{confirm:l,alert:o}=si(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=yt({queryKey:["worker-detail",e,t],queryFn:()=>cR(e,t),refetchInterval:3e3});return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:m.jsxs("div",{onClick:g=>g.stopPropagation(),className:"nb-card mt-8 w-full max-w-3xl",children:[m.jsxs("header",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:["worker-",t]}),m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-0.5",children:e})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>y(),type:"button","aria-label":"刷新",children:[m.jsx(Df,{size:12,strokeWidth:2.5})," 刷新"]}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:"✕"})]})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:m.jsxs("dl",{className:"grid grid-cols-[130px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"状态"}),m.jsx("dd",{children:m.jsx(rS,{state:c.state})}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Card"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.card?`#${c.card.seq} · ${c.card.title}`:"—"}),m.jsx("dt",{className:"font-bold",children:"Stage"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.stage??"—"}),m.jsx("dt",{className:"font-bold",children:"Runtime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:sS(c.runtimeMs)}),m.jsx("dt",{className:"font-bold",children:"Marker"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs text-[var(--color-text-muted)] break-all",children:c.markerPath}),m.jsx("dt",{className:"font-bold",children:"Marker 更新"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:c.markerUpdatedAt?`${new Date(c.markerUpdatedAt).toLocaleString()} (${hR(c.markerUpdatedAt)})`:"—"})]})}),m.jsxs("div",{children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:["最近 ",c.recentLogs.length," 行日志"]}),c.recentLogs.length===0?m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:["没找到带 worker-",t," 标签的日志。去 Logs 页看全量。"]}):m.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap break-words",children:c.recentLogs.map(g=>`${g.ts??""} [${g.level}] ${g.msg}`).join(`
452
+ `).trim()}function nR({project:e,seq:t,onClose:n,onChanged:r}){const l=$n(),{confirm:o,alert:c}=si(),{data:f,isLoading:d,isError:h,error:y,refetch:g}=yt({queryKey:["card",e,t],queryFn:()=>BO(e,t)}),[v,x]=M.useState(!1),[S,w]=M.useState(""),[k,_]=M.useState(""),[R,A]=M.useState(new Set),[L,$]=M.useState([]),[T,P]=M.useState(""),I=yt({queryKey:["skills-all",e],queryFn:()=>sg(e),enabled:v});M.useEffect(()=>{v&&f&&(w(f.title),_(vp(f.body)),A(new Set(f.skills)),$([...f.labels]))},[v,f]),M.useEffect(()=>{const H=Q=>{Q.key==="Escape"&&(v?x(!1):n())};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[n,v]);const W=Pn({mutationFn:()=>{if(!f)throw new Error("no data");const H={},Q=S.trim();Q&&Q!==f.title&&(H.title=Q);const K=vp(f.body);k!==K&&(H.description=k);const le=[...R].sort(),X=[...f.skills].sort();return JSON.stringify(le)!==JSON.stringify(X)&&(H.skills=le),JSON.stringify(L)!==JSON.stringify(f.labels)&&(H.labels=L),Object.keys(H).length===0?Promise.resolve({ok:!0,noop:!0}):qO(e,t,H)},onSuccess:()=>{l.invalidateQueries({queryKey:["card",e,t]}),l.invalidateQueries({queryKey:["cards",e]}),x(!1),r()},onError:H=>{c({title:"保存失败",body:H instanceof Error?H.message:String(H)})}}),j=M.useMemo(()=>{if(!v||!f)return!1;if(S.trim()!==f.title||k!==vp(f.body))return!0;const H=[...R].sort(),Q=[...f.skills].sort();return JSON.stringify(H)!==JSON.stringify(Q)||JSON.stringify(L)!==JSON.stringify(f.labels)},[v,f,S,k,R,L]),G=H=>{const Q=new Set(R);Q.has(H)?Q.delete(H):Q.add(H),A(Q)},J=()=>{const H=T.trim();if(H){if(L.includes(H)){P("");return}$([...L,H]),P("")}},oe=H=>{$(L.filter(Q=>Q!==H))};return m.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:m.jsxs("div",{onClick:H=>H.stopPropagation(),className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[m.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&m.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),v&&m.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:"⚠ 编辑中"})]}),v?m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:S,onChange:H=>w(H.target.value),maxLength:200,"aria-label":"卡片标题"}):m.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??"加载中…"})]}),m.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!v&&f&&m.jsxs("button",{onClick:()=>x(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":"编辑卡片",children:[m.jsx(qm,{size:12,strokeWidth:2.5})," 编辑"]}),m.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":"关闭",type:"button",children:m.jsx(vr,{size:14,strokeWidth:3})})]})]}),d&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),h&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",y instanceof Error?y.message:String(y)]}),f&&m.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!v&&m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx($C,{size:14}),m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:f.branch})]}),v?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),I.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),I.data&&I.data.data.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:I.data.data.map(H=>{const Q=R.has(H.name);return m.jsx("button",{type:"button",onClick:()=>G(H.name),"aria-pressed":Q,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",Q?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:H.name},H.name)})})]}),m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[L.map(H=>m.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[H,m.jsx("button",{type:"button",onClick:()=>oe(H),className:"hover:text-[var(--color-crashed)]","aria-label":`删除 ${H}`,children:m.jsx(vr,{size:10,strokeWidth:3})})]},H)),m.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:"+ 添加 label",value:T,onChange:H=>P(H.target.value),onKeyDown:H=>{H.key==="Enter"&&!H.nativeEvent.isComposing&&(H.preventDefault(),J())}}),T&&m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:J,"aria-label":"添加 label",children:m.jsx(Xi,{size:10,strokeWidth:3})})]}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖"})]})]}):(f.skills.length>0||f.labels.length>0)&&m.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.skills.map(H=>m.jsx(eS,{name:H},H)),f.labels.map(H=>m.jsx(tS,{label:H,kind:H==="NEEDS-FIX"?"warn":"default"},H))]}),f.checklist.total>0&&m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsxs("span",{className:"font-bold text-sm",children:["检查清单 ",f.checklist.done,"/",f.checklist.total]}),m.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${f.checklist.percent}%`}})})]}),m.jsx("ul",{className:"text-sm space-y-1",children:f.checklist.items.map((H,Q)=>m.jsxs("li",{className:`flex items-start gap-2 ${H.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:H.done?"✓":"○"}),m.jsx("span",{children:H.text})]},Q))})]}),v?m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:k,onChange:H=>_(H.target.value),"aria-label":"卡片描述"}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:'只替换 "## 描述" 段的内容;检查清单和日志段不动。'})]}):f.body&&m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"正文"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:f.body.trim()||"(空)"})]}),m.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end",children:v?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{x(!1),g()},disabled:W.isPending,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>W.mutate(),disabled:!j||!S.trim()||W.isPending,"aria-label":"保存卡片修改",children:[W.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Lf,{size:14,strokeWidth:3}),"保存"]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:async()=>{try{await FO(e,t),r()}catch(H){c({title:"启动 worker 失败",body:H instanceof Error?H.message:String(H)})}},children:[m.jsx(Hm,{size:14,strokeWidth:3}),"启动 worker"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:`重置卡片 #${t}`,body:"卡片状态会回到初始,已做的 checklist 会清空。",confirm:"重置",danger:!0}))try{await UO(e,t),r(),n()}catch(Q){c({title:"重置失败",body:Q instanceof Error?Q.message:String(Q)})}},children:[m.jsx(Df,{size:14,strokeWidth:2.5}),"重置卡片"]})]})})]})]})})}function lg({current:e,onChange:t}){const[n,r]=M.useState(!1),l=M.useRef(null),{data:o}=yt({queryKey:["projects"],queryFn:bc});return M.useEffect(()=>{const c=f=>{var d;(d=l.current)!=null&&d.contains(f.target)||r(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),m.jsxs("div",{className:"relative",ref:l,children:[m.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 px-3 py-2 bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[3px_3px_0_var(--color-text)] font-[family-name:var(--font-mono)] text-sm font-bold hover:-translate-x-px hover:-translate-y-px hover:shadow-[4px_4px_0_var(--color-text)] transition-[transform,box-shadow] duration-150",onClick:()=>r(c=>!c),children:[e,m.jsx(Fm,{size:14,strokeWidth:2.5})]}),n&&o&&m.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[5px_5px_0_var(--color-text)] overflow-hidden",children:o.data.map(c=>m.jsxs("button",{type:"button",onClick:()=>{t(c.name),r(!1)},className:["w-full text-left px-4 py-2 text-sm font-semibold",c.name===e?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:c.name}),m.jsxs("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:[c.cards.total," cards"]})]},c.name))})]})}const iR=[{state:"Planning",label:"Planning",bg:"var(--color-accent-purple)"},{state:"Backlog",label:"Backlog",bg:"var(--color-bg-cream)"},{state:"Todo",label:"Todo",bg:"var(--color-accent-yellow)"},{state:"Inprogress",label:"Inprogress",bg:"var(--color-secondary)"},{state:"QA",label:"QA / Review",bg:"var(--color-accent-pink)"},{state:"Done",label:"Done",bg:"var(--color-accent-mint)"}],nS="sps-console:last-board-project";function aR(){if(typeof window>"u")return null;try{return localStorage.getItem(nS)}catch{return null}}function rR(e){if(!(typeof window>"u"))try{localStorage.setItem(nS,e)}catch{}}function sR(){var Q,K,le;const[e,t]=Um(),n=e.get("project"),[r,l]=M.useState(null),[o,c]=M.useState(""),[f,d]=M.useState(()=>new Set),[h,y]=M.useState(()=>new Set),{confirm:g,alert:v}=si();J1(n);const x=yt({queryKey:["projects"],queryFn:bc}),S=yt({queryKey:["cards",n],queryFn:()=>zO(n??""),enabled:!!n}),w=$n(),k=()=>{w.invalidateQueries({queryKey:["cards",n]}),w.invalidateQueries({queryKey:["projects"]}),w.invalidateQueries({queryKey:["pipeline-status",n]})},_=X=>{t({project:X})};M.useEffect(()=>{var me;if(n){rR(n);return}const X=aR();X&&((me=x.data)!=null&&me.data.some(O=>O.name===X))&&t({project:X},{replace:!0})},[n,x.data,t]);const R=Pn({mutationFn:()=>HO(n),onSuccess:()=>{k()},onError:X=>{v({title:"启动 pipeline 失败",body:X instanceof Error?X.message:String(X)})}}),A=Pn({mutationFn:()=>KO(n),onSuccess:()=>k(),onError:X=>{v({title:"停止 pipeline 失败",body:X instanceof Error?X.message:String(X)})}}),L=Pn({mutationFn:()=>GO(n,{all:!0}),onSuccess:()=>k(),onError:X=>{v({title:"重置失败",body:X instanceof Error?X.message:String(X)})}}),[$,T]=M.useState(!1),P=Pn({mutationFn:X=>PO(n,X),onSuccess:()=>{k(),T(!1)},onError:X=>{v({title:"新建卡片失败",body:X instanceof Error?X.message:String(X)})}}),I=Pn({mutationFn:({seq:X,state:me})=>$O(n,X,me),onMutate:async({seq:X,state:me})=>{await w.cancelQueries({queryKey:["cards",n]});const O=w.getQueryData(["cards",n]);return O&&w.setQueryData(["cards",n],{...O,data:O.data.map(D=>D.seq===X?{...D,state:me}:D)}),{prev:O}},onError:(X,me,O)=>{O!=null&&O.prev&&w.setQueryData(["cards",n],O.prev),v({title:"移动卡片失败",body:X instanceof Error?X.message:String(X)})},onSettled:()=>{w.invalidateQueries({queryKey:["cards",n]})}}),W=((Q=S.data)==null?void 0:Q.data)??[],{allSkills:j,allLabels:G}=M.useMemo(()=>{const X=new Set,me=new Set;for(const O of W){for(const D of O.skills)X.add(D);for(const D of O.labels)me.add(D)}return{allSkills:[...X].sort(),allLabels:[...me].sort()}},[W]);if(!n)return m.jsxs("div",{className:"flex flex-col gap-6 max-w-4xl",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"看板"}),m.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:"选择一个项目 🎯"}),m.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:"看板按项目分。挑一个开始:"}),m.jsx("div",{className:"flex flex-wrap gap-2",children:(K=x.data)==null?void 0:K.data.map(X=>m.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>_(X.name),type:"button",children:X.name},X.name))})]})]});const J=W.filter(X=>{if(o){const me=o.toLowerCase();if(!(X.title.toLowerCase().includes(me)||X.skills.some(D=>D.toLowerCase().includes(me))||X.labels.some(D=>D.toLowerCase().includes(me))))return!1}return!(f.size>0&&!X.skills.some(O=>f.has(O))||h.size>0&&!X.labels.some(O=>h.has(O)))}),oe=(le=x.data)==null?void 0:le.data.find(X=>X.name===n),H=(oe==null?void 0:oe.pipelineStatus)==="running";return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"看板 ✨"}),m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:oe?`${oe.name} · ${oe.cards.total} cards · ${oe.workers.active} workers 活跃`:"加载中…"})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsx(lg,{current:n,onChange:_}),m.jsxs("button",{className:"nb-btn nb-btn-primary",onClick:()=>R.mutate(),disabled:H||R.isPending,type:"button","aria-label":"启动 pipeline",title:H?"pipeline 正在运行":"启动 pipeline",children:[R.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Hm,{size:14,strokeWidth:3}),"启动"]}),m.jsxs("button",{className:"nb-btn nb-btn-danger",onClick:()=>A.mutate(),disabled:!H||A.isPending,type:"button","aria-label":"停止 pipeline",title:H?"停止 pipeline":"pipeline 未在运行",children:[A.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(ZE,{size:14,strokeWidth:3}),"停止"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await g({title:"重置整个流水线",body:"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。",confirm:"重置全部",danger:!0})&&L.mutate()},disabled:L.isPending,children:[L.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:14,strokeWidth:2.5}),"重置"]}),m.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>T(!0),disabled:P.isPending,children:[P.isPending?m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:14,strokeWidth:3}),"新卡片"]})]})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(yf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"搜索标题 / skill / label…",value:o,onChange:X=>c(X.target.value),"aria-label":"搜索卡片"})]}),m.jsx(Xv,{label:"skill",options:j,selected:f,onChange:d}),m.jsx(Xv,{label:"label",options:G,selected:h,onChange:y}),(o||f.size>0||h.size>0)&&m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{c(""),d(new Set),y(new Set)},type:"button","aria-label":"清空筛选",children:[m.jsx(vr,{size:11,strokeWidth:3}),"清空"]}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[m.jsx(FC,{size:12}),J.length," / ",W.length]})]}),S.isError&&m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("p",{className:"font-semibold",children:"加载卡片失败"}),m.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:S.error instanceof Error?S.error.message:String(S.error)})]}),!S.isError&&m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-3",children:iR.map(X=>m.jsx(tR,{label:X.label,bg:X.bg,cards:J.filter(lR(X.state)),onCardClick:me=>l(me.seq),onDropCard:me=>I.mutate({seq:me,state:X.state})},X.state))}),r!==null&&m.jsx(nR,{project:n,seq:r,onClose:()=>l(null),onChanged:k}),$&&m.jsx(IO,{project:n,isPending:P.isPending,onCancel:()=>T(!1),onCreate:X=>P.mutate(X)})]})}function lR(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Xv({label:e,options:t,selected:n,onChange:r}){const[l,o]=M.useState(!1),c=M.useRef(null);M.useEffect(()=>{if(!l)return;const y=v=>{var x;(x=c.current)!=null&&x.contains(v.target)||o(!1)},g=v=>{v.key==="Escape"&&o(!1)};return window.addEventListener("click",y),window.addEventListener("keydown",g),()=>{window.removeEventListener("click",y),window.removeEventListener("keydown",g)}},[l]);const f=y=>{const g=new Set(n);g.has(y)?g.delete(y):g.add(y),r(g)},d=t.length===0,h=n.size;return m.jsxs("div",{ref:c,className:"relative",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!d&&o(y=>!y),disabled:d,"aria-haspopup":"listbox","aria-expanded":l,"aria-label":`按 ${e} 筛选`,children:[e,h>0&&m.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:h}),m.jsx(Fm,{size:11,strokeWidth:3,className:["transition-transform",l?"rotate-180":""].join(" ")})]}),l&&m.jsxs("div",{role:"listbox",className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] max-h-64 overflow-auto nb-card p-2",style:{padding:8},children:[t.map(y=>{const g=n.has(y);return m.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",g?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("input",{type:"checkbox",checked:g,onChange:()=>f(y),className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:y})]},y)}),h>0&&m.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>r(new Set),children:"清空选择"})]})]})}function oR(e){return qt(`/api/projects/${encodeURIComponent(e)}/workers`)}function cR(e,t){return qt(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function iS(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function wf(e,t){return iS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function aS(e,t,n){return iS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function uR(){const[e,t]=Um(),n=e.get("project");J1(n);const r=$n(),[l,o]=M.useState(null),{data:c,isLoading:f,isError:d,error:h,refetch:y}=yt({queryKey:["workers",n],queryFn:()=>oR(n??""),enabled:!!n,refetchInterval:5e3});if(!n)return m.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-accent-yellow)]",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["在 URL 上加 ",m.jsx("code",{className:"bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"?project=xx"}),",或从",m.jsx(wr,{to:"/projects",className:"underline font-semibold",children:" 项目列表"})," 打开看板后跳转。"]})]});const g=(c==null?void 0:c.data)??[],v=g.filter(w=>w.state==="running").length,x=g.filter(w=>w.state==="stuck").length,S=g.filter(w=>w.state==="crashed").length;return m.jsxs("div",{className:"flex flex-col gap-4 max-w-6xl",children:[m.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[g.length," 个 slot · ",v," running · ",x," stuck · ",S," crashed"]})]}),m.jsxs("div",{className:"flex gap-3 items-center",children:[m.jsx(lg,{current:n,onChange:w=>t({project:w})}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",onClick:()=>y(),type:"button",children:[m.jsx(Df,{size:14,strokeWidth:2.5})," 刷新"]})]})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{className:"font-semibold",children:["加载失败: ",h instanceof Error?h.message:String(h)]})}),!f&&g.length===0&&m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)]",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"当前没有 worker slot。启动一次 pipeline 就会出现。"})}),g.length>0&&m.jsx("div",{className:"nb-card p-0 overflow-hidden",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)]",children:[m.jsx(Vr,{w:"70px",children:"Slot"}),m.jsx(Vr,{children:"Card"}),m.jsx(Vr,{w:"110px",children:"Status"}),m.jsx(Vr,{w:"90px",children:"Stage"}),m.jsx(Vr,{w:"90px",children:"PID"}),m.jsx(Vr,{w:"120px",children:"Runtime"}),m.jsx(Vr,{w:"260px",right:!0,children:"Action"})]})}),m.jsx("tbody",{children:g.map(w=>m.jsx(fR,{project:n,worker:w,onChange:()=>r.invalidateQueries({queryKey:["workers",n]}),onDetail:()=>o(w.slot)},w.slot))})]})}),l!==null&&m.jsx(dR,{project:n,slot:l,onClose:()=>o(null),onChange:()=>r.invalidateQueries({queryKey:["workers",n]})})]})}function Vr({children:e,w:t,right:n}){return m.jsx("th",{className:["px-4 py-3 text-left font-[family-name:var(--font-heading)] font-bold text-[12px] uppercase tracking-wider text-[var(--color-text-muted)]",n?"text-right":""].join(" "),style:t?{width:t}:void 0,children:e})}function fR({project:e,worker:t,onChange:n,onDetail:r}){const{confirm:l,alert:o}=si(),c=t.state==="idle",f=t.state==="crashed"||t.state==="stuck";return m.jsxs("tr",{className:"border-b border-dashed border-[var(--color-border-light)] last:border-0 hover:bg-[var(--color-accent-yellow)] transition-colors",children:[m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] font-bold",children:t.slot}),m.jsx("td",{className:"px-4 py-3",children:t.card?m.jsxs("span",{className:"font-semibold",children:[m.jsxs("span",{className:"inline-block px-2 py-0.5 text-xs bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full font-[family-name:var(--font-mono)] mr-2",children:["#",t.card.seq]}),t.card.title]}):m.jsx("em",{className:"text-[var(--color-text-subtle)]",children:"— 空闲 —"})}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(rS,{state:t.state})}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:t.stage||"—"}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:t.pid??"—"}),m.jsx("td",{className:"px-4 py-3 font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:sS(t.runtimeMs)}),m.jsxs("td",{className:"px-4 py-3 text-right space-x-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:r,type:"button","aria-label":`查看 worker-${t.slot} 详情`,children:[m.jsx(YC,{size:12,strokeWidth:2.5})," 详情"]}),f&&t.card&&m.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await l({title:`重启 worker-${t.slot}`,body:`先杀掉当前进程,然后重新 launch 到卡 #${t.card.seq}。`,confirm:"重启"})){try{await wf(e,t.slot)}catch{}try{await aS(e,t.slot,t.card.seq),n()}catch(h){o({title:"重启失败",body:h instanceof Error?h.message:String(h)})}}},type:"button",children:[m.jsx(jl,{size:12,strokeWidth:2.5})," 重启"]}),!c&&m.jsxs(m.Fragment,{children:[m.jsxs(wr,{to:`/logs?project=${encodeURIComponent(e)}&worker=${t.slot}`,className:"nb-btn",style:{display:"inline-flex",padding:"4px 10px",fontSize:11},children:[m.jsx(SA,{size:12,strokeWidth:2.5})," log"]}),m.jsxs("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await l({title:`终止 worker-${t.slot}`,body:"当前任务会被强制中断,未保存的工作可能丢失。",confirm:"终止",danger:!0})&&(await wf(e,t.slot),n())},type:"button",children:[m.jsx(e1,{size:12,strokeWidth:2.5})," 终止"]})]})]})]})}function dR({project:e,slot:t,onClose:n,onChange:r}){const{confirm:l,alert:o}=si(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=yt({queryKey:["worker-detail",e,t],queryFn:()=>cR(e,t),refetchInterval:3e3});return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:m.jsxs("div",{onClick:g=>g.stopPropagation(),className:"nb-card mt-8 w-full max-w-3xl",children:[m.jsxs("header",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:["worker-",t]}),m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-0.5",children:e})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>y(),type:"button","aria-label":"刷新",children:[m.jsx(Df,{size:12,strokeWidth:2.5})," 刷新"]}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:"✕"})]})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:m.jsxs("dl",{className:"grid grid-cols-[130px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"状态"}),m.jsx("dd",{children:m.jsx(rS,{state:c.state})}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Card"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.card?`#${c.card.seq} · ${c.card.title}`:"—"}),m.jsx("dt",{className:"font-bold",children:"Stage"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:c.stage??"—"}),m.jsx("dt",{className:"font-bold",children:"Runtime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:sS(c.runtimeMs)}),m.jsx("dt",{className:"font-bold",children:"Marker"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs text-[var(--color-text-muted)] break-all",children:c.markerPath}),m.jsx("dt",{className:"font-bold",children:"Marker 更新"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:c.markerUpdatedAt?`${new Date(c.markerUpdatedAt).toLocaleString()} (${hR(c.markerUpdatedAt)})`:"—"})]})}),m.jsxs("div",{children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:["最近 ",c.recentLogs.length," 行日志"]}),c.recentLogs.length===0?m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:["没找到带 worker-",t," 标签的日志。去 Logs 页看全量。"]}):m.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap break-words",children:c.recentLogs.map(g=>`${g.ts??""} [${g.level}] ${g.msg}`).join(`
453
453
  `)}),m.jsx(wr,{to:`/logs?project=${encodeURIComponent(e)}&worker=${t}`,className:"inline-block mt-2 text-xs underline text-[var(--color-running)]",children:"查看完整 log →"})]}),m.jsxs("div",{className:"flex gap-2 justify-end border-t-2 border-dashed border-[var(--color-text)] pt-3",children:[(c.state==="crashed"||c.state==="stuck")&&c.card&&m.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{if(await l({title:`重启 worker-${t}`,body:`先杀掉当前进程,重新 launch 到卡 #${c.card.seq}。`,confirm:"重启"})){try{await wf(e,t)}catch{}try{await aS(e,t,c.card.seq),r(),y()}catch(v){o({title:"重启失败",body:v instanceof Error?v.message:String(v)})}}},type:"button",children:[m.jsx(jl,{size:14,strokeWidth:2.5})," 重启"]}),c.state!=="idle"&&m.jsxs("button",{className:"nb-btn nb-btn-danger",onClick:async()=>{if(await l({title:`终止 worker-${t}`,body:"当前任务会被强制中断。",confirm:"终止",danger:!0}))try{await wf(e,t),r(),y()}catch(v){o({title:"终止失败",body:v instanceof Error?v.message:String(v)})}},type:"button",children:[m.jsx(e1,{size:14,strokeWidth:3})," 终止"]}),c.state==="running"&&m.jsx(nn,{size:14,strokeWidth:3,className:"animate-spin self-center text-[var(--color-running)]"})]})]})]})})}function hR(e){const t=Date.now()-new Date(e).getTime();return t<6e4?`${Math.floor(t/1e3)}s 前`:t<36e5?`${Math.floor(t/6e4)}m 前`:`${Math.floor(t/36e5)}h 前`}function rS({state:e}){const t={running:{bg:"var(--color-running-bg)",color:"var(--color-running)"},stuck:{bg:"var(--color-stuck-bg)",color:"var(--color-stuck)"},crashed:{bg:"var(--color-crashed-bg)",color:"var(--color-crashed)"},idle:{bg:"var(--color-idle-bg)",color:"var(--color-idle)"}},{bg:n,color:r}=t[e];return m.jsx("span",{className:"nb-status",style:{background:n,color:r},children:e})}function sS(e){if(e==null||e<=0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),l=t%60,o=c=>c.toString().padStart(2,"0");return n>0?`${o(n)}:${o(r)}:${o(l)}`:`${o(r)}:${o(l)}`}function pR(e){const t=new URLSearchParams({project:e.project});return e.worker&&t.set("worker",e.worker),t.set("limit",String(e.limit)),e.since&&t.set("since",e.since),qt(`/api/logs?${t}`)}function mR(e){const t=new URLSearchParams({project:e.project});return e.worker&&t.set("worker",e.worker),`/stream/logs?${t}`}const gR=["error","warn","info","debug"],bR=["error","warn","info"];function yR(){const[e,t]=Um(),n=e.get("project"),r=e.get("worker")??"",[l,o]=M.useState([]),[c,f]=M.useState(!1),[d,h]=M.useState(!0),[y,g]=M.useState(()=>new Set(bR)),[v,x]=M.useState(""),[S,w]=M.useState("live"),[k,_]=M.useState(()=>{const T=new Date(Date.now()-36e5),P=I=>String(I).padStart(2,"0");return`${T.getFullYear()}-${P(T.getMonth()+1)}-${P(T.getDate())}T${P(T.getHours())}:${P(T.getMinutes())}`}),R=M.useRef(null),{data:A,refetch:L}=yt({queryKey:["logs",n,r,S,S==="history"?k:"live"],queryFn:()=>pR({project:n??"",worker:r||void 0,limit:S==="history"?2e3:500,since:S==="history"?new Date(k).toISOString():void 0}),enabled:!!n});M.useEffect(()=>{A!=null&&A.data&&o(A.data)},[A]),M.useEffect(()=>{if(!n||S!=="live")return;const T=mR({project:n,worker:r||void 0}),P=new EventSource(T);return P.addEventListener("log.line",I=>{if(!c)try{const W=JSON.parse(I.data);o(j=>{const G=[...j,W];return G.length>5e3&&G.splice(0,G.length-5e3),G})}catch{}}),()=>P.close()},[n,r,c,S]),M.useEffect(()=>{if(!d)return;const T=R.current;T&&(T.scrollTop=T.scrollHeight)},[l,d]);const $=M.useMemo(()=>{const T=v.toLowerCase();return l.filter(P=>!(!y.has(P.level)||T&&!P.msg.toLowerCase().includes(T)))},[l,y,v]);return n?m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Logs 📜"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[n,r&&` · worker-${r}`," · tail -f · ",l.length," lines",c&&m.jsx("span",{className:"text-[var(--color-stuck)] ml-2 font-bold",children:"⏸ PAUSED"})]})]}),m.jsx("div",{className:"flex gap-3 items-center",children:m.jsx(lg,{current:n,onChange:T=>t({project:T})})})]}),m.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[m.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[m.jsxs("button",{type:"button",onClick:()=>w("live"),"aria-pressed":S==="live",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",S==="live"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[m.jsx(VE,{size:11,strokeWidth:2.5}),"实时"]}),m.jsxs("button",{type:"button",onClick:()=>w("history"),"aria-pressed":S==="history",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",S==="history"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[m.jsx(GC,{size:11,strokeWidth:2.5}),"历史"]})]}),S==="history"&&m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"datetime-local",className:"nb-input",style:{padding:"4px 8px",fontSize:12},value:k,onChange:T=>_(T.target.value),"aria-label":"查询起始时间"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>L(),type:"button","aria-label":"查询",children:[m.jsx(yf,{size:11,strokeWidth:3}),"查询"]})]}),m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(yf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"过滤关键字…",value:v,onChange:T=>x(T.target.value),"aria-label":"过滤日志"})]}),m.jsx("div",{className:"flex items-center gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:gR.map(T=>m.jsx(xR,{level:T,enabled:y.has(T),onToggle:()=>{g(P=>{const I=new Set(P);return I.has(T)?I.delete(T):I.add(T),I})}},T))}),m.jsxs("div",{className:"ml-auto flex gap-2",children:[S==="live"&&m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(T=>!T),type:"button",children:d?"✓ Auto-scroll":"Auto-scroll"}),m.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>f(T=>!T),type:"button",children:c?m.jsxs(m.Fragment,{children:[m.jsx(Hm,{size:12,strokeWidth:3})," Resume"]}):m.jsxs(m.Fragment,{children:[m.jsx(sA,{size:12,strokeWidth:3})," Pause"]})})]}),m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>{const T=new Blob([$.map(W=>W.raw).join(`
454
454
  `)],{type:"text/plain"}),P=URL.createObjectURL(T),I=document.createElement("a");I.href=P,I.download=`${n}-log-${Date.now()}.log`,I.click(),URL.revokeObjectURL(P)},type:"button",children:[m.jsx(YE,{size:12,strokeWidth:2.5})," Export"]})]})]}),m.jsxs("div",{className:"nb-card p-0 overflow-hidden",children:[m.jsxs("div",{className:"px-4 py-2 bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)] flex items-center justify-between font-[family-name:var(--font-mono)] text-xs",children:[m.jsx("span",{className:"text-[var(--color-text-muted)]",children:(A==null?void 0:A.file)??"~/.coral/projects/.../logs/*.log"}),S==="live"?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"live"}):m.jsx("span",{className:"nb-status",style:{background:"var(--color-accent-purple)",color:"var(--color-text)"},children:"history"})]}),m.jsxs("div",{ref:R,className:"overflow-auto font-[family-name:var(--font-mono)] text-[12px] leading-[22px] max-h-[70vh] bg-[var(--color-bg)] p-2",onScroll:T=>{const P=T.currentTarget;!(P.scrollHeight-P.scrollTop-P.clientHeight<40)&&d&&h(!1)},children:[$.map((T,P)=>m.jsx(vR,{line:T},P)),$.length===0&&m.jsx("div",{className:"text-center py-12 text-[var(--color-text-subtle)]",children:"没有匹配的日志"})]})]})]}):m.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-accent-yellow)]",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"Logs 📜"}),m.jsxs("p",{className:"text-sm",children:["需要 ",m.jsx("code",{children:"?project=xx"}),"。"]})]})}function xR({level:e,enabled:t,onToggle:n}){const r={error:"var(--color-crashed-bg)",warn:"var(--color-stuck-bg)",info:"var(--color-secondary)",debug:"var(--color-accent-purple)"},l={error:"var(--color-crashed)",warn:"var(--color-stuck)",info:"var(--color-text)",debug:"var(--color-text)"};return m.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:["px-3 py-0.5 rounded-full font-[family-name:var(--font-mono)] text-[10px] font-bold tracking-widest cursor-pointer",t?"border-[1.5px] border-[var(--color-text)]":"text-[var(--color-text-subtle)]"].join(" "),style:t?{background:r[e],color:l[e]}:{},children:e.toUpperCase()})}function vR({line:e}){var n;const t={error:"bg-[var(--color-crashed)] text-[var(--color-text)]",warn:"bg-[var(--color-stuck)] text-[var(--color-text)]",info:"bg-[var(--color-secondary)] text-[var(--color-text)]",debug:"",trace:""};return m.jsxs("div",{className:"grid grid-cols-[100px_60px_1fr] gap-2 px-2 py-0.5 rounded hover:bg-[var(--color-bg-cream)]",children:[m.jsx("span",{className:"text-[var(--color-text-subtle)] whitespace-nowrap",children:e.ts?((n=e.ts.split("T")[1])==null?void 0:n.replace("Z",""))??e.ts:"--"}),m.jsx("span",{className:`text-center font-bold ${t[e.level]??""}`,style:{borderRadius:4,padding:"0 6px"},children:e.level.toUpperCase()}),m.jsx("span",{className:"truncate text-[var(--color-text)]",children:e.msg})]})}function ER(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const SR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_R={};function Zv(e,t){return(_R.jsx?wR:SR).test(e)}const kR=/[ \t\n\f\r]/g;function NR(e){return typeof e=="object"?e.type==="text"?Wv(e.value):!1:Wv(e)}function Wv(e){return e.replace(kR,"")===""}class Ec{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ec.prototype.normal={};Ec.prototype.property={};Ec.prototype.space=void 0;function lS(e,t){const n={},r={};for(const l of e)Object.assign(n,l.property),Object.assign(r,l.normal);return new Ec(n,r,t)}function fm(e){return e.toLowerCase()}class qn{constructor(t,n){this.attribute=n,this.property=t}}qn.prototype.attribute="";qn.prototype.booleanish=!1;qn.prototype.boolean=!1;qn.prototype.commaOrSpaceSeparated=!1;qn.prototype.commaSeparated=!1;qn.prototype.defined=!1;qn.prototype.mustUseProperty=!1;qn.prototype.number=!1;qn.prototype.overloadedBoolean=!1;qn.prototype.property="";qn.prototype.spaceSeparated=!1;qn.prototype.space=void 0;let TR=0;const Fe=ms(),Xt=ms(),dm=ms(),ue=ms(),St=ms(),ml=ms(),ti=ms();function ms(){return 2**++TR}const hm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:Xt,commaOrSpaceSeparated:ti,commaSeparated:ml,number:ue,overloadedBoolean:dm,spaceSeparated:St},Symbol.toStringTag,{value:"Module"})),Ep=Object.keys(hm);class og extends qn{constructor(t,n,r,l){let o=-1;if(super(t,n),Jv(this,"space",l),typeof r=="number")for(;++o<Ep.length;){const c=Ep[o];Jv(this,Ep[o],(r&hm[c])===hm[c])}}}og.prototype.defined=!0;function Jv(e,t,n){n&&(e[t]=n)}function ql(e){const t={},n={};for(const[r,l]of Object.entries(e.properties)){const o=new og(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[fm(r)]=r,n[fm(o.attribute)]=r}return new Ec(t,n,e.space)}const oS=ql({properties:{ariaActiveDescendant:null,ariaAtomic:Xt,ariaAutoComplete:null,ariaBusy:Xt,ariaChecked:Xt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:St,ariaCurrent:null,ariaDescribedBy:St,ariaDetails:null,ariaDisabled:Xt,ariaDropEffect:St,ariaErrorMessage:null,ariaExpanded:Xt,ariaFlowTo:St,ariaGrabbed:Xt,ariaHasPopup:null,ariaHidden:Xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:St,ariaLevel:ue,ariaLive:null,ariaModal:Xt,ariaMultiLine:Xt,ariaMultiSelectable:Xt,ariaOrientation:null,ariaOwns:St,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:Xt,ariaReadOnly:Xt,ariaRelevant:null,ariaRequired:Xt,ariaRoleDescription:St,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:Xt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cS(e,t){return t in e?e[t]:t}function uS(e,t){return cS(e,t.toLowerCase())}const CR=ql({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ml,acceptCharset:St,accessKey:St,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:St,autoFocus:Fe,autoPlay:Fe,blocking:St,capture:null,charSet:null,checked:Fe,cite:null,className:St,cols:ue,colSpan:null,content:null,contentEditable:Xt,controls:Fe,controlsList:St,coords:ue|ml,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:dm,draggable:Xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:St,height:ue,hidden:dm,high:ue,href:null,hrefLang:null,htmlFor:St,httpEquiv:St,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:St,itemRef:St,itemScope:Fe,itemType:St,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Fe,optimum:ue,pattern:null,ping:St,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:St,required:Fe,reversed:Fe,rows:ue,rowSpan:ue,sandbox:St,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:Xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Fe,useMap:null,value:Xt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:St,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:Xt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Fe,disableRemotePlayback:Fe,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:uS}),AR=ql({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ti,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:St,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ml,g2:ml,glyphName:ml,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:St,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ti,rev:ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ti,requiredFeatures:ti,requiredFonts:ti,requiredFormats:ti,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ti,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cS}),fS=ql({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dS=ql({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uS}),hS=ql({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),OR={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},RR=/[A-Z]/g,e0=/-[a-z]/g,MR=/^data[-\w.:]+$/i;function DR(e,t){const n=fm(t);let r=t,l=qn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&MR.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(e0,jR);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!e0.test(o)){let c=o.replace(RR,LR);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=og}return new l(r,t)}function LR(e){return"-"+e.toLowerCase()}function jR(e){return e.charAt(1).toUpperCase()}const IR=lS([oS,CR,fS,dS,hS],"html"),cg=lS([oS,AR,fS,dS,hS],"svg");function zR(e){return e.join(" ").trim()}var al={},Sp,t0;function BR(){if(t0)return Sp;t0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
455
455
  `,h="/",y="*",g="",v="comment",x="declaration";function S(k,_){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];_=_||{};var R=1,A=1;function L(H){var Q=H.match(t);Q&&(R+=Q.length);var K=H.lastIndexOf(d);A=~K?H.length-K:A+H.length}function $(){var H={line:R,column:A};return function(Q){return Q.position=new T(H),W(),Q}}function T(H){this.start=H,this.end={line:R,column:A},this.source=_.source}T.prototype.content=k;function P(H){var Q=new Error(_.source+":"+R+":"+A+": "+H);if(Q.reason=H,Q.filename=_.source,Q.line=R,Q.column=A,Q.source=k,!_.silent)throw Q}function I(H){var Q=H.exec(k);if(Q){var K=Q[0];return L(K),k=k.slice(K.length),Q}}function W(){I(n)}function j(H){var Q;for(H=H||[];Q=G();)Q!==!1&&H.push(Q);return H}function G(){var H=$();if(!(h!=k.charAt(0)||y!=k.charAt(1))){for(var Q=2;g!=k.charAt(Q)&&(y!=k.charAt(Q)||h!=k.charAt(Q+1));)++Q;if(Q+=2,g===k.charAt(Q-1))return P("End of comment missing");var K=k.slice(2,Q-2);return A+=2,L(K),k=k.slice(Q),A+=2,H({type:v,comment:K})}}function J(){var H=$(),Q=I(r);if(Q){if(G(),!I(l))return P("property missing ':'");var K=I(o),le=H({type:x,property:w(Q[0].replace(e,g)),value:K?w(K[0].replace(e,g)):g});return I(c),le}}function oe(){var H=[];j(H);for(var Q;Q=J();)Q!==!1&&(H.push(Q),j(H));return H}return W(),oe()}function w(k){return k?k.replace(f,g):g}return Sp=S,Sp}var n0;function UR(){if(n0)return al;n0=1;var e=al&&al.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(al,"__esModule",{value:!0}),al.default=n;const t=e(BR());function n(r,l){let o=null;if(!r||typeof r!="string")return o;const c=(0,t.default)(r),f=typeof l=="function";return c.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:y}=d;f?l(h,y,d):y&&(o=o||{},o[h]=y)}),o}return al}var Ho={},i0;function FR(){if(i0)return Ho;i0=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},d=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(r,f),h.replace(t,c))};return Ho.camelCase=d,Ho}var Ko,a0;function PR(){if(a0)return Ko;a0=1;var e=Ko&&Ko.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(UR()),n=FR();function r(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,d){f&&d&&(c[(0,n.camelCase)(f,o)]=d)}),c}return r.default=r,Ko=r,Ko}var $R=PR();const qR=_m($R),pS=mS("end"),ug=mS("start");function mS(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function HR(e){const t=ug(e),n=pS(e);if(t&&n)return{start:t,end:n}}function Wo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?r0(e.position):"start"in e||"end"in e?r0(e):"line"in e||"column"in e?pm(e):""}function pm(e){return s0(e&&e.line)+":"+s0(e&&e.column)}function r0(e){return pm(e&&e.start)+"-"+pm(e&&e.end)}function s0(e){return e&&typeof e=="number"?e:1}class bn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=Wo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}bn.prototype.file="";bn.prototype.name="";bn.prototype.reason="";bn.prototype.message="";bn.prototype.stack="";bn.prototype.column=void 0;bn.prototype.line=void 0;bn.prototype.ancestors=void 0;bn.prototype.cause=void 0;bn.prototype.fatal=void 0;bn.prototype.place=void 0;bn.prototype.ruleId=void 0;bn.prototype.source=void 0;const fg={}.hasOwnProperty,KR=new Map,GR=/[A-Z]/g,QR=new Set(["table","tbody","thead","tfoot","tr"]),YR=new Set(["td","th"]),gS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VR(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=iM(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=nM(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?cg:IR,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bS(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function bS(e,t,n){if(t.type==="element")return XR(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ZR(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JR(e,t,n);if(t.type==="mdxjsEsm")return WR(e,t);if(t.type==="root")return eM(e,t,n);if(t.type==="text")return tM(e,t)}function XR(e,t,n){const r=e.schema;let l=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(l=cg,e.schema=l),e.ancestors.push(t);const o=xS(e,t.tagName,!1),c=aM(e,t);let f=hg(e,t);return QR.has(t.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!NR(d):!0})),yS(e,c,o,t),dg(c,f),e.ancestors.pop(),e.schema=r,e.create(t,o,c,n)}function ZR(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}lc(e,t.position)}function WR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lc(e,t.position)}function JR(e,t,n){const r=e.schema;let l=r;t.name==="svg"&&r.space==="html"&&(l=cg,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:xS(e,t.name,!0),c=rM(e,t),f=hg(e,t);return yS(e,c,o,t),dg(c,f),e.ancestors.pop(),e.schema=r,e.create(t,o,c,n)}function eM(e,t,n){const r={};return dg(r,hg(e,t)),e.create(t,e.Fragment,r,n)}function tM(e,t){return t.value}function yS(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function dg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nM(e,t,n){return r;function r(l,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function iM(e,t){return n;function n(r,l,o,c){const f=Array.isArray(o.children),d=ug(r);return t(l,o,c,f,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function aM(e,t){const n={};let r,l;for(l in t.properties)if(l!=="children"&&fg.call(t.properties,l)){const o=sM(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&YR.has(t.tagName)?r=f:n[c]=f}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function rM(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else lc(e,t.position);else{const l=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else lc(e,t.position);else o=r.value===null?!0:r.value;n[l]=o}return n}function hg(e,t){const n=[];let r=-1;const l=e.passKeys?new Map:KR;for(;++r<t.children.length;){const o=t.children[r];let c;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const h=l.get(d)||0;c=d+"-"+h,l.set(d,h+1)}}const f=bS(e,o,c);f!==void 0&&n.push(f)}return n}function sM(e,t,n){const r=DR(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ER(n):zR(n)),r.property==="style"){let l=typeof n=="object"?n:lM(e,String(n));return e.stylePropertyNameCase==="css"&&(l=oM(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&r.space?OR[r.property]||r.property:r.attribute,n]}}function lM(e,t){try{return qR(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,l=new bn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=gS+"#cannot-parse-style-attribute",l}}function xS(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=Zv(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}r=c}else r=Zv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const l=r.value;return fg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(r);lc(e)}function lc(e,t){const n=new bn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=gS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oM(e){const t={};let n;for(n in e)fg.call(e,n)&&(t[cM(n)]=e[n]);return t}function cM(e){let t=e.replace(GR,uM);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function uM(e){return"-"+e.toLowerCase()}const wp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fM={};function pg(e,t){const n=fM,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vS(e,r,l)}function vS(e,t,n){if(dM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return l0(e.children,t,n)}return Array.isArray(e)?l0(e,t,n):""}function l0(e,t,n){const r=[];let l=-1;for(;++l<e.length;)r[l]=vS(e[l],t,n);return r.join("")}function dM(e){return!!(e&&typeof e=="object")}const o0=document.createElement("i");function mg(e){const t="&"+e+";";o0.innerHTML=t;const n=o0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ai(e,t,n,r){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,r.length<1e4)c=Array.from(r),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<r.length;)c=r.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function xi(e,t){return e.length>0?(ai(e,e.length,0,t),e):t}const c0={}.hasOwnProperty;function ES(e){const t={};let n=-1;for(;++n<e.length;)hM(t,e[n]);return t}function hM(e,t){let n;for(n in t){const l=(c0.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){c0.call(l,c)||(l[c]=[]);const f=o[c];pM(l[c],Array.isArray(f)?f:f?[f]:[])}}}function pM(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ai(e,0,0,r)}function SS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nn=kr(/[A-Za-z]/),mn=kr(/[\dA-Za-z]/),mM=kr(/[#-'*+\--9=?A-Z^-~]/);function _f(e){return e!==null&&(e<32||e===127)}const mm=kr(/\d/),gM=kr(/[\dA-Fa-f]/),bM=kr(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}const Vf=kr(new RegExp("\\p{P}|\\p{S}","u")),ds=kr(/\s/);function kr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Hl(e){const t=[];let n=-1,r=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&mn(e.charCodeAt(n+1))&&mn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(r,n),encodeURIComponent(c)),r=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function Je(e,t,n,r){const l=r?r-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(d){return Ge(d)?(e.enter(n),f(d)):t(d)}function f(d){return Ge(d)&&o++<l?(e.consume(d),f):(e.exit(n),t(d))}}const yM={tokenize:xM};function xM(e){const t=e.attempt(this.parser.constructs.contentInitial,r,l);let n;return t;function r(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Je(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Te(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const vM={tokenize:EM},u0={tokenize:SM};function EM(e){const t=this,n=[];let r=0,l,o,c;return f;function f(A){if(r<n.length){const L=n[r];return t.containerState=L[1],e.attempt(L[0].continuation,d,h)(A)}return h(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&R();const L=t.events.length;let $=L,T;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){T=t.events[$][1].end;break}_(r);let P=L;for(;P<t.events.length;)t.events[P][1].end={...T},P++;return ai(t.events,$+1,0,t.events.slice(L)),t.events.length=P,h(A)}return f(A)}function h(A){if(r===n.length){if(!l)return v(A);if(l.currentConstruct&&l.currentConstruct.concrete)return S(A);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(u0,y,g)(A)}function y(A){return l&&R(),_(r),v(A)}function g(A){return t.parser.lazy[t.now().line]=r!==n.length,c=t.now().offset,S(A)}function v(A){return t.containerState={},e.attempt(u0,x,S)(A)}function x(A){return r++,n.push([t.currentConstruct,t.containerState]),v(A)}function S(A){if(A===null){l&&R(),_(0),e.consume(A);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),w(A)}function w(A){if(A===null){k(e.exit("chunkFlow"),!0),_(0),e.consume(A);return}return Te(A)?(e.consume(A),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,f):(e.consume(A),w)}function k(A,L){const $=t.sliceStream(A);if(L&&$.push(null),A.previous=o,o&&(o.next=A),o=A,l.defineSkip(A.start),l.write($),t.parser.lazy[A.start.line]){let T=l.events.length;for(;T--;)if(l.events[T][1].start.offset<c&&(!l.events[T][1].end||l.events[T][1].end.offset>c))return;const P=t.events.length;let I=P,W,j;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(W){j=t.events[I][1].end;break}W=!0}for(_(r),T=P;T<t.events.length;)t.events[T][1].end={...j},T++;ai(t.events,I+1,0,t.events.slice(P)),t.events.length=T}}function _(A){let L=n.length;for(;L-- >A;){const $=n[L];t.containerState=$[1],$[0].exit.call(t,e)}n.length=A}function R(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function SM(e,t,n){return Je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ol(e){if(e===null||xt(e)||ds(e))return 1;if(Vf(e))return 2}function Xf(e,t,n){const r=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const gm={name:"attention",resolveAll:wM,tokenize:_M};function wM(e,t){let n=-1,r,l,o,c,f,d,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},v={...e[n][1].start};f0(g,-d),f0(v,d),c={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},l={type:d>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[r][1].end={...c.start},e[n][1].start={...f.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=xi(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=xi(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=xi(h,Xf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=xi(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=xi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,ai(e,r-1,n-r+3,h),n=r+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _M(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,l=Ol(r);let o;return c;function c(d){return o=d,e.enter("attentionSequence"),f(d)}function f(d){if(d===o)return e.consume(d),f;const h=e.exit("attentionSequence"),y=Ol(d),g=!y||y===2&&l||n.includes(d),v=!l||l===2&&y||n.includes(r);return h._open=!!(o===42?g:g&&(l||!v)),h._close=!!(o===42?v:v&&(y||!g)),t(d)}}function f0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kM={name:"autolink",tokenize:NM};function NM(e,t,n){let r=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return Nn(x)?(e.consume(x),c):x===64?n(x):h(x)}function c(x){return x===43||x===45||x===46||mn(x)?(r=1,f(x)):h(x)}function f(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||mn(x))&&r++<32?(e.consume(x),f):(r=0,h(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||_f(x)?n(x):(e.consume(x),d)}function h(x){return x===64?(e.consume(x),y):mM(x)?(e.consume(x),h):n(x)}function y(x){return mn(x)?g(x):n(x)}function g(x){return x===46?(e.consume(x),r=0,y):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):v(x)}function v(x){if((x===45||mn(x))&&r++<63){const S=x===45?v:g;return e.consume(x),S}return n(x)}}const Sc={partial:!0,tokenize:TM};function TM(e,t,n){return r;function r(o){return Ge(o)?Je(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Te(o)?t(o):n(o)}}const wS={continuation:{tokenize:AM},exit:OM,name:"blockQuote",tokenize:CM};function CM(e,t,n){const r=this;return l;function l(c){if(c===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return Ge(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function AM(e,t,n){const r=this;return l;function l(c){return Ge(c)?Je(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(wS,t,n)(c)}}function OM(e){e.exit("blockQuote")}const _S={name:"characterEscape",tokenize:RM};function RM(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return bM(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const kS={name:"characterReference",tokenize:MM};function MM(e,t,n){const r=this;let l=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=mn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=gM,y):(e.enter("characterReferenceValue"),o=7,c=mm,y(g))}function y(g){if(g===59&&l){const v=e.exit("characterReferenceValue");return c===mn&&!mg(r.sliceSerialize(v))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<o?(e.consume(g),y):n(g)}}const d0={partial:!0,tokenize:LM},h0={concrete:!0,name:"codeFenced",tokenize:DM};function DM(e,t,n){const r=this,l={partial:!0,tokenize:$};let o=0,c=0,f;return d;function d(T){return h(T)}function h(T){const P=r.events[r.events.length-1];return o=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,f=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(T)}function y(T){return T===f?(c++,e.consume(T),y):c<3?n(T):(e.exit("codeFencedFenceSequence"),Ge(T)?Je(e,g,"whitespace")(T):g(T))}function g(T){return T===null||Te(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(d0,w,L)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===null||Te(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(T)):Ge(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,x,"whitespace")(T)):T===96&&T===f?n(T):(e.consume(T),v)}function x(T){return T===null||Te(T)?g(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(T))}function S(T){return T===null||Te(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(T)):T===96&&T===f?n(T):(e.consume(T),S)}function w(T){return e.attempt(l,L,k)(T)}function k(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),_}function _(T){return o>0&&Ge(T)?Je(e,R,"linePrefix",o+1)(T):R(T)}function R(T){return T===null||Te(T)?e.check(d0,w,L)(T):(e.enter("codeFlowValue"),A(T))}function A(T){return T===null||Te(T)?(e.exit("codeFlowValue"),R(T)):(e.consume(T),A)}function L(T){return e.exit("codeFenced"),t(T)}function $(T,P,I){let W=0;return j;function j(Q){return T.enter("lineEnding"),T.consume(Q),T.exit("lineEnding"),G}function G(Q){return T.enter("codeFencedFence"),Ge(Q)?Je(T,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):J(Q)}function J(Q){return Q===f?(T.enter("codeFencedFenceSequence"),oe(Q)):I(Q)}function oe(Q){return Q===f?(W++,T.consume(Q),oe):W>=c?(T.exit("codeFencedFenceSequence"),Ge(Q)?Je(T,H,"whitespace")(Q):H(Q)):I(Q)}function H(Q){return Q===null||Te(Q)?(T.exit("codeFencedFence"),P(Q)):I(Q)}}}function LM(e,t,n){const r=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return r.parser.lazy[r.now().line]?n(c):t(c)}}const _p={name:"codeIndented",tokenize:IM},jM={partial:!0,tokenize:zM};function IM(e,t,n){const r=this;return l;function l(h){return e.enter("codeIndented"),Je(e,o,"linePrefix",5)(h)}function o(h){const y=r.events[r.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?d(h):Te(h)?e.attempt(jM,c,d)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Te(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function d(h){return e.exit("codeIndented"),t(h)}}function zM(e,t,n){const r=this;return l;function l(c){return r.parser.lazy[r.now().line]?n(c):Te(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):Je(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Te(c)?l(c):n(c)}}const BM={name:"codeText",previous:FM,resolve:UM,tokenize:PM};function UM(e){let t=e.length-4,n=3,r,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)l===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(l=r):(r===t||e[r][1].type==="lineEnding")&&(e[l][1].type="codeTextData",r!==l+2&&(e[l][1].end=e[r-1][1].end,e.splice(l+2,r-l-2),t-=r-l-2,r=l+2),l=void 0);return e}function FM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function PM(e,t,n){let r=0,l,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),r++,f):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):Te(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Te(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class $M{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return r&&Go(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Go(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Go(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Go(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Go(this.left,n.reverse())}}}function Go(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function NS(e){const t={};let n=-1,r,l,o,c,f,d,h;const y=new $M(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(r=y.get(n),n&&r[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,qM(y,n)),n=t[n],h=!0);else if(r[1]._container){for(o=n,l=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(r[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(r),y.splice(l,n-l+1,f))}}return ai(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function qM(e,t){const n=e.get(t)[1],r=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,d=[],h={};let y,g,v=-1,x=n,S=0,w=0;const k=[w];for(;x;){for(;e.get(++l)[1]!==x;);o.push(l),x._tokenizer||(y=r.sliceStream(x),x.next||y.push(null),g&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=n;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(w=v+1,k.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),v=k.length;v--;){const _=f.slice(k[v],k[v+1]),R=o.pop();d.push([R,R+_.length-1]),e.splice(R,2,_)}for(d.reverse(),v=-1;++v<d.length;)h[S+d[v][0]]=S+d[v][1],S+=d[v][1]-d[v][0]-1;return h}const HM={resolve:GM,tokenize:QM},KM={partial:!0,tokenize:YM};function GM(e){return NS(e),e}function QM(e,t){let n;return r;function r(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Te(f)?e.check(KM,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function YM(e,t,n){const r=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Je(e,o,"linePrefix")}function o(c){if(c===null||Te(c))return n(c);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(r.parser.constructs.flow,n,t)(c)}}function TS(e,t,n,r,l,o,c,f,d){const h=d||Number.POSITIVE_INFINITY;let y=0;return g;function g(_){return _===60?(e.enter(r),e.enter(l),e.enter(o),e.consume(_),e.exit(o),v):_===null||_===32||_===41||_f(_)?n(_):(e.enter(r),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),w(_))}function v(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(l),e.exit(r),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(_))}function x(_){return _===62?(e.exit("chunkString"),e.exit(f),v(_)):_===null||_===60||Te(_)?n(_):(e.consume(_),_===92?S:x)}function S(_){return _===60||_===62||_===92?(e.consume(_),x):x(_)}function w(_){return!y&&(_===null||_===41||xt(_))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(r),t(_)):y<h&&_===40?(e.consume(_),y++,w):_===41?(e.consume(_),y--,w):_===null||_===32||_===40||_f(_)?n(_):(e.consume(_),_===92?k:w)}function k(_){return _===40||_===41||_===92?(e.consume(_),w):w(_)}}function CS(e,t,n,r,l,o){const c=this;let f=0,d;return h;function h(x){return e.enter(r),e.enter(l),e.consume(x),e.exit(l),e.enter(o),y}function y(x){return f>999||x===null||x===91||x===93&&!d||x===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(x):x===93?(e.exit(o),e.enter(l),e.consume(x),e.exit(l),e.exit(r),t):Te(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||Te(x)||f++>999?(e.exit("chunkString"),y(x)):(e.consume(x),d||(d=!Ge(x)),x===92?v:g)}function v(x){return x===91||x===92||x===93?(e.consume(x),f++,g):g(x)}}function AS(e,t,n,r,l,o){let c;return f;function f(v){return v===34||v===39||v===40?(e.enter(r),e.enter(l),e.consume(v),e.exit(l),c=v===40?41:v,d):n(v)}function d(v){return v===c?(e.enter(l),e.consume(v),e.exit(l),e.exit(r),t):(e.enter(o),h(v))}function h(v){return v===c?(e.exit(o),d(c)):v===null?n(v):Te(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Je(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===c||v===null||Te(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?g:y)}function g(v){return v===c||v===92?(e.consume(v),y):y(v)}}function Jo(e,t){let n;return r;function r(l){return Te(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):Ge(l)?Je(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}const VM={name:"definition",tokenize:ZM},XM={partial:!0,tokenize:WM};function ZM(e,t,n){const r=this;let l;return o;function o(x){return e.enter("definition"),c(x)}function c(x){return CS.call(r,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return l=Mi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return xt(x)?Jo(e,h)(x):h(x)}function h(x){return TS(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return e.attempt(XM,g,g)(x)}function g(x){return Ge(x)?Je(e,v,"whitespace")(x):v(x)}function v(x){return x===null||Te(x)?(e.exit("definition"),r.parser.defined.push(l),t(x)):n(x)}}function WM(e,t,n){return r;function r(f){return xt(f)?Jo(e,l)(f):n(f)}function l(f){return AS(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Ge(f)?Je(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Te(f)?t(f):n(f)}}const JM={name:"hardBreakEscape",tokenize:eD};function eD(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Te(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const tD={name:"headingAtx",resolve:nD,tokenize:iD};function nD(e,t){let n=e.length-2,r=3,l,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(l={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ai(e,r,n-r+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function iD(e,t,n){let r=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&r++<6?(e.consume(y),c):y===null||xt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),d(y)):y===null||Te(y)?(e.exit("atxHeading"),t(y)):Ge(y)?Je(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function d(y){return y===35?(e.consume(y),d):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||xt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const aD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],p0=["pre","script","style","textarea"],rD={concrete:!0,name:"htmlFlow",resolveTo:oD,tokenize:cD},sD={partial:!0,tokenize:fD},lD={partial:!0,tokenize:uD};function oD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function cD(e,t,n){const r=this;let l,o,c,f,d;return h;function h(C){return y(C)}function y(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),g}function g(C){return C===33?(e.consume(C),v):C===47?(e.consume(C),o=!0,w):C===63?(e.consume(C),l=3,r.interrupt?t:O):Nn(C)?(e.consume(C),c=String.fromCharCode(C),k):n(C)}function v(C){return C===45?(e.consume(C),l=2,x):C===91?(e.consume(C),l=5,f=0,S):Nn(C)?(e.consume(C),l=4,r.interrupt?t:O):n(C)}function x(C){return C===45?(e.consume(C),r.interrupt?t:O):n(C)}function S(C){const he="CDATA[";return C===he.charCodeAt(f++)?(e.consume(C),f===he.length?r.interrupt?t:J:S):n(C)}function w(C){return Nn(C)?(e.consume(C),c=String.fromCharCode(C),k):n(C)}function k(C){if(C===null||C===47||C===62||xt(C)){const he=C===47,ke=c.toLowerCase();return!he&&!o&&p0.includes(ke)?(l=1,r.interrupt?t(C):J(C)):aD.includes(c.toLowerCase())?(l=6,he?(e.consume(C),_):r.interrupt?t(C):J(C)):(l=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?R(C):A(C))}return C===45||mn(C)?(e.consume(C),c+=String.fromCharCode(C),k):n(C)}function _(C){return C===62?(e.consume(C),r.interrupt?t:J):n(C)}function R(C){return Ge(C)?(e.consume(C),R):j(C)}function A(C){return C===47?(e.consume(C),j):C===58||C===95||Nn(C)?(e.consume(C),L):Ge(C)?(e.consume(C),A):j(C)}function L(C){return C===45||C===46||C===58||C===95||mn(C)?(e.consume(C),L):$(C)}function $(C){return C===61?(e.consume(C),T):Ge(C)?(e.consume(C),$):A(C)}function T(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),d=C,P):Ge(C)?(e.consume(C),T):I(C)}function P(C){return C===d?(e.consume(C),d=null,W):C===null||Te(C)?n(C):(e.consume(C),P)}function I(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?$(C):(e.consume(C),I)}function W(C){return C===47||C===62||Ge(C)?A(C):n(C)}function j(C){return C===62?(e.consume(C),G):n(C)}function G(C){return C===null||Te(C)?J(C):Ge(C)?(e.consume(C),G):n(C)}function J(C){return C===45&&l===2?(e.consume(C),K):C===60&&l===1?(e.consume(C),le):C===62&&l===4?(e.consume(C),D):C===63&&l===3?(e.consume(C),O):C===93&&l===5?(e.consume(C),me):Te(C)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(sD,te,oe)(C)):C===null||Te(C)?(e.exit("htmlFlowData"),oe(C)):(e.consume(C),J)}function oe(C){return e.check(lD,H,te)(C)}function H(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),Q}function Q(C){return C===null||Te(C)?oe(C):(e.enter("htmlFlowData"),J(C))}function K(C){return C===45?(e.consume(C),O):J(C)}function le(C){return C===47?(e.consume(C),c="",X):J(C)}function X(C){if(C===62){const he=c.toLowerCase();return p0.includes(he)?(e.consume(C),D):J(C)}return Nn(C)&&c.length<8?(e.consume(C),c+=String.fromCharCode(C),X):J(C)}function me(C){return C===93?(e.consume(C),O):J(C)}function O(C){return C===62?(e.consume(C),D):C===45&&l===2?(e.consume(C),O):J(C)}function D(C){return C===null||Te(C)?(e.exit("htmlFlowData"),te(C)):(e.consume(C),D)}function te(C){return e.exit("htmlFlow"),t(C)}}function uD(e,t,n){const r=this;return l;function l(c){return Te(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return r.parser.lazy[r.now().line]?n(c):t(c)}}function fD(e,t,n){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Sc,t,n)}}const dD={name:"htmlText",tokenize:hD};function hD(e,t,n){const r=this;let l,o,c;return f;function f(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),h):O===47?(e.consume(O),$):O===63?(e.consume(O),A):Nn(O)?(e.consume(O),I):n(O)}function h(O){return O===45?(e.consume(O),y):O===91?(e.consume(O),o=0,S):Nn(O)?(e.consume(O),R):n(O)}function y(O){return O===45?(e.consume(O),x):n(O)}function g(O){return O===null?n(O):O===45?(e.consume(O),v):Te(O)?(c=g,le(O)):(e.consume(O),g)}function v(O){return O===45?(e.consume(O),x):g(O)}function x(O){return O===62?K(O):O===45?v(O):g(O)}function S(O){const D="CDATA[";return O===D.charCodeAt(o++)?(e.consume(O),o===D.length?w:S):n(O)}function w(O){return O===null?n(O):O===93?(e.consume(O),k):Te(O)?(c=w,le(O)):(e.consume(O),w)}function k(O){return O===93?(e.consume(O),_):w(O)}function _(O){return O===62?K(O):O===93?(e.consume(O),_):w(O)}function R(O){return O===null||O===62?K(O):Te(O)?(c=R,le(O)):(e.consume(O),R)}function A(O){return O===null?n(O):O===63?(e.consume(O),L):Te(O)?(c=A,le(O)):(e.consume(O),A)}function L(O){return O===62?K(O):A(O)}function $(O){return Nn(O)?(e.consume(O),T):n(O)}function T(O){return O===45||mn(O)?(e.consume(O),T):P(O)}function P(O){return Te(O)?(c=P,le(O)):Ge(O)?(e.consume(O),P):K(O)}function I(O){return O===45||mn(O)?(e.consume(O),I):O===47||O===62||xt(O)?W(O):n(O)}function W(O){return O===47?(e.consume(O),K):O===58||O===95||Nn(O)?(e.consume(O),j):Te(O)?(c=W,le(O)):Ge(O)?(e.consume(O),W):K(O)}function j(O){return O===45||O===46||O===58||O===95||mn(O)?(e.consume(O),j):G(O)}function G(O){return O===61?(e.consume(O),J):Te(O)?(c=G,le(O)):Ge(O)?(e.consume(O),G):W(O)}function J(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,oe):Te(O)?(c=J,le(O)):Ge(O)?(e.consume(O),J):(e.consume(O),H)}function oe(O){return O===l?(e.consume(O),l=void 0,Q):O===null?n(O):Te(O)?(c=oe,le(O)):(e.consume(O),oe)}function H(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||xt(O)?W(O):(e.consume(O),H)}function Q(O){return O===47||O===62||xt(O)?W(O):n(O)}function K(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function le(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),X}function X(O){return Ge(O)?Je(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):me(O)}function me(O){return e.enter("htmlTextData"),c(O)}}const gg={name:"labelEnd",resolveAll:bD,resolveTo:yD,tokenize:xD},pD={tokenize:vD},mD={tokenize:ED},gD={tokenize:SD};function bD(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const l=r.type==="labelImage"?4:2;r.type="data",t+=l}}return e.length!==n.length&&ai(e,0,e.length,n),e}function yD(e,t){let n=e.length,r=0,l,o,c,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){r=2;break}}else l.type==="labelEnd"&&(c=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",d,t],["enter",h,t]],f=xi(f,e.slice(o+1,o+r+3)),f=xi(f,[["enter",y,t]]),f=xi(f,Xf(t.parser.constructs.insideSpan.null,e.slice(o+r+4,c-3),t)),f=xi(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=xi(f,e.slice(c+1)),f=xi(f,[["exit",d,t]]),ai(e,o,e.length,f),e}function xD(e,t,n){const r=this;let l=r.events.length,o,c;for(;l--;)if((r.events[l][1].type==="labelImage"||r.events[l][1].type==="labelLink")&&!r.events[l][1]._balanced){o=r.events[l][1];break}return f;function f(v){return o?o._inactive?g(v):(c=r.parser.defined.includes(Mi(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),d):n(v)}function d(v){return v===40?e.attempt(pD,y,c?y:g)(v):v===91?e.attempt(mD,y,c?h:g)(v):c?y(v):g(v)}function h(v){return e.attempt(gD,y,g)(v)}function y(v){return t(v)}function g(v){return o._balanced=!0,n(v)}}function vD(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return xt(g)?Jo(e,o)(g):o(g)}function o(g){return g===41?y(g):TS(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return xt(g)?Jo(e,d)(g):y(g)}function f(g){return n(g)}function d(g){return g===34||g===39||g===40?AS(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return xt(g)?Jo(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function ED(e,t,n){const r=this;return l;function l(f){return CS.call(r,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return r.parser.defined.includes(Mi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function SD(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const wD={name:"labelStartImage",resolveAll:gg.resolveAll,tokenize:_D};function _D(e,t,n){const r=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(f):t(f)}}const kD={name:"labelStartLink",resolveAll:gg.resolveAll,tokenize:ND};function ND(e,t,n){const r=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const kp={name:"lineEnding",tokenize:TD};function TD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Je(e,t,"linePrefix")}}const hf={name:"thematicBreak",tokenize:CD};function CD(e,t,n){let r=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Te(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===l?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),Ge(h)?Je(e,f,"whitespace")(h):f(h))}}const zn={continuation:{tokenize:MD},exit:LD,name:"list",tokenize:RD},AD={partial:!0,tokenize:jD},OD={partial:!0,tokenize:DD};function RD(e,t,n){const r=this,l=r.events[r.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(x){const S=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:mm(x)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(hf,n,h)(x):h(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return mm(x)&&++c<10?(e.consume(x),d):(!r.interrupt||c<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(Sc,r.interrupt?n:y,e.attempt(AD,v,g))}function y(x){return r.containerState.initialBlankLine=!0,o++,v(x)}function g(x){return Ge(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),v):n(x)}function v(x){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function MD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Sc,l,o);function l(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Je(e,t,"listItemIndent",r.containerState.size+1)(f)}function o(f){return r.containerState.furtherBlankLines||!Ge(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(OD,t,c)(f))}function c(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,Je(e,e.attempt(zn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function DD(e,t,n){const r=this;return Je(e,l,"listItemIndent",r.containerState.size+1);function l(o){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?t(o):n(o)}}function LD(e){e.exit(this.containerState.type)}function jD(e,t,n){const r=this;return Je(e,l,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=r.events[r.events.length-1];return!Ge(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const m0={name:"setextUnderline",resolveTo:ID,tokenize:zD};function ID(e,t){let n=e.length,r,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=c,e.push(["exit",c,t]),e}function zD(e,t,n){const r=this;let l;return o;function o(h){let y=r.events.length,g;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){g=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),l=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Ge(h)?Je(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Te(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const BD={tokenize:UD};function UD(e){const t=this,n=e.attempt(Sc,r,e.attempt(this.parser.constructs.flowInitial,l,Je(e,e.attempt(this.parser.constructs.flow,l,e.attempt(HM,l)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const FD={resolveAll:RS()},PD=OS("string"),$D=OS("text");function OS(e){return{resolveAll:RS(e==="text"?qD:void 0),tokenize:t};function t(n){const r=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),d}function d(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),d)}function h(y){if(y===null)return!0;const g=l[y];let v=-1;if(g)for(;++v<g.length;){const x=g[v];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function RS(e){return t;function t(n,r){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,r):n}}function qD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],l=t.sliceStream(r);let o=l.length,c=-1,f=0,d;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)d=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:r.start._bufferIndex+c,_index:r.start._index+o,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const HD={42:zn,43:zn,45:zn,48:zn,49:zn,50:zn,51:zn,52:zn,53:zn,54:zn,55:zn,56:zn,57:zn,62:wS},KD={91:VM},GD={[-2]:_p,[-1]:_p,32:_p},QD={35:tD,42:hf,45:[m0,hf],60:rD,61:m0,95:hf,96:h0,126:h0},YD={38:kS,92:_S},VD={[-5]:kp,[-4]:kp,[-3]:kp,33:wD,38:kS,42:gm,60:[kM,dD],91:kD,92:[JM,_S],93:gg,95:gm,96:BM},XD={null:[gm,FD]},ZD={null:[42,95]},WD={null:[]},JD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZD,contentInitial:KD,disable:WD,document:HD,flow:QD,flowInitial:GD,insideSpan:XD,string:YD,text:VD},Symbol.toStringTag,{value:"Module"}));function eL(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],f=[];const d={attempt:P($),check:P(T),consume:R,enter:A,exit:L,interrupt:P(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:x,write:g};let y=t.tokenize.call(h,d);return t.resolveAll&&o.push(t),h;function g(G){return c=xi(c,G),k(),c[c.length-1]!==null?[]:(I(t,0),h.events=Xf(o,h.events,h),h.events)}function v(G,J){return nL(x(G),J)}function x(G){return tL(c,G)}function S(){const{_bufferIndex:G,_index:J,line:oe,column:H,offset:Q}=r;return{_bufferIndex:G,_index:J,line:oe,column:H,offset:Q}}function w(G){l[G.line]=G.column,j()}function k(){let G;for(;r._index<c.length;){const J=c[r._index];if(typeof J=="string")for(G=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<J.length;)_(J.charCodeAt(r._bufferIndex));else _(J)}}function _(G){y=y(G)}function R(G){Te(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,j()):G!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=G}function A(G,J){const oe=J||{};return oe.type=G,oe.start=S(),h.events.push(["enter",oe,h]),f.push(oe),oe}function L(G){const J=f.pop();return J.end=S(),h.events.push(["exit",J,h]),J}function $(G,J){I(G,J.from)}function T(G,J){J.restore()}function P(G,J){return oe;function oe(H,Q,K){let le,X,me,O;return Array.isArray(H)?te(H):"tokenize"in H?te([H]):D(H);function D(ve){return Pe;function Pe(st){const it=st!==null&&ve[st],Zt=st!==null&&ve.null,Hn=[...Array.isArray(it)?it:it?[it]:[],...Array.isArray(Zt)?Zt:Zt?[Zt]:[]];return te(Hn)(st)}}function te(ve){return le=ve,X=0,ve.length===0?K:C(ve[X])}function C(ve){return Pe;function Pe(st){return O=W(),me=ve,ve.partial||(h.currentConstruct=ve),ve.name&&h.parser.constructs.disable.null.includes(ve.name)?ke():ve.tokenize.call(J?Object.assign(Object.create(h),J):h,d,he,ke)(st)}}function he(ve){return G(me,O),Q}function ke(ve){return O.restore(),++X<le.length?C(le[X]):K}}}function I(G,J){G.resolveAll&&!o.includes(G)&&o.push(G),G.resolve&&ai(h.events,J,h.events.length-J,G.resolve(h.events.slice(J),h)),G.resolveTo&&(h.events=G.resolveTo(h.events,h))}function W(){const G=S(),J=h.previous,oe=h.currentConstruct,H=h.events.length,Q=Array.from(f);return{from:H,restore:K};function K(){r=G,h.previous=J,h.currentConstruct=oe,h.events.length=H,f=Q,j()}}function j(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}function tL(e,t){const n=t.start._index,r=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(r,o)];else{if(c=e.slice(n,l),r>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(r):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function nL(e,t){let n=-1;const r=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
@@ -7,8 +7,8 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
10
- <script type="module" crossorigin src="/assets/index-Ct85CE4h.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-DzQeUId_.css">
10
+ <script type="module" crossorigin src="/assets/index-e8k3Ad3j.js"></script>
11
+ <link rel="stylesheet" crossorigin href="/assets/index-CTjgcd4h.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
@@ -1,7 +1,17 @@
1
1
  /**
2
2
  * @module console-server/watchers/cardWatcher
3
3
  * @description chokidar 监听 cards 目录变化,推 card.created/updated/deleted 事件
4
+ *
5
+ * v0.49.8:chokidar v4+ 删除了 glob 支持(官方 breaking change)。
6
+ * 所以 v0.44.0 写的 `projects/.../cards/*.md` glob 一直不工作,
7
+ * SSE 实时更新从上线就是假的。改为 watch 项目根目录递归 + 事件过滤。
4
8
  */
5
9
  import { type FSWatcher } from 'chokidar';
10
+ /**
11
+ * Chokidar v4+ 没 glob 了,只能 watch 绝对路径(文件或目录)。
12
+ * 策略:watch `${coralRoot}/projects` 根,让 chokidar 递归监听所有子目录。
13
+ * 进 event handler 后用 extractProjectAndSeq 正则挑出卡片 md 文件。
14
+ * 其它 md 文件(conf、pipeline.yaml 等不是 md、自动过滤掉)。
15
+ */
6
16
  export declare function startCardWatcher(coralRoot: string): FSWatcher;
7
17
  //# sourceMappingURL=cardWatcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cardWatcher.d.ts","sourceRoot":"","sources":["../../../src/console-server/watchers/cardWatcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AA+BpD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAY7D"}
1
+ {"version":3,"file":"cardWatcher.d.ts","sourceRoot":"","sources":["../../../src/console-server/watchers/cardWatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAgCpD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAsB7D"}
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * @module console-server/watchers/cardWatcher
3
3
  * @description chokidar 监听 cards 目录变化,推 card.created/updated/deleted 事件
4
+ *
5
+ * v0.49.8:chokidar v4+ 删除了 glob 支持(官方 breaking change)。
6
+ * 所以 v0.44.0 写的 `projects/.../cards/*.md` glob 一直不工作,
7
+ * SSE 实时更新从上线就是假的。改为 watch 项目根目录递归 + 事件过滤。
4
8
  */
5
9
  import chokidar from 'chokidar';
6
10
  import { resolve } from 'node:path';
@@ -8,7 +12,8 @@ import { readCard } from '../lib/cardReader.js';
8
12
  import { eventBus } from '../sse/eventBus.js';
9
13
  const HOME = process.env.HOME || '/home/coral';
10
14
  function extractProjectAndSeq(path) {
11
- const match = path.match(/projects\/([^/]+)\/cards\/(\d+)(?:-[^/]*)?\.md$/);
15
+ // 允许可选的 state 子目录层级(cards/<state>/N-title.md)+ 兼容顶层 cards/N.md
16
+ const match = path.match(/projects\/([^/]+)\/cards\/(?:[^/]+\/)?(\d+)(?:-[^/]*)?\.md$/);
12
17
  if (!match)
13
18
  return null;
14
19
  const seq = Number.parseInt(match[2] ?? '', 10);
@@ -32,17 +37,32 @@ function publishCardEvent(event, path) {
32
37
  card: card ?? null,
33
38
  });
34
39
  }
40
+ /**
41
+ * Chokidar v4+ 没 glob 了,只能 watch 绝对路径(文件或目录)。
42
+ * 策略:watch `${coralRoot}/projects` 根,让 chokidar 递归监听所有子目录。
43
+ * 进 event handler 后用 extractProjectAndSeq 正则挑出卡片 md 文件。
44
+ * 其它 md 文件(conf、pipeline.yaml 等不是 md、自动过滤掉)。
45
+ */
35
46
  export function startCardWatcher(coralRoot) {
36
- const pattern = `${coralRoot}/projects/*/cards/*.md`;
37
- const watcher = chokidar.watch(pattern, {
47
+ const root = resolve(coralRoot, 'projects');
48
+ const watcher = chokidar.watch(root, {
38
49
  persistent: true,
39
50
  ignoreInitial: true,
40
51
  awaitWriteFinish: { stabilityThreshold: 100, pollInterval: 50 },
52
+ // Depth 4 够:projects/<name>/cards/<state>/<file>.md
53
+ depth: 4,
54
+ // 忽略 node_modules / .git / 隐藏文件
55
+ ignored: (path) => /\/(node_modules|\.git|\.DS_Store)(\/|$)/.test(path),
41
56
  });
57
+ const handle = (event, path) => {
58
+ if (!path.endsWith('.md'))
59
+ return;
60
+ publishCardEvent(event, path);
61
+ };
42
62
  watcher
43
- .on('add', (path) => publishCardEvent('card.created', path))
44
- .on('change', (path) => publishCardEvent('card.updated', path))
45
- .on('unlink', (path) => publishCardEvent('card.deleted', path));
63
+ .on('add', (path) => handle('card.created', path))
64
+ .on('change', (path) => handle('card.updated', path))
65
+ .on('unlink', (path) => handle('card.deleted', path));
46
66
  return watcher;
47
67
  }
48
68
  //# sourceMappingURL=cardWatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cardWatcher.js","sourceRoot":"","sources":["../../../src/console-server/watchers/cardWatcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,QAA4B,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,aAAa,CAAC;AAE/C,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC5E,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa,EAAE,IAAY;IACnD,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,IAAI,KAAK,KAAK,cAAc,EAAE,CAAC;QAC7B,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE;QACtB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,IAAI,EAAE,IAAI,IAAI,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,MAAM,OAAO,GAAG,GAAG,SAAS,wBAAwB,CAAC;IACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE;QACtC,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,EAAE,kBAAkB,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE;KAChE,CAAC,CAAC;IACH,OAAO;SACJ,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SAC3D,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SAC9D,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC;IAClE,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"cardWatcher.js","sourceRoot":"","sources":["../../../src/console-server/watchers/cardWatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,QAA4B,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,aAAa,CAAC;AAE/C,SAAS,oBAAoB,CAAC,IAAY;IACxC,+DAA+D;IAC/D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACxF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa,EAAE,IAAY;IACnD,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrE,IAAI,KAAK,KAAK,cAAc,EAAE,CAAC;QAC7B,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE;QACtB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,IAAI,EAAE,IAAI,IAAI,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;QACnC,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,EAAE,kBAAkB,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/D,oDAAoD;QACpD,KAAK,EAAE,CAAC;QACR,gCAAgC;QAChC,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,yCAAyC,CAAC,IAAI,CAAC,IAAI,CAAC;KAChF,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,IAAY,EAAQ,EAAE;QACnD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO;QAClC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,OAAO;SACJ,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SACjD,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SACpD,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC;IACxD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"markerWatcher.d.ts","sourceRoot":"","sources":["../../../src/console-server/watchers/markerWatcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAkCpD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAY/D"}
1
+ {"version":3,"file":"markerWatcher.d.ts","sourceRoot":"","sources":["../../../src/console-server/watchers/markerWatcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAkCpD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAqB/D"}
@@ -38,16 +38,24 @@ function publishMarker(event, path) {
38
38
  });
39
39
  }
40
40
  export function startMarkerWatcher(coralRoot) {
41
- const pattern = `${coralRoot}/projects/*/runtime/worker-*-current.json`;
42
- const watcher = chokidar.watch(pattern, {
41
+ // v0.49.8:chokidar v4+ 没 glob,改 watch 根目录 + 事件过滤(同 cardWatcher)
42
+ const root = `${coralRoot}/projects`;
43
+ const watcher = chokidar.watch(root, {
43
44
  persistent: true,
44
45
  ignoreInitial: true,
45
46
  awaitWriteFinish: { stabilityThreshold: 80, pollInterval: 40 },
47
+ depth: 3, // projects/<name>/runtime/worker-N-current.json
48
+ ignored: (path) => /\/(node_modules|\.git|\.DS_Store)(\/|$)/.test(path),
46
49
  });
50
+ const handle = (event, path) => {
51
+ if (!/worker-\d+-current\.json$/.test(path))
52
+ return;
53
+ publishMarker(event, path);
54
+ };
47
55
  watcher
48
- .on('add', (path) => publishMarker('worker.added', path))
49
- .on('change', (path) => publishMarker('worker.updated', path))
50
- .on('unlink', (path) => publishMarker('worker.deleted', path));
56
+ .on('add', (path) => handle('worker.added', path))
57
+ .on('change', (path) => handle('worker.updated', path))
58
+ .on('unlink', (path) => handle('worker.deleted', path));
51
59
  return watcher;
52
60
  }
53
61
  //# sourceMappingURL=markerWatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"markerWatcher.js","sourceRoot":"","sources":["../../../src/console-server/watchers/markerWatcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,QAA4B,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,SAAS,qBAAqB,CAAC,IAAY;IACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAChF,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC;AAED,SAAS,aAAa,CAAC,KAAa,EAAE,IAAY;IAChD,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,IAAI,MAAM,GAAY,IAAI,CAAC;IAC3B,IAAI,KAAK,KAAK,gBAAgB,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,WAAW;YACX,OAAO;QACT,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM;QACN,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE,KAAK,KAAK,gBAAgB;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,MAAM,OAAO,GAAG,GAAG,SAAS,2CAA2C,CAAC;IACxE,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE;QACtC,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;KAC/D,CAAC,CAAC;IACH,OAAO;SACJ,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SACxD,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;SAC7D,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC;IACjE,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"markerWatcher.js","sourceRoot":"","sources":["../../../src/console-server/watchers/markerWatcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,QAA4B,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,SAAS,qBAAqB,CAAC,IAAY;IACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAChF,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC;AAED,SAAS,aAAa,CAAC,KAAa,EAAE,IAAY;IAChD,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,IAAI,MAAM,GAAY,IAAI,CAAC;IAC3B,IAAI,KAAK,KAAK,gBAAgB,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,WAAW;YACX,OAAO;QACT,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM;QACN,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE,KAAK,KAAK,gBAAgB;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,gEAAgE;IAChE,MAAM,IAAI,GAAG,GAAG,SAAS,WAAW,CAAC;IACrC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;QACnC,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;QAC9D,KAAK,EAAE,CAAC,EAAE,gDAAgD;QAC1D,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,yCAAyC,CAAC,IAAI,CAAC,IAAI,CAAC;KAChF,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,IAAY,EAAQ,EAAE;QACnD,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO;QACpD,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO;SACJ,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;SACjD,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;SACtD,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC;IAC1D,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralai/sps-cli",
3
- "version": "0.49.7",
3
+ "version": "0.49.8",
4
4
  "description": "SPS CLI — AI-driven development pipeline orchestrator",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",