Files
skills-here-run-place/dist/client/_astro/SkillEditor.CYIrd0Il.js
Alejandro Martinez f09af719cf Initial commit
2026-02-12 02:04:10 +01:00

66 lines
52 KiB
JavaScript

import{v as H,a as Y,b as de,w as Me}from"./runtime-dom.esm-bundler.ALO2-icn.js";import{_ as qe}from"./_plugin-vue_export-helper.DlAUqK2U.js";import{c as C,a as p,w as $,b as Q,t as O,F as ge,r as fe,d as ke,e as De,f as y,g as He,h as Oe,o as P,n as Ze}from"./runtime-core.esm-bundler.D9KZBfyO.js";function ne(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var E=ne();function Se(s){E=s}var L={exec:()=>null};function g(s,e=""){let r=typeof s=="string"?s:s.source,n={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(w.caret,"$1"),r=r.replace(t,l),n},getRegex:()=>new RegExp(r,e)};return n}var Ne=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),w={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)}}>`)},je=/^(?:[ \t]*(?:\n|$))+/,Ve=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ue=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,V=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,se=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Te=g(Re).replace(/bull/g,se).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(),Fe=g(Re).replace(/bull/g,se).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(),le=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ge=/^[^\n]+/,ie=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Je=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ie).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),We=g(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,se).getRegex(),X="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",ae=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Xe=g("^ {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",ae).replace("tag",X).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$e=g(le).replace("hr",V).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",X).getRegex(),Ke=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$e).getRegex(),oe={blockquote:Ke,code:Ve,def:Je,fences:Ue,heading:Qe,hr:V,html:Xe,lheading:Te,list:We,newline:je,paragraph:$e,table:L,text:Ge},xe=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V).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",X).getRegex(),Ye={...oe,lheading:Fe,table:xe,paragraph:g(le).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xe).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",X).getRegex()},et={...oe,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae).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:L,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(le).replace("hr",V).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Te).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,rt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ae=/^( {2,}|\\)\n(?!\s*$)/,nt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,K=/[\p{P}\p{S}]/u,ce=/[\s\p{P}\p{S}]/u,ze=/[^\s\p{P}\p{S}]/u,st=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ce).getRegex(),Ie=/(?!~)[\p{P}\p{S}]/u,lt=/(?!~)[\s\p{P}\p{S}]/u,it=/(?:[^\s\p{P}\p{S}]|~)/u,Ce=/(?![*_])[\p{P}\p{S}]/u,at=/(?![*_])[\s\p{P}\p{S}]/u,ot=/(?:[^\s\p{P}\p{S}]|[*_])/u,ct=g(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ne?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Pe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,pt=g(Pe,"u").replace(/punct/g,K).getRegex(),ut=g(Pe,"u").replace(/punct/g,Ie).getRegex(),Le="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ht=g(Le,"gu").replace(/notPunctSpace/g,ze).replace(/punctSpace/g,ce).replace(/punct/g,K).getRegex(),dt=g(Le,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,lt).replace(/punct/g,Ie).getRegex(),gt=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ze).replace(/punctSpace/g,ce).replace(/punct/g,K).getRegex(),ft=g(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ce).getRegex(),kt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",xt=g(kt,"gu").replace(/notPunctSpace/g,ot).replace(/punctSpace/g,at).replace(/punct/g,Ce).getRegex(),bt=g(/\\(punct)/,"gu").replace(/punct/g,K).getRegex(),mt=g(/^<(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(),wt=g(ae).replace("(?:-->|$)","-->").getRegex(),yt=g("^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",wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),G=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,vt=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",G).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Be=g(/^!?\[(label)\]\[(ref)\]/).replace("label",G).replace("ref",ie).getRegex(),Ee=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",ie).getRegex(),St=g("reflink|nolink(?!\\()","g").replace("reflink",Be).replace("nolink",Ee).getRegex(),be=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pe={_backpedal:L,anyPunctuation:bt,autolink:mt,blockSkip:ct,br:Ae,code:rt,del:L,delLDelim:L,delRDelim:L,emStrongLDelim:pt,emStrongRDelimAst:ht,emStrongRDelimUnd:gt,escape:tt,link:vt,nolink:Ee,punctuation:st,reflink:Be,reflinkSearch:St,tag:yt,text:nt,url:L},Rt={...pe,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",G).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",G).getRegex()},ee={...pe,emStrongRDelimAst:dt,emStrongLDelim:ut,delLDelim:ft,delRDelim:xt,url:g(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",be).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:g(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",be).getRegex()},Tt={...ee,br:g(Ae).replace("{2,}","*").getRegex(),text:g(ee.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},F={normal:oe,gfm:Ye,pedantic:et},Z={normal:pe,gfm:ee,breaks:Tt,pedantic:Rt},$t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},me=s=>$t[s];function A(s,e){if(e){if(w.escapeTest.test(s))return s.replace(w.escapeReplace,me)}else if(w.escapeTestNoEncode.test(s))return s.replace(w.escapeReplaceNoEncode,me);return s}function we(s){try{s=encodeURI(s).replace(w.percentDecode,"%")}catch{return null}return s}function ye(s,e){let r=s.replace(w.findPipe,(i,l,o)=>{let a=!1,u=l;for(;--u>=0&&o[u]==="\\";)a=!a;return a?"|":" |"}),n=r.split(w.splitPipe),t=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;t<n.length;t++)n[t]=n[t].trim().replace(w.slashPipe,"|");return n}function N(s,e,r){let n=s.length;if(n===0)return"";let t=0;for(;t<n&&s.charAt(n-t-1)===e;)t++;return s.slice(0,n-t)}function At(s,e){if(s.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])r++;else if(s[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function zt(s,e=0){let r=e,n="";for(let t of s)if(t===" "){let i=4-r%4;n+=" ".repeat(i),r+=i}else n+=t,r++;return n}function ve(s,e,r,n,t){let i=e.href,l=e.title||null,o=s[1].replace(t.other.outputLinkReplace,"$1");n.state.inLink=!0;let a={type:s[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,a}function It(s,e,r){let n=s.match(r.other.indentCodeCompensation);if(n===null)return e;let t=n[1];return e.split(`
`).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[o]=l;return o.length>=t.length?i.slice(t.length):i}).join(`
`)}var J=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 r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:N(r,`
`)}}}fences(s){let e=this.rules.block.fences.exec(s);if(e){let r=e[0],n=It(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(s){let e=this.rules.block.heading.exec(s);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=N(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(s){let e=this.rules.block.hr.exec(s);if(e)return{type:"hr",raw:N(e[0],`
`)}}blockquote(s){let e=this.rules.block.blockquote.exec(s);if(e){let r=N(e[0],`
`).split(`
`),n="",t="",i=[];for(;r.length>0;){let l=!1,o=[],a;for(a=0;a<r.length;a++)if(this.rules.other.blockquoteStart.test(r[a]))o.push(r[a]),l=!0;else if(!l)o.push(r[a]);else break;r=r.slice(a);let u=o.join(`
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
${u}`:u,t=t?`${t}
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=d,r.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let x=h,k=x.raw+`
`+r.join(`
`),v=this.blockquote(k);i[i.length-1]=v,n=n.substring(0,n.length-x.raw.length)+v.raw,t=t.substring(0,t.length-x.text.length)+v.text;break}else if(h?.type==="list"){let x=h,k=x.raw+`
`+r.join(`
`),v=this.list(k);i[i.length-1]=v,n=n.substring(0,n.length-h.raw.length)+v.raw,t=t.substring(0,t.length-x.raw.length)+v.raw,r=k.substring(i.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:t}}}list(s){let e=this.rules.block.list.exec(s);if(e){let r=e[1].trim(),n=r.length>1,t={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let i=this.rules.other.listItemRegex(r),l=!1;for(;s;){let a=!1,u="",c="";if(!(e=i.exec(s))||this.rules.block.hr.test(s))break;u=e[0],s=s.substring(u.length);let d=zt(e[2].split(`
`,1)[0],e[1].length),h=s.split(`
`,1)[0],x=!d.trim(),k=0;if(this.options.pedantic?(k=2,c=d.trimStart()):x?k=e[1].length+1:(k=d.search(this.rules.other.nonSpaceChar),k=k>4?1:k,c=d.slice(k),k+=e[1].length),x&&this.rules.other.blankLine.test(h)&&(u+=h+`
`,s=s.substring(h.length+1),a=!0),!a){let v=this.rules.other.nextBulletRegex(k),_=this.rules.other.hrRegex(k),T=this.rules.other.fencesBeginRegex(k),U=this.rules.other.headingBeginRegex(k),M=this.rules.other.htmlBeginRegex(k),q=this.rules.other.blockquoteBeginRegex(k);for(;s;){let z=s.split(`
`,1)[0],I;if(h=z,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),I=h):I=h.replace(this.rules.other.tabCharGlobal," "),T.test(h)||U.test(h)||M.test(h)||q.test(h)||v.test(h)||_.test(h))break;if(I.search(this.rules.other.nonSpaceChar)>=k||!h.trim())c+=`
`+I.slice(k);else{if(x||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(d)||U.test(d)||_.test(d))break;c+=`
`+h}x=!h.trim(),u+=z+`
`,s=s.substring(z.length+1),d=I.slice(k)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0)),t.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=u}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a of t.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(a.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};a.checked=c.checked,t.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!t.loose){let u=a.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));t.loose=c}}if(t.loose)for(let a of t.items){a.loose=!0;for(let u of a.tokens)u.type==="text"&&(u.type="paragraph")}return t}}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 r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:n,title:t}}}table(s){let e=this.rules.block.table.exec(s);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=ye(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let l of n)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<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of t)i.rows.push(ye(l,i.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[a]})));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 r=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}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 r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=N(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=At(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 n=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),ve(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(s,e){let r;if((r=this.rules.inline.reflink.exec(s))||(r=this.rules.inline.nolink.exec(s))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[n.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return ve(r,t,r[0],this.lexer,this.rules)}}emStrong(s,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(s);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...n[0]].length-1,i,l,o=t,a=0,u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*s.length+t);(n=u.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(l=[...i].length,n[3]||n[4]){o+=l;continue}else if((n[5]||n[6])&&t%3&&!((t+l)%3)){a+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+a);let c=[...n[0]][0].length,d=s.slice(0,t+n.index+c+l);if(Math.min(t,l)%2){let x=d.slice(1,-1);return{type:"em",raw:d,text:x,tokens:this.lexer.inlineTokens(x)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(s){let e=this.rules.inline.code.exec(s);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(s){let e=this.rules.inline.br.exec(s);if(e)return{type:"br",raw:e[0]}}del(s,e,r=""){let n=this.rules.inline.delLDelim.exec(s);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let t=[...n[0]].length-1,i,l,o=t,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*s.length+t);(n=a.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(l=[...i].length,l!==t))continue;if(n[3]||n[4]){o+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o);let u=[...n[0]][0].length,c=s.slice(0,t+n.index+u+l),d=c.slice(t,-t);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(s){let e=this.rules.inline.autolink.exec(s);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(s){let e;if(e=this.rules.inline.url.exec(s)){let r,n;if(e[2]==="@")r=e[0],n="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(s){let e=this.rules.inline.text.exec(s);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},S=class te{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 J,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 r={other:w,block:F.normal,inline:Z.normal};this.options.pedantic?(r.block=F.pedantic,r.inline=Z.pedantic):this.options.gfm&&(r.block=F.gfm,this.options.breaks?r.inline=Z.breaks:r.inline=Z.gfm),this.tokenizer.rules=r}static get rules(){return{block:F,inline:Z}}static lex(e,r){return new te(r).lex(e)}static lexInline(e,r){return new te(r).inlineTokens(e)}lex(e){e=e.replace(w.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){for(this.options.pedantic&&(e=e.replace(w.tabCharGlobal," ").replace(w.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(l=>(t=l.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=r.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
`:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.text,this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},r.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),r.push(t);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0,o=e.slice(1),a;this.options.extensions.startBlock.forEach(u=>{a=u.call({lexer:this},o),typeof a=="number"&&a>=0&&(l=Math.min(l,a))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(i))){let l=r.at(-1);n&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t),n=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);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,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let n=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,t.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=t[2]?t[2].length:0,n=n.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let l=!1,o="";for(;e;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,n,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e,n,o)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),h;this.options.extensions.startInline.forEach(x=>{h=x.call({lexer:this},d),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(u)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},W=class{options;parser;constructor(s){this.options=s||E}space(s){return""}code({text:s,lang:e,escaped:r}){let n=(e||"").match(w.notSpaceStart)?.[0],t=s.replace(w.endingNewline,"")+`
`;return n?'<pre><code class="language-'+A(n)+'">'+(r?t:A(t,!0))+`</code></pre>
`:"<pre><code>"+(r?t:A(t,!0))+`</code></pre>
`}blockquote({tokens:s}){return`<blockquote>
${this.parser.parse(s)}</blockquote>
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:e}){return`<h${e}>${this.parser.parseInline(s)}</h${e}>
`}hr(s){return`<hr>
`}list(s){let e=s.ordered,r=s.start,n="";for(let l=0;l<s.items.length;l++){let o=s.items[l];n+=this.listitem(o)}let t=e?"ol":"ul",i=e&&r!==1?' start="'+r+'"':"";return"<"+t+i+`>
`+n+"</"+t+`>
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
`}table(s){let e="",r="";for(let t=0;t<s.header.length;t++)r+=this.tablecell(s.header[t]);e+=this.tablerow({text:r});let n="";for(let t=0;t<s.rows.length;t++){let i=s.rows[t];r="";for(let l=0;l<i.length;l++)r+=this.tablecell(i[l]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+n+`</table>
`}tablerow({text:s}){return`<tr>
${s}</tr>
`}tablecell(s){let e=this.parser.parseInline(s.tokens),r=s.header?"th":"td";return(s.align?`<${r} align="${s.align}">`:`<${r}>`)+e+`</${r}>
`}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>${A(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:r}){let n=this.parser.parseInline(r),t=we(s);if(t===null)return n;s=t;let i='<a href="'+s+'"';return e&&(i+=' title="'+A(e)+'"'),i+=">"+n+"</a>",i}image({href:s,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let t=we(s);if(t===null)return A(r);s=t;let i=`<img src="${s}" alt="${r}"`;return e&&(i+=` title="${A(e)}"`),i+=">",i}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:A(s.text)}},ue=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}},R=class re{options;renderer;textRenderer;constructor(e){this.options=e||E,this.options.renderer=this.options.renderer||new W,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ue}static parse(e,r){return new re(r).parse(e)}static parseInline(e,r){return new re(r).parseInline(e)}parse(e){let r="";for(let n=0;n<e.length;n++){let t=e[n];if(this.options.extensions?.renderers?.[t.type]){let l=t,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=o||"";continue}}let i=t;switch(i.type){case"space":{r+=this.renderer.space(i);break}case"hr":{r+=this.renderer.hr(i);break}case"heading":{r+=this.renderer.heading(i);break}case"code":{r+=this.renderer.code(i);break}case"table":{r+=this.renderer.table(i);break}case"blockquote":{r+=this.renderer.blockquote(i);break}case"list":{r+=this.renderer.list(i);break}case"checkbox":{r+=this.renderer.checkbox(i);break}case"html":{r+=this.renderer.html(i);break}case"def":{r+=this.renderer.def(i);break}case"paragraph":{r+=this.renderer.paragraph(i);break}case"text":{r+=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 r}parseInline(e,r=this.renderer){let n="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}let l=i;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},j=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?S.lex:S.lexInline}provideParser(){return this.block?R.parse:R.parseInline}},Ct=class{defaults=ne();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=R;Renderer=W;TextRenderer=ue;Lexer=S;Tokenizer=J;Hooks=j;constructor(...s){this.use(...s)}walkTokens(s,e){let r=[];for(let n of s)switch(r=r.concat(e.call(this,n)),n.type){case"table":{let t=n;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=n;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=n;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let o=t.renderer.apply(this,l);return o===!1&&(o=i.apply(this,l)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),n.extensions=e),r.renderer){let t=this.defaults.renderer||new W(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,o=r.renderer[l],a=t[l];t[l]=(...u)=>{let c=o.apply(t,u);return c===!1&&(c=a.apply(t,u)),c||""}}n.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new J(this.defaults);for(let i in r.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,o=r.tokenizer[l],a=t[l];t[l]=(...u)=>{let c=o.apply(t,u);return c===!1&&(c=a.apply(t,u)),c}}n.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new j;for(let i in r.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,o=r.hooks[l],a=t[l];j.passThroughHooks.has(i)?t[l]=u=>{if(this.defaults.async&&j.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await o.call(t,u);return a.call(t,d)})();let c=o.call(t,u);return a.call(t,c)}:t[l]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(t,u);return d===!1&&(d=await a.apply(t,u)),d})();let c=o.apply(t,u);return c===!1&&(c=a.apply(t,u)),c}}n.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(l){let o=[];return o.push(i.call(this,l)),t&&(o=o.concat(t.call(this,l))),o}}this.defaults={...this.defaults,...n}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return S.lex(s,e??this.defaults)}parser(s,e){return R.parse(s,e??this.defaults)}parseMarkdown(s){return(e,r)=>{let n={...r},t={...this.defaults,...n},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&n.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(t.hooks&&(t.hooks.options=t,t.hooks.block=s),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,o=await(t.hooks?await t.hooks.provideLexer():s?S.lex:S.lexInline)(l,t),a=t.hooks?await t.hooks.processAllTokens(o):o;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let u=await(t.hooks?await t.hooks.provideParser():s?R.parse:R.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(u):u})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer():s?S.lex:S.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let o=(t.hooks?t.hooks.provideParser():s?R.parse:R.parseInline)(l,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(l){return i(l)}}}onError(s,e){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,s){let n="<p>An error occurred:</p><pre>"+A(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},B=new Ct;function f(s,e){return B.parse(s,e)}f.options=f.setOptions=function(s){return B.setOptions(s),f.defaults=B.defaults,Se(f.defaults),f};f.getDefaults=ne;f.defaults=E;f.use=function(...s){return B.use(...s),f.defaults=B.defaults,Se(f.defaults),f};f.walkTokens=function(s,e){return B.walkTokens(s,e)};f.parseInline=B.parseInline;f.Parser=R;f.parser=R.parse;f.Renderer=W;f.TextRenderer=ue;f.Lexer=S;f.lexer=S.lex;f.Tokenizer=J;f.Hooks=j;f.parse=f;f.options;f.setOptions;f.use;f.walkTokens;f.parseInline;R.parse;S.lex;const Pt=De({__name:"SkillEditor",props:{mode:{},slug:{},initialName:{},initialDescription:{},initialAllowedTools:{},initialArgumentHint:{},initialModel:{},initialUserInvocable:{type:Boolean},initialDisableModelInvocation:{type:Boolean},initialContext:{},initialAgent:{},initialHooks:{},initialBody:{},availableTools:{},availableModels:{}},setup(s,{expose:e}){e();const r=s,n=r.availableTools??["Bash","Read","Write","Edit","Glob","Grep","WebFetch","WebSearch","Task","NotebookEdit"],t=r.availableModels??[{id:"claude-opus-4-6",display_name:"Claude Opus 4.6"},{id:"claude-sonnet-4-5-20250929",display_name:"Claude Sonnet 4.5"},{id:"claude-haiku-4-5-20251001",display_name:"Claude Haiku 4.5"}],i=y(r.initialName||""),l=y(r.initialDescription||""),o=y(r.initialArgumentHint||""),a=y(r.initialModel||""),u=y(r.initialUserInvocable??!0),c=y(r.initialDisableModelInvocation??!1),d=y(r.initialContext||""),h=y(r.initialAgent||""),x=y(r.initialHooks||""),k=y(r.initialBody||""),v=y(!1),_=y(""),T=y(new Set(r.initialAllowedTools?r.initialAllowedTools.split(",").map(b=>b.trim()).filter(Boolean):[]));function U(b){T.value.has(b)?T.value.delete(b):T.value.add(b),T.value=new Set(T.value)}const M=Oe(()=>r.mode==="edit"&&r.slug?r.slug:i.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||"my-skill");let q=y(""),z;He(k,b=>{clearTimeout(z),z=setTimeout(async()=>{q.value=await f(b||"")},300)},{immediate:!0});function I(){const b=[...T.value],m=["---"];if(m.push(`name: ${i.value}`),l.value&&m.push(`description: ${l.value}`),o.value&&m.push(`argument-hint: ${o.value}`),b.length>0&&m.push(`allowed-tools: ${b.join(", ")}`),a.value&&m.push(`model: ${a.value}`),u.value===!1&&m.push("user-invocable: false"),c.value&&m.push("disable-model-invocation: true"),d.value&&m.push(`context: ${d.value}`),h.value&&m.push(`agent: ${h.value}`),x.value.trim())try{const D=JSON.parse(x.value.trim());m.push(`hooks: ${JSON.stringify(D)}`)}catch{}return m.push("---"),m.join(`
`)+`
`+k.value.trim()+`
`}async function _e(){v.value=!0,_.value="";try{const b=I();if(r.mode==="create"){const m=await fetch("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:M.value,content:b})});if(!m.ok){const D=await m.json();throw new Error(D.error||"Failed to create skill")}window.location.href=`/${M.value}`}else{const m=await fetch(`/api/skills/${r.slug}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:b})});if(!m.ok){const D=await m.json();throw new Error(D.error||"Failed to update skill")}window.location.href=`/${r.slug}`}}catch(b){_.value=b instanceof Error?b.message:"Something went wrong"}finally{v.value=!1}}const he={props:r,AVAILABLE_TOOLS:n,AVAILABLE_MODELS:t,name:i,description:l,argumentHint:o,model:a,userInvocable:u,disableModelInvocation:c,context:d,agent:h,hooksJson:x,body:k,saving:v,error:_,selectedTools:T,toggleTool:U,computedSlug:M,get previewHtml(){return q},set previewHtml(b){q=b},get debounceTimer(){return z},set debounceTimer(b){z=b},buildContent:I,save:_e};return Object.defineProperty(he,"__isScriptSetup",{enumerable:!1,value:!0}),he}}),Lt={class:"grid gap-4 sm:grid-cols-2"},Bt={class:"mt-1.5 text-xs text-gray-600"},Et={class:"text-gray-500 font-mono"},_t={class:"flex flex-wrap gap-1.5 rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-3 py-2.5 min-h-[42px]"},Mt=["onClick"],qt={class:"grid gap-4 sm:grid-cols-3"},Dt=["value"],Ht={class:"flex flex-wrap gap-6"},Ot={class:"flex items-center gap-2.5 cursor-pointer group"},Zt={class:"flex items-center gap-2.5 cursor-pointer group"},Nt={class:"group"},jt={class:"mt-3"},Vt={class:"grid gap-4 lg:grid-cols-2"},Ut=["innerHTML"],Qt={class:"flex items-center gap-4 pt-2"},Ft=["disabled"],Gt={key:0,class:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},Jt={key:0,class:"text-sm text-red-400"};function Wt(s,e,r,n,t,i){return P(),C("form",{onSubmit:Me(n.save,["prevent"]),class:"space-y-6"},[p("div",Lt,[p("div",null,[e[11]||(e[11]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Name",-1)),$(p("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>n.name=l),type:"text",required:"",placeholder:"My Awesome Skill",class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-2.5 text-sm text-white placeholder-gray-600 focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all"},null,512),[[H,n.name]]),p("p",Bt,[e[10]||(e[10]=Q(" Slug: ",-1)),p("code",Et,O(n.computedSlug),1)])]),p("div",null,[e[12]||(e[12]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Description",-1)),$(p("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>n.description=l),type:"text",placeholder:"Brief description of what this skill does",class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-2.5 text-sm text-white placeholder-gray-600 focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all"},null,512),[[H,n.description]])])]),p("div",null,[e[13]||(e[13]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Allowed Tools",-1)),p("div",_t,[(P(!0),C(ge,null,fe(n.AVAILABLE_TOOLS,l=>(P(),C("button",{key:l,type:"button",onClick:o=>n.toggleTool(l),class:Ze(["rounded-md px-2.5 py-1 text-xs font-medium transition-all",n.selectedTools.has(l)?"bg-[var(--color-accent-500)] text-white shadow-sm":"bg-white/[0.04] border border-white/[0.06] text-gray-500 hover:text-gray-300 hover:bg-white/[0.08]"])},O(l),11,Mt))),128))])]),p("div",qt,[p("div",null,[e[15]||(e[15]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Model",-1)),$(p("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>n.model=l),class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-2.5 text-sm text-white focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all"},[e[14]||(e[14]=p("option",{value:""},"Default",-1)),(P(!0),C(ge,null,fe(n.AVAILABLE_MODELS,l=>(P(),C("option",{key:l.id,value:l.id},O(l.display_name),9,Dt))),128))],512),[[Y,n.model]])]),p("div",null,[e[16]||(e[16]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Argument Hint",-1)),$(p("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>n.argumentHint=l),type:"text",placeholder:"e.g. <file-path>",class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-2.5 text-sm text-white placeholder-gray-600 focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all"},null,512),[[H,n.argumentHint]])]),p("div",null,[e[18]||(e[18]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Agent",-1)),$(p("select",{"onUpdate:modelValue":e[4]||(e[4]=l=>n.agent=l),class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-2.5 text-sm text-white focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all"},[...e[17]||(e[17]=[p("option",{value:""},"general-purpose (default)",-1),p("option",{value:"Explore"},"Explore",-1),p("option",{value:"Plan"},"Plan",-1)])],512),[[Y,n.agent]])])]),p("div",Ht,[p("label",Ot,[$(p("input",{type:"checkbox","onUpdate:modelValue":e[5]||(e[5]=l=>n.userInvocable=l),class:"sr-only peer"},null,512),[[de,n.userInvocable]]),e[19]||(e[19]=p("div",{class:"h-5 w-9 rounded-full bg-white/[0.06] border border-white/[0.06] peer-checked:bg-[var(--color-accent-500)] peer-checked:border-[var(--color-accent-500)] relative transition-all after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:h-4 after:w-4 after:rounded-full after:bg-gray-400 after:transition-all peer-checked:after:translate-x-4 peer-checked:after:bg-white"},null,-1)),e[20]||(e[20]=p("span",{class:"text-xs text-gray-500 group-hover:text-gray-300 transition-colors"},[Q("User Invocable "),p("span",{class:"text-gray-600"},"(show in /menu)")],-1))]),p("label",Zt,[$(p("input",{type:"checkbox","onUpdate:modelValue":e[6]||(e[6]=l=>n.disableModelInvocation=l),class:"sr-only peer"},null,512),[[de,n.disableModelInvocation]]),e[21]||(e[21]=p("div",{class:"h-5 w-9 rounded-full bg-white/[0.06] border border-white/[0.06] peer-checked:bg-[var(--color-accent-500)] peer-checked:border-[var(--color-accent-500)] relative transition-all after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:h-4 after:w-4 after:rounded-full after:bg-gray-400 after:transition-all peer-checked:after:translate-x-4 peer-checked:after:bg-white"},null,-1)),e[22]||(e[22]=p("span",{class:"text-xs text-gray-500 group-hover:text-gray-300 transition-colors"},[Q("Disable Model Invocation "),p("span",{class:"text-gray-600"},"(manual only)")],-1))])]),p("div",null,[e[24]||(e[24]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Context",-1)),$(p("select",{"onUpdate:modelValue":e[7]||(e[7]=l=>n.context=l),class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-2.5 text-sm text-white focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all"},[...e[23]||(e[23]=[p("option",{value:""},"Inline (default)",-1),p("option",{value:"fork"},"Fork (run in subagent)",-1)])],512),[[Y,n.context]]),e[25]||(e[25]=p("p",{class:"mt-1.5 text-xs text-gray-600"},"Fork runs the skill in an isolated subagent context",-1))]),p("details",Nt,[e[27]||(e[27]=p("summary",{class:"text-xs font-medium uppercase tracking-wider text-gray-500 cursor-pointer hover:text-gray-400 transition-colors"},"Hooks (advanced)",-1)),p("div",jt,[$(p("textarea",{"onUpdate:modelValue":e[8]||(e[8]=l=>n.hooksJson=l),rows:"4",placeholder:'{ "preToolExecution": [{ "matcher": "Bash", "hooks": [{ "type": "command", "command": "echo pre" }] }] }',class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-3 font-mono text-xs text-white placeholder-gray-700 focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all resize-y"},null,512),[[H,n.hooksJson]]),e[26]||(e[26]=p("p",{class:"mt-1.5 text-xs text-gray-600"},"JSON object. Leave empty to omit.",-1))])]),p("div",Vt,[p("div",null,[e[28]||(e[28]=p("label",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Skill Body",-1)),$(p("textarea",{"onUpdate:modelValue":e[9]||(e[9]=l=>n.body=l),rows:"20",placeholder:`# My Skill
Instructions for Claude...`,class:"w-full rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] px-4 py-3 font-mono text-sm text-white placeholder-gray-600 focus:border-[var(--color-accent-500)]/50 focus:outline-none focus:ring-1 focus:ring-[var(--color-accent-500)]/20 transition-all resize-y leading-relaxed"},null,512),[[H,n.body]])]),p("div",null,[e[29]||(e[29]=p("p",{class:"block text-xs font-medium uppercase tracking-wider text-gray-500 mb-1.5"},"Preview",-1)),p("div",{class:"skill-prose rounded-xl border border-white/[0.06] bg-[var(--color-surface-100)] p-5 min-h-[20rem] overflow-auto",innerHTML:n.previewHtml},null,8,Ut)])]),p("div",Qt,[p("button",{type:"submit",disabled:n.saving,class:"inline-flex items-center gap-2 rounded-xl bg-[var(--color-accent-500)] px-6 py-2.5 text-sm font-semibold text-white shadow-lg shadow-[var(--color-accent-500)]/20 hover:bg-[var(--color-accent-600)] hover:shadow-[var(--color-accent-500)]/30 disabled:opacity-50 active:scale-[0.97] transition-all"},[n.saving?(P(),C("svg",Gt,[...e[30]||(e[30]=[p("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),p("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):ke("",!0),Q(" "+O(n.saving?"Saving...":r.mode==="create"?"Create Skill":"Save Changes"),1)],8,Ft),e[31]||(e[31]=p("a",{href:"/",class:"text-sm text-gray-600 hover:text-gray-300 transition-colors"},"Cancel",-1)),n.error?(P(),C("p",Jt,O(n.error),1)):ke("",!0)])],32)}const er=qe(Pt,[["render",Wt]]);export{er as default};