@thxgg/steward 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{C_NevjZD.js → BSA0RJ-H.js} +1 -1
- package/.output/public/_nuxt/{BubpH_wW.js → BWVTacYj.js} +1 -1
- package/.output/public/_nuxt/{CMu9GKTH.js → Bibm_IDv.js} +2 -2
- package/.output/public/_nuxt/{wbj-mIhK.js → CVJh28bx.js} +1 -1
- package/.output/public/_nuxt/{BDqHART1.js → CxHOXVf6.js} +1 -1
- package/.output/public/_nuxt/CyZuidLG.js +60 -0
- package/.output/public/_nuxt/{qt5OEWHC.js → D0op9E2g.js} +1 -1
- package/.output/public/_nuxt/{CVvrkZkq.js → DX8awZaa.js} +1 -1
- package/.output/public/_nuxt/Detail.z33AHKev.css +1 -0
- package/.output/public/_nuxt/{C2HGkiSP.js → DiTJUZOC.js} +1 -1
- package/.output/public/_nuxt/{nYTZJhvT.js → Dum5qplW.js} +1 -1
- package/.output/public/_nuxt/{BPeTf9dd.js → T_3JE9C-.js} +1 -1
- package/.output/public/_nuxt/WOI2tLsR.js +42 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/029070b0-b8e2-4988-84f4-d0c9ff55c998.json +1 -0
- package/.output/public/_nuxt/{B-5VWizU.js → odRGDGwj.js} +1 -1
- package/.output/public/_nuxt/{qKRNa41x.js → wbjFvimm.js} +1 -1
- package/.output/public/_nuxt/{uTyw4SRK.js → ynmyrfyT.js} +1 -1
- package/.output/server/chunks/build/{Detail-DC-KJQ1f.mjs → Detail-CUfU85GY.mjs} +26 -26
- package/.output/server/chunks/build/Detail-CUfU85GY.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs +4 -0
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs +10 -0
- package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs.map +1 -0
- package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs +8 -0
- package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs.map +1 -0
- package/.output/server/chunks/build/{_prd_-C1C4GAhW.mjs → _prd_-CeVnQzOV.mjs} +3 -3
- package/.output/server/chunks/build/_prd_-CeVnQzOV.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{repo-graph-CTEkxiYd.mjs → repo-graph-CHNl58mY.mjs} +3 -3
- package/.output/server/chunks/build/repo-graph-CHNl58mY.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +2 -2
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/nitro/nitro.mjs +598 -598
- package/.output/server/package.json +1 -1
- package/README.md +10 -1
- package/dist/host/src/mcp.js +2 -0
- package/dist/host/src/prompts.js +127 -0
- package/docs/MCP.md +13 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/-k8zG74W.js +0 -61
- package/.output/public/_nuxt/BMAq0QVD.js +0 -42
- package/.output/public/_nuxt/Detail.CzXXlavD.css +0 -1
- package/.output/public/_nuxt/builds/meta/b57a8fc3-6a38-4f58-b2ae-54768412ea40.json +0 -1
- package/.output/server/chunks/build/Detail-DC-KJQ1f.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs +0 -4
- package/.output/server/chunks/build/DiffViewer-styles-1.mjs-D0sb4vsK.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs +0 -10
- package/.output/server/chunks/build/DiffViewer-styles.CkSjCQ0r.mjs.map +0 -1
- package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs +0 -8
- package/.output/server/chunks/build/DiffViewer-styles.FJJuYjYB.mjs.map +0 -1
- package/.output/server/chunks/build/_prd_-C1C4GAhW.mjs.map +0 -1
- package/.output/server/chunks/build/repo-graph-CTEkxiYd.mjs.map +0 -1
- package/.output/server/node_modules/shiki/dist/bundle-web.mjs +0 -366
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as O,j as A,e as q,z as j,an as T,ao as E,D as N,ap as U,a0 as L,a7 as P,aq as I,C as H,q as D,ar as _,as as z,at as F,s as y,au as V,av as M,aw as B,ax as W,ay as $,az as G,aA as Q}from"./
|
|
1
|
+
import{g as O,j as A,e as q,z as j,an as T,ao as E,D as N,ap as U,a0 as L,a7 as P,aq as I,C as H,q as D,ar as _,as as z,at as F,s as y,au as V,av as M,aw as B,ax as W,ay as $,az as G,aA as Q}from"./Bibm_IDv.js";const J=(...t)=>t.find(o=>o!==void 0);function K(t){const o=t.componentName||"NuxtLink";function f(e){return typeof e=="string"&&e.startsWith("#")}function R(e,l,v){const a=v??t.trailingSlash;if(!e||a!=="append"&&a!=="remove")return e;if(typeof e=="string")return S(e,a);const u="path"in e&&e.path!==void 0?e.path:l(e).path;return{...e,name:void 0,path:S(u,a)}}function k(e){const l=A(),v=Q(),a=y(()=>!!e.target&&e.target!=="_self"),u=y(()=>{const i=e.to||e.href||"";return typeof i=="string"&&B(i,{acceptRelative:!0})}),b=P("RouterLink"),h=b&&typeof b!="string"?b.useLink:void 0,c=y(()=>{if(e.external)return!0;const i=e.to||e.href||"";return typeof i=="object"?!1:i===""||u.value}),n=y(()=>{const i=e.to||e.href||"";return c.value?i:R(i,l.resolve,e.trailingSlash)}),g=c.value?void 0:h?.({...e,to:n}),m=y(()=>{const i=e.trailingSlash??t.trailingSlash;if(!n.value||u.value||f(n.value))return n.value;if(c.value){const x=typeof n.value=="object"&&"path"in n.value?_(n.value):n.value,C=typeof x=="object"?l.resolve(x).href:x;return S(C,i)}return typeof n.value=="object"?l.resolve(n.value)?.href??null:S(W(v.app.baseURL,n.value),i)});return{to:n,hasTarget:a,isAbsoluteUrl:u,isExternal:c,href:m,isActive:g?.isActive??y(()=>n.value===l.currentRoute.value.path),isExactActive:g?.isExactActive??y(()=>n.value===l.currentRoute.value.path),route:g?.route??y(()=>l.resolve(n.value)),async navigate(i){await F(m.value,{replace:e.replace,external:c.value||a.value})}}}return O({name:o,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:k,setup(e,{slots:l}){const v=A(),{to:a,href:u,navigate:b,isExternal:h,hasTarget:c,isAbsoluteUrl:n}=k(e),g=H(!1),m=D(null),i=s=>{m.value=e.custom?s?.$el?.nextElementSibling:s?.$el};function x(s){return!g.value&&(typeof e.prefetchOn=="string"?e.prefetchOn===s:e.prefetchOn?.[s]??t.prefetchOn?.[s])&&(e.prefetch??t.prefetch)!==!1&&e.noPrefetch!==!0&&e.target!=="_blank"&&!Z()}async function C(s=q()){if(g.value)return;g.value=!0;const d=typeof a.value=="string"?a.value:h.value?_(a.value):v.resolve(a.value).fullPath,r=h.value?new URL(d,window.location.href).href:d;await Promise.all([s.hooks.callHook("link:prefetch",r).catch(()=>{}),!h.value&&!c.value&&z(a.value,v).catch(()=>{})])}if(x("visibility")){const s=q();let d,r=null;j(()=>{const p=X();T(()=>{d=E(()=>{m?.value?.tagName&&(r=p.observe(m.value,async()=>{r?.(),r=null,await C(s)}))})})}),N(()=>{d&&U(d),r?.(),r=null})}return()=>{if(!h.value&&!c.value&&!f(a.value)){const r={ref:i,to:a.value,activeClass:e.activeClass||t.activeClass,exactActiveClass:e.exactActiveClass||t.exactActiveClass,replace:e.replace,ariaCurrentValue:e.ariaCurrentValue,custom:e.custom};return e.custom||(x("interaction")&&(r.onPointerenter=C.bind(null,void 0),r.onFocus=C.bind(null,void 0)),g.value&&(r.class=e.prefetchedClass||t.prefetchedClass),r.rel=e.rel||void 0),L(P("RouterLink"),r,l.default)}const s=e.target||null,d=J(e.noRel?"":e.rel,t.externalRelAttribute,n.value||c.value?"noopener noreferrer":"")||null;return e.custom?l.default?l.default({href:u.value,navigate:b,prefetch:C,get route(){if(!u.value)return;const r=new URL(u.value,window.location.href);return{path:r.pathname,fullPath:r.pathname,get query(){return I(r.search)},hash:r.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:u.value}},rel:d,target:s,isExternal:h.value||c.value,isActive:!1,isExactActive:!1}):null:L("a",{ref:m,href:u.value||null,rel:d,target:s,onClick:async r=>{if(!(h.value||c.value)){r.preventDefault();try{const p=V(u.value);return await(e.replace?v.replace(p):v.push(p))}finally{if(f(a.value)){const p=a.value.slice(1);let w=p;try{w=decodeURIComponent(p)}catch{}document.getElementById(w)?.focus()}}}}},l.default?.())}}})}const ae=K(M);function S(t,o){const f=o==="append"?$:G;return B(t)&&!t.startsWith("http")?t:f(t,!0)}function X(){const t=q();if(t._observer)return t._observer;let o=null;const f=new Map,R=(e,l)=>(o||=new IntersectionObserver(v=>{for(const a of v){const u=f.get(a.target);(a.isIntersecting||a.intersectionRatio>0)&&u&&u()}}),f.set(e,l),o.observe(e),()=>{f.delete(e),o?.unobserve(e),f.size===0&&(o?.disconnect(),o=null)});return t._observer={observe:R}}const Y=/2g/;function Z(){const t=navigator.connection;return!!(t&&(t.saveData||Y.test(t.effectiveType)))}export{ae as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,e as s,h as u,i as r,f as h}from"./
|
|
1
|
+
import{u as a,e as s,h as u,i as r,f as h}from"./Bibm_IDv.js";function i(t){const e=t||s();return e.ssrContext?.head||e.runWithContext(()=>{if(u()){const n=r(h);if(!n)throw new Error("[nuxt] [unhead] Missing Unhead instance.");return n}})}function d(t,e={}){const n=e.head||i(e.nuxt);return a(t,{head:n,...e})}export{d as u};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import{_ as Ns}from"./CVJh28bx.js";import{u as Jn,c as es,a as ts,b as Rt,P as zs,B as ns,C as ss,d as Bs,e as Fs,L as Us,R as qs,G as Hs}from"./BSA0RJ-H.js";import{c as ct,d as as,P as Ve,e as fe,r as Ct,u as Gs,a as js,b as Vs,B as Dn,F as Ws}from"./D0op9E2g.js";import{C as Ys,E as Pn,c as Zs,M as On,a as $n,b as Ks,_ as Qs,d as Xs}from"./WOI2tLsR.js";import{g as B,v as sn,o as T,x as se,w as C,b as S,l as c,y as Z,q as U,z as vt,A as rs,s as M,B as Js,C as ea,D as ta,E as na,n as Te,G as sa,p as aa,c as L,a as $,t as te,d as Ce,k as De,H as de,I as ls,F as is,r as os,J as ra,K as la,L as It,M as ia,j as oa,m as Mn,i as ca}from"./Bibm_IDv.js";import{u as cs,f as us,E as ua,a as pa,g as da,w as fa,A as Nn}from"./DiTJUZOC.js";import{_ as ha}from"./DlAUqK2U.js";import"./Dum5qplW.js";const ga=ct("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const ma=ct("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);const ka=ct("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const zn=ct("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);const ba=ct("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),[_a,xa]=es("RovingFocusGroup");var ya=B({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(s,{expose:e,emit:t}){const a=s,n=t,{loop:i,orientation:l,dir:u}=sn(a),o=Jn(u),d=as(a,"currentTabStopId",n,{defaultValue:a.defaultCurrentTabStopId,passive:a.currentTabStopId===void 0}),p=U(!1),f=U(!1),k=U(0),{getItems:b,CollectionSlot:y}=cs({isProvider:!0});function D(P){const O=!f.value;if(P.currentTarget&&P.target===P.currentTarget&&O&&!p.value){const I=new CustomEvent(ua,pa);if(P.currentTarget.dispatchEvent(I),n("entryFocus",I),!I.defaultPrevented){const E=b().map(G=>G.ref).filter(G=>G.dataset.disabled!==""),X=E.find(G=>G.getAttribute("data-active")===""),K=E.find(G=>G.getAttribute("data-highlighted")===""),he=E.find(G=>G.id===d.value),ge=[X,K,he,...E].filter(Boolean);us(ge,a.preventScrollOnEntryFocus)}}f.value=!1}function oe(){setTimeout(()=>{f.value=!1},1)}return e({getItems:b}),xa({loop:i,dir:o,orientation:l,currentTabStopId:d,onItemFocus:P=>{d.value=P},onItemShiftTab:()=>{p.value=!0},onFocusableItemAdd:()=>{k.value++},onFocusableItemRemove:()=>{k.value--}}),(P,O)=>(T(),se(c(y),null,{default:C(()=>[S(c(Ve),{tabindex:p.value||k.value===0?-1:0,"data-orientation":c(l),as:P.as,"as-child":P.asChild,dir:c(o),style:{outline:"none"},onMousedown:O[0]||(O[0]=I=>f.value=!0),onMouseup:oe,onFocus:D,onBlur:O[1]||(O[1]=I=>p.value=!1)},{default:C(()=>[Z(P.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),Ta=ya,wa=B({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(s){const e=s,t=_a(),a=ts(),n=M(()=>e.tabStopId||a),i=M(()=>t.currentTabStopId.value===n.value),{getItems:l,CollectionItem:u}=cs();vt(()=>{e.focusable&&t.onFocusableItemAdd()}),rs(()=>{e.focusable&&t.onFocusableItemRemove()});function o(d){if(d.key==="Tab"&&d.shiftKey){t.onItemShiftTab();return}if(d.target!==d.currentTarget)return;const p=da(d,t.orientation.value,t.dir.value);if(p!==void 0){if(d.metaKey||d.ctrlKey||d.altKey||!e.allowShiftKey&&d.shiftKey)return;d.preventDefault();let f=[...l().map(k=>k.ref).filter(k=>k.dataset.disabled!=="")];if(p==="last")f.reverse();else if(p==="prev"||p==="next"){p==="prev"&&f.reverse();const k=f.indexOf(d.currentTarget);f=t.loop.value?fa(f,k+1):f.slice(k+1)}Js(()=>us(f))}}return(d,p)=>(T(),se(c(u),null,{default:C(()=>[S(c(Ve),{tabindex:i.value?0:-1,"data-orientation":c(t).orientation.value,"data-active":d.active?"":void 0,"data-disabled":d.focusable?void 0:"",as:d.as,"as-child":d.asChild,onMousedown:p[0]||(p[0]=f=>{d.focusable?c(t).onItemFocus(n.value):f.preventDefault()}),onFocus:p[1]||(p[1]=f=>c(t).onItemFocus(n.value)),onKeydown:o},{default:C(()=>[Z(d.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),va=wa;const[an,Sa]=es("TabsRoot");var Aa=B({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,a=e,{orientation:n,unmountOnHide:i,dir:l}=sn(t),u=Jn(l);Rt();const o=as(t,"modelValue",a,{defaultValue:t.defaultValue,passive:t.modelValue===void 0}),d=U(),p=ea(new Set);return Sa({modelValue:o,changeModelValue:f=>{o.value=f},orientation:n,dir:u,unmountOnHide:i,activationMode:t.activationMode,baseId:ts(void 0,"reka-tabs"),tabsList:d,contentIds:p,registerContent:f=>{p.value=new Set([...p.value,f])},unregisterContent:f=>{const k=new Set(p.value);k.delete(f),p.value=k}}),(f,k)=>(T(),se(c(Ve),{dir:c(u),"data-orientation":c(n),"as-child":f.asChild,as:f.as},{default:C(()=>[Z(f.$slots,"default",{modelValue:c(o)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),Ea=Aa;function ps(s,e){return`${s}-trigger-${e}`}function ds(s,e){return`${s}-content-${e}`}var Ra=B({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const e=s,{forwardRef:t}=Rt(),a=an(),n=M(()=>ps(a.baseId,e.value)),i=M(()=>ds(a.baseId,e.value)),l=M(()=>e.value===a.modelValue.value),u=U(l.value);return vt(()=>{a.registerContent(e.value),requestAnimationFrame(()=>{u.value=!1})}),ta(()=>{a.unregisterContent(e.value)}),(o,d)=>(T(),se(c(zs),{present:o.forceMount||l.value,"force-mount":""},{default:C(({present:p})=>[S(c(Ve),{id:i.value,ref:c(t),"as-child":o.asChild,as:o.as,role:"tabpanel","data-state":l.value?"active":"inactive","data-orientation":c(a).orientation.value,"aria-labelledby":n.value,hidden:!p,tabindex:"0",style:na({animationDuration:u.value?"0s":void 0})},{default:C(()=>[!c(a).unmountOnHide.value||p?Z(o.$slots,"default",{key:0}):Te("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),Ca=Ra,Ia=B({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const e=s,{loop:t}=sn(e),{forwardRef:a,currentElement:n}=Rt(),i=an();return i.tabsList=n,(l,u)=>(T(),se(c(Ta),{"as-child":"",orientation:c(i).orientation.value,dir:c(i).dir.value,loop:c(t)},{default:C(()=>[S(c(Ve),{ref:c(a),role:"tablist","as-child":l.asChild,as:l.as,"aria-orientation":c(i).orientation.value},{default:C(()=>[Z(l.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),La=Ia,Da=B({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(s){const e=s,{forwardRef:t}=Rt(),a=an(),n=M(()=>ps(a.baseId,e.value)),i=M(()=>a.contentIds.value.has(e.value)?ds(a.baseId,e.value):void 0),l=M(()=>e.value===a.modelValue.value);return(u,o)=>(T(),se(c(va),{"as-child":"",focusable:!u.disabled,active:l.value},{default:C(()=>[S(c(Ve),{id:n.value,ref:c(t),role:"tab",type:u.as==="button"?"button":void 0,as:u.as,"as-child":u.asChild,"aria-selected":l.value?"true":"false","aria-controls":i.value,"data-state":l.value?"active":"inactive",disabled:u.disabled,"data-disabled":u.disabled?"":void 0,"data-orientation":c(a).orientation.value,onMousedown:o[0]||(o[0]=aa(d=>{!u.disabled&&d.ctrlKey===!1?c(a).changeModelValue(u.value):d.preventDefault()},["left"])),onKeydown:o[1]||(o[1]=sa(d=>c(a).changeModelValue(u.value),["enter","space"])),onFocus:o[2]||(o[2]=()=>{const d=c(a).activationMode!=="manual";!l.value&&!u.disabled&&d&&c(a).changeModelValue(u.value)})},{default:C(()=>[Z(u.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),Pa=Da;const Oa={key:0,class:"flex flex-wrap items-center gap-3 text-sm"},$a={key:0,class:"flex items-center gap-1.5 text-muted-foreground"},Ma={key:1,class:"flex items-center gap-1.5 text-muted-foreground"},Na=["href"],za={key:4,class:"flex items-center gap-1.5 text-muted-foreground"},Ba=B({__name:"Meta",props:{metadata:{}},setup(s){const e=s,t=M(()=>{const n=e.metadata.status?.toLowerCase();return n?n.includes("complete")||n.includes("done")||n.includes("progress")||n.includes("active")?"default":n.includes("draft")?"secondary":n.includes("blocked")||n.includes("paused")?"destructive":"secondary":"secondary"}),a=M(()=>e.metadata.author||e.metadata.date||e.metadata.status||e.metadata.shortcutStory);return(n,i)=>c(a)?(T(),L("div",Oa,[s.metadata.author?(T(),L("div",$a,[S(c(ba),{class:"size-3.5"}),$("span",null,te(s.metadata.author),1)])):Te("",!0),s.metadata.date?(T(),L("div",Ma,[S(c(Ys),{class:"size-3.5"}),$("span",null,te(s.metadata.date),1)])):Te("",!0),s.metadata.status?(T(),se(c(ns),{key:2,variant:c(t),class:"gap-1"},{default:C(()=>[S(c(ma),{class:"size-3"}),Ce(" "+te(s.metadata.status),1)]),_:1},8,["variant"])):Te("",!0),s.metadata.shortcutStory&&s.metadata.shortcutUrl?(T(),L("a",{key:3,href:s.metadata.shortcutUrl,target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-1.5 text-primary hover:underline"},[S(c(Pn),{class:"size-3.5"}),$("span",null,te(s.metadata.shortcutStory),1)],8,Na)):s.metadata.shortcutStory?(T(),L("span",za,[S(c(Pn),{class:"size-3.5"}),$("span",null,te(s.metadata.shortcutStory),1)])):Te("",!0)])):Te("",!0)}}),Fa=Object.assign(Ba,{__name:"PrdMeta"});function rn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $e=rn();function fs(s){$e=s}var Pe={exec:()=>null};function A(s,e=""){let t=typeof s=="string"?s:s.source,a={replace:(n,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(ne.caret,"$1"),t=t.replace(n,l),a},getRegex:()=>new RegExp(t,e)};return a}var Ua=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ne={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},qa=/^(?:[ \t]*(?:\n|$))+/,Ha=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ga=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ut=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ja=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ln=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,hs=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gs=A(hs).replace(/bull/g,ln).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Va=A(hs).replace(/bull/g,ln).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),on=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wa=/^[^\n]+/,cn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ya=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Za=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ln).getRegex(),Lt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",un=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ka=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",un).replace("tag",Lt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ms=A(on).replace("hr",ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lt).getRegex(),Qa=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ms).getRegex(),pn={blockquote:Qa,code:Ha,def:Ya,fences:Ga,heading:ja,hr:ut,html:Ka,lheading:gs,list:Za,newline:qa,paragraph:ms,table:Pe,text:Wa},Bn=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lt).getRegex(),Xa={...pn,lheading:Va,table:Bn,paragraph:A(on).replace("hr",ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lt).getRegex()},Ja={...pn,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",un).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Pe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(on).replace("hr",ut).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",gs).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},er=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ks=/^( {2,}|\\)\n(?!\s*$)/,nr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Dt=/[\p{P}\p{S}]/u,dn=/[\s\p{P}\p{S}]/u,bs=/[^\s\p{P}\p{S}]/u,sr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dn).getRegex(),_s=/(?!~)[\p{P}\p{S}]/u,ar=/(?!~)[\s\p{P}\p{S}]/u,rr=/(?:[^\s\p{P}\p{S}]|~)/u,xs=/(?![*_])[\p{P}\p{S}]/u,lr=/(?![*_])[\s\p{P}\p{S}]/u,ir=/(?:[^\s\p{P}\p{S}]|[*_])/u,or=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ua?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ys=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,cr=A(ys,"u").replace(/punct/g,Dt).getRegex(),ur=A(ys,"u").replace(/punct/g,_s).getRegex(),Ts="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pr=A(Ts,"gu").replace(/notPunctSpace/g,bs).replace(/punctSpace/g,dn).replace(/punct/g,Dt).getRegex(),dr=A(Ts,"gu").replace(/notPunctSpace/g,rr).replace(/punctSpace/g,ar).replace(/punct/g,_s).getRegex(),fr=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,bs).replace(/punctSpace/g,dn).replace(/punct/g,Dt).getRegex(),hr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,xs).getRegex(),gr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",mr=A(gr,"gu").replace(/notPunctSpace/g,ir).replace(/punctSpace/g,lr).replace(/punct/g,xs).getRegex(),kr=A(/\\(punct)/,"gu").replace(/punct/g,Dt).getRegex(),br=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_r=A(un).replace("(?:-->|$)","-->").getRegex(),xr=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_r).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),St=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,yr=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",St).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ws=A(/^!?\[(label)\]\[(ref)\]/).replace("label",St).replace("ref",cn).getRegex(),vs=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",cn).getRegex(),Tr=A("reflink|nolink(?!\\()","g").replace("reflink",ws).replace("nolink",vs).getRegex(),Fn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fn={_backpedal:Pe,anyPunctuation:kr,autolink:br,blockSkip:or,br:ks,code:tr,del:Pe,delLDelim:Pe,delRDelim:Pe,emStrongLDelim:cr,emStrongRDelimAst:pr,emStrongRDelimUnd:fr,escape:er,link:yr,nolink:vs,punctuation:sr,reflink:ws,reflinkSearch:Tr,tag:xr,text:nr,url:Pe},wr={...fn,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",St).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",St).getRegex()},Qt={...fn,emStrongRDelimAst:dr,emStrongLDelim:ur,delLDelim:hr,delRDelim:mr,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fn).getRegex()},vr={...Qt,br:A(ks).replace("{2,}","*").getRegex(),text:A(Qt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xt={normal:pn,gfm:Xa,pedantic:Ja},tt={normal:fn,gfm:Qt,breaks:vr,pedantic:wr},Sr={"&":"&","<":"<",">":">",'"':""","'":"'"},Un=s=>Sr[s];function xe(s,e){if(e){if(ne.escapeTest.test(s))return s.replace(ne.escapeReplace,Un)}else if(ne.escapeTestNoEncode.test(s))return s.replace(ne.escapeReplaceNoEncode,Un);return s}function qn(s){try{s=encodeURI(s).replace(ne.percentDecode,"%")}catch{return null}return s}function Hn(s,e){let t=s.replace(ne.findPipe,(i,l,u)=>{let o=!1,d=l;for(;--d>=0&&u[d]==="\\";)o=!o;return o?"|":" |"}),a=t.split(ne.splitPipe),n=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;n<a.length;n++)a[n]=a[n].trim().replace(ne.slashPipe,"|");return a}function nt(s,e,t){let a=s.length;if(a===0)return"";let n=0;for(;n<a&&s.charAt(a-n-1)===e;)n++;return s.slice(0,a-n)}function Ar(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let a=0;a<s.length;a++)if(s[a]==="\\")a++;else if(s[a]===e[0])t++;else if(s[a]===e[1]&&(t--,t<0))return a;return t>0?-2:-1}function Er(s,e=0){let t=e,a="";for(let n of s)if(n===" "){let i=4-t%4;a+=" ".repeat(i),t+=i}else a+=n,t++;return a}function Gn(s,e,t,a,n){let i=e.href,l=e.title||null,u=s[1].replace(n.other.outputLinkReplace,"$1");a.state.inLink=!0;let o={type:s[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:l,text:u,tokens:a.inlineTokens(u)};return a.state.inLink=!1,o}function Rr(s,e,t){let a=s.match(t.other.indentCodeCompensation);if(a===null)return e;let n=a[1];return e.split(`
|
|
3
|
+
`).map(i=>{let l=i.match(t.other.beginningSpace);if(l===null)return i;let[u]=l;return u.length>=n.length?i.slice(n.length):i}).join(`
|
|
4
|
+
`)}var At=class{options;rules;lexer;constructor(s){this.options=s||$e}space(s){let e=this.rules.block.newline.exec(s);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(s){let e=this.rules.block.code.exec(s);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:nt(t,`
|
|
5
|
+
`)}}}fences(s){let e=this.rules.block.fences.exec(s);if(e){let t=e[0],a=Rr(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(s){let e=this.rules.block.heading.exec(s);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let a=nt(t,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(t=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(s){let e=this.rules.block.hr.exec(s);if(e)return{type:"hr",raw:nt(e[0],`
|
|
6
|
+
`)}}blockquote(s){let e=this.rules.block.blockquote.exec(s);if(e){let t=nt(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),a="",n="",i=[];for(;t.length>0;){let l=!1,u=[],o;for(o=0;o<t.length;o++)if(this.rules.other.blockquoteStart.test(t[o]))u.push(t[o]),l=!0;else if(!l)u.push(t[o]);else break;t=t.slice(o);let d=u.join(`
|
|
9
|
+
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
|
|
11
|
+
${d}`:d,n=n?`${n}
|
|
12
|
+
${p}`:p;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=f,t.length===0)break;let k=i.at(-1);if(k?.type==="code")break;if(k?.type==="blockquote"){let b=k,y=b.raw+`
|
|
13
|
+
`+t.join(`
|
|
14
|
+
`),D=this.blockquote(y);i[i.length-1]=D,a=a.substring(0,a.length-b.raw.length)+D.raw,n=n.substring(0,n.length-b.text.length)+D.text;break}else if(k?.type==="list"){let b=k,y=b.raw+`
|
|
15
|
+
`+t.join(`
|
|
16
|
+
`),D=this.list(y);i[i.length-1]=D,a=a.substring(0,a.length-k.raw.length)+D.raw,n=n.substring(0,n.length-b.raw.length)+D.raw,t=y.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:a,tokens:i,text:n}}}list(s){let e=this.rules.block.list.exec(s);if(e){let t=e[1].trim(),a=t.length>1,n={type:"list",raw:"",ordered:a,start:a?+t.slice(0,-1):"",loose:!1,items:[]};t=a?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=a?t:"[*+-]");let i=this.rules.other.listItemRegex(t),l=!1;for(;s;){let o=!1,d="",p="";if(!(e=i.exec(s))||this.rules.block.hr.test(s))break;d=e[0],s=s.substring(d.length);let f=Er(e[2].split(`
|
|
18
|
+
`,1)[0],e[1].length),k=s.split(`
|
|
19
|
+
`,1)[0],b=!f.trim(),y=0;if(this.options.pedantic?(y=2,p=f.trimStart()):b?y=e[1].length+1:(y=f.search(this.rules.other.nonSpaceChar),y=y>4?1:y,p=f.slice(y),y+=e[1].length),b&&this.rules.other.blankLine.test(k)&&(d+=k+`
|
|
20
|
+
`,s=s.substring(k.length+1),o=!0),!o){let D=this.rules.other.nextBulletRegex(y),oe=this.rules.other.hrRegex(y),P=this.rules.other.fencesBeginRegex(y),O=this.rules.other.headingBeginRegex(y),I=this.rules.other.htmlBeginRegex(y),E=this.rules.other.blockquoteBeginRegex(y);for(;s;){let X=s.split(`
|
|
21
|
+
`,1)[0],K;if(k=X,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),K=k):K=k.replace(this.rules.other.tabCharGlobal," "),P.test(k)||O.test(k)||I.test(k)||E.test(k)||D.test(k)||oe.test(k))break;if(K.search(this.rules.other.nonSpaceChar)>=y||!k.trim())p+=`
|
|
22
|
+
`+K.slice(y);else{if(b||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||P.test(f)||O.test(f)||oe.test(f))break;p+=`
|
|
23
|
+
`+k}b=!k.trim(),d+=X+`
|
|
24
|
+
`,s=s.substring(X.length+1),f=K.slice(y)}}n.loose||(l?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0)),n.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),n.raw+=d}let u=n.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let o of n.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(o.raw);if(d){let p={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};o.checked=p.checked,n.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=p.raw+o.tokens[0].raw,o.tokens[0].text=p.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(p)):o.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):o.tokens.unshift(p)}}if(!n.loose){let d=o.tokens.filter(f=>f.type==="space"),p=d.length>0&&d.some(f=>this.rules.other.anyLine.test(f.raw));n.loose=p}}if(n.loose)for(let o of n.items){o.loose=!0;for(let d of o.tokens)d.type==="text"&&(d.type="paragraph")}return n}}html(s){let e=this.rules.block.html.exec(s);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(s){let e=this.rules.block.def.exec(s);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:a,title:n}}}table(s){let e=this.rules.block.table.exec(s);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Hn(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===a.length){for(let l of a)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<t.length;l++)i.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:i.align[l]});for(let l of n)i.rows.push(Hn(l,i.header.length).map((u,o)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[o]})));return i}}lheading(s){let e=this.rules.block.lheading.exec(s);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(s){let e=this.rules.block.paragraph.exec(s);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(s){let e=this.rules.block.text.exec(s);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(s){let e=this.rules.inline.escape.exec(s);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(s){let e=this.rules.inline.tag.exec(s);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(s){let e=this.rules.inline.link.exec(s);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=nt(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=Ar(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let a=e[2],n="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(a);i&&(a=i[1],n=i[3])}else n=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?a=a.slice(1):a=a.slice(1,-1)),Gn(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(s,e){let t;if((t=this.rules.inline.reflink.exec(s))||(t=this.rules.inline.nolink.exec(s))){let a=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[a.toLowerCase()];if(!n){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return Gn(t,n,t[0],this.lexer,this.rules)}}emStrong(s,e,t=""){let a=this.rules.inline.emStrongLDelim.exec(s);if(!(!a||a[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!t||this.rules.inline.punctuation.exec(t))){let n=[...a[0]].length-1,i,l,u=n,o=0,d=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*s.length+n);(a=d.exec(e))!=null;){if(i=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!i)continue;if(l=[...i].length,a[3]||a[4]){u+=l;continue}else if((a[5]||a[6])&&n%3&&!((n+l)%3)){o+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+o);let p=[...a[0]][0].length,f=s.slice(0,n+a.index+p+l);if(Math.min(n,l)%2){let b=f.slice(1,-1);return{type:"em",raw:f,text:b,tokens:this.lexer.inlineTokens(b)}}let k=f.slice(2,-2);return{type:"strong",raw:f,text:k,tokens:this.lexer.inlineTokens(k)}}}}codespan(s){let e=this.rules.inline.code.exec(s);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return a&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(s){let e=this.rules.inline.br.exec(s);if(e)return{type:"br",raw:e[0]}}del(s,e,t=""){let a=this.rules.inline.delLDelim.exec(s);if(a&&(!a[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...a[0]].length-1,i,l,u=n,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*s.length+n);(a=o.exec(e))!=null;){if(i=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!i||(l=[...i].length,l!==n))continue;if(a[3]||a[4]){u+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u);let d=[...a[0]][0].length,p=s.slice(0,n+a.index+d+l),f=p.slice(n,-n);return{type:"del",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(s){let e=this.rules.inline.autolink.exec(s);if(e){let t,a;return e[2]==="@"?(t=e[1],a="mailto:"+t):(t=e[1],a=t),{type:"link",raw:e[0],text:t,href:a,tokens:[{type:"text",raw:t,text:t}]}}}url(s){let e;if(e=this.rules.inline.url.exec(s)){let t,a;if(e[2]==="@")t=e[0],a="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?a="http://"+e[0]:a=e[0]}return{type:"link",raw:e[0],text:t,href:a,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(s){let e=this.rules.inline.text.exec(s);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},ue=class Xt{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$e,this.options.tokenizer=this.options.tokenizer||new At,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:ne,block:xt.normal,inline:tt.normal};this.options.pedantic?(t.block=xt.pedantic,t.inline=tt.pedantic):this.options.gfm&&(t.block=xt.gfm,this.options.breaks?t.inline=tt.breaks:t.inline=tt.gfm),this.tokenizer.rules=t}static get rules(){return{block:xt,inline:tt}}static lex(e,t){return new Xt(t).lex(e)}static lexInline(e,t){return new Xt(t).inlineTokens(e)}lex(e){e=e.replace(ne.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let a=this.inlineQueue[t];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],a=!1){for(this.options.pedantic&&(e=e.replace(ne.tabCharGlobal," ").replace(ne.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(l=>(n=l.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let l=t.at(-1);n.raw.length===1&&l!==void 0?l.raw+=`
|
|
28
|
+
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+n.raw,l.text+=`
|
|
31
|
+
`+n.text,this.inlineQueue.at(-1).src=l.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+n.raw,l.text+=`
|
|
34
|
+
`+n.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0,u=e.slice(1),o;this.options.extensions.startBlock.forEach(d=>{o=d.call({lexer:this},u),typeof o=="number"&&o>=0&&(l=Math.min(l,o))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){let l=t.at(-1);a&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+n.raw,l.text+=`
|
|
37
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(n),a=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let l=t.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+n.raw,l.text+=`
|
|
40
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(n);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let a=e,n=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)o.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,n.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)i=n[2]?n[2].length:0,a=a.slice(0,n.index+i)+"["+"a".repeat(n[0].length-i-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let l=!1,u="";for(;e;){l||(u=""),l=!1;let o;if(this.options.extensions?.inline?.some(p=>(o=p.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=t.at(-1);o.type==="text"&&p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,a,u)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,a,u)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let d=e;if(this.options.extensions?.startInline){let p=1/0,f=e.slice(1),k;this.options.extensions.startInline.forEach(b=>{k=b.call({lexer:this},f),typeof k=="number"&&k>=0&&(p=Math.min(p,k))}),p<1/0&&p>=0&&(d=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(d)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(u=o.raw.slice(-1)),l=!0;let p=t.at(-1);p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}},Et=class{options;parser;constructor(s){this.options=s||$e}space(s){return""}code({text:s,lang:e,escaped:t}){let a=(e||"").match(ne.notSpaceStart)?.[0],n=s.replace(ne.endingNewline,"")+`
|
|
41
|
+
`;return a?'<pre><code class="language-'+xe(a)+'">'+(t?n:xe(n,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(t?n:xe(n,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:s}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(s)}</blockquote>
|
|
45
|
+
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:e}){return`<h${e}>${this.parser.parseInline(s)}</h${e}>
|
|
46
|
+
`}hr(s){return`<hr>
|
|
47
|
+
`}list(s){let e=s.ordered,t=s.start,a="";for(let l=0;l<s.items.length;l++){let u=s.items[l];a+=this.listitem(u)}let n=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+n+i+`>
|
|
48
|
+
`+a+"</"+n+`>
|
|
49
|
+
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
|
|
50
|
+
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
51
|
+
`}table(s){let e="",t="";for(let n=0;n<s.header.length;n++)t+=this.tablecell(s.header[n]);e+=this.tablerow({text:t});let a="";for(let n=0;n<s.rows.length;n++){let i=s.rows[n];t="";for(let l=0;l<i.length;l++)t+=this.tablecell(i[l]);a+=this.tablerow({text:t})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+e+`</thead>
|
|
54
|
+
`+a+`</table>
|
|
55
|
+
`}tablerow({text:s}){return`<tr>
|
|
56
|
+
${s}</tr>
|
|
57
|
+
`}tablecell(s){let e=this.parser.parseInline(s.tokens),t=s.header?"th":"td";return(s.align?`<${t} align="${s.align}">`:`<${t}>`)+e+`</${t}>
|
|
58
|
+
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${xe(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:t}){let a=this.parser.parseInline(t),n=qn(s);if(n===null)return a;s=n;let i='<a href="'+s+'"';return e&&(i+=' title="'+xe(e)+'"'),i+=">"+a+"</a>",i}image({href:s,title:e,text:t,tokens:a}){a&&(t=this.parser.parseInline(a,this.parser.textRenderer));let n=qn(s);if(n===null)return xe(t);s=n;let i=`<img src="${s}" alt="${xe(t)}"`;return e&&(i+=` title="${xe(e)}"`),i+=">",i}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:xe(s.text)}},hn=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},pe=class Jt{options;renderer;textRenderer;constructor(e){this.options=e||$e,this.options.renderer=this.options.renderer||new Et,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hn}static parse(e,t){return new Jt(t).parse(e)}static parseInline(e,t){return new Jt(t).parseInline(e)}parse(e){let t="";for(let a=0;a<e.length;a++){let n=e[a];if(this.options.extensions?.renderers?.[n.type]){let l=n,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){t+=u||"";continue}}let i=n;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return t}parseInline(e,t=this.renderer){let a="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let u=this.options.extensions.renderers[i.type].call({parser:this},i);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){a+=u||"";continue}}let l=i;switch(l.type){case"escape":{a+=t.text(l);break}case"html":{a+=t.html(l);break}case"link":{a+=t.link(l);break}case"image":{a+=t.image(l);break}case"checkbox":{a+=t.checkbox(l);break}case"strong":{a+=t.strong(l);break}case"em":{a+=t.em(l);break}case"codespan":{a+=t.codespan(l);break}case"br":{a+=t.br(l);break}case"del":{a+=t.del(l);break}case"text":{a+=t.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return a}},ot=class{options;block;constructor(s){this.options=s||$e}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(){return this.block?ue.lex:ue.lexInline}provideParser(){return this.block?pe.parse:pe.parseInline}},Cr=class{defaults=rn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=pe;Renderer=Et;TextRenderer=hn;Lexer=ue;Tokenizer=At;Hooks=ot;constructor(...s){this.use(...s)}walkTokens(s,e){let t=[];for(let a of s)switch(t=t.concat(e.call(this,a)),a.type){case"table":{let n=a;for(let i of n.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of n.rows)for(let l of i)t=t.concat(this.walkTokens(l.tokens,e));break}case"list":{let n=a;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=a;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(i=>{let l=n[i].flat(1/0);t=t.concat(this.walkTokens(l,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(t=>{let a={...t};if(a.async=this.defaults.async||a.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let i=e.renderers[n.name];i?e.renderers[n.name]=function(...l){let u=n.renderer.apply(this,l);return u===!1&&(u=i.apply(this,l)),u}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),a.extensions=e),t.renderer){let n=this.defaults.renderer||new Et(this.defaults);for(let i in t.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,u=t.renderer[l],o=n[l];n[l]=(...d)=>{let p=u.apply(n,d);return p===!1&&(p=o.apply(n,d)),p||""}}a.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new At(this.defaults);for(let i in t.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,u=t.tokenizer[l],o=n[l];n[l]=(...d)=>{let p=u.apply(n,d);return p===!1&&(p=o.apply(n,d)),p}}a.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new ot;for(let i in t.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,u=t.hooks[l],o=n[l];ot.passThroughHooks.has(i)?n[l]=d=>{if(this.defaults.async&&ot.passThroughHooksRespectAsync.has(i))return(async()=>{let f=await u.call(n,d);return o.call(n,f)})();let p=u.call(n,d);return o.call(n,p)}:n[l]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await u.apply(n,d);return f===!1&&(f=await o.apply(n,d)),f})();let p=u.apply(n,d);return p===!1&&(p=o.apply(n,d)),p}}a.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,i=t.walkTokens;a.walkTokens=function(l){let u=[];return u.push(i.call(this,l)),n&&(u=u.concat(n.call(this,l))),u}}this.defaults={...this.defaults,...a}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return ue.lex(s,e??this.defaults)}parser(s,e){return pe.parse(s,e??this.defaults)}parseMarkdown(s){return(e,t)=>{let a={...t},n={...this.defaults,...a},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&a.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=s),n.async)return(async()=>{let l=n.hooks?await n.hooks.preprocess(e):e,u=await(n.hooks?await n.hooks.provideLexer():s?ue.lex:ue.lexInline)(l,n),o=n.hooks?await n.hooks.processAllTokens(u):u;n.walkTokens&&await Promise.all(this.walkTokens(o,n.walkTokens));let d=await(n.hooks?await n.hooks.provideParser():s?pe.parse:pe.parseInline)(o,n);return n.hooks?await n.hooks.postprocess(d):d})().catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let l=(n.hooks?n.hooks.provideLexer():s?ue.lex:ue.lexInline)(e,n);n.hooks&&(l=n.hooks.processAllTokens(l)),n.walkTokens&&this.walkTokens(l,n.walkTokens);let u=(n.hooks?n.hooks.provideParser():s?pe.parse:pe.parseInline)(l,n);return n.hooks&&(u=n.hooks.postprocess(u)),u}catch(l){return i(l)}}}onError(s,e){return t=>{if(t.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,s){let a="<p>An error occurred:</p><pre>"+xe(t.message+"",!0)+"</pre>";return e?Promise.resolve(a):a}if(e)return Promise.reject(t);throw t}}},Oe=new Cr;function R(s,e){return Oe.parse(s,e)}R.options=R.setOptions=function(s){return Oe.setOptions(s),R.defaults=Oe.defaults,fs(R.defaults),R};R.getDefaults=rn;R.defaults=$e;R.use=function(...s){return Oe.use(...s),R.defaults=Oe.defaults,fs(R.defaults),R};R.walkTokens=function(s,e){return Oe.walkTokens(s,e)};R.parseInline=Oe.parseInline;R.Parser=pe;R.parser=pe.parse;R.Renderer=Et;R.TextRenderer=hn;R.Lexer=ue;R.lexer=ue.lex;R.Tokenizer=At;R.Hooks=ot;R.parse=R;R.options;R.setOptions;R.use;R.walkTokens;R.parseInline;pe.parse;ue.lex;const{entries:Ss,setPrototypeOf:jn,isFrozen:Ir,getPrototypeOf:Lr,getOwnPropertyDescriptor:Dr}=Object;let{freeze:ae,seal:ie,create:en}=Object,{apply:tn,construct:nn}=typeof Reflect<"u"&&Reflect;ae||(ae=function(e){return e});ie||(ie=function(e){return e});tn||(tn=function(e,t){for(var a=arguments.length,n=new Array(a>2?a-2:0),i=2;i<a;i++)n[i-2]=arguments[i];return e.apply(t,n)});nn||(nn=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return new e(...a)});const yt=re(Array.prototype.forEach),Pr=re(Array.prototype.lastIndexOf),Vn=re(Array.prototype.pop),st=re(Array.prototype.push),Or=re(Array.prototype.splice),wt=re(String.prototype.toLowerCase),qt=re(String.prototype.toString),Ht=re(String.prototype.match),at=re(String.prototype.replace),$r=re(String.prototype.indexOf),Mr=re(String.prototype.trim),ce=re(Object.prototype.hasOwnProperty),ee=re(RegExp.prototype.test),rt=Nr(TypeError);function re(s){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return tn(s,e,a)}}function Nr(s){return function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return nn(s,t)}}function w(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wt;jn&&jn(s,null);let a=e.length;for(;a--;){let n=e[a];if(typeof n=="string"){const i=t(n);i!==n&&(Ir(e)||(e[a]=i),n=i)}s[n]=!0}return s}function zr(s){for(let e=0;e<s.length;e++)ce(s,e)||(s[e]=null);return s}function ye(s){const e=en(null);for(const[t,a]of Ss(s))ce(s,t)&&(Array.isArray(a)?e[t]=zr(a):a&&typeof a=="object"&&a.constructor===Object?e[t]=ye(a):e[t]=a);return e}function lt(s,e){for(;s!==null;){const a=Dr(s,e);if(a){if(a.get)return re(a.get);if(typeof a.value=="function")return re(a.value)}s=Lr(s)}function t(){return null}return t}const Wn=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Gt=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),jt=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Br=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Vt=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Fr=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Yn=ae(["#text"]),Zn=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Wt=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Kn=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Tt=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ur=ie(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qr=ie(/<%[\w\W]*|[\w\W]*%>/gm),Hr=ie(/\$\{[\w\W]*/gm),Gr=ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),jr=ie(/^aria-[\-\w]+$/),As=ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vr=ie(/^(?:\w+script|data):/i),Wr=ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Es=ie(/^html$/i),Yr=ie(/^[a-z][.\w]*(-[.\w]+)+$/i);var Qn=Object.freeze({__proto__:null,ARIA_ATTR:jr,ATTR_WHITESPACE:Wr,CUSTOM_ELEMENT:Yr,DATA_ATTR:Gr,DOCTYPE_NAME:Es,ERB_EXPR:qr,IS_ALLOWED_URI:As,IS_SCRIPT_OR_DATA:Vr,MUSTACHE_EXPR:Ur,TMPLIT_EXPR:Hr});const it={element:1,text:3,progressingInstruction:7,comment:8,document:9},Zr=function(){return typeof window>"u"?null:window},Kr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let a=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(a=t.getAttribute(n));const i="dompurify"+(a?"#"+a:"");try{return e.createPolicy(i,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Xn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Rs(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zr();const e=x=>Rs(x);if(e.version="3.3.1",e.removed=[],!s||!s.document||s.document.nodeType!==it.document||!s.Element)return e.isSupported=!1,e;let{document:t}=s;const a=t,n=a.currentScript,{DocumentFragment:i,HTMLTemplateElement:l,Node:u,Element:o,NodeFilter:d,NamedNodeMap:p=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:f,DOMParser:k,trustedTypes:b}=s,y=o.prototype,D=lt(y,"cloneNode"),oe=lt(y,"remove"),P=lt(y,"nextSibling"),O=lt(y,"childNodes"),I=lt(y,"parentNode");if(typeof l=="function"){const x=t.createElement("template");x.content&&x.content.ownerDocument&&(t=x.content.ownerDocument)}let E,X="";const{implementation:K,createNodeIterator:he,createDocumentFragment:ge,getElementsByTagName:G}=t,{importNode:me}=a;let F=Xn();e.isSupported=typeof Ss=="function"&&typeof I=="function"&&K&&K.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ie,ERB_EXPR:Me,TMPLIT_EXPR:Ne,DATA_ATTR:We,ARIA_ATTR:pt,IS_SCRIPT_OR_DATA:Pt,ATTR_WHITESPACE:ze,CUSTOM_ELEMENT:dt}=Qn;let{IS_ALLOWED_URI:Ye}=Qn,q=null;const Ze=w({},[...Wn,...Gt,...jt,...Vt,...Yn]);let j=null;const ft=w({},[...Zn,...Wt,...Kn,...Tt]);let z=Object.seal(en(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,Be=null;const ke=Object.seal(en(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ht=!0,Ke=!0,g=!1,m=!0,v=!1,W=!0,J=!1,Qe=!1,Xe=!1,Ee=!1,Re=!1,gt=!1,gn=!0,mn=!1;const Cs="user-content-";let Ot=!0,Je=!1,Fe={},be=null;const $t=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let kn=null;const bn=w({},["audio","video","img","source","image","track"]);let Mt=null;const _n=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mt="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml";let Ue=ve,Nt=!1,zt=null;const Is=w({},[mt,kt,ve],qt);let bt=w({},["mi","mo","mn","ms","mtext"]),_t=w({},["annotation-xml"]);const Ls=w({},["title","style","font","a","script"]);let et=null;const Ds=["application/xhtml+xml","text/html"],Ps="text/html";let V=null,qe=null;const Os=t.createElement("form"),xn=function(r){return r instanceof RegExp||r instanceof Function},Bt=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(qe&&qe===r)){if((!r||typeof r!="object")&&(r={}),r=ye(r),et=Ds.indexOf(r.PARSER_MEDIA_TYPE)===-1?Ps:r.PARSER_MEDIA_TYPE,V=et==="application/xhtml+xml"?qt:wt,q=ce(r,"ALLOWED_TAGS")?w({},r.ALLOWED_TAGS,V):Ze,j=ce(r,"ALLOWED_ATTR")?w({},r.ALLOWED_ATTR,V):ft,zt=ce(r,"ALLOWED_NAMESPACES")?w({},r.ALLOWED_NAMESPACES,qt):Is,Mt=ce(r,"ADD_URI_SAFE_ATTR")?w(ye(_n),r.ADD_URI_SAFE_ATTR,V):_n,kn=ce(r,"ADD_DATA_URI_TAGS")?w(ye(bn),r.ADD_DATA_URI_TAGS,V):bn,be=ce(r,"FORBID_CONTENTS")?w({},r.FORBID_CONTENTS,V):$t,we=ce(r,"FORBID_TAGS")?w({},r.FORBID_TAGS,V):ye({}),Be=ce(r,"FORBID_ATTR")?w({},r.FORBID_ATTR,V):ye({}),Fe=ce(r,"USE_PROFILES")?r.USE_PROFILES:!1,ht=r.ALLOW_ARIA_ATTR!==!1,Ke=r.ALLOW_DATA_ATTR!==!1,g=r.ALLOW_UNKNOWN_PROTOCOLS||!1,m=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,v=r.SAFE_FOR_TEMPLATES||!1,W=r.SAFE_FOR_XML!==!1,J=r.WHOLE_DOCUMENT||!1,Ee=r.RETURN_DOM||!1,Re=r.RETURN_DOM_FRAGMENT||!1,gt=r.RETURN_TRUSTED_TYPE||!1,Xe=r.FORCE_BODY||!1,gn=r.SANITIZE_DOM!==!1,mn=r.SANITIZE_NAMED_PROPS||!1,Ot=r.KEEP_CONTENT!==!1,Je=r.IN_PLACE||!1,Ye=r.ALLOWED_URI_REGEXP||As,Ue=r.NAMESPACE||ve,bt=r.MATHML_TEXT_INTEGRATION_POINTS||bt,_t=r.HTML_INTEGRATION_POINTS||_t,z=r.CUSTOM_ELEMENT_HANDLING||{},r.CUSTOM_ELEMENT_HANDLING&&xn(r.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=r.CUSTOM_ELEMENT_HANDLING.tagNameCheck),r.CUSTOM_ELEMENT_HANDLING&&xn(r.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=r.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),r.CUSTOM_ELEMENT_HANDLING&&typeof r.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=r.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),v&&(Ke=!1),Re&&(Ee=!0),Fe&&(q=w({},Yn),j=[],Fe.html===!0&&(w(q,Wn),w(j,Zn)),Fe.svg===!0&&(w(q,Gt),w(j,Wt),w(j,Tt)),Fe.svgFilters===!0&&(w(q,jt),w(j,Wt),w(j,Tt)),Fe.mathMl===!0&&(w(q,Vt),w(j,Kn),w(j,Tt))),r.ADD_TAGS&&(typeof r.ADD_TAGS=="function"?ke.tagCheck=r.ADD_TAGS:(q===Ze&&(q=ye(q)),w(q,r.ADD_TAGS,V))),r.ADD_ATTR&&(typeof r.ADD_ATTR=="function"?ke.attributeCheck=r.ADD_ATTR:(j===ft&&(j=ye(j)),w(j,r.ADD_ATTR,V))),r.ADD_URI_SAFE_ATTR&&w(Mt,r.ADD_URI_SAFE_ATTR,V),r.FORBID_CONTENTS&&(be===$t&&(be=ye(be)),w(be,r.FORBID_CONTENTS,V)),r.ADD_FORBID_CONTENTS&&(be===$t&&(be=ye(be)),w(be,r.ADD_FORBID_CONTENTS,V)),Ot&&(q["#text"]=!0),J&&w(q,["html","head","body"]),q.table&&(w(q,["tbody"]),delete we.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=r.TRUSTED_TYPES_POLICY,X=E.createHTML("")}else E===void 0&&(E=Kr(b,n)),E!==null&&typeof X=="string"&&(X=E.createHTML(""));ae&&ae(r),qe=r}},yn=w({},[...Gt,...jt,...Br]),Tn=w({},[...Vt,...Fr]),$s=function(r){let h=I(r);(!h||!h.tagName)&&(h={namespaceURI:Ue,tagName:"template"});const _=wt(r.tagName),N=wt(h.tagName);return zt[r.namespaceURI]?r.namespaceURI===kt?h.namespaceURI===ve?_==="svg":h.namespaceURI===mt?_==="svg"&&(N==="annotation-xml"||bt[N]):!!yn[_]:r.namespaceURI===mt?h.namespaceURI===ve?_==="math":h.namespaceURI===kt?_==="math"&&_t[N]:!!Tn[_]:r.namespaceURI===ve?h.namespaceURI===kt&&!_t[N]||h.namespaceURI===mt&&!bt[N]?!1:!Tn[_]&&(Ls[_]||!yn[_]):!!(et==="application/xhtml+xml"&&zt[r.namespaceURI]):!1},_e=function(r){st(e.removed,{element:r});try{I(r).removeChild(r)}catch{oe(r)}},Le=function(r,h){try{st(e.removed,{attribute:h.getAttributeNode(r),from:h})}catch{st(e.removed,{attribute:null,from:h})}if(h.removeAttribute(r),r==="is")if(Ee||Re)try{_e(h)}catch{}else try{h.setAttribute(r,"")}catch{}},wn=function(r){let h=null,_=null;if(Xe)r="<remove></remove>"+r;else{const H=Ht(r,/^[\r\n\t ]+/);_=H&&H[0]}et==="application/xhtml+xml"&&Ue===ve&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");const N=E?E.createHTML(r):r;if(Ue===ve)try{h=new k().parseFromString(N,et)}catch{}if(!h||!h.documentElement){h=K.createDocument(Ue,"template",null);try{h.documentElement.innerHTML=Nt?X:N}catch{}}const Q=h.body||h.documentElement;return r&&_&&Q.insertBefore(t.createTextNode(_),Q.childNodes[0]||null),Ue===ve?G.call(h,J?"html":"body")[0]:J?h.documentElement:Q},vn=function(r){return he.call(r.ownerDocument||r,r,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Ft=function(r){return r instanceof f&&(typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||!(r.attributes instanceof p)||typeof r.removeAttribute!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function")},Sn=function(r){return typeof u=="function"&&r instanceof u};function Se(x,r,h){yt(x,_=>{_.call(e,r,h,qe)})}const An=function(r){let h=null;if(Se(F.beforeSanitizeElements,r,null),Ft(r))return _e(r),!0;const _=V(r.nodeName);if(Se(F.uponSanitizeElement,r,{tagName:_,allowedTags:q}),W&&r.hasChildNodes()&&!Sn(r.firstElementChild)&&ee(/<[/\w!]/g,r.innerHTML)&&ee(/<[/\w!]/g,r.textContent)||r.nodeType===it.progressingInstruction||W&&r.nodeType===it.comment&&ee(/<[/\w]/g,r.data))return _e(r),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(_))&&(!q[_]||we[_])){if(!we[_]&&Rn(_)&&(z.tagNameCheck instanceof RegExp&&ee(z.tagNameCheck,_)||z.tagNameCheck instanceof Function&&z.tagNameCheck(_)))return!1;if(Ot&&!be[_]){const N=I(r)||r.parentNode,Q=O(r)||r.childNodes;if(Q&&N){const H=Q.length;for(let le=H-1;le>=0;--le){const Ae=D(Q[le],!0);Ae.__removalCount=(r.__removalCount||0)+1,N.insertBefore(Ae,P(r))}}}return _e(r),!0}return r instanceof o&&!$s(r)||(_==="noscript"||_==="noembed"||_==="noframes")&&ee(/<\/no(script|embed|frames)/i,r.innerHTML)?(_e(r),!0):(v&&r.nodeType===it.text&&(h=r.textContent,yt([Ie,Me,Ne],N=>{h=at(h,N," ")}),r.textContent!==h&&(st(e.removed,{element:r.cloneNode()}),r.textContent=h)),Se(F.afterSanitizeElements,r,null),!1)},En=function(r,h,_){if(gn&&(h==="id"||h==="name")&&(_ in t||_ in Os))return!1;if(!(Ke&&!Be[h]&&ee(We,h))){if(!(ht&&ee(pt,h))){if(!(ke.attributeCheck instanceof Function&&ke.attributeCheck(h,r))){if(!j[h]||Be[h]){if(!(Rn(r)&&(z.tagNameCheck instanceof RegExp&&ee(z.tagNameCheck,r)||z.tagNameCheck instanceof Function&&z.tagNameCheck(r))&&(z.attributeNameCheck instanceof RegExp&&ee(z.attributeNameCheck,h)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(h,r))||h==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&ee(z.tagNameCheck,_)||z.tagNameCheck instanceof Function&&z.tagNameCheck(_))))return!1}else if(!Mt[h]){if(!ee(Ye,at(_,ze,""))){if(!((h==="src"||h==="xlink:href"||h==="href")&&r!=="script"&&$r(_,"data:")===0&&kn[r])){if(!(g&&!ee(Pt,at(_,ze,"")))){if(_)return!1}}}}}}}return!0},Rn=function(r){return r!=="annotation-xml"&&Ht(r,dt)},Cn=function(r){Se(F.beforeSanitizeAttributes,r,null);const{attributes:h}=r;if(!h||Ft(r))return;const _={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let N=h.length;for(;N--;){const Q=h[N],{name:H,namespaceURI:le,value:Ae}=Q,He=V(H),Ut=Ae;let Y=H==="value"?Ut:Mr(Ut);if(_.attrName=He,_.attrValue=Y,_.keepAttr=!0,_.forceKeepAttr=void 0,Se(F.uponSanitizeAttribute,r,_),Y=_.attrValue,mn&&(He==="id"||He==="name")&&(Le(H,r),Y=Cs+Y),W&&ee(/((--!?|])>)|<\/(style|title|textarea)/i,Y)){Le(H,r);continue}if(He==="attributename"&&Ht(Y,"href")){Le(H,r);continue}if(_.forceKeepAttr)continue;if(!_.keepAttr){Le(H,r);continue}if(!m&&ee(/\/>/i,Y)){Le(H,r);continue}v&&yt([Ie,Me,Ne],Ln=>{Y=at(Y,Ln," ")});const In=V(r.nodeName);if(!En(In,He,Y)){Le(H,r);continue}if(E&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!le)switch(b.getAttributeType(In,He)){case"TrustedHTML":{Y=E.createHTML(Y);break}case"TrustedScriptURL":{Y=E.createScriptURL(Y);break}}if(Y!==Ut)try{le?r.setAttributeNS(le,H,Y):r.setAttribute(H,Y),Ft(r)?_e(r):Vn(e.removed)}catch{Le(H,r)}}Se(F.afterSanitizeAttributes,r,null)},Ms=function x(r){let h=null;const _=vn(r);for(Se(F.beforeSanitizeShadowDOM,r,null);h=_.nextNode();)Se(F.uponSanitizeShadowNode,h,null),An(h),Cn(h),h.content instanceof i&&x(h.content);Se(F.afterSanitizeShadowDOM,r,null)};return e.sanitize=function(x){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,_=null,N=null,Q=null;if(Nt=!x,Nt&&(x="<!-->"),typeof x!="string"&&!Sn(x))if(typeof x.toString=="function"){if(x=x.toString(),typeof x!="string")throw rt("dirty is not a string, aborting")}else throw rt("toString is not a function");if(!e.isSupported)return x;if(Qe||Bt(r),e.removed=[],typeof x=="string"&&(Je=!1),Je){if(x.nodeName){const Ae=V(x.nodeName);if(!q[Ae]||we[Ae])throw rt("root node is forbidden and cannot be sanitized in-place")}}else if(x instanceof u)h=wn("<!---->"),_=h.ownerDocument.importNode(x,!0),_.nodeType===it.element&&_.nodeName==="BODY"||_.nodeName==="HTML"?h=_:h.appendChild(_);else{if(!Ee&&!v&&!J&&x.indexOf("<")===-1)return E&>?E.createHTML(x):x;if(h=wn(x),!h)return Ee?null:gt?X:""}h&&Xe&&_e(h.firstChild);const H=vn(Je?x:h);for(;N=H.nextNode();)An(N),Cn(N),N.content instanceof i&&Ms(N.content);if(Je)return x;if(Ee){if(Re)for(Q=ge.call(h.ownerDocument);h.firstChild;)Q.appendChild(h.firstChild);else Q=h;return(j.shadowroot||j.shadowrootmode)&&(Q=me.call(a,Q,!0)),Q}let le=J?h.outerHTML:h.innerHTML;return J&&q["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&ee(Es,h.ownerDocument.doctype.name)&&(le="<!DOCTYPE "+h.ownerDocument.doctype.name+`>
|
|
60
|
+
`+le),v&&yt([Ie,Me,Ne],Ae=>{le=at(le,Ae," ")}),E&>?E.createHTML(le):le},e.setConfig=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bt(x),Qe=!0},e.clearConfig=function(){qe=null,Qe=!1},e.isValidAttribute=function(x,r,h){qe||Bt({});const _=V(x),N=V(r);return En(_,N,h)},e.addHook=function(x,r){typeof r=="function"&&st(F[x],r)},e.removeHook=function(x,r){if(r!==void 0){const h=Pr(F[x],r);return h===-1?void 0:Or(F[x],h,1)[0]}return Vn(F[x])},e.removeHooks=function(x){F[x]=[]},e.removeAllHooks=function(){F=Xn()},e}var Qr=Rs();const Xr={class:"prd-viewer"},Jr={key:0,class:"flex items-center justify-center py-8"},el=["innerHTML"],tl=B({__name:"Viewer",props:{content:{}},setup(s){const e=s,t=U(""),a=U(!0),n={ADD_TAGS:["style"],ADD_ATTR:["style","class","target","rel"]},i=new R.Renderer;i.link=({href:d,title:p,text:f})=>{const k=p?` title="${p}"`:"";return`<a href="${d}"${k} target="_blank" rel="noopener noreferrer">${f}</a>`};async function l(d,p){try{return await Zs(d,{lang:p||"text",themes:{light:"github-light",dark:"github-dark"}})}catch{return`<pre><code class="language-${p}">${u(d)}</code></pre>`}}function u(d){return d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function o(d){const p=/```(\w*)\n([\s\S]*?)```/g,f=[];let k=0;const b=d.replace(p,(P,O,I)=>{const E=`CODEBLOCK${k++}PLACEHOLDER`;return f.push({placeholder:E,lang:O||"text",code:I.trim()}),E});R.setOptions({renderer:i,gfm:!0,breaks:!0});let y=await R.parse(b);const D=f.map(async({placeholder:P,lang:O,code:I})=>{const E=await l(I,O);return{placeholder:P,highlighted:E}}),oe=await Promise.all(D);for(const{placeholder:P,highlighted:O}of oe)y=y.replace(`<p>${P}</p>`,O),y=y.replace(P,O);return Qr.sanitize(y,n)}return De(()=>e.content,async d=>{if(d){a.value=!0;try{t.value=await o(d)}finally{a.value=!1}}},{immediate:!0}),(d,p)=>(T(),L("div",Xr,[c(a)?(T(),L("div",Jr,[...p[0]||(p[0]=[$("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):(T(),L("div",{key:1,class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:c(t)},null,8,el))]))}}),nl=Object.assign(tl,{__name:"PrdViewer"}),sl=B({__name:"Card",props:{class:{}},setup(s){const e=s;return(t,a)=>(T(),L("div",{"data-slot":"card",class:de(c(fe)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e.class))},[Z(t.$slots,"default")],2))}}),al=Object.assign(sl,{__name:"UiCard"}),rl=B({__name:"CardAction",props:{class:{}},setup(s){const e=s;return(t,a)=>(T(),L("div",{"data-slot":"card-action",class:de(c(fe)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e.class))},[Z(t.$slots,"default")],2))}});Object.assign(rl,{__name:"UiCardAction"});const ll=B({__name:"CardContent",props:{class:{}},setup(s){const e=s;return(t,a)=>(T(),L("div",{"data-slot":"card-content",class:de(c(fe)("px-6",e.class))},[Z(t.$slots,"default")],2))}}),il=Object.assign(ll,{__name:"UiCardContent"}),ol=B({__name:"CardDescription",props:{class:{}},setup(s){const e=s;return(t,a)=>(T(),L("p",{"data-slot":"card-description",class:de(c(fe)("text-muted-foreground text-sm",e.class))},[Z(t.$slots,"default")],2))}});Object.assign(ol,{__name:"UiCardDescription"});const cl=B({__name:"CardFooter",props:{class:{}},setup(s){const e=s;return(t,a)=>(T(),L("div",{"data-slot":"card-footer",class:de(c(fe)("flex items-center px-6 [.border-t]:pt-6",e.class))},[Z(t.$slots,"default")],2))}});Object.assign(cl,{__name:"UiCardFooter"});const ul=B({__name:"CardHeader",props:{class:{}},setup(s){const e=s;return(t,a)=>(T(),L("div",{"data-slot":"card-header",class:de(c(fe)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e.class))},[Z(t.$slots,"default")],2))}});Object.assign(ul,{__name:"UiCardHeader"});const pl=B({__name:"CardTitle",props:{class:{}},setup(s){const e=s;return(t,a)=>(T(),L("h3",{"data-slot":"card-title",class:de(c(fe)("leading-none font-semibold",e.class))},[Z(t.$slots,"default")],2))}});Object.assign(pl,{__name:"UiCardTitle"});const dl={class:"flex items-center justify-between gap-2 mb-1.5"},fl={class:"text-sm font-medium leading-snug"},hl={class:"text-muted-foreground"},gl={key:0,class:"mt-2 flex items-center gap-1.5 text-xs text-destructive"},ml=B({__name:"Card",props:{task:{},blockedBy:{}},emits:["click"],setup(s,{emit:e}){const t=s,a=e,n=M(()=>{switch(t.task.category){case"setup":return{label:"Setup",variant:"secondary"};case"feature":return{label:"Feature",variant:"default"};case"integration":return{label:"Integration",variant:"outline"};case"testing":return{label:"Testing",variant:"secondary"};case"documentation":return{label:"Docs",variant:"secondary"};default:return{label:t.task.category,variant:"secondary"}}}),i=M(()=>{switch(t.task.priority){case"critical":return{icon:Nn,class:"text-destructive",label:"Critical"};case"high":return{icon:Nn,class:"text-orange-500",label:"High"};case"medium":return{icon:On,class:"text-muted-foreground",label:"Medium"};case"low":return{icon:ga,class:"text-muted-foreground",label:"Low"};default:return{icon:On,class:"text-muted-foreground",label:"Unknown"}}}),l=M(()=>t.blockedBy&&t.blockedBy.length>0),u=M(()=>{const f=t.task.id.match(/(\d+)$/)?.[1];return f?parseInt(f,10):0}),o=M(()=>t.blockedBy?.length??0);function d(){a("click",t.task)}return(p,f)=>(T(),se(c(al),{class:de(["cursor-pointer py-0 gap-0 transition-all hover:shadow-md hover:border-primary/50",{"opacity-60":c(l)}]),onClick:d},{default:C(()=>[S(c(il),{class:"p-2.5"},{default:C(()=>[$("div",dl,[S(c(ns),{variant:c(n).variant,class:"text-xs"},{default:C(()=>[Ce(te(c(n).label),1)]),_:1},8,["variant"]),(T(),se(ls(c(i).icon),{class:de(["size-4",c(i).class]),title:c(i).label},null,8,["class","title"]))]),$("h4",fl,[$("span",hl,"#"+te(c(u)),1),Ce(" "+te(s.task.title),1)]),c(l)?(T(),L("div",gl,[S(c(ss),{class:"size-3.5"}),$("span",null,"Blocked by "+te(c(o))+" task"+te(c(o)===1?"":"s"),1)])):Te("",!0)]),_:1})]),_:1},8,["class"]))}}),kl=Object.assign(ml,{__name:"TasksCard"}),bl={class:"flex h-full min-w-56 flex-1 flex-col overflow-hidden rounded-lg border border-border bg-card"},_l={class:"text-sm font-medium"},xl={class:"ml-auto text-xs text-muted-foreground"},yl={class:"scrollbar-hide min-h-0 flex-1 overflow-y-auto p-1.5"},Tl={class:"space-y-1.5"},wl={key:0,class:"py-8 text-center text-sm text-muted-foreground"},vl=B({__name:"Column",props:{status:{},tasks:{},blockedByMap:{}},emits:["taskClick"],setup(s,{emit:e}){const t=s,a=e,n=M(()=>{switch(t.status){case"pending":return{label:"Pending",icon:$n,headerClass:"bg-muted/50",iconClass:"text-muted-foreground"};case"in_progress":return{label:"In Progress",icon:ka,headerClass:"bg-blue-500/10",iconClass:"text-blue-500"};case"completed":return{label:"Completed",icon:Ks,headerClass:"bg-green-500/10",iconClass:"text-green-500"};default:return{label:t.status,icon:$n,headerClass:"bg-muted/50",iconClass:"text-muted-foreground"}}});function i(u){return t.blockedByMap?.get(u)??[]}function l(u){a("taskClick",u)}return(u,o)=>{const d=kl;return T(),L("div",bl,[$("div",{class:de(["flex items-center gap-2 rounded-t-lg border-b border-border px-3 py-2",c(n).headerClass])},[(T(),se(ls(c(n).icon),{class:de(["size-4",c(n).iconClass])},null,8,["class"])),$("h3",_l,te(c(n).label),1),$("span",xl,te(s.tasks.length),1)],2),$("div",yl,[$("div",Tl,[(T(!0),L(is,null,os(s.tasks,p=>(T(),se(d,{key:p.id,task:p,"blocked-by":i(p.id),onClick:l},null,8,["task","blocked-by"]))),128)),s.tasks.length===0?(T(),L("div",wl," No tasks ")):Te("",!0)])])])}}}),Sl=Object.assign(ha(vl,[["__scopeId","data-v-a1317eba"]]),{__name:"TasksColumn"}),Al={class:"flex h-full gap-3 overflow-x-auto pb-2"},El=B({__name:"Board",props:{tasks:{}},emits:["taskClick"],setup(s,{emit:e}){const t=s,a=e;function n(f){const b=f.id.match(/(\d+)$/)?.[1];return b?parseInt(b,10):0}const i=M(()=>t.tasks.filter(f=>f.status==="pending").sort((f,k)=>n(f)-n(k))),l=M(()=>t.tasks.filter(f=>f.status==="in_progress").sort((f,k)=>n(f)-n(k))),u=M(()=>t.tasks.filter(f=>f.status==="completed").sort((f,k)=>{const b=f.completedAt?new Date(f.completedAt).getTime():0;return(k.completedAt?new Date(k.completedAt).getTime():0)-b})),o=M(()=>{const f=new Map,k=new Set(u.value.map(b=>b.id));for(const b of t.tasks)if(b.dependencies.length>0){const y=b.dependencies.filter(D=>!k.has(D));y.length>0&&f.set(b.id,y)}return f}),d=[{status:"pending",tasks:i},{status:"in_progress",tasks:l},{status:"completed",tasks:u}];function p(f){a("taskClick",f)}return(f,k)=>{const b=Sl;return T(),L("div",Al,[(T(),L(is,null,os(d,y=>S(b,{key:y.status,status:y.status,tasks:y.tasks.value,"blocked-by-map":c(o),onTaskClick:p},null,8,["status","tasks","blocked-by-map"])),64))])}}}),Rl=Object.assign(El,{__name:"TasksBoard"}),Cl=B({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,a=e,n=Ct(t,"class"),i=Bs(n,a);return(l,u)=>(T(),se(c(Ea),It({"data-slot":"tabs"},c(i),{class:c(fe)("flex flex-col gap-2",t.class)}),{default:C(o=>[Z(l.$slots,"default",ra(la(o)))]),_:3},16,["class"]))}}),Il=Object.assign(Cl,{__name:"UiTabs"}),Ll=B({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(s){const e=s,t=Ct(e,"class");return(a,n)=>(T(),se(c(Ca),It({"data-slot":"tabs-content",class:c(fe)("flex-1 outline-none",e.class)},c(t)),{default:C(()=>[Z(a.$slots,"default")]),_:3},16,["class"]))}}),Yt=Object.assign(Ll,{__name:"UiTabsContent"}),Dl=B({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(s){const e=s,t=Ct(e,"class");return(a,n)=>(T(),se(c(La),It({"data-slot":"tabs-list"},c(t),{class:c(fe)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e.class)}),{default:C(()=>[Z(a.$slots,"default")]),_:3},16,["class"]))}}),Pl=Object.assign(Dl,{__name:"UiTabsList"}),Ol=B({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(s){const e=s,t=Ct(e,"class"),a=Fs(t);return(n,i)=>(T(),se(c(Pa),It({"data-slot":"tabs-trigger",class:c(fe)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e.class)},c(a)),{default:C(()=>[Z(n.$slots,"default")]),_:3},16,["class"]))}}),Zt=Object.assign(Ol,{__name:"UiTabsTrigger"}),$l={class:"h-full p-4 md:p-6"},Ml={key:0,class:"flex h-full items-center justify-center"},Nl={class:"flex flex-col items-center gap-4"},zl={key:1,class:"flex h-full items-center justify-center"},Bl={class:"flex max-w-md flex-col items-center gap-4 text-center"},Fl={class:"text-sm text-muted-foreground"},Ul={class:"flex gap-3"},ql={key:2,class:"mx-auto max-w-6xl space-y-6"},Hl={class:"space-y-2"},Gl={class:"text-2xl font-bold tracking-tight"},jl={key:0,class:"text-xs text-muted-foreground"},Vl={class:"rounded-lg border border-border bg-card p-4 md:p-6"},Wl={key:0,class:"h-[calc(100vh-280px)] min-h-[400px]"},Yl={key:1,class:"py-12 text-center"},Zl={class:"h-[calc(100vh-300px)] min-h-[440px] motion-safe:transition-[opacity,transform] motion-safe:duration-200 motion-safe:ease-[var(--ease-out-cubic)] motion-reduce:transition-none"},Kt="prd-viewer-tab",Ge="task",je="taskPrd",ai=B({__name:"[prd]",setup(s){function e(g){return g==="document"||g==="board"||g==="graph"}function t(g){if(typeof g=="string"){const m=g.trim();return m.length>0?m:null}if(Array.isArray(g)&&g.length>0){const m=g[0];if(typeof m=="string"){const v=m.trim();return v.length>0?v:null}}return null}const a=ia(),n=oa(),{selectRepo:i}=Gs(),{fetchDocument:l,fetchTasks:u,fetchProgress:o,fetchTaskCommits:d,fetchPrdGraph:p}=js(),{showError:f}=Vs(),k=M(()=>a.params.repo),b=M(()=>a.params.prd),y=U(null),D=U(null),oe=U(null),P=U(!0),O=U(null),I=U("document"),E=U(null),X=U(!1),K=U(null),he=U({}),ge=U(null),G=U(null),me=U(!1),F=U([]),Ie=M(()=>t(a.query[Ge])),Me=M(()=>t(a.query[je])),Ne=M(()=>Ie.value?{taskId:Ie.value,prdSlug:Me.value||b.value}:null);function We(g,m){he.value={...he.value,[g]:m}}async function pt(g){if(g===b.value)return D.value;if(Object.prototype.hasOwnProperty.call(he.value,g))return he.value[g]??null;const m=await u(g);return We(g,m),m}function Pt(){const g={};for(const[m,v]of Object.entries(a.query))if(!(m===Ge||m===je)){if(typeof v=="string"){g[m]=v;continue}if(Array.isArray(v)){const W=v.filter(J=>typeof J=="string");W.length>0&&(g[m]=W)}}return g}async function ze(g,m=null){const v=Pt();g&&(v[Ge]=g,m&&m!==b.value&&(v[je]=m));const W=typeof v[Ge]=="string"?v[Ge]:null,J=typeof v[je]=="string"?v[je]:null;Ie.value===W&&Me.value===J||await n.replace({query:v})}async function dt(g,m){ge.value=g,G.value=m,me.value=!0,F.value=[],await ze(g.id,m),F.value=await d(m,g.id)}async function Ye(){const g=Ne.value;if(!g){ge.value=null,G.value=null,F.value=[],me.value=!1;return}const v=(await pt(g.prdSlug))?.tasks.find(J=>J.id===g.taskId);if(!v){ge.value=null,G.value=null,F.value=[],me.value=!1,f("Task unavailable",`Could not find ${g.taskId} in ${g.prdSlug}.`),await ze(null);return}const W=ge.value?.id===v.id&&G.value===g.prdSlug;ge.value=v,G.value=g.prdSlug,me.value=!0,W||(F.value=await d(g.prdSlug,v.id))}const q=M(()=>{const g=new Map,m=G.value||b.value,v=m===b.value?D.value:he.value[m]??null;if(!v?.tasks)return g;for(const W of v.tasks)g.set(W.id,W.title);return g});function Ze(g){g.key===Kt&&g.newValue&&e(g.newValue)&&(I.value=g.newValue)}vt(()=>{const g=localStorage.getItem(Kt);g&&e(g)&&(I.value=g),window.addEventListener("storage",Ze)}),rs(()=>{window.removeEventListener("storage",Ze)}),De(I,g=>{localStorage.setItem(Kt,g)});const j=ca("fileChangeEvent",U(null));async function ft(){const g=await l(b.value);g&&(y.value=g)}async function z(){const[g,m]=await Promise.all([u(b.value),o(b.value)]);D.value=g,oe.value=m,We(b.value,g)}async function we(g=!1){X.value=!0;try{if(!g&&E.value?.prdSlug===b.value)return;const m=await p(b.value);if(!m){K.value="Failed to load PRD graph.";return}E.value=m,K.value=null}finally{X.value=!1}}async function Be(g=!1){I.value==="graph"&&await we(g)}async function ke(){P.value=!0,O.value=null,K.value=null,E.value=null,he.value={};try{i(k.value);const[g,m,v]=await Promise.all([l(b.value),u(b.value),o(b.value)]);if(!g){O.value=`PRD "${b.value}" not found in this repository.`;return}y.value=g,D.value=m,oe.value=v,We(b.value,m),!m&&I.value==="board"&&(I.value="document"),await Be(),await Ye()}catch(g){const m=g;m.statusCode===404?O.value=`PRD "${b.value}" not found. Check if the file exists in docs/prd/.`:m.statusCode===500?(O.value="Server error while loading the PRD. Check the file format.",f("Server error",m.data?.message||"Failed to read PRD file")):(O.value="Failed to load PRD document. Please try again.",f("Load failed","Could not fetch the PRD document"))}finally{P.value=!1}}De(I,async g=>{g==="graph"&&await Be()}),De(()=>[a.query[Ge],a.query[je],b.value],async()=>{P.value||await Ye()}),De(me,async g=>{!g&&Ne.value&&await ze(null)}),De(()=>j.value,async g=>{if(!g)return;if(g.category==="prd"){await ft(),I.value==="graph"&&await we(!0);return}if(g.category!=="tasks"&&g.category!=="progress")return;const m=g.path?.includes(`/${b.value}/`)??!1;m&&(await z(),E.value=null),I.value==="graph"&&m&&await we(!0)}),vt(ke),De([k,b],ke);async function ht(g){await dt(g,b.value)}async function Ke(g){const v=(await pt(g.prdSlug))?.tasks.find(W=>W.id===g.taskId);if(!v){f("Task unavailable",`Could not find ${g.taskId} in ${g.prdSlug}.`);return}await dt(v,g.prdSlug)}return(g,m)=>{const v=Ns,W=Fa,J=nl,Qe=Rl,Xe=Xs,Ee=Qs;return T(),L("div",$l,[c(P)?(T(),L("div",Ml,[$("div",Nl,[S(c(Us),{class:"size-8 animate-spin text-primary"}),m[2]||(m[2]=$("p",{class:"text-sm text-muted-foreground"},"Loading PRD...",-1))])])):c(O)?(T(),L("div",zl,[$("div",Bl,[S(c(ss),{class:"size-12 text-destructive"}),m[5]||(m[5]=$("h2",{class:"text-lg font-semibold"},"Error Loading PRD",-1)),$("p",Fl,te(c(O)),1),$("div",Ul,[S(c(Dn),{variant:"outline",size:"sm",onClick:ke},{default:C(()=>[S(c(qs),{class:"mr-2 size-4"}),m[3]||(m[3]=Ce(" Retry ",-1))]),_:1}),S(v,{to:"/"},{default:C(()=>[S(c(Dn),{variant:"ghost",size:"sm"},{default:C(()=>[...m[4]||(m[4]=[Ce(" Go back home ",-1)])]),_:1})]),_:1})])])])):c(y)?(T(),L("div",ql,[$("div",Hl,[$("h1",Gl,te(c(y).name),1),S(W,{metadata:c(y).metadata},null,8,["metadata"])]),S(c(Il),{modelValue:c(I),"onUpdate:modelValue":m[0]||(m[0]=Re=>Mn(I)?I.value=Re:null),class:"w-full"},{default:C(()=>[S(c(Pl),null,{default:C(()=>[S(c(Zt),{value:"document",class:"gap-2"},{default:C(()=>[S(c(Ws),{class:"size-4"}),m[6]||(m[6]=Ce(" Document ",-1))]),_:1}),S(c(Zt),{value:"board",class:"gap-2",disabled:!c(D)},{default:C(()=>[S(c(zn),{class:"size-4"}),m[7]||(m[7]=Ce(" Task Board ",-1)),c(D)?(T(),L("span",jl," ("+te(c(D).tasks.length)+") ",1)):Te("",!0)]),_:1},8,["disabled"]),S(c(Zt),{value:"graph",class:"gap-2"},{default:C(()=>[S(c(Hs),{class:"size-4"}),m[8]||(m[8]=Ce(" Graph ",-1))]),_:1})]),_:1}),S(c(Yt),{value:"document",class:"mt-4"},{default:C(()=>[$("div",Vl,[S(J,{content:c(y).content},null,8,["content"])])]),_:1}),S(c(Yt),{value:"board",class:"mt-4"},{default:C(()=>[c(D)?(T(),L("div",Wl,[S(Qe,{tasks:c(D).tasks,onTaskClick:ht},null,8,["tasks"])])):(T(),L("div",Yl,[S(c(zn),{class:"mx-auto size-12 text-muted-foreground/50"}),m[9]||(m[9]=$("p",{class:"mt-4 text-muted-foreground"}," No tasks found for this PRD ",-1)),m[10]||(m[10]=$("p",{class:"mt-1 text-sm text-muted-foreground/70"}," Task state has not been generated for this PRD yet. ",-1))]))]),_:1}),S(c(Yt),{value:"graph",class:"mt-4"},{default:C(()=>[$("div",Zl,[S(Xe,{payload:c(E),scope:"prd",loading:c(X),error:c(K),onTaskClick:Ke},null,8,["payload","loading","error"])])]),_:1})]),_:1},8,["modelValue"])])):Te("",!0),S(Ee,{open:c(me),"onUpdate:open":m[1]||(m[1]=Re=>Mn(me)?me.value=Re:null),task:c(ge),"task-titles":c(q),commits:c(F),"repo-id":c(k),"task-prd-slug":c(G),"current-prd-slug":c(b)},null,8,["open","task","task-titles","commits","repo-id","task-prd-slug","current-prd-slug"])])}}});export{ai as default};
|