@fabrika/builder 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILD-CONTRACT.md +41 -0
- package/LICENSE +21 -0
- package/README.md +100 -0
- package/cli/src/bin.ts +66 -0
- package/cli/src/build-status.ts +109 -0
- package/cli/src/catalog.ts +42 -0
- package/cli/src/commands/advance.ts +73 -0
- package/cli/src/commands/build.ts +215 -0
- package/cli/src/commands/ensure-daemon.ts +25 -0
- package/cli/src/commands/gate.ts +165 -0
- package/cli/src/commands/induce.ts +61 -0
- package/cli/src/commands/init.ts +91 -0
- package/cli/src/commands/next.ts +31 -0
- package/cli/src/config.ts +47 -0
- package/cli/src/context.ts +28 -0
- package/cli/src/daemon-client.ts +280 -0
- package/cli/src/daemon-lifecycle.ts +171 -0
- package/cli/src/derive.ts +109 -0
- package/cli/src/index.ts +38 -0
- package/cli/src/induce.ts +151 -0
- package/cli/src/inject-skills.ts +313 -0
- package/cli/src/issues.ts +75 -0
- package/cli/src/layout.ts +124 -0
- package/cli/src/packet.ts +108 -0
- package/cli/src/phase-state.ts +19 -0
- package/cli/src/phases.ts +131 -0
- package/cli/src/skeletons.ts +104 -0
- package/daemon/src/bin.ts +70 -0
- package/daemon/src/build-stream.ts +38 -0
- package/daemon/src/handlers.ts +472 -0
- package/daemon/src/index.ts +123 -0
- package/daemon/src/paths.ts +30 -0
- package/daemon/src/phases.ts +221 -0
- package/daemon/src/static.ts +72 -0
- package/decisions/README.md +133 -0
- package/decisions/patterns/app-deploy.md +55 -0
- package/decisions/patterns/auth-password-kv.md +45 -0
- package/decisions/patterns/count-store.md +44 -0
- package/decisions/patterns/di-container.md +47 -0
- package/decisions/patterns/feature-architecture.md +48 -0
- package/decisions/patterns/lib-publish.md +46 -0
- package/decisions/patterns/monorepo.md +47 -0
- package/decisions/patterns/named-seeds.md +45 -0
- package/decisions/patterns/observability.md +45 -0
- package/decisions/patterns/single-worker-spa.md +74 -0
- package/decisions/patterns/structured-logging.md +49 -0
- package/decisions/patterns/typed-worker-rpc.md +87 -0
- package/decisions/patterns/vozka-app-deploy.md +74 -0
- package/decisions/patterns/write-split.md +47 -0
- package/decisions/technologies/analytics-engine.md +44 -0
- package/decisions/technologies/bindx.md +55 -0
- package/decisions/technologies/bun.md +51 -0
- package/decisions/technologies/buzola.md +80 -0
- package/decisions/technologies/cloudflare-access.md +50 -0
- package/decisions/technologies/cloudflare-vite-plugin.md +43 -0
- package/decisions/technologies/cloudflare.md +50 -0
- package/decisions/technologies/contember.md +65 -0
- package/decisions/technologies/cron-triggers.md +46 -0
- package/decisions/technologies/d1.md +51 -0
- package/decisions/technologies/durable-objects.md +44 -0
- package/decisions/technologies/kv.md +42 -0
- package/decisions/technologies/lopata.md +55 -0
- package/decisions/technologies/nuasite.md +50 -0
- package/decisions/technologies/oblaka.md +48 -0
- package/decisions/technologies/opice.md +40 -0
- package/decisions/technologies/pletivo.md +53 -0
- package/decisions/technologies/postgres.md +47 -0
- package/decisions/technologies/preact.md +44 -0
- package/decisions/technologies/propustka.md +137 -0
- package/decisions/technologies/queue.md +55 -0
- package/decisions/technologies/r2.md +41 -0
- package/decisions/technologies/react-router.md +47 -0
- package/decisions/technologies/react.md +37 -0
- package/decisions/technologies/roj.md +51 -0
- package/decisions/technologies/sentry.md +49 -0
- package/decisions/technologies/tailwind.md +45 -0
- package/decisions/technologies/vite.md +47 -0
- package/decisions/technologies/vozka.md +122 -0
- package/decisions/technologies/workers-ai.md +59 -0
- package/decisions/technologies/wrangler.md +41 -0
- package/decisions/tooling/deptective.md +45 -0
- package/decisions/tooling/edvabe.md +45 -0
- package/index.ts +2 -0
- package/package.json +51 -0
- package/skill/SKILL.md +76 -0
- package/skill/agents/build-orchestrator.md +170 -0
- package/skill/agents/flows-author.md +65 -0
- package/skill/agents/implementer.md +37 -0
- package/skill/agents/openai.yaml +4 -0
- package/skill/agents/opice-skeleton-author.md +68 -0
- package/skill/gates/brief.jsx +20 -0
- package/skill/gates/build.jsx +20 -0
- package/skill/gates/design.jsx +22 -0
- package/skill/gates/flows.jsx +14 -0
- package/skill/gates/review-grid.jsx +32 -0
- package/skill/gates/tech.jsx +17 -0
- package/skill/gates/vision.jsx +27 -0
- package/stacks/README.md +44 -0
- package/stacks/cf-fat.md +64 -0
- package/stacks/cf-internal-app.md +125 -0
- package/stacks/cf-lightweight.md +54 -0
- package/stacks/contember-app.md +53 -0
- package/stacks/content-site.md +45 -0
- package/ui/dist/assets/annotations-runtime.js +1 -0
- package/ui/dist/assets/client.css +2 -0
- package/ui/dist/assets/client.fhjppkvr.js +214 -0
- package/ui/dist/assets/components.js +63 -0
- package/ui/dist/assets/preact-compat.js +1 -0
- package/ui/dist/assets/react-jsx-dev-runtime.js +3 -0
- package/ui/dist/assets/react-jsx-runtime.js +3 -0
- package/ui/dist/assets/runtime.js +1 -0
- package/ui/dist/index.html +36 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import{useFeedback as j$}from"#canvas/runtime";function n0(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var U0=n0();function b5(Q){U0=Q}var H0={exec:()=>null};function O(Q,$=""){let Y=typeof Q=="string"?Q:Q.source,B={replace:(J,W)=>{let K=typeof W=="string"?W:W.source;return K=K.replace(E.caret,"$1"),Y=Y.replace(J,K),B},getRegex:()=>new RegExp(Y,$)};return B}var T1=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),E={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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:(Q)=>new RegExp(`^( {0,3}${Q})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:(Q)=>new RegExp(`^ {0,${Math.min(3,Q-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:(Q)=>new RegExp(`^ {0,${Math.min(3,Q-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:(Q)=>new RegExp(`^ {0,${Math.min(3,Q-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:(Q)=>new RegExp(`^ {0,${Math.min(3,Q-1)}}#`),htmlBeginRegex:(Q)=>new RegExp(`^ {0,${Math.min(3,Q-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:(Q)=>new RegExp(`^ {0,${Math.min(3,Q-1)}}>`)},O1=/^(?:[ \t]*(?:\n|$))+/,w1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,A1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,w0=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,S1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,e0=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,I5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,R5=O(I5).replace(/bull/g,e0).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(),C1=O(I5).replace(/bull/g,e0).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(),$5=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,k1=/^[^\n]+/,Q5=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,f1=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q5).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),v1=O(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,e0).getRegex(),j0="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",Y5=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b1=O("^ {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[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Y5).replace("tag",j0).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V5=O($5).replace("hr",w0).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",j0).getRegex(),I1=O(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",V5).getRegex(),J5={blockquote:I1,code:w1,def:f1,fences:A1,heading:S1,hr:w0,html:b1,lheading:R5,list:v1,newline:O1,paragraph:V5,table:H0,text:k1},A5=O("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",w0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\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",j0).getRegex(),R1={...J5,lheading:C1,table:A5,paragraph:O($5).replace("hr",w0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",A5).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",j0).getRegex()},V1={...J5,html:O(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Y5).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:H0,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O($5).replace("hr",w0).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",R5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},m1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,j1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,m5=/^( {2,}|\\)\n(?!\s*$)/,D1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,N0=/[\p{P}\p{S}]/u,D0=/[\s\p{P}\p{S}]/u,B5=/[^\s\p{P}\p{S}]/u,E1=O(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,D0).getRegex(),j5=/(?!~)[\p{P}\p{S}]/u,h1=/(?!~)[\s\p{P}\p{S}]/u,x1=/(?:[^\s\p{P}\p{S}]|~)/u,g1=O(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",T1?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),D5=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,u1=O(D5,"u").replace(/punct/g,N0).getRegex(),p1=O(D5,"u").replace(/punct/g,j5).getRegex(),E5="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",c1=O(E5,"gu").replace(/notPunctSpace/g,B5).replace(/punctSpace/g,D0).replace(/punct/g,N0).getRegex(),d1=O(E5,"gu").replace(/notPunctSpace/g,x1).replace(/punctSpace/g,h1).replace(/punct/g,j5).getRegex(),r1=O("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,B5).replace(/punctSpace/g,D0).replace(/punct/g,N0).getRegex(),l1=O(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,N0).getRegex(),i1="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",o1=O(i1,"gu").replace(/notPunctSpace/g,B5).replace(/punctSpace/g,D0).replace(/punct/g,N0).getRegex(),s1=O(/\\(punct)/,"gu").replace(/punct/g,N0).getRegex(),a1=O(/^<(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(),t1=O(Y5).replace("(?:-->|$)","-->").getRegex(),n1=O("^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",t1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),R0=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,e1=O(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",R0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),h5=O(/^!?\[(label)\]\[(ref)\]/).replace("label",R0).replace("ref",Q5).getRegex(),x5=O(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q5).getRegex(),$2=O("reflink|nolink(?!\\()","g").replace("reflink",h5).replace("nolink",x5).getRegex(),S5=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,W5={_backpedal:H0,anyPunctuation:s1,autolink:a1,blockSkip:g1,br:m5,code:j1,del:H0,delLDelim:H0,delRDelim:H0,emStrongLDelim:u1,emStrongRDelimAst:c1,emStrongRDelimUnd:r1,escape:m1,link:e1,nolink:x5,punctuation:E1,reflink:h5,reflinkSearch:$2,tag:n1,text:D1,url:H0},Q2={...W5,link:O(/^!?\[(label)\]\((.*?)\)/).replace("label",R0).getRegex(),reflink:O(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R0).getRegex()},t0={...W5,emStrongRDelimAst:d1,emStrongLDelim:p1,delLDelim:l1,delRDelim:o1,url:O(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",S5).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:O(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",S5).getRegex()},Y2={...t0,br:O(m5).replace("{2,}","*").getRegex(),text:O(t0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},I0={normal:J5,gfm:R1,pedantic:V1},z0={normal:W5,gfm:t0,breaks:Y2,pedantic:Q2},J2={"&":"&","<":"<",">":">",'"':""","'":"'"},C5=(Q)=>J2[Q];function n(Q,$){if($){if(E.escapeTest.test(Q))return Q.replace(E.escapeReplace,C5)}else if(E.escapeTestNoEncode.test(Q))return Q.replace(E.escapeReplaceNoEncode,C5);return Q}function k5(Q){try{Q=encodeURI(Q).replace(E.percentDecode,"%")}catch{return null}return Q}function f5(Q,$){let Y=Q.replace(E.findPipe,(W,K,q)=>{let X=!1,H=K;for(;--H>=0&&q[H]==="\\";)X=!X;return X?"|":" |"}),B=Y.split(E.splitPipe),J=0;if(B[0].trim()||B.shift(),B.length>0&&!B.at(-1)?.trim()&&B.pop(),$)if(B.length>$)B.splice($);else for(;B.length<$;)B.push("");for(;J<B.length;J++)B[J]=B[J].trim().replace(E.slashPipe,"|");return B}function T0(Q,$,Y){let B=Q.length;if(B===0)return"";let J=0;for(;J<B;){let W=Q.charAt(B-J-1);if(W===$&&!Y)J++;else if(W!==$&&Y)J++;else break}return Q.slice(0,B-J)}function B2(Q,$){if(Q.indexOf($[1])===-1)return-1;let Y=0;for(let B=0;B<Q.length;B++)if(Q[B]==="\\")B++;else if(Q[B]===$[0])Y++;else if(Q[B]===$[1]&&(Y--,Y<0))return B;return Y>0?-2:-1}function W2(Q,$=0){let Y=$,B="";for(let J of Q)if(J==="\t"){let W=4-Y%4;B+=" ".repeat(W),Y+=W}else B+=J,Y++;return B}function v5(Q,$,Y,B,J){let W=$.href,K=$.title||null,q=Q[1].replace(J.other.outputLinkReplace,"$1");B.state.inLink=!0;let X={type:Q[0].charAt(0)==="!"?"image":"link",raw:Y,href:W,title:K,text:q,tokens:B.inlineTokens(q)};return B.state.inLink=!1,X}function K2(Q,$,Y){let B=Q.match(Y.other.indentCodeCompensation);if(B===null)return $;let J=B[1];return $.split(`
|
|
3
|
+
`).map((W)=>{let K=W.match(Y.other.beginningSpace);if(K===null)return W;let[q]=K;return q.length>=J.length?W.slice(J.length):W}).join(`
|
|
4
|
+
`)}var V0=class{options;rules;lexer;constructor(Q){this.options=Q||U0}space(Q){let $=this.rules.block.newline.exec(Q);if($&&$[0].length>0)return{type:"space",raw:$[0]}}code(Q){let $=this.rules.block.code.exec(Q);if($){let Y=$[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:$[0],codeBlockStyle:"indented",text:this.options.pedantic?Y:T0(Y,`
|
|
5
|
+
`)}}}fences(Q){let $=this.rules.block.fences.exec(Q);if($){let Y=$[0],B=K2(Y,$[3]||"",this.rules);return{type:"code",raw:Y,lang:$[2]?$[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):$[2],text:B}}}heading(Q){let $=this.rules.block.heading.exec(Q);if($){let Y=$[2].trim();if(this.rules.other.endingHash.test(Y)){let B=T0(Y,"#");(this.options.pedantic||!B||this.rules.other.endingSpaceChar.test(B))&&(Y=B.trim())}return{type:"heading",raw:$[0],depth:$[1].length,text:Y,tokens:this.lexer.inline(Y)}}}hr(Q){let $=this.rules.block.hr.exec(Q);if($)return{type:"hr",raw:T0($[0],`
|
|
6
|
+
`)}}blockquote(Q){let $=this.rules.block.blockquote.exec(Q);if($){let Y=T0($[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),B="",J="",W=[];for(;Y.length>0;){let K=!1,q=[],X;for(X=0;X<Y.length;X++)if(this.rules.other.blockquoteStart.test(Y[X]))q.push(Y[X]),K=!0;else if(!K)q.push(Y[X]);else break;Y=Y.slice(X);let H=q.join(`
|
|
9
|
+
`),G=H.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");B=B?`${B}
|
|
11
|
+
${H}`:H,J=J?`${J}
|
|
12
|
+
${G}`:G;let Z=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(G,W,!0),this.lexer.state.top=Z,Y.length===0)break;let _=W.at(-1);if(_?.type==="code")break;if(_?.type==="blockquote"){let N=_,U=N.raw+`
|
|
13
|
+
`+Y.join(`
|
|
14
|
+
`),y=this.blockquote(U);W[W.length-1]=y,B=B.substring(0,B.length-N.raw.length)+y.raw,J=J.substring(0,J.length-N.text.length)+y.text;break}else if(_?.type==="list"){let N=_,U=N.raw+`
|
|
15
|
+
`+Y.join(`
|
|
16
|
+
`),y=this.list(U);W[W.length-1]=y,B=B.substring(0,B.length-_.raw.length)+y.raw,J=J.substring(0,J.length-N.raw.length)+y.raw,Y=U.substring(W.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:B,tokens:W,text:J}}}list(Q){let $=this.rules.block.list.exec(Q);if($){let Y=$[1].trim(),B=Y.length>1,J={type:"list",raw:"",ordered:B,start:B?+Y.slice(0,-1):"",loose:!1,items:[]};Y=B?`\\d{1,9}\\${Y.slice(-1)}`:`\\${Y}`,this.options.pedantic&&(Y=B?Y:"[*+-]");let W=this.rules.other.listItemRegex(Y),K=!1;for(;Q;){let X=!1,H="",G="";if(!($=W.exec(Q))||this.rules.block.hr.test(Q))break;H=$[0],Q=Q.substring(H.length);let Z=W2($[2].split(`
|
|
18
|
+
`,1)[0],$[1].length),_=Q.split(`
|
|
19
|
+
`,1)[0],N=!Z.trim(),U=0;if(this.options.pedantic?(U=2,G=Z.trimStart()):N?U=$[1].length+1:(U=Z.search(this.rules.other.nonSpaceChar),U=U>4?1:U,G=Z.slice(U),U+=$[1].length),N&&this.rules.other.blankLine.test(_)&&(H+=_+`
|
|
20
|
+
`,Q=Q.substring(_.length+1),X=!0),!X){let y=this.rules.other.nextBulletRegex(U),P=this.rules.other.hrRegex(U),L=this.rules.other.fencesBeginRegex(U),w=this.rules.other.headingBeginRegex(U),A=this.rules.other.htmlBeginRegex(U),I=this.rules.other.blockquoteBeginRegex(U);for(;Q;){let v=Q.split(`
|
|
21
|
+
`,1)[0],b;if(_=v,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),b=_):b=_.replace(this.rules.other.tabCharGlobal," "),L.test(_)||w.test(_)||A.test(_)||I.test(_)||y.test(_)||P.test(_))break;if(b.search(this.rules.other.nonSpaceChar)>=U||!_.trim())G+=`
|
|
22
|
+
`+b.slice(U);else{if(N||Z.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(Z)||w.test(Z)||P.test(Z))break;G+=`
|
|
23
|
+
`+_}N=!_.trim(),H+=v+`
|
|
24
|
+
`,Q=Q.substring(v.length+1),Z=b.slice(U)}}J.loose||(K?J.loose=!0:this.rules.other.doubleBlankLine.test(H)&&(K=!0)),J.items.push({type:"list_item",raw:H,task:!!this.options.gfm&&this.rules.other.listIsTask.test(G),loose:!1,text:G,tokens:[]}),J.raw+=H}let q=J.items.at(-1);if(q)q.raw=q.raw.trimEnd(),q.text=q.text.trimEnd();else return;J.raw=J.raw.trimEnd();for(let X of J.items){if(this.lexer.state.top=!1,X.tokens=this.lexer.blockTokens(X.text,[]),X.task){if(X.text=X.text.replace(this.rules.other.listReplaceTask,""),X.tokens[0]?.type==="text"||X.tokens[0]?.type==="paragraph"){X.tokens[0].raw=X.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),X.tokens[0].text=X.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let G=this.lexer.inlineQueue.length-1;G>=0;G--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[G].src)){this.lexer.inlineQueue[G].src=this.lexer.inlineQueue[G].src.replace(this.rules.other.listReplaceTask,"");break}}let H=this.rules.other.listTaskCheckbox.exec(X.raw);if(H){let G={type:"checkbox",raw:H[0]+" ",checked:H[0]!=="[ ]"};X.checked=G.checked,J.loose?X.tokens[0]&&["paragraph","text"].includes(X.tokens[0].type)&&"tokens"in X.tokens[0]&&X.tokens[0].tokens?(X.tokens[0].raw=G.raw+X.tokens[0].raw,X.tokens[0].text=G.raw+X.tokens[0].text,X.tokens[0].tokens.unshift(G)):X.tokens.unshift({type:"paragraph",raw:G.raw,text:G.raw,tokens:[G]}):X.tokens.unshift(G)}}if(!J.loose){let H=X.tokens.filter((Z)=>Z.type==="space"),G=H.length>0&&H.some((Z)=>this.rules.other.anyLine.test(Z.raw));J.loose=G}}if(J.loose)for(let X of J.items){X.loose=!0;for(let H of X.tokens)H.type==="text"&&(H.type="paragraph")}return J}}html(Q){let $=this.rules.block.html.exec(Q);if($)return{type:"html",block:!0,raw:$[0],pre:$[1]==="pre"||$[1]==="script"||$[1]==="style",text:$[0]}}def(Q){let $=this.rules.block.def.exec(Q);if($){let Y=$[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),B=$[2]?$[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",J=$[3]?$[3].substring(1,$[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):$[3];return{type:"def",tag:Y,raw:$[0],href:B,title:J}}}table(Q){let $=this.rules.block.table.exec(Q);if(!$||!this.rules.other.tableDelimiter.test($[2]))return;let Y=f5($[1]),B=$[2].replace(this.rules.other.tableAlignChars,"").split("|"),J=$[3]?.trim()?$[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],W={type:"table",raw:$[0],header:[],align:[],rows:[]};if(Y.length===B.length){for(let K of B)this.rules.other.tableAlignRight.test(K)?W.align.push("right"):this.rules.other.tableAlignCenter.test(K)?W.align.push("center"):this.rules.other.tableAlignLeft.test(K)?W.align.push("left"):W.align.push(null);for(let K=0;K<Y.length;K++)W.header.push({text:Y[K],tokens:this.lexer.inline(Y[K]),header:!0,align:W.align[K]});for(let K of J)W.rows.push(f5(K,W.header.length).map((q,X)=>({text:q,tokens:this.lexer.inline(q),header:!1,align:W.align[X]})));return W}}lheading(Q){let $=this.rules.block.lheading.exec(Q);if($){let Y=$[1].trim();return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:Y,tokens:this.lexer.inline(Y)}}}paragraph(Q){let $=this.rules.block.paragraph.exec(Q);if($){let Y=$[1].charAt($[1].length-1)===`
|
|
26
|
+
`?$[1].slice(0,-1):$[1];return{type:"paragraph",raw:$[0],text:Y,tokens:this.lexer.inline(Y)}}}text(Q){let $=this.rules.block.text.exec(Q);if($)return{type:"text",raw:$[0],text:$[0],tokens:this.lexer.inline($[0])}}escape(Q){let $=this.rules.inline.escape.exec(Q);if($)return{type:"escape",raw:$[0],text:$[1]}}tag(Q){let $=this.rules.inline.tag.exec(Q);if($)return!this.lexer.state.inLink&&this.rules.other.startATag.test($[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test($[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test($[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test($[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:$[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:$[0]}}link(Q){let $=this.rules.inline.link.exec(Q);if($){let Y=$[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(Y)){if(!this.rules.other.endAngleBracket.test(Y))return;let W=T0(Y.slice(0,-1),"\\");if((Y.length-W.length)%2===0)return}else{let W=B2($[2],"()");if(W===-2)return;if(W>-1){let K=($[0].indexOf("!")===0?5:4)+$[1].length+W;$[2]=$[2].substring(0,W),$[0]=$[0].substring(0,K).trim(),$[3]=""}}let B=$[2],J="";if(this.options.pedantic){let W=this.rules.other.pedanticHrefTitle.exec(B);W&&(B=W[1],J=W[3])}else J=$[3]?$[3].slice(1,-1):"";return B=B.trim(),this.rules.other.startAngleBracket.test(B)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(Y)?B=B.slice(1):B=B.slice(1,-1)),v5($,{href:B&&B.replace(this.rules.inline.anyPunctuation,"$1"),title:J&&J.replace(this.rules.inline.anyPunctuation,"$1")},$[0],this.lexer,this.rules)}}reflink(Q,$){let Y;if((Y=this.rules.inline.reflink.exec(Q))||(Y=this.rules.inline.nolink.exec(Q))){let B=(Y[2]||Y[1]).replace(this.rules.other.multipleSpaceGlobal," "),J=$[B.toLowerCase()];if(!J){let W=Y[0].charAt(0);return{type:"text",raw:W,text:W}}return v5(Y,J,Y[0],this.lexer,this.rules)}}emStrong(Q,$,Y=""){let B=this.rules.inline.emStrongLDelim.exec(Q);if(!B||!B[1]&&!B[2]&&!B[3]&&!B[4]||B[4]&&Y.match(this.rules.other.unicodeAlphaNumeric))return;if(!(B[1]||B[3])||!Y||this.rules.inline.punctuation.exec(Y)){let J=[...B[0]].length-1,W,K,q=J,X=0,H=B[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(H.lastIndex=0,$=$.slice(-1*Q.length+J);(B=H.exec($))!==null;){if(W=B[1]||B[2]||B[3]||B[4]||B[5]||B[6],!W)continue;if(K=[...W].length,B[3]||B[4]){q+=K;continue}else if((B[5]||B[6])&&J%3&&!((J+K)%3)){X+=K;continue}if(q-=K,q>0)continue;K=Math.min(K,K+q+X);let G=[...B[0]][0].length,Z=Q.slice(0,J+B.index+G+K);if(Math.min(J,K)%2){let N=Z.slice(1,-1);return{type:"em",raw:Z,text:N,tokens:this.lexer.inlineTokens(N)}}let _=Z.slice(2,-2);return{type:"strong",raw:Z,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(Q){let $=this.rules.inline.code.exec(Q);if($){let Y=$[2].replace(this.rules.other.newLineCharGlobal," "),B=this.rules.other.nonSpaceChar.test(Y),J=this.rules.other.startingSpaceChar.test(Y)&&this.rules.other.endingSpaceChar.test(Y);return B&&J&&(Y=Y.substring(1,Y.length-1)),{type:"codespan",raw:$[0],text:Y}}}br(Q){let $=this.rules.inline.br.exec(Q);if($)return{type:"br",raw:$[0]}}del(Q,$,Y=""){let B=this.rules.inline.delLDelim.exec(Q);if(!B)return;if(!B[1]||!Y||this.rules.inline.punctuation.exec(Y)){let J=[...B[0]].length-1,W,K,q=J,X=this.rules.inline.delRDelim;for(X.lastIndex=0,$=$.slice(-1*Q.length+J);(B=X.exec($))!==null;){if(W=B[1]||B[2]||B[3]||B[4]||B[5]||B[6],!W||(K=[...W].length,K!==J))continue;if(B[3]||B[4]){q+=K;continue}if(q-=K,q>0)continue;K=Math.min(K,K+q);let H=[...B[0]][0].length,G=Q.slice(0,J+B.index+H+K),Z=G.slice(J,-J);return{type:"del",raw:G,text:Z,tokens:this.lexer.inlineTokens(Z)}}}}autolink(Q){let $=this.rules.inline.autolink.exec(Q);if($){let Y,B;return $[2]==="@"?(Y=$[1],B="mailto:"+Y):(Y=$[1],B=Y),{type:"link",raw:$[0],text:Y,href:B,tokens:[{type:"text",raw:Y,text:Y}]}}}url(Q){let $;if($=this.rules.inline.url.exec(Q)){let Y,B;if($[2]==="@")Y=$[0],B="mailto:"+Y;else{let J;do J=$[0],$[0]=this.rules.inline._backpedal.exec($[0])?.[0]??"";while(J!==$[0]);Y=$[0],$[1]==="www."?B="http://"+$[0]:B=$[0]}return{type:"link",raw:$[0],text:Y,href:B,tokens:[{type:"text",raw:Y,text:Y}]}}}inlineText(Q){let $=this.rules.inline.text.exec(Q);if($){let Y=this.lexer.state.inRawBlock;return{type:"text",raw:$[0],text:$[0],escaped:Y}}}},r=class Q{tokens;options;state;inlineQueue;tokenizer;constructor($){this.tokens=[],this.tokens.links=Object.create(null),this.options=$||U0,this.options.tokenizer=this.options.tokenizer||new V0,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 Y={other:E,block:I0.normal,inline:z0.normal};this.options.pedantic?(Y.block=I0.pedantic,Y.inline=z0.pedantic):this.options.gfm&&(Y.block=I0.gfm,this.options.breaks?Y.inline=z0.breaks:Y.inline=z0.gfm),this.tokenizer.rules=Y}static get rules(){return{block:I0,inline:z0}}static lex($,Y){return new Q(Y).lex($)}static lexInline($,Y){return new Q(Y).inlineTokens($)}lex($){$=$.replace(E.carriageReturn,`
|
|
27
|
+
`),this.blockTokens($,this.tokens);for(let Y=0;Y<this.inlineQueue.length;Y++){let B=this.inlineQueue[Y];this.inlineTokens(B.src,B.tokens)}return this.inlineQueue=[],this.tokens}blockTokens($,Y=[],B=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&($=$.replace(E.tabCharGlobal," ").replace(E.spaceLine,""));$;){let J;if(this.options.extensions?.block?.some((K)=>(J=K.call({lexer:this},$,Y))?($=$.substring(J.raw.length),Y.push(J),!0):!1))continue;if(J=this.tokenizer.space($)){$=$.substring(J.raw.length);let K=Y.at(-1);J.raw.length===1&&K!==void 0?K.raw+=`
|
|
28
|
+
`:Y.push(J);continue}if(J=this.tokenizer.code($)){$=$.substring(J.raw.length);let K=Y.at(-1);K?.type==="paragraph"||K?.type==="text"?(K.raw+=(K.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+J.raw,K.text+=`
|
|
31
|
+
`+J.text,this.inlineQueue.at(-1).src=K.text):Y.push(J);continue}if(J=this.tokenizer.fences($)){$=$.substring(J.raw.length),Y.push(J);continue}if(J=this.tokenizer.heading($)){$=$.substring(J.raw.length),Y.push(J);continue}if(J=this.tokenizer.hr($)){$=$.substring(J.raw.length),Y.push(J);continue}if(J=this.tokenizer.blockquote($)){$=$.substring(J.raw.length),Y.push(J);continue}if(J=this.tokenizer.list($)){$=$.substring(J.raw.length),Y.push(J);continue}if(J=this.tokenizer.html($)){$=$.substring(J.raw.length),Y.push(J);continue}if(J=this.tokenizer.def($)){$=$.substring(J.raw.length);let K=Y.at(-1);K?.type==="paragraph"||K?.type==="text"?(K.raw+=(K.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+J.raw,K.text+=`
|
|
34
|
+
`+J.raw,this.inlineQueue.at(-1).src=K.text):this.tokens.links[J.tag]||(this.tokens.links[J.tag]={href:J.href,title:J.title},Y.push(J));continue}if(J=this.tokenizer.table($)){$=$.substring(J.raw.length),Y.push(J);continue}if(J=this.tokenizer.lheading($)){$=$.substring(J.raw.length),Y.push(J);continue}let W=$;if(this.options.extensions?.startBlock){let K=1/0,q=$.slice(1),X;this.options.extensions.startBlock.forEach((H)=>{X=H.call({lexer:this},q),typeof X=="number"&&X>=0&&(K=Math.min(K,X))}),K<1/0&&K>=0&&(W=$.substring(0,K+1))}if(this.state.top&&(J=this.tokenizer.paragraph(W))){let K=Y.at(-1);B&&K?.type==="paragraph"?(K.raw+=(K.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+J.raw,K.text+=`
|
|
37
|
+
`+J.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):Y.push(J),B=W.length!==$.length,$=$.substring(J.raw.length);continue}if(J=this.tokenizer.text($)){$=$.substring(J.raw.length);let K=Y.at(-1);K?.type==="text"?(K.raw+=(K.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+J.raw,K.text+=`
|
|
40
|
+
`+J.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):Y.push(J);continue}if($){let K="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(K);break}else throw Error(K)}}return this.state.top=!0,Y}inline($,Y=[]){return this.inlineQueue.push({src:$,tokens:Y}),Y}inlineTokens($,Y=[]){this.tokenizer.lexer=this;let B=$,J=null;if(this.tokens.links){let X=Object.keys(this.tokens.links);if(X.length>0)for(;(J=this.tokenizer.rules.inline.reflinkSearch.exec(B))!==null;)X.includes(J[0].slice(J[0].lastIndexOf("[")+1,-1))&&(B=B.slice(0,J.index)+"["+"a".repeat(J[0].length-2)+"]"+B.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(J=this.tokenizer.rules.inline.anyPunctuation.exec(B))!==null;)B=B.slice(0,J.index)+"++"+B.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let W;for(;(J=this.tokenizer.rules.inline.blockSkip.exec(B))!==null;)W=J[2]?J[2].length:0,B=B.slice(0,J.index+W)+"["+"a".repeat(J[0].length-W-2)+"]"+B.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);B=this.options.hooks?.emStrongMask?.call({lexer:this},B)??B;let K=!1,q="";for(;$;){K||(q=""),K=!1;let X;if(this.options.extensions?.inline?.some((G)=>(X=G.call({lexer:this},$,Y))?($=$.substring(X.raw.length),Y.push(X),!0):!1))continue;if(X=this.tokenizer.escape($)){$=$.substring(X.raw.length),Y.push(X);continue}if(X=this.tokenizer.tag($)){$=$.substring(X.raw.length),Y.push(X);continue}if(X=this.tokenizer.link($)){$=$.substring(X.raw.length),Y.push(X);continue}if(X=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(X.raw.length);let G=Y.at(-1);X.type==="text"&&G?.type==="text"?(G.raw+=X.raw,G.text+=X.text):Y.push(X);continue}if(X=this.tokenizer.emStrong($,B,q)){$=$.substring(X.raw.length),Y.push(X);continue}if(X=this.tokenizer.codespan($)){$=$.substring(X.raw.length),Y.push(X);continue}if(X=this.tokenizer.br($)){$=$.substring(X.raw.length),Y.push(X);continue}if(X=this.tokenizer.del($,B,q)){$=$.substring(X.raw.length),Y.push(X);continue}if(X=this.tokenizer.autolink($)){$=$.substring(X.raw.length),Y.push(X);continue}if(!this.state.inLink&&(X=this.tokenizer.url($))){$=$.substring(X.raw.length),Y.push(X);continue}let H=$;if(this.options.extensions?.startInline){let G=1/0,Z=$.slice(1),_;this.options.extensions.startInline.forEach((N)=>{_=N.call({lexer:this},Z),typeof _=="number"&&_>=0&&(G=Math.min(G,_))}),G<1/0&&G>=0&&(H=$.substring(0,G+1))}if(X=this.tokenizer.inlineText(H)){$=$.substring(X.raw.length),X.raw.slice(-1)!=="_"&&(q=X.raw.slice(-1)),K=!0;let G=Y.at(-1);G?.type==="text"?(G.raw+=X.raw,G.text+=X.text):Y.push(X);continue}if($){let G="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(G);break}else throw Error(G)}}return Y}},m0=class{options;parser;constructor(Q){this.options=Q||U0}space(Q){return""}code({text:Q,lang:$,escaped:Y}){let B=($||"").match(E.notSpaceStart)?.[0],J=Q.replace(E.endingNewline,"")+`
|
|
41
|
+
`;return B?'<pre><code class="language-'+n(B)+'">'+(Y?J:n(J,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(Y?J:n(J,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:Q}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(Q)}</blockquote>
|
|
45
|
+
`}html({text:Q}){return Q}def(Q){return""}heading({tokens:Q,depth:$}){return`<h${$}>${this.parser.parseInline(Q)}</h${$}>
|
|
46
|
+
`}hr(Q){return`<hr>
|
|
47
|
+
`}list(Q){let{ordered:$,start:Y}=Q,B="";for(let K=0;K<Q.items.length;K++){let q=Q.items[K];B+=this.listitem(q)}let J=$?"ol":"ul",W=$&&Y!==1?' start="'+Y+'"':"";return"<"+J+W+`>
|
|
48
|
+
`+B+"</"+J+`>
|
|
49
|
+
`}listitem(Q){return`<li>${this.parser.parse(Q.tokens)}</li>
|
|
50
|
+
`}checkbox({checked:Q}){return"<input "+(Q?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:Q}){return`<p>${this.parser.parseInline(Q)}</p>
|
|
51
|
+
`}table(Q){let $="",Y="";for(let J=0;J<Q.header.length;J++)Y+=this.tablecell(Q.header[J]);$+=this.tablerow({text:Y});let B="";for(let J=0;J<Q.rows.length;J++){let W=Q.rows[J];Y="";for(let K=0;K<W.length;K++)Y+=this.tablecell(W[K]);B+=this.tablerow({text:Y})}return B&&(B=`<tbody>${B}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+$+`</thead>
|
|
54
|
+
`+B+`</table>
|
|
55
|
+
`}tablerow({text:Q}){return`<tr>
|
|
56
|
+
${Q}</tr>
|
|
57
|
+
`}tablecell(Q){let $=this.parser.parseInline(Q.tokens),Y=Q.header?"th":"td";return(Q.align?`<${Y} align="${Q.align}">`:`<${Y}>`)+$+`</${Y}>
|
|
58
|
+
`}strong({tokens:Q}){return`<strong>${this.parser.parseInline(Q)}</strong>`}em({tokens:Q}){return`<em>${this.parser.parseInline(Q)}</em>`}codespan({text:Q}){return`<code>${n(Q,!0)}</code>`}br(Q){return"<br>"}del({tokens:Q}){return`<del>${this.parser.parseInline(Q)}</del>`}link({href:Q,title:$,tokens:Y}){let B=this.parser.parseInline(Y),J=k5(Q);if(J===null)return B;Q=J;let W='<a href="'+Q+'"';return $&&(W+=' title="'+n($)+'"'),W+=">"+B+"</a>",W}image({href:Q,title:$,text:Y,tokens:B}){B&&(Y=this.parser.parseInline(B,this.parser.textRenderer));let J=k5(Q);if(J===null)return n(Y);Q=J;let W=`<img src="${Q}" alt="${n(Y)}"`;return $&&(W+=` title="${n($)}"`),W+=">",W}text(Q){return"tokens"in Q&&Q.tokens?this.parser.parseInline(Q.tokens):("escaped"in Q)&&Q.escaped?Q.text:n(Q.text)}},K5=class{strong({text:Q}){return Q}em({text:Q}){return Q}codespan({text:Q}){return Q}del({text:Q}){return Q}html({text:Q}){return Q}text({text:Q}){return Q}link({text:Q}){return""+Q}image({text:Q}){return""+Q}br(){return""}checkbox({raw:Q}){return Q}},l=class Q{options;renderer;textRenderer;constructor($){this.options=$||U0,this.options.renderer=this.options.renderer||new m0,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new K5}static parse($,Y){return new Q(Y).parse($)}static parseInline($,Y){return new Q(Y).parseInline($)}parse($){this.renderer.parser=this;let Y="";for(let B=0;B<$.length;B++){let J=$[B];if(this.options.extensions?.renderers?.[J.type]){let K=J,q=this.options.extensions.renderers[K.type].call({parser:this},K);if(q!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(K.type)){Y+=q||"";continue}}let W=J;switch(W.type){case"space":{Y+=this.renderer.space(W);break}case"hr":{Y+=this.renderer.hr(W);break}case"heading":{Y+=this.renderer.heading(W);break}case"code":{Y+=this.renderer.code(W);break}case"table":{Y+=this.renderer.table(W);break}case"blockquote":{Y+=this.renderer.blockquote(W);break}case"list":{Y+=this.renderer.list(W);break}case"checkbox":{Y+=this.renderer.checkbox(W);break}case"html":{Y+=this.renderer.html(W);break}case"def":{Y+=this.renderer.def(W);break}case"paragraph":{Y+=this.renderer.paragraph(W);break}case"text":{Y+=this.renderer.text(W);break}default:{let K='Token with "'+W.type+'" type was not found.';if(this.options.silent)return console.error(K),"";throw Error(K)}}}return Y}parseInline($,Y=this.renderer){this.renderer.parser=this;let B="";for(let J=0;J<$.length;J++){let W=$[J];if(this.options.extensions?.renderers?.[W.type]){let q=this.options.extensions.renderers[W.type].call({parser:this},W);if(q!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(W.type)){B+=q||"";continue}}let K=W;switch(K.type){case"escape":{B+=Y.text(K);break}case"html":{B+=Y.html(K);break}case"link":{B+=Y.link(K);break}case"image":{B+=Y.image(K);break}case"checkbox":{B+=Y.checkbox(K);break}case"strong":{B+=Y.strong(K);break}case"em":{B+=Y.em(K);break}case"codespan":{B+=Y.codespan(K);break}case"br":{B+=Y.br(K);break}case"del":{B+=Y.del(K);break}case"text":{B+=Y.text(K);break}default:{let q='Token with "'+K.type+'" type was not found.';if(this.options.silent)return console.error(q),"";throw Error(q)}}}return B}},O0=class{options;block;constructor(Q){this.options=Q||U0}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(Q){return Q}postprocess(Q){return Q}processAllTokens(Q){return Q}emStrongMask(Q){return Q}provideLexer(Q=this.block){return Q?r.lex:r.lexInline}provideParser(Q=this.block){return Q?l.parse:l.parseInline}},X2=class{defaults=n0();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=l;Renderer=m0;TextRenderer=K5;Lexer=r;Tokenizer=V0;Hooks=O0;constructor(...Q){this.use(...Q)}walkTokens(Q,$){let Y=[];for(let B of Q)switch(Y=Y.concat($.call(this,B)),B.type){case"table":{let J=B;for(let W of J.header)Y=Y.concat(this.walkTokens(W.tokens,$));for(let W of J.rows)for(let K of W)Y=Y.concat(this.walkTokens(K.tokens,$));break}case"list":{let J=B;Y=Y.concat(this.walkTokens(J.items,$));break}default:{let J=B;this.defaults.extensions?.childTokens?.[J.type]?this.defaults.extensions.childTokens[J.type].forEach((W)=>{let K=J[W].flat(1/0);Y=Y.concat(this.walkTokens(K,$))}):J.tokens&&(Y=Y.concat(this.walkTokens(J.tokens,$)))}}return Y}use(...Q){let $=this.defaults.extensions||{renderers:{},childTokens:{}};return Q.forEach((Y)=>{let B={...Y};if(B.async=this.defaults.async||B.async||!1,Y.extensions&&(Y.extensions.forEach((J)=>{if(!J.name)throw Error("extension name required");if("renderer"in J){let W=$.renderers[J.name];W?$.renderers[J.name]=function(...K){let q=J.renderer.apply(this,K);return q===!1&&(q=W.apply(this,K)),q}:$.renderers[J.name]=J.renderer}if("tokenizer"in J){if(!J.level||J.level!=="block"&&J.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let W=$[J.level];W?W.unshift(J.tokenizer):$[J.level]=[J.tokenizer],J.start&&(J.level==="block"?$.startBlock?$.startBlock.push(J.start):$.startBlock=[J.start]:J.level==="inline"&&($.startInline?$.startInline.push(J.start):$.startInline=[J.start]))}"childTokens"in J&&J.childTokens&&($.childTokens[J.name]=J.childTokens)}),B.extensions=$),Y.renderer){let J=this.defaults.renderer||new m0(this.defaults);for(let W in Y.renderer){if(!(W in J))throw Error(`renderer '${W}' does not exist`);if(["options","parser"].includes(W))continue;let K=W,q=Y.renderer[K],X=J[K];J[K]=(...H)=>{let G=q.apply(J,H);return G===!1&&(G=X.apply(J,H)),G||""}}B.renderer=J}if(Y.tokenizer){let J=this.defaults.tokenizer||new V0(this.defaults);for(let W in Y.tokenizer){if(!(W in J))throw Error(`tokenizer '${W}' does not exist`);if(["options","rules","lexer"].includes(W))continue;let K=W,q=Y.tokenizer[K],X=J[K];J[K]=(...H)=>{let G=q.apply(J,H);return G===!1&&(G=X.apply(J,H)),G}}B.tokenizer=J}if(Y.hooks){let J=this.defaults.hooks||new O0;for(let W in Y.hooks){if(!(W in J))throw Error(`hook '${W}' does not exist`);if(["options","block"].includes(W))continue;let K=W,q=Y.hooks[K],X=J[K];O0.passThroughHooks.has(W)?J[K]=(H)=>{if(this.defaults.async&&O0.passThroughHooksRespectAsync.has(W))return(async()=>{let Z=await q.call(J,H);return X.call(J,Z)})();let G=q.call(J,H);return X.call(J,G)}:J[K]=(...H)=>{if(this.defaults.async)return(async()=>{let Z=await q.apply(J,H);return Z===!1&&(Z=await X.apply(J,H)),Z})();let G=q.apply(J,H);return G===!1&&(G=X.apply(J,H)),G}}B.hooks=J}if(Y.walkTokens){let J=this.defaults.walkTokens,W=Y.walkTokens;B.walkTokens=function(K){let q=[];return q.push(W.call(this,K)),J&&(q=q.concat(J.call(this,K))),q}}this.defaults={...this.defaults,...B}}),this}setOptions(Q){return this.defaults={...this.defaults,...Q},this}lexer(Q,$){return r.lex(Q,$??this.defaults)}parser(Q,$){return l.parse(Q,$??this.defaults)}parseMarkdown(Q){return($,Y)=>{let B={...Y},J={...this.defaults,...B},W=this.onError(!!J.silent,!!J.async);if(this.defaults.async===!0&&B.async===!1)return W(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 $>"u"||$===null)return W(Error("marked(): input parameter is undefined or null"));if(typeof $!="string")return W(Error("marked(): input parameter is of type "+Object.prototype.toString.call($)+", string expected"));if(J.hooks&&(J.hooks.options=J,J.hooks.block=Q),J.async)return(async()=>{let K=J.hooks?await J.hooks.preprocess($):$,q=await(J.hooks?await J.hooks.provideLexer(Q):Q?r.lex:r.lexInline)(K,J),X=J.hooks?await J.hooks.processAllTokens(q):q;J.walkTokens&&await Promise.all(this.walkTokens(X,J.walkTokens));let H=await(J.hooks?await J.hooks.provideParser(Q):Q?l.parse:l.parseInline)(X,J);return J.hooks?await J.hooks.postprocess(H):H})().catch(W);try{J.hooks&&($=J.hooks.preprocess($));let K=(J.hooks?J.hooks.provideLexer(Q):Q?r.lex:r.lexInline)($,J);J.hooks&&(K=J.hooks.processAllTokens(K)),J.walkTokens&&this.walkTokens(K,J.walkTokens);let q=(J.hooks?J.hooks.provideParser(Q):Q?l.parse:l.parseInline)(K,J);return J.hooks&&(q=J.hooks.postprocess(q)),q}catch(K){return W(K)}}}onError(Q,$){return(Y)=>{if(Y.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,Q){let B="<p>An error occurred:</p><pre>"+n(Y.message+"",!0)+"</pre>";return $?Promise.resolve(B):B}if($)return Promise.reject(Y);throw Y}}},G0=new X2;function T(Q,$){return G0.parse(Q,$)}T.options=T.setOptions=function(Q){return G0.setOptions(Q),T.defaults=G0.defaults,b5(T.defaults),T};T.getDefaults=n0;T.defaults=U0;T.use=function(...Q){return G0.use(...Q),T.defaults=G0.defaults,b5(T.defaults),T};T.walkTokens=function(Q,$){return G0.walkTokens(Q,$)};T.parseInline=G0.parseInline;T.Parser=l;T.parser=l.parse;T.Renderer=m0;T.TextRenderer=K5;T.Lexer=r;T.lexer=r.lex;T.Tokenizer=V0;T.Hooks=O0;T.parse=T;var{options:v4,setOptions:b4,use:I4,walkTokens:R4,parseInline:V4}=T;var m4=l.parse,j4=r.lex;import g5 from"react";import{jsxDEV as X5}from"react/jsx-dev-runtime";T.setOptions({gfm:!0,breaks:!1});var q2=new Set(["a","abbr","b","br","code","del","em","i","kbd","mark","q","s","small","span","strong","sub","sup","time","u"]),H2=new Set(["Priority"]);function G2(Q){if(typeof Q==="string"||typeof Q==="number")return!0;if(!g5.isValidElement(Q))return!1;if(typeof Q!=="object"||Q===null||!("type"in Q))return!1;let $=Q.type;if(typeof $==="string")return q2.has($);if(typeof $==="function"){let Y="displayName"in $&&typeof $.displayName==="string"?$.displayName:$.name;return Y?H2.has(Y):!1}return!1}function U2(Q,$){let Y=Q.trim();if(!Y)return null;let B=T.parse(Y,{async:!1});return X5("div",{className:"prose-canvas","data-md":"markdown","data-md-source":Y,dangerouslySetInnerHTML:{__html:B}},$,!1,void 0,this)}function Z2(Q,$){return X5("div",{className:"prose-canvas",children:Q.map((Y,B)=>{if(typeof Y==="string"||typeof Y==="number"){let J=T.parseInline(String(Y),{async:!1});return X5("span",{dangerouslySetInnerHTML:{__html:J}},B,!1,void 0,this)}return Y})},$,!1,void 0,this)}function J0(Q){let $=g5.Children.toArray(Q);if($.length===0)return null;let Y=[],B=[],J=0,W=()=>{if(B.length===0)return;if(B.some((q)=>typeof q!=="string"&&typeof q!=="number"))Y.push(Z2(B,`md-${J++}`));else{let q=U2(B.join(""),`md-${J++}`);if(q)Y.push(q)}B=[]};for(let K of $)if(G2(K))B.push(K);else W(),Y.push(K);return W(),Y}import{jsxDEV as q5}from"react/jsx-dev-runtime";var y2={info:{bg:"bg-accent-blue-muted",icon:"i",iconColor:"text-accent-blue"},warning:{bg:"bg-accent-amber-muted",icon:"!",iconColor:"text-accent-amber"},danger:{bg:"bg-accent-red-muted",icon:"✕",iconColor:"text-accent-red"},tip:{bg:"bg-accent-green-muted",icon:"✓",iconColor:"text-accent-green"}};function N2({type:Q="info",children:$}){let Y=y2[Q];return q5("div",{className:`${Y.bg} relative rounded-lg px-5 py-4 mt-3 flex gap-3 items-start`,"data-md":"callout","data-md-type":Q,children:[q5("span",{"aria-hidden":"true",className:`${Y.iconColor} opacity-70 text-base leading-relaxed flex-shrink-0 mt-px`,children:Y.icon},void 0,!1,void 0,this),q5("div",{className:"text-body text-text-secondary leading-relaxed",children:J0($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{jsxDEV as P0}from"react/jsx-dev-runtime";function P2({items:Q}){return P0("ul",{className:"space-y-1 mt-3","data-md":"checklist",children:Q.map(($,Y)=>P0("li",{"data-md":"checklist-item","data-md-label":$.label,className:"relative flex items-start gap-2.5 py-1",children:[P0("span",{className:`w-4 h-4 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5 transition-all ${$.checked?"bg-accent-green":"border-[1.5px] border-border-hover"}`,children:$.checked&&P0("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:P0("path",{d:"M2.5 5L4.5 7L7.5 3",style:{stroke:"var(--color-text-inverse)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),P0("span",{className:`text-body font-body ${$.checked?"text-text-tertiary line-through decoration-border-hover":"text-text-secondary"}`,children:$.label},void 0,!1,void 0,this)]},Y,!0,void 0,this))},void 0,!1,void 0,this)}import{useAnnotations as Y1,useResponseRegistration as J1}from"#canvas/runtime";import{useEffect as B1,useMemo as W1,useRef as K1,useState as X1}from"react";import{AnnotationCtx as B7,AnnotationHostContext as W7,SessionContext as K7,useAnnotationHost as X7,useAnnotations as q7}from"@fabrika/annotations/runtime";function H5(Q,$){let Y=[],B=_2(Q);for(let J of B){let W=document.createRange();if(W.selectNodeContents(J),J===Q.startContainer)W.setStart(J,Q.startOffset);if(J===Q.endContainer)W.setEnd(J,Q.endOffset);let K=W.toString();if(!K||!K.trim())continue;let q=document.createElement("mark");q.setAttribute("data-annotation-id",$);try{W.surroundContents(q)}catch{let X=W.extractContents();q.appendChild(X),W.insertNode(q)}Y.push(q)}return Y}function G5(Q){let $=Q.parentElement;if($?.classList.contains("select-none"))return!1;if($?.closest("[data-annotation-id]"))return!1;return!0}function _2(Q){let $=[],Y=Q.commonAncestorContainer;if(Y.nodeType===Node.TEXT_NODE)return $.push(Y),$;let B=document.createTreeWalker(Y,NodeFilter.SHOW_TEXT),J;while(J=B.nextNode()){if(!G5(J))continue;if(Q.intersectsNode(J))$.push(J)}return $}function U5(Q,$){for(let Y of $){if(Q.querySelector(`[data-annotation-id="${Y.id}"]`))continue;let B=Y.snippet;if(!B)continue;let{fullText:J,textNodes:W}=F2(Q),K=[],q=0;while(!0){let U=J.indexOf(B,q);if(U===-1)break;K.push(U),q=U+1}let[X]=K;if(X===void 0)continue;let H=X;if(K.length>1&&Y.context){let U=-1;for(let y of K){let P=0;if(Y.context.before){let L=J.slice(Math.max(0,y-80),y);if(L.includes(Y.context.before))P+=2;else if(Y.context.before.length>10&&L.includes(Y.context.before.slice(-10)))P+=1}if(Y.context.after){let L=J.slice(y+B.length,y+B.length+80);if(L.includes(Y.context.after))P+=2;else if(Y.context.after.length>10&&L.includes(Y.context.after.slice(0,10)))P+=1}if(P>U)U=P,H=y}}let G=H,Z=H+B.length,_=u5(W,G),N=u5(W,Z);if(!_||!N)continue;try{let U=document.createRange();U.setStart(_.node,_.offset),U.setEnd(N.node,N.offset),H5(U,Y.id)}catch{}}}function F2(Q){let $=[],Y="",B=document.createTreeWalker(Q,NodeFilter.SHOW_TEXT),J;while(J=B.nextNode()){if(!G5(J))continue;$.push({node:J,start:Y.length}),Y+=J.textContent||""}return{fullText:Y,textNodes:$}}function u5(Q,$){for(let Y=Q.length-1;Y>=0;Y--){let B=Q[Y];if(!B||B.start>$)continue;let J=$-B.start,W=B.node.textContent?.length??0;if(J<=W)return{node:B.node,offset:J}}return null}function A0(Q){return{kind:Q.kind,owns:($)=>Q.parse($)!==null,find:($,Y)=>{let B=Q.parse($);return B===null?null:Q.find(B,Y)},restore:($,Y)=>{let B=Q.parse(Y.snippet);if(B===null)return;Q.restore?.(B,$,Y)},describe:($)=>{let Y=Q.parse($);if(Y===null||!Q.describe)return null;return Q.describe(Y)}}}function p5(Q){let $=document.createTreeWalker(Q,NodeFilter.SHOW_TEXT),Y="";for(let B=$.nextNode();B;B=$.nextNode()){let J=B.parentElement?.closest("[aria-hidden='true']");if(J&&Q.contains(J))continue;Y+=B.textContent??""}return Y.trim()}function E0(Q,$,Y){return{selector:Q,snippet:(B)=>{let J=B.getAttribute(Y);return J?`${$} ${J}`:null}}}var Z5=[E0("[data-md='item']","[Item]","data-md-label"),E0("[data-md='section']","[Section]","data-md-title"),E0("[data-md='checklist-item']","[Checklist]","data-md-label"),E0("[data-md='image']","[Image]","data-md-src"),{selector:"[data-md='callout']",snippet:(Q)=>{return`[Callout:${Q.getAttribute("data-md-type")||"info"}] ${p5(Q).slice(0,60)||"Callout"}`}},{selector:"[data-md='note']",snippet:(Q)=>`[Note] ${p5(Q).slice(0,60)||"Note"}`},{selector:"[data-md='table'] tbody tr",snippet:(Q)=>{let $=Array.from(Q.querySelectorAll("td")).map((Y)=>Y.textContent?.trim()).filter(Boolean);return $.length?`[Row] ${$.join(" | ")}`:null}}],L2=["[data-md='choice-option']","[data-md='multichoice-option']","[data-md='userinput']","[data-md='rangeinput']"],y5=Z5.map((Q)=>Q.selector).join(", "),c5=[...Z5.map((Q)=>Q.selector),...L2].join(", ");function N5(Q){for(let $ of Z5)if(Q.matches($.selector))return $.snippet(Q);return null}var P5={kind:"block",parse:(Q)=>Q.startsWith("[")?{snippet:Q}:null,format:(Q)=>Q.snippet,find:(Q,$)=>{for(let Y of $.querySelectorAll(y5)){if(!(Y instanceof HTMLElement))continue;if(N5(Y)===Q.snippet)return Y}return null}};var M2=/^\[Region:(rect|ellipse)\] ([\s\S]+) @(0|[1-9]\d*),(0|[1-9]\d*),(0|[1-9]\d*),(0|[1-9]\d*)$/;function z2(Q){if(Q==="rect")return"rect";if(Q==="ellipse")return"ellipse";return null}function h0(Q){if(Q===void 0)return null;let $=Number(Q);if(!Number.isInteger($)||$<0||$>1e4)return null;return $}function d5(Q){return{left:`${Q.x/100}%`,top:`${Q.y/100}%`,width:`${Q.w/100}%`,height:`${Q.h/100}%`}}function x0(Q){return`${(Q/100).toFixed(1).replace(/\.0$/,"")}%`}function F5(Q){let $=`${x0(Q.x)}-${x0(Q.x+Q.w)}`,Y=`${x0(Q.y)}-${x0(Q.y+Q.h)}`;return`[Region] ${Q.src} — ${Q.shape} x ${$}, y ${Y} of the image`}function _5(Q,$){for(let Y of $.querySelectorAll("[data-md='image']")){if(!(Y instanceof HTMLElement))continue;if(Y.getAttribute("data-md-src")!==Q)continue;let B=Y.querySelector("[data-annotation-image]");if(B instanceof HTMLElement)return B}return null}function r5(Q,$){let Y=d5($);Q.style.left=Y.left,Q.style.top=Y.top,Q.style.width=Y.width,Q.style.height=Y.height}function L5(Q,$,Y){let B=document.createElement("div");return B.className="ann-region",B.setAttribute("data-annotation-id",Y),B.setAttribute("data-annotation-region",$),r5(B,Q),B}var g0={kind:"region",parse:(Q)=>{let $=M2.exec(Q);if(!$)return null;let Y=z2($[1]),B=$[2],J=h0($[3]),W=h0($[4]),K=h0($[5]),q=h0($[6]);if(Y===null||B===void 0)return null;if(J===null||W===null||K===null||q===null)return null;if(K<1||q<1)return null;return{src:B,shape:Y,x:J,y:W,w:K,h:q}},format:(Q)=>`[Region:${Q.shape}] ${Q.src} @${Q.x},${Q.y},${Q.w},${Q.h}`,find:(Q,$)=>_5(Q.src,$),restore:(Q,$,Y)=>{if($.querySelector(`[data-annotation-id="${Y.id}"]`))return;let B=_5(Q.src,$);if(!B)return;B.appendChild(L5(Q,Q.shape,Y.id))},describe:F5};var M5={kind:"text",parse:(Q)=>Q?{text:Q}:null,format:(Q)=>Q.text,find:()=>null,restore:(Q,$,Y)=>{U5($,[Y])}};var T2=[A0(g0),A0(P5),A0(M5)];import{AnnotationCtx as M3,SessionContext as z3,useAnnotationHost as T3}from"@fabrika/annotations/runtime";import{useEffect as A3,useState as S3}from"react";import{useCallback as y3,useMemo as N3,useState as P3}from"react";function S0(Q){return Q.uploadUrl!==null}function Q0(Q,$){Q.style.height="auto",Q.style.height=($?Math.max($,Q.scrollHeight):Q.scrollHeight)+"px"}import{useAnnotations as u0}from"@fabrika/annotations/runtime";import{jsxDEV as v3}from"react/jsx-dev-runtime";import{jsxDEV as j3,Fragment as m3}from"react/jsx-dev-runtime";import{useAnnotationHost as w2}from"@fabrika/annotations/runtime";import{useCallback as Y0,useEffect as A2,useRef as T5,useState as O5}from"react";import{jsxDEV as h}from"react/jsx-dev-runtime";function l5(Q){if(Q.startsWith("/s/")||Q.startsWith("http://")||Q.startsWith("https://"))return Q;return`/api/uploads/${Q.split("/").pop()}`}async function S2(Q,$){let Y=Q.uploadUrl;if(!Y)return null;let B=new FormData;B.append("image",$);try{let W=await(await fetch(Y(),{method:"POST",body:B})).json();if(Q.isShared)return W.url||null;return W.path||null}catch{return null}}function p0({note:Q,onNoteChange:$,images:Y,onAddImage:B,onRemoveImage:J,sessionId:W,placeholder:K="Add your note...",autoFocus:q=!1,autoResize:X=!1,readOnly:H=!1,onKeyDown:G,onTextareaClick:Z,textareaRef:_,textareaClassName:N,textareaStyle:U,minHeight:y,attachButton:P="always",openFilePickerRef:L}){let w=w2(),A=!H&&S0(w),[I,v]=O5(!1),[b,x]=O5(!1),[u,i]=O5(!1),k=T5(0),R=T5(null),g=T5(null),j=Y0(()=>g.current?.click(),[]);if(L)L.current=j;let o=Y0((M)=>{if(R.current=M,_)_.current=M;if(M&&X)Q0(M,y)},[_,X,y]);A2(()=>{if(q&&R.current){let M=R.current;if(M.focus(),M.value)M.setSelectionRange(M.value.length,M.value.length)}},[q]);let p=Y0(async(M)=>{if(!M.type.startsWith("image/"))return;x(!0);try{let D=await S2(w,M);if(D)B(D)}finally{x(!1)}},[w,B]),K0=Y0((M)=>{for(let D of M.clipboardData?.items??[])if(D.type.startsWith("image/")){M.preventDefault();let y0=D.getAsFile();if(y0)p(y0);return}},[p]),c=Y0((M)=>{if(M.preventDefault(),k.current++,k.current===1)v(!0)},[]),d=Y0((M)=>{M.preventDefault()},[]),s=Y0((M)=>{if(M.preventDefault(),k.current--,k.current===0)v(!1)},[]),a=Y0((M)=>{M.preventDefault(),k.current=0,v(!1);for(let D of M.dataTransfer?.files??[])if(D.type.startsWith("image/"))p(D)},[p]),X0=Y0((M)=>{if($(M.currentTarget.value),X)M.currentTarget.style.height="auto",M.currentTarget.style.height=(y?Math.max(y,M.currentTarget.scrollHeight):M.currentTarget.scrollHeight)+"px"},[$,X,y]),q0="w-full bg-transparent text-[13px] font-body text-text-primary resize-none focus:outline-none leading-relaxed p-0 border-none",a0={width:"100%",background:"transparent",border:"none",color:"var(--color-text-primary)",fontFamily:"'Inter', sans-serif",fontSize:"13px",lineHeight:"1.5",outline:"none",...X?{resize:"none",overflow:"hidden"}:{resize:"vertical"}},b0=A&&(P==="always"||P==="on-focus"&&u);return h("div",{style:{position:"relative"},onDragEnter:A?c:void 0,onDragOver:A?d:void 0,onDragLeave:A?s:void 0,onDrop:A?a:void 0,children:[h("textarea",{ref:o,value:Q,onChange:H?void 0:X0,onPaste:A?K0:void 0,onKeyDown:G,onClick:Z,onFocus:()=>i(!0),onBlur:()=>{setTimeout(()=>i(!1),150)},readOnly:H,placeholder:K,className:N??q0,style:U??a0,rows:X?1:void 0},void 0,!1,void 0,this),A&&h("input",{ref:g,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:(M)=>{let D=M.currentTarget.files;if(D)for(let y0 of D)p(y0);M.currentTarget.value=""}},void 0,!1,void 0,this),(Y.length>0||b0)&&h("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap",marginTop:"6px",alignItems:"center"},children:[Y.map((M)=>h("div",{style:{position:"relative",width:"56px",height:"56px",borderRadius:"6px",overflow:"hidden",border:"1px solid var(--color-border-subtle)",flexShrink:0},children:[h("img",{src:l5(M),alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}},void 0,!1,void 0,this),!H&&h("button",{onClick:(D)=>{D.stopPropagation(),J(M)},style:{position:"absolute",top:"2px",right:"2px",width:"16px",height:"16px",borderRadius:"50%",background:"rgba(0,0,0,0.6)",color:"white",border:"none",cursor:"pointer",fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,padding:0},title:"Remove image",children:"×"},void 0,!1,void 0,this)]},M,!0,void 0,this)),b0&&h(c0,{onClick:j},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&h("div",{style:{fontSize:"11px",color:"var(--color-text-tertiary)",fontFamily:"'Inter', sans-serif",marginTop:"4px"},children:"Uploading..."},void 0,!1,void 0,this),I&&h("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--color-highlight-bg)",opacity:0.9,border:"2px dashed var(--color-highlight-border)",borderRadius:"6px",zIndex:10,pointerEvents:"none",fontSize:"12px",fontFamily:"'Inter', sans-serif",color:"var(--color-text-secondary)"},children:"Drop image"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function c0({onClick:Q,size:$=16}){return h("button",{onClick:(Y)=>{Y.stopPropagation(),Q()},style:{width:`${$*2}px`,height:`${$*2}px`,borderRadius:"6px",border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-tertiary)",flexShrink:0,transition:"color 0.15s"},title:"Attach image",onMouseEnter:(Y)=>{Y.currentTarget.style.color="var(--color-text-secondary)"},onMouseLeave:(Y)=>{Y.currentTarget.style.color="var(--color-text-tertiary)"},children:h("svg",{width:$,height:$,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[h("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"},void 0,!1,void 0,this),h("circle",{cx:"8.5",cy:"8.5",r:"1.5"},void 0,!1,void 0,this),h("polyline",{points:"21 15 16 10 5 21"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}import{SessionContext as d3}from"@fabrika/annotations/runtime";import{useContext as l3,useEffect as i3,useRef as o3}from"react";import{jsxDEV as $6,Fragment as Q6}from"react/jsx-dev-runtime";import{SessionContext as v2,useAnnotationHost as b2}from"@fabrika/annotations/runtime";import{useCallback as d0,useContext as I2,useEffect as R2,useMemo as a5,useRef as r0,useState as _0}from"react";import{createPortal as V2}from"react-dom";function o5(Q){let $=/^(\d+(?:\.\d+)?)px$/.exec(Q.trim());return $?Number($[1]):void 0}function s5(Q,$,Y=280){let J=$||document.body,W=Q.getBoundingClientRect(),K=J.getBoundingClientRect(),q=J===document.body?0:J.scrollTop,X=W.bottom-K.top+q+8,H=Math.max(0,Math.min(W.left-K.left,K.width-Y-12));return J.style.position="relative",{style:{position:"absolute",top:`${X}px`,left:`${H}px`},parent:J}}import{jsxDEV as m,Fragment as m2}from"react/jsx-dev-runtime";function n5({anchorEl:Q,scrollContainer:$,onClose:Y,ignoreSelector:B,zIndex:J="50",padding:W="12px",width:K="280px",children:q}){let X=r0(null),H=r0(Y);H.current=Y;let{style:G,parent:Z}=s5(Q,$,o5(K));return R2(()=>{let _=setTimeout(()=>{let N=(U)=>{if(X.current&&!X.current.contains(U.target)){if(B&&U.target.closest?.(B))return;H.current(),document.removeEventListener("mousedown",N)}};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},0);return()=>clearTimeout(_)},[B]),V2(m("div",{ref:X,style:{...G,zIndex:J,width:K,background:"var(--color-bg-elevated)",border:"1px solid var(--color-border-hover)",borderRadius:"8px",boxShadow:"0 4px 12px var(--color-shadow)",padding:W,fontFamily:"'Inter', sans-serif"},children:q},void 0,!1,void 0,this),Z)}var e5=[{label:"Clarity",items:["Unclear","Why?","Needs example","Missing context"]},{label:"Scope",items:["Overkill","Out of scope","Important","Risky"]},{label:"Action",items:["Simplify","Rethink","Expand on this","Skip this"]}],t5=e5.flatMap((Q)=>Q.items);function $1({anchorEl:Q,scrollContainer:$,snippet:Y,truncateAt:B=100,header:J,initialNote:W="",initialImages:K,onConfirm:q,onCancel:X,onDelete:H}){let G=I2(v2),Z=b2(),_=S0(Z),N=W!==""||!!H,[U,y]=_0(W),[P,L]=_0(K||[]),[w,A]=_0(null),[I,v]=_0(N),[b,x]=_0(!1),u=r0(null),i=r0(null),k=d0(()=>{if(U.trim()||P.length>0)q(U.trim(),P);else if(N&&H)H();else X()},[U,P,q,X,N,H]),R=d0(()=>{if(N){if(!U.trim()&&P.length===0&&H){H(),X();return}q(U,P);return}X()},[U,P,N,q,X,H]),g=!N,j=U.trim().length>0?t5.filter((F)=>F.toLowerCase().startsWith(U.trim().toLowerCase())):t5,o=!g||I?[]:j.length===1&&j[0]?.toLowerCase()===U.trim().toLowerCase()?[]:j,p=new Set(o),K0=e5.map((F)=>({label:F.label,items:F.items.filter((C)=>p.has(C))})).filter((F)=>F.items.length>0),c=K0.map((F)=>F.items),d=(F)=>c[F]?.length??0,s=c.flat(),a=a5(()=>{if(w===null)return 0;let F=0;for(let C=0;C<c.length;C++){if(w<F+d(C))return C;F+=d(C)}return 0},[w,c]),X0=a5(()=>{if(w===null)return 0;let F=0;for(let C=0;C<a;C++)F+=d(C);return w-F},[w,a,c]),q0=(F,C)=>{let V=0;for(let t=0;t<F;t++)V+=d(t);return V+C},[a0,b0]=_0(U);if(U!==a0)b0(U),A(null),v(N);let M=d0((F)=>{y(F)},[]),D=Y.length>B?Y.slice(0,B)+"...":Y,y0=d0((F)=>{if(s.length>0&&(F.key==="ArrowDown"||F.key==="ArrowUp"||F.key==="ArrowLeft"||F.key==="ArrowRight")){if(F.preventDefault(),w===null){A(0);return}if(F.key==="ArrowDown"){let V=Math.min(X0+1,d(a)-1);A(q0(a,V))}else if(F.key==="ArrowUp"){let V=Math.max(X0-1,0);A(q0(a,V))}else if(F.key==="ArrowRight"){let V=Math.min(a+1,c.length-1),t=Math.min(X0,d(V)-1);A(q0(V,t))}else if(F.key==="ArrowLeft"){let V=Math.max(a-1,0),t=Math.min(X0,d(V)-1);A(q0(V,t))}return}let C=w===null?void 0:s[w];if(C!==void 0){if(F.key==="Tab"){F.preventDefault(),M(C);return}if(F.key==="Enter"&&!F.shiftKey){F.preventDefault(),q(C,P);return}}if(F.key==="Enter"&&!F.shiftKey){F.preventDefault(),k();return}if(F.key==="Escape")if(s.length>0&&!I)v(!0);else if(N)R();else X()},[s,w,X0,a,c,q0,M,q,P,k,I,N,R,X]);return m(n5,{anchorEl:Q,scrollContainer:$,onClose:N?R:X,ignoreSelector:N?"[data-annotation-id]":void 0,zIndex:N?"60":"50",padding:N?"10px 12px":"12px",width:"420px",children:[!N&&(J??m("div",{style:{fontSize:"11px",color:"var(--color-text-tertiary)",fontStyle:"italic",marginBottom:"8px",lineHeight:"1.4",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:["“",D,"”"]},void 0,!0,void 0,this)),m(p0,{note:U,onNoteChange:y,images:P,onAddImage:(F)=>L((C)=>[...C,F]),onRemoveImage:(F)=>L((C)=>C.filter((V)=>V!==F)),sessionId:G,autoFocus:!0,autoResize:N,textareaRef:u,onKeyDown:y0,attachButton:"none",openFilePickerRef:i,textareaStyle:N?{width:"100%",background:"transparent",border:"none",color:"var(--color-text-primary)",fontFamily:"'Inter', sans-serif",fontSize:"13px",lineHeight:"1.5",resize:"none",outline:"none",overflow:"hidden"}:{width:"100%",minHeight:"60px",background:"transparent",border:"none",color:"var(--color-text-primary)",fontFamily:"'Inter', sans-serif",fontSize:"13px",lineHeight:"1.5",resize:"vertical",outline:"none"},placeholder:"Add your note..."},void 0,!1,void 0,this),m("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:N?"6px":"8px"},children:[_&&m(c0,{onClick:()=>i.current?.(),size:14},void 0,!1,void 0,this),m("div",{style:{flex:1}},void 0,!1,void 0,this),N?m("button",{onClick:()=>{if(H)H();X()},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),style:{fontSize:"11px",color:b?"var(--color-accent-red)":"var(--color-text-tertiary)",background:"none",border:"none",cursor:"pointer",padding:"2px 0",fontFamily:"'Inter', sans-serif"},children:"Delete"},void 0,!1,void 0,this):m(m2,{children:[m("button",{onClick:X,style:{fontSize:"11px",color:"var(--color-text-tertiary)",background:"none",border:"none",cursor:"pointer",padding:"4px 12px",fontFamily:"'Inter', sans-serif"},children:"Cancel"},void 0,!1,void 0,this),m("button",{onClick:k,style:{fontSize:"11px",fontWeight:500,padding:"4px 12px",borderRadius:"6px",background:"var(--color-highlight-bg)",color:"var(--color-text-primary)",border:"1px solid var(--color-highlight-border)",cursor:"pointer",fontFamily:"'Inter', sans-serif"},children:"Add"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.length>0&&m("div",{style:{marginTop:"6px",borderTop:"1px solid var(--color-border-subtle)",paddingTop:"8px",display:"flex",gap:"4px"},children:K0.map((F)=>m("div",{style:{flex:1},children:[m("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--color-text-disabled)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 6px",marginBottom:"2px",fontFamily:"'Inter', sans-serif"},children:F.label},void 0,!1,void 0,this),F.items.map((C)=>{let V=s.indexOf(C);return m("div",{onMouseDown:(t)=>{t.preventDefault(),t.stopPropagation(),M(C)},onMouseEnter:()=>A(V),style:{padding:"3px 6px",fontSize:"12px",borderRadius:"4px",fontFamily:"'Inter', sans-serif",color:V===w?"var(--color-text-primary)":"var(--color-text-secondary)",background:V===w?"var(--color-highlight-selected)":"transparent",cursor:"pointer"},children:[m("span",{style:{fontWeight:500},children:C.slice(0,U.trim().length)},void 0,!1,void 0,this),C.slice(U.trim().length)]},C,!0,void 0,this)})]},F.label,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function C0({anchorEl:Q,scrollContainer:$,snippet:Y,truncateAt:B,header:J,onAdd:W,onCancel:K}){return m($1,{anchorEl:Q,scrollContainer:$,snippet:Y,truncateAt:B,header:J,onConfirm:(q,X)=>W(q,X),onCancel:K},void 0,!1,void 0,this)}import{useEffect as L6,useRef as M6,useState as z6}from"react";import{jsxDEV as C6}from"react/jsx-dev-runtime";import{useCallback as I6,useEffect as R6,useRef as V6,useState as m6}from"react";import{jsxDEV as p6,Fragment as u6}from"react/jsx-dev-runtime";import{jsxDEV as Q1}from"react/jsx-dev-runtime";function F0({note:Q,onChange:$}){return Q1("div",{className:"mt-1.5",children:Q1("textarea",{value:Q,onChange:(Y)=>$(Y.currentTarget.value),className:"w-full bg-transparent text-[12px] font-body text-text-primary resize-none focus:outline-none border-none placeholder:text-text-disabled transition-colors min-h-[20px] p-0 leading-relaxed",placeholder:"Add a note...",rows:1,onInput:(Y)=>Q0(Y.currentTarget),ref:(Y)=>{if(Y)Q0(Y)}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}import{jsxDEV as f}from"react/jsx-dev-runtime";function q1(Q){return Q.map(($)=>typeof $==="string"?{value:$,label:$}:{value:$.value,label:$.label??$.value})}function d2({id:Q,label:$,options:Y,required:B}){let{responses:J,setResponse:W}=Y1();J1(Q);let K=W1(()=>q1(Y),[Y]),q=J.get(Q),X=q?.value,H=q?.note||"",[G,Z]=X1(!1),_=K1(null);if(!J.has(Q))W(Q,{id:Q,type:"radio",label:$,value:null,options:K.map((y)=>y.value),required:B});let N=(y)=>{W(Q,{...q,value:y})};B1(()=>{let y=_.current;if(!y)return;let P=(L)=>{let A=L.target.closest("[data-md-label]")?.getAttribute("data-md-label"),I=K.find((v)=>v.label===A);if(I)N(I.value)};return y.addEventListener("kb-select",P),()=>y.removeEventListener("kb-select",P)},[K,N]);let U=q?.required&&!X;return f("div",{ref:_,"data-md":"choice","data-md-label":$,className:"-mx-4 px-4 py-3 my-1 rounded-lg transition-colors duration-150 hover:bg-bg-input",children:[f("div",{className:"flex items-baseline gap-2 mb-2",children:[f("span",{className:"text-[13px] font-body font-medium text-text-primary",children:$},void 0,!1,void 0,this),B&&f("span",{className:"text-[10px] text-accent-red font-body",children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f("div",{className:"space-y-1",children:K.map(({value:y,label:P})=>f("label",{"data-md":"choice-option","data-md-label":P,onClick:()=>N(y),className:`flex items-center gap-2.5 px-3 py-2 rounded-lg cursor-pointer transition-all duration-150 ${X===y?"bg-highlight-selected":"hover:bg-bg-elevated"}`,children:[f("span",{className:`w-4 h-4 rounded-full border-[1.5px] flex items-center justify-center flex-shrink-0 transition-all ${X===y?"border-accent-amber bg-accent-amber":"border-border-strong"}`,children:X===y&&f("span",{className:"w-1.5 h-1.5 rounded-full bg-text-inverse"},void 0,!1,void 0,this)},void 0,!1,void 0,this),f("span",{className:"text-[13px] font-body text-text-secondary",children:P},void 0,!1,void 0,this)]},y,!0,void 0,this))},void 0,!1,void 0,this),f(F0,{show:G,note:H,onToggle:()=>Z(!G),onChange:(y)=>W(Q,{...q,note:y})},void 0,!1,void 0,this),U&&f("p",{className:"text-[11px] text-accent-red font-body mt-1",children:"Please select an option."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function r2({id:Q,label:$,options:Y,required:B}){let{responses:J,setResponse:W}=Y1();J1(Q);let K=W1(()=>q1(Y),[Y]),q=J.get(Q),X=q?.value||[],H=q?.note||"",[G,Z]=X1(!1),_=K1(null);if(!J.has(Q))W(Q,{id:Q,type:"checkbox",label:$,value:[],options:K.map((y)=>y.value),required:B});let N=(y)=>{let P=X.includes(y)?X.filter((L)=>L!==y):[...X,y];W(Q,{...q,value:P})};B1(()=>{let y=_.current;if(!y)return;let P=(L)=>{let A=L.target.closest("[data-md-label]")?.getAttribute("data-md-label"),I=K.find((v)=>v.label===A);if(I)N(I.value)};return y.addEventListener("kb-select",P),()=>y.removeEventListener("kb-select",P)},[K,N]);let U=q?.required&&X.length===0;return f("div",{ref:_,"data-md":"multichoice","data-md-label":$,className:"-mx-4 px-4 py-3 my-1 rounded-lg transition-colors duration-150 hover:bg-bg-input",children:[f("div",{className:"flex items-baseline gap-2 mb-2",children:[f("span",{className:"text-[13px] font-body font-medium text-text-primary",children:$},void 0,!1,void 0,this),B&&f("span",{className:"text-[10px] text-accent-red font-body",children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f("div",{className:"space-y-1",children:K.map(({value:y,label:P})=>{let L=X.includes(y);return f("label",{"data-md":"multichoice-option","data-md-label":P,onClick:()=>N(y),className:`flex items-center gap-2.5 px-3 py-2 rounded-lg cursor-pointer transition-all duration-150 ${L?"bg-highlight-selected":"hover:bg-bg-elevated"}`,children:[f("span",{className:`w-4 h-4 rounded flex items-center justify-center flex-shrink-0 transition-all ${L?"bg-accent-amber":"border-[1.5px] border-border-strong"}`,children:L&&f("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:f("path",{d:"M2.5 5L4.5 7L7.5 3",style:{stroke:"var(--color-text-inverse)"},strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),f("span",{className:"text-[13px] font-body text-text-secondary",children:P},void 0,!1,void 0,this)]},y,!0,void 0,this)})},void 0,!1,void 0,this),f(F0,{show:G,note:H,onToggle:()=>Z(!G),onChange:(y)=>W(Q,{...q,note:y})},void 0,!1,void 0,this),U&&f("p",{className:"text-[11px] text-accent-red font-body mt-1",children:"Please select at least one option."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{useEffect as l2,useRef as i2}from"react";import{jsxDEV as l0}from"react/jsx-dev-runtime";function o2({language:Q,children:$}){let Y=typeof $==="string"?$:String($??""),B=i2(null);return l2(()=>{let J=B.current,W=window.hljs;if(!J||!W)return;J.removeAttribute("data-highlighted"),J.className=Q?`language-${Q}`:"",J.textContent=Y,W.highlightElement(J)},[Y,Q]),l0("div",{className:"relative mt-3 group/code","data-md":"codeblock","data-md-language":Q||"",children:[Q&&l0("span",{className:"absolute top-2 right-3 text-tiny text-text-tertiary opacity-0 group-hover/code:opacity-60 transition-opacity duration-150 z-10 font-mono",children:Q},void 0,!1,void 0,this),l0("pre",{className:"bg-bg-code rounded-md p-4 overflow-x-auto text-code font-mono leading-relaxed",children:l0("code",{ref:B,className:Q?`language-${Q}`:"",children:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function H1(Q,$){let Y=Q.split(`
|
|
60
|
+
`),B=$.split(`
|
|
61
|
+
`),J=s2(Y,B),W=[],K=0,q=0,X=0;while(K<Y.length||q<B.length){let H=Y[K],G=B[q];if(X<J.length&&H!==void 0&&G!==void 0&&H===J[X]&&G===J[X])W.push({type:"same",line:H}),K++,q++,X++;else if(H!==void 0&&(X>=J.length||H!==J[X]))W.push({type:"removed",line:H}),K++;else if(G!==void 0)W.push({type:"added",line:G}),q++}return W}function s2(Q,$){let Y=Q.length,B=$.length,J=Array.from({length:Y+1},()=>Array(B+1).fill(0));for(let X=1;X<=Y;X++){let H=J[X]??[],G=J[X-1]??[];for(let Z=1;Z<=B;Z++)H[Z]=Q[X-1]===$[Z-1]?(G[Z-1]??0)+1:Math.max(G[Z]??0,H[Z-1]??0)}let W=[],K=Y,q=B;while(K>0&&q>0){let X=Q[K-1];if(X!==void 0&&X===$[q-1])W.unshift(X),K--,q--;else if((J[K-1]?.[q]??0)>(J[K]?.[q-1]??0))K--;else q--}return W}import{jsxDEV as k0}from"react/jsx-dev-runtime";function a2({before:Q,after:$,language:Y}){let B=H1(Q,$);return k0("div",{className:"mt-3 bg-bg-code rounded-md overflow-hidden group/diff","data-md":"diff","data-md-language":Y||"",children:[Y&&k0("div",{className:"px-4 py-2 text-meta font-mono text-text-tertiary opacity-0 group-hover/diff:opacity-60 transition-opacity",children:["diff (",Y,")"]},void 0,!0,void 0,this),k0("pre",{className:"px-4 pb-3 overflow-x-auto text-code font-mono",children:B.map((J,W)=>k0("div",{className:J.type==="removed"?"bg-accent-red-muted text-accent-red":J.type==="added"?"bg-accent-green-muted text-accent-green":"text-text-tertiary",children:[k0("span",{className:"select-none w-6 inline-block text-center opacity-60",children:J.type==="removed"?"-":J.type==="added"?"+":" "},void 0,!1,void 0,this),J.line]},W,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{ActiveViewCtx as t2,SessionContext as n2}from"#canvas/runtime";import{useContext as G1,useEffect as U1,useRef as e2,useState as i0}from"react";import{jsxDEV as B0}from"react/jsx-dev-runtime";var $4={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",rs:"rust",go:"go",rb:"ruby",java:"java",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",css:"css",html:"html",sh:"bash",bash:"bash",toml:"toml",sql:"sql",xml:"xml",c:"c",cpp:"cpp",h:"c"};function Q4({path:Q,lines:$,__content:Y}){let B=G1(n2),{setActiveView:J}=G1(t2),[W,K]=i0(Y??null),[q,X]=i0(()=>{let U=Q.split(".").pop()||"";return $4[U]||"text"}),[H,G]=i0(null),[Z,_]=i0(!Y),N=e2(null);if(U1(()=>{if(Y!==void 0)return;_(!0),G(null),fetch(`/api/file?session=${B}&path=${encodeURIComponent(Q)}`).then((U)=>U.json()).then((U)=>{if(U.error)G(U.error);else{let y=U.content;if($)y=y.split(`
|
|
62
|
+
`).slice($[0]-1,$[1]).join(`
|
|
63
|
+
`);K(y),X(U.language||"text")}}).catch(()=>G("Failed to fetch file")).finally(()=>_(!1))},[B,Q,$?.[0],$?.[1],Y]),U1(()=>{let U=N.current,y=window.hljs;if(!U||!y||!W)return;U.removeAttribute("data-highlighted"),U.className=q?`language-${q}`:"",U.textContent=W,y.highlightElement(U)},[W,q]),Z)return B0("div",{className:"text-text-tertiary text-body mt-3 bg-bg-code rounded-md p-4",children:["Loading ",Q,"..."]},void 0,!0,void 0,this);if(H)return B0("div",{className:"text-accent-red text-body mt-3 bg-accent-red-muted rounded-md p-4",children:[Q,": ",H]},void 0,!0,void 0,this);return B0("div",{className:"mt-3 bg-bg-code rounded-md overflow-hidden","data-md":"filepreview","data-md-path":Q,...$?{"data-md-lines":`${$[0]}-${$[1]}`}:{},children:[B0("div",{className:"px-4 py-2 flex items-center justify-between",children:[B0("button",{className:"font-mono text-meta text-text-tertiary hover:text-text-secondary hover:underline cursor-pointer text-left",onClick:()=>J({type:"file",path:Q}),title:`Open ${Q}`,children:Q},void 0,!1,void 0,this),$&&B0("span",{className:"font-mono text-meta text-text-tertiary opacity-60",children:["L",$[0],"–",$[1]]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B0("pre",{className:"px-4 pb-3 overflow-x-auto text-code font-mono !bg-transparent",style:{background:"transparent"},children:B0("code",{ref:N,className:q?`language-${q}`:"",children:W},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{SessionContext as Y4}from"#canvas/runtime";import{useContext as J4,useState as B4}from"react";import{jsxDEV as f0}from"react/jsx-dev-runtime";function W4({src:Q,alt:$,caption:Y,width:B,height:J}){let W=J4(Y4),[K,q]=B4(!1),X=`/api/image?session=${encodeURIComponent(W)}&path=${encodeURIComponent(Q)}`;if(K)return f0("div",{className:"mt-3 text-accent-red text-body bg-accent-red-muted rounded-md p-4",children:[Q,": Failed to load image"]},void 0,!0,void 0,this);return f0("figure",{className:"mt-3 relative","data-md":"image","data-md-src":Q,children:[f0("div",{"data-annotation-image":!0,className:"rounded-md overflow-hidden border border-border-subtle bg-bg-code inline-block",children:f0("img",{src:X,alt:$||Q,onError:()=>q(!0),draggable:!1,className:"block max-w-full h-auto",...B?{width:B}:{},...J?{height:J}:{}},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&f0("figcaption",{className:"mt-1.5 text-meta text-text-tertiary font-body",children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{useMemo as K4}from"react";import{jsxDEV as Z1}from"react/jsx-dev-runtime";T.setOptions({gfm:!0,breaks:!1});function X4({children:Q,file:$,__content:Y}){let B=Y??(typeof Q==="string"?Q:String(Q??"")),J=K4(()=>{if(!B)return"";return T.parse(B,{async:!1})},[B]);if(!B)return Z1("div",{className:"text-text-tertiary text-tiny mt-3",children:$?`Could not load: ${$}`:"No markdown content"},void 0,!1,void 0,this);return Z1("div",{className:"mt-3 prose-canvas","data-md":"markdown",...$?{"data-md-file":$}:{},"data-md-source":B,dangerouslySetInnerHTML:{__html:J}},void 0,!1,void 0,this)}import{useAnnotations as q4,useCanvasFile as H4}from"#canvas/runtime";import{useCallback as e,useEffect as w5,useRef as v0,useState as L0}from"react";import G4 from"react-dom";import{jsxDEV as z,Fragment as _1}from"react/jsx-dev-runtime";var M0=0.2,o0=0.25,s0=4;function N1({zoom:Q,onZoomIn:$,onZoomOut:Y,onZoomReset:B,onFullscreen:J}){return z("div",{className:"flex items-center gap-0.5 bg-bg-surface border border-border-subtle rounded-md px-1 py-0.5",style:{fontSize:"12px"},children:[z("button",{className:"flex items-center justify-center w-7 h-7 rounded hover:bg-bg-elevated text-text-secondary hover:text-text-primary transition-colors",onClick:Y,title:"Zoom out",disabled:Q<=o0,children:z("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:z("line",{x1:"5",y1:"12",x2:"19",y2:"12"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("button",{className:"px-1.5 h-7 rounded hover:bg-bg-elevated text-text-tertiary hover:text-text-primary transition-colors tabular-nums",onClick:B,title:"Reset zoom",children:[Math.round(Q*100),"%"]},void 0,!0,void 0,this),z("button",{className:"flex items-center justify-center w-7 h-7 rounded hover:bg-bg-elevated text-text-secondary hover:text-text-primary transition-colors",onClick:$,title:"Zoom in",disabled:Q>=s0,children:z("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[z("line",{x1:"12",y1:"5",x2:"12",y2:"19"},void 0,!1,void 0,this),z("line",{x1:"5",y1:"12",x2:"19",y2:"12"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),J&&z(_1,{children:[z("div",{className:"w-px h-4 bg-border-subtle mx-0.5"},void 0,!1,void 0,this),z("button",{className:"flex items-center justify-center w-7 h-7 rounded hover:bg-bg-elevated text-text-secondary hover:text-text-primary transition-colors",onClick:J,title:"Fullscreen",children:z("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[z("polyline",{points:"15 3 21 3 21 9"},void 0,!1,void 0,this),z("polyline",{points:"9 21 3 21 3 15"},void 0,!1,void 0,this),z("line",{x1:"21",y1:"3",x2:"14",y2:"10"},void 0,!1,void 0,this),z("line",{x1:"3",y1:"21",x2:"10",y2:"14"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function P1(Q=1){let[$,Y]=L0(Q),B=e(()=>Y((K)=>Math.min(s0,+(K+M0).toFixed(2))),[]),J=e(()=>Y((K)=>Math.max(o0,+(K-M0).toFixed(2))),[]),W=e(()=>Y(1),[]);return{zoom:$,zoomIn:B,zoomOut:J,zoomReset:W,setZoom:Y}}function U4({svgHtml:Q,source:$,onClose:Y}){let B=v0(null),{zoom:J,zoomIn:W,zoomOut:K,zoomReset:q,setZoom:X}=P1(1),[H,G]=L0({x:0,y:0}),Z=v0(null);w5(()=>{let L=(w)=>{if(w.key==="Escape")Y()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[Y]);let _=e((L)=>{L.preventDefault();let w=L.deltaY>0?-M0:M0;X((A)=>Math.max(o0,Math.min(s0,+(A+w).toFixed(2))))},[X]),N=e((L)=>{if(L.button!==0)return;Z.current={startX:L.clientX,startY:L.clientY,panX:H.x,panY:H.y},L.preventDefault()},[H]),U=e((L)=>{if(!Z.current)return;G({x:Z.current.panX+(L.clientX-Z.current.startX),y:Z.current.panY+(L.clientY-Z.current.startY)})},[]),y=e(()=>{Z.current=null},[]),P=e(()=>{q(),G({x:0,y:0})},[q]);return G4.createPortal(z("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"var(--color-bg-base)",display:"flex",flexDirection:"column"},onMouseMove:U,onMouseUp:y,onMouseLeave:y,children:[z("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border-subtle",style:{flexShrink:0,background:"var(--color-bg-surface)"},children:[z("span",{className:"text-body text-text-secondary",style:{fontSize:"13px"},children:"Mermaid Diagram"},void 0,!1,void 0,this),z("div",{className:"flex items-center gap-2",children:[z(N1,{zoom:J,onZoomIn:W,onZoomOut:K,onZoomReset:P},void 0,!1,void 0,this),z("button",{className:"flex items-center justify-center w-8 h-8 rounded hover:bg-bg-elevated text-text-secondary hover:text-text-primary transition-colors",onClick:Y,title:"Close (Esc)",children:z("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[z("line",{x1:"18",y1:"6",x2:"6",y2:"18"},void 0,!1,void 0,this),z("line",{x1:"6",y1:"6",x2:"18",y2:"18"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z("div",{style:{flex:1,overflow:"hidden",cursor:Z.current?"grabbing":"grab"},onWheel:_,onMouseDown:N,children:z("div",{ref:B,style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",transform:`translate(${H.x}px, ${H.y}px) scale(${J})`,transformOrigin:"center center",transition:Z.current?"none":"transform 0.1s ease-out"},dangerouslySetInnerHTML:{__html:Q}},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),document.body)}function Z4({children:Q}){let $=v0(null),[Y,B]=L0(null),[J,W]=L0(!1),[K,q]=L0(""),X=typeof Q==="string"?Q:String(Q??""),{annotations:H,addAnnotationWithId:G,activeAnnotationId:Z,setActiveAnnotationId:_}=q4(),N=H4(),[U,y]=L0(null),{zoom:P,zoomIn:L,zoomOut:w,zoomReset:A,setZoom:I}=P1(1),v=v0(H);v.current=H;let b=e((k,R,g)=>{let j=`[Diagram ${g.toLowerCase()}] ${R}`,o=v.current.find((p)=>p.snippet===j);if(o)_(o.id);else y({anchorEl:k,snippet:R,prefix:g})},[_]),x=v0(b);x.current=b,w5(()=>{let k=!1,R=async()=>{try{let j=window.mermaid;if(!j){B("Mermaid library not loaded");return}let o=document.documentElement.dataset.theme==="light"?"default":"dark";j.initialize({startOnLoad:!1,theme:o});let p=`mermaid-${Math.random().toString(36).slice(2)}`,{svg:K0}=await j.render(p,X.trim());if(!k&&$.current)$.current.innerHTML=K0,q(K0),y4($.current,(c,d,s)=>x.current(c,d,s)),y1($.current,v.current);B(null)}catch(j){if(!k)B(j.message||"Invalid diagram")}};R();let g=new MutationObserver((j)=>{for(let o of j)if(o.attributeName==="data-theme")R()});return g.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{k=!0,g.disconnect()}},[X]),w5(()=>{if($.current)y1($.current,H,Z)},[H,Z]);let u=e((k)=>{if(!k.ctrlKey&&!k.metaKey)return;k.preventDefault();let R=k.deltaY>0?-M0:M0;I((g)=>Math.max(o0,Math.min(s0,+(g+R).toFixed(2))))},[I]);if(Y)return z("div",{className:"bg-accent-red-muted rounded-md p-4 mt-3 text-body text-accent-red",children:["Mermaid error: ",Y,z("pre",{className:"mt-2 text-tiny text-text-tertiary whitespace-pre-wrap",children:X},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let i=$.current?.closest("#plan-scroll-container");return z(_1,{children:[z("div",{className:"mt-3 mermaid-container","data-md":"mermaid","data-md-source":X.trim(),children:[z("div",{className:"flex justify-end mb-1",children:z(N1,{zoom:P,onZoomIn:L,onZoomOut:w,onZoomReset:A,onFullscreen:()=>W(!0)},void 0,!1,void 0,this)},void 0,!1,void 0,this),z("div",{style:{overflow:"auto",maxHeight:"70vh"},onWheel:u,children:z("div",{ref:$,className:"flex justify-center",style:{transform:`scale(${P})`,transformOrigin:"top center",transition:"transform 0.1s ease-out",minHeight:P<1?void 0:void 0}},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U&&z(C0,{anchorEl:U.anchorEl,scrollContainer:i,snippet:U.snippet,header:z("div",{style:{fontSize:"12px",color:"var(--color-text-tertiary)",marginBottom:"8px",lineHeight:"1.4",display:"flex",alignItems:"center",gap:"6px"},children:[z("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"var(--color-accent-amber)",flexShrink:0}},void 0,!1,void 0,this),U.snippet]},void 0,!0,void 0,this),onAdd:(k,R)=>{let g=`ann-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;G(g,`[Diagram ${U.prefix.toLowerCase()}] ${U.snippet}`,k,void 0,void 0,R,N||void 0),y(null)},onCancel:()=>y(null)},void 0,!1,void 0,this),J&&K&&z(U4,{svgHtml:K,source:X,onClose:()=>W(!1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function y4(Q,$){let Y=(B,J,W)=>{B.style.cursor="pointer",B.addEventListener("mouseenter",()=>{B.style.filter="brightness(1.2)"}),B.addEventListener("mouseleave",()=>{B.style.filter=""}),B.addEventListener("click",(K)=>{K.stopPropagation(),K.preventDefault(),$(B,J(),W)})};for(let B of Q.querySelectorAll(".node"))Y(B,()=>{return(B.querySelector(".nodeLabel")||B.querySelector("foreignObject span")||B.querySelector("text"))?.textContent?.trim()||"Node"},"Node");for(let B of Q.querySelectorAll(".edgePath")){let J=B,W=J.querySelector("path");if(W){W.style.strokeWidth=Math.max(parseFloat(W.style.strokeWidth||"1"),8)+"px",W.style.strokeOpacity="0";let q=W.cloneNode(!0);q.style.strokeWidth="",q.style.strokeOpacity="",J.insertBefore(q,W)}let K=J.id||"";Y(J,()=>{let q=Q.querySelectorAll(".edgeLabel");for(let X of q)if(X.id&&K&&X.id.replace("label","").includes(K.replace("L-","").replace("edge",""))){let H=X.textContent?.trim();if(H)return H}return"Connection"},"Edge")}for(let B of Q.querySelectorAll(".edgeLabel")){let J=B.textContent?.trim();if(!J)continue;Y(B,()=>J,"Edge")}for(let B of Q.querySelectorAll(".actor")){let J=B.closest("g")?.querySelector("text")||B.parentElement?.querySelector("text");if(!J)continue;let W=B.closest("g");if(!W||W.hasAttribute("data-clickable"))continue;W.setAttribute("data-clickable","true"),Y(W,()=>J.textContent?.trim()||"Participant","Node")}for(let B of Q.querySelectorAll(".messageText")){let J=B.textContent?.trim();if(!J)continue;Y(B,()=>J,"Edge")}for(let B of Q.querySelectorAll(".entityBox")){let J=B.closest("g");if(!J||J.hasAttribute("data-clickable"))continue;let W=J.querySelector(".entityLabel");if(!W)continue;J.setAttribute("data-clickable","true"),Y(J,()=>W.textContent?.trim()||"Entity","Node")}for(let B of Q.querySelectorAll(".relationshipLabel")){let J=B.textContent?.trim();if(!J)continue;let K=B.closest("g")||B;if(K.hasAttribute("data-clickable"))continue;K.setAttribute("data-clickable","true"),Y(K,()=>J,"Edge")}for(let B of Q.querySelectorAll(".classGroup")){let J=B;if(J.hasAttribute("data-clickable"))continue;let W=J.querySelector(".classTitle, .classTitleText, text");if(!W)continue;J.setAttribute("data-clickable","true"),Y(J,()=>W.textContent?.trim()||"Class","Node")}for(let B of Q.querySelectorAll(".statediagram-state")){let J=B;if(J.hasAttribute("data-clickable"))continue;let W=J.querySelector(".state-title, text");if(!W)continue;J.setAttribute("data-clickable","true"),Y(J,()=>W.textContent?.trim()||"State","Node")}for(let B of Q.querySelectorAll(".mindmap-node")){let J=B;if(J.hasAttribute("data-clickable"))continue;let W=J.querySelector(".mindmap-node-label, text");if(!W)continue;J.setAttribute("data-clickable","true"),Y(J,()=>W.textContent?.trim()||"Node","Node")}}function y1(Q,$,Y){let B=new Map;for(let W of $){let K=W.snippet.match(/^\[Diagram (?:node|edge)\] (.+)$/)?.[1];if(K)B.set(K,W.id)}for(let W of Q.querySelectorAll("[data-annotated]"))W.style.outline="",W.style.outlineOffset="",W.style.borderRadius="",W.removeAttribute("data-annotated");if(B.size===0)return;for(let W of Q.querySelectorAll(".node")){let q=(W.querySelector(".nodeLabel")||W.querySelector("foreignObject span")||W.querySelector("text"))?.textContent?.trim();if(!q||!B.has(q))continue;let X=B.get(q),H=W;H.setAttribute("data-annotated",X);let G=X===Y;H.style.outline=G?"2px solid var(--color-highlight-border)":"2px solid var(--color-highlight-annotation)",H.style.outlineOffset="2px",H.style.borderRadius="4px"}for(let W of Q.querySelectorAll(".edgeLabel")){let K=W.textContent?.trim();if(!K||!B.has(K))continue;let q=B.get(K),X=W;X.setAttribute("data-annotated",q);let H=q===Y;X.style.outline=H?"2px solid var(--color-highlight-border)":"2px solid var(--color-highlight-annotation)",X.style.outlineOffset="2px",X.style.borderRadius="4px"}for(let W of Q.querySelectorAll(".actor")){let K=W.closest("g");if(!K)continue;let X=K.querySelector("text")?.textContent?.trim();if(!X||!B.has(X))continue;if(K.hasAttribute("data-annotated"))continue;let H=B.get(X);K.setAttribute("data-annotated",H);let G=H===Y,Z=K.querySelector("rect");if(Z)Z.style.outline=G?"2px solid var(--color-highlight-border)":"2px solid var(--color-highlight-annotation)",Z.style.outlineOffset="2px",Z.style.borderRadius="4px"}for(let W of Q.querySelectorAll(".messageText")){let K=W.textContent?.trim();if(!K||!B.has(K))continue;let q=B.get(K),X=W;X.setAttribute("data-annotated",q);let H=q===Y;X.style.outline=H?"2px solid var(--color-highlight-border)":"2px solid var(--color-highlight-annotation)",X.style.outlineOffset="2px",X.style.borderRadius="4px"}let J=(W,K,q)=>{for(let X of Q.querySelectorAll(W)){let H=q(X);if(!H||H.hasAttribute("data-annotated"))continue;let Z=H.querySelector(K)?.textContent?.trim();if(!Z||!B.has(Z))continue;let _=B.get(Z);H.setAttribute("data-annotated",_);let N=_===Y,U=H.querySelector("rect, circle, ellipse, polygon")||H;U.style.outline=N?"2px solid var(--color-highlight-border)":"2px solid var(--color-highlight-annotation)",U.style.outlineOffset="2px",U.style.borderRadius="4px"}};J(".entityBox",".entityLabel",(W)=>W.closest("g"));for(let W of Q.querySelectorAll(".relationshipLabel")){let q=W.closest("g")||W;if(q.hasAttribute("data-annotated"))continue;let X=W.textContent?.trim();if(!X||!B.has(X))continue;let H=B.get(X);q.setAttribute("data-annotated",H);let G=H===Y;q.style.outline=G?"2px solid var(--color-highlight-border)":"2px solid var(--color-highlight-annotation)",q.style.outlineOffset="2px",q.style.borderRadius="4px"}J(".classGroup",".classTitle, .classTitleText, text",(W)=>W),J(".statediagram-state",".state-title, text",(W)=>W),J(".mindmap-node",".mindmap-node-label, text",(W)=>W)}import{jsxDEV as P4}from"react/jsx-dev-runtime";function N4({children:Q}){return P4("div",{className:"relative bg-bg-elevated rounded-lg px-5 py-4 mt-3 text-body text-text-secondary italic leading-relaxed","data-md":"note",children:J0(Q)},void 0,!1,void 0,this)}import{jsxDEV as L4}from"react/jsx-dev-runtime";var _4={high:"text-accent-red bg-accent-red-muted",medium:"text-accent-amber bg-accent-amber-muted",low:"text-text-tertiary bg-border-subtle"};function F4({level:Q}){return L4("span",{className:`inline text-tiny font-medium font-body ml-2 px-1.5 py-0.5 rounded ${_4[Q]}`,"data-md":"priority","data-md-level":Q,children:Q},void 0,!1,void 0,this)}import{useState as M4}from"react";import{jsxDEV as Z0}from"react/jsx-dev-runtime";function z4({title:Q,children:$}){let[Y,B]=M4(!1);return Z0("div",{className:"relative mb-8 p-4 group/section","data-md":"section","data-md-title":Q,children:[Z0("div",{className:"relative mb-2",children:[Z0("button",{onClick:()=>B(!Y),className:`absolute -left-8 top-1/2 -translate-y-1/2 text-text-tertiary opacity-0 group-hover/section:opacity-50 hover:!opacity-100 transition-all duration-150 p-0.5 ${Y?"-rotate-90":""}`,children:Z0("svg",{width:"14",height:"14",viewBox:"0 0 12 12",fill:"none",children:Z0("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z0("h2",{className:"font-heading text-section text-text-primary",style:{fontWeight:400},children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z0("div",{className:Y?"mt-6 hidden":"mt-6",children:J0($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{jsxDEV as W0}from"react/jsx-dev-runtime";function T4({headers:Q,rows:$}){return W0("div",{className:"overflow-x-auto mt-3","data-md":"table",children:W0("table",{className:"w-full text-body",children:[W0("thead",{children:W0("tr",{className:"border-b border-border-subtle",children:Q.map((Y,B)=>W0("th",{className:"text-left px-4 py-2.5 text-meta font-medium uppercase tracking-wider text-text-tertiary font-body",children:Y},B,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),W0("tbody",{children:$.map((Y,B)=>W0("tr",{className:`relative border-b border-border-subtle last:border-b-0 transition-colors hover:bg-bg-surface/50 ${B%2===1?"bg-bg-surface/30":""}`,children:Y.map((J,W)=>W0("td",{className:"px-4 py-2.5 text-text-secondary font-body",children:J},W,!1,void 0,this))},B,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}import{jsxDEV as $0}from"react/jsx-dev-runtime";var O4={todo:"bg-border-hover",done:"bg-accent-green",blocked:"bg-accent-red","in-progress":"bg-accent-blue"},w4={todo:"Todo",done:"Done",blocked:"Blocked","in-progress":"In progress"},A4={info:"bg-accent-blue-muted text-accent-blue",success:"bg-accent-green-muted text-accent-green",warning:"bg-accent-amber-muted text-accent-amber",danger:"bg-accent-red-muted text-accent-red",neutral:"bg-border-subtle text-text-tertiary"};function F1({id:Q,label:$,status:Y,badge:B,badgeVariant:J="neutral",children:W}){return $0("div",{className:"group/task relative -mx-4 px-4 py-3 rounded-md transition-colors duration-150 hover:bg-bg-input","data-task-id":Q,"data-md":"item","data-md-label":$,...Y?{"data-md-status":Y}:{},...B?{"data-md-badge":B}:{},children:$0("div",{className:"flex items-start gap-3",children:[Y&&$0("span",{className:`w-2 h-2 rounded-full mt-[7px] flex-shrink-0 ${O4[Y]}`},void 0,!1,void 0,this),$0("div",{className:"flex-1 min-w-0",children:[$0("div",{className:"flex items-baseline gap-2",children:[$0("span",{className:"font-body text-task-label font-semibold text-text-primary",children:$},void 0,!1,void 0,this),Y&&$0("span",{className:"font-body text-tiny uppercase tracking-wider text-text-tertiary opacity-0 group-hover/task:opacity-100 transition-opacity duration-150",children:w4[Y]},void 0,!1,void 0,this),B&&$0("span",{className:`font-body text-tiny font-medium px-1.5 py-px rounded-full ${A4[J]}`,children:B},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W&&$0("div",{className:"text-body text-text-secondary mt-1 leading-relaxed",children:J0(W)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function S4(Q){return $0(F1,{...Q},void 0,!1,void 0,this)}import{useAnnotations as L1,useResponseRegistration as M1}from"#canvas/runtime";import{useRef as C4,useState as z1}from"react";import{jsxDEV as S}from"react/jsx-dev-runtime";function k4({id:Q,label:$,placeholder:Y,multiline:B,required:J}){let{responses:W,setResponse:K}=L1();M1(Q);let q=W.get(Q),X=q?.value??"",H=q?.note||"",[G,Z]=z1(!1),_=C4(null);if(!W.has(Q))K(Q,{id:Q,type:"text",label:$,value:"",required:J});let N=(P)=>{K(Q,{...q,value:P})},U=(P)=>Q0(P,B?60:32),y=q?.required&&!X.trim();return S("div",{"data-md":"userinput","data-md-label":$,className:"-mx-4 px-4 py-3 my-1 rounded-lg transition-colors duration-150 hover:bg-bg-input",children:[S("div",{className:"flex items-baseline gap-2 mb-2",children:[S("span",{className:"text-[13px] font-body font-medium text-text-primary",children:$},void 0,!1,void 0,this),J&&S("span",{className:"text-[10px] text-accent-red font-body",children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S("textarea",{ref:_,value:X,onChange:(P)=>{N(P.currentTarget.value),U(P.currentTarget)},placeholder:Y||"Type your response...",rows:B?3:1,className:"w-full bg-bg-input text-[13px] font-body text-text-primary rounded-lg px-3 py-2 resize-none focus:outline-none border border-border-subtle focus:border-border-hover placeholder:text-text-tertiary transition-colors",onInput:(P)=>U(P.currentTarget),onFocus:(P)=>U(P.currentTarget)},void 0,!1,void 0,this),S(F0,{show:G,note:H,onToggle:()=>Z(!G),onChange:(P)=>K(Q,{...q,note:P})},void 0,!1,void 0,this),y&&S("p",{className:"text-[11px] text-accent-red font-body mt-1",children:"This field is required."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function f4({id:Q,label:$,min:Y=1,max:B=10,step:J=1,required:W,minLabel:K,maxLabel:q}){let{responses:X,setResponse:H}=L1();M1(Q);let G=X.get(Q),Z=G?.value,_=G?.note||"",[N,U]=z1(!1);if(!X.has(Q))H(Q,{id:Q,type:"range",label:$,value:null,required:W});let y=(b)=>{H(Q,{...G,value:b})},P=Z!==null&&Z!==void 0,L=P?Z:Math.round((Y+B)/2),w=(L-Y)/(B-Y)*100,A=Math.round((B-Y)/J),I=A<=20,v=G?.required&&!P;return S("div",{"data-md":"rangeinput","data-md-label":$,className:"-mx-4 px-4 py-3 my-1 rounded-lg transition-colors duration-150 hover:bg-bg-input",children:[S("div",{className:"flex items-baseline justify-between mb-1",children:[S("div",{className:"flex items-baseline gap-2",children:[S("span",{className:"text-[13px] font-body font-medium text-text-primary",children:$},void 0,!1,void 0,this),W&&S("span",{className:"text-[10px] text-accent-red font-body",children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S("span",{className:"flex items-center gap-1.5",children:[S("span",{className:`text-[13px] font-mono ${P?"text-accent-amber":"text-text-disabled"}`,children:P?Z:"—"},void 0,!1,void 0,this),P&&S("button",{onClick:()=>H(Q,{...G,value:null}),className:"text-text-disabled hover:text-text-tertiary transition-colors text-[10px] leading-none",title:"Clear",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S("div",{className:"relative h-6 flex items-center",children:[S("div",{className:"absolute left-0 right-0 h-1.5 rounded-full bg-border-medium",children:P&&S("div",{className:"h-full rounded-full bg-accent-amber transition-all duration-150",style:{width:`${w}%`}},void 0,!1,void 0,this)},void 0,!1,void 0,this),I&&Array.from({length:A+1},(b,x)=>{let u=Y+x*J,i=(u-Y)/(B-Y)*100,k=P&&u<=Z;return S("div",{className:`absolute rounded-full pointer-events-none transition-all duration-150 ${P&&u===Z?"w-2.5 h-2.5 bg-accent-amber":k?"w-1.5 h-1.5 bg-accent-amber":"w-1.5 h-1.5 bg-border-hover"}`,style:{left:`${i}%`,transform:"translate(-50%, -50%)",top:"50%"}},x,!1,void 0,this)}),P?S("div",{className:"absolute h-5 w-5 rounded-full bg-accent-amber shadow-md pointer-events-none transition-all duration-150",style:{left:`calc(${w}% - 10px)`,borderWidth:"2px",borderStyle:"solid",borderColor:"var(--color-bg-base)"}},void 0,!1,void 0,this):S("div",{className:"absolute h-4 w-4 rounded-full bg-border-hover pointer-events-none opacity-50",style:{left:"calc(50% - 8px)",borderWidth:"2px",borderStyle:"solid",borderColor:"var(--color-bg-base)"}},void 0,!1,void 0,this),S("input",{type:"range",min:Y,max:B,step:J,value:L,onChange:(b)=>y(Number(b.currentTarget.value)),className:"absolute inset-0 w-full opacity-0 cursor-pointer"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I&&A<=10?S("div",{className:"flex justify-between -mt-0.5 px-0",children:Array.from({length:A+1},(b,x)=>{let u=Y+x*J;return S("span",{className:`text-[10px] font-mono transition-colors ${P&&u===Z?"text-accent-amber font-medium":"text-text-disabled"}`,style:{minWidth:"1ch",textAlign:"center"},children:u},x,!1,void 0,this)})},void 0,!1,void 0,this):S("div",{className:"flex justify-between -mt-0.5",children:[S("span",{className:"text-[11px] text-text-tertiary font-body",children:K||Y},void 0,!1,void 0,this),S("span",{className:"text-[11px] text-text-tertiary font-body",children:q||B},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S(F0,{show:N,note:_,onToggle:()=>U(!N),onChange:(b)=>H(Q,{...G,note:b})},void 0,!1,void 0,this),v&&S("p",{className:"text-[11px] text-accent-red font-body mt-1",children:"Please select a value."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{j$ as useFeedback,k4 as UserInput,S4 as Task,T4 as Table,z4 as Section,f4 as RangeInput,F4 as Priority,N4 as Note,r2 as MultiChoice,Z4 as Mermaid,X4 as Markdown,F1 as Item,W4 as ImageView,Q4 as FilePreview,a2 as Diff,o2 as CodeBlock,d2 as Choice,P2 as Checklist,N2 as Callout};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s,N,k0,C1,w,_0,x0,m0,X0,e,h,y0,V0,K0,W0,h0,l={},t=[],T1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function j(Y,Z){for(var G in Z)Y[G]=Z[G];return Y}function E0(Y){Y&&Y.parentNode&&Y.parentNode.removeChild(Y)}function $(Y,Z,G){var O,X,Q,K={};for(Q in Z)Q=="key"?O=Z[Q]:Q=="ref"?X=Z[Q]:K[Q]=Z[Q];if(arguments.length>2&&(K.children=arguments.length>3?s.call(arguments,2):G),typeof Y=="function"&&Y.defaultProps!=null)for(Q in Y.defaultProps)K[Q]===void 0&&(K[Q]=Y.defaultProps[Q]);return a(Y,K,O,X,null)}function a(Y,Z,G,O,X){var Q={type:Y,props:Z,key:G,ref:O,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:X==null?++k0:X,__i:-1,__u:0};return X==null&&N.vnode!=null&&N.vnode(Q),Q}function N0(){return{current:null}}function A(Y){return Y.children}function S(Y,Z){this.props=Y,this.context=Z}function P(Y,Z){if(Z==null)return Y.__?P(Y.__,Y.__i+1):null;for(var G;Z<Y.__k.length;Z++)if((G=Y.__k[Z])!=null&&G.__e!=null)return G.__e;return typeof Y.type=="function"?P(Y):null}function j1(Y){if(Y.__P&&Y.__d){var Z=Y.__v,G=Z.__e,O=[],X=[],Q=j({},Z);Q.__v=Z.__v+1,N.vnode&&N.vnode(Q),q0(Y.__P,Q,Z,Y.__n,Y.__P.namespaceURI,32&Z.__u?[G]:null,O,G==null?P(Z):G,!!(32&Z.__u),X),Q.__v=Z.__v,Q.__.__k[Q.__i]=Q,p0(O,Q,X),Z.__e=Z.__=null,Q.__e!=G&&a0(Q)}}function a0(Y){if((Y=Y.__)!=null&&Y.__c!=null)return Y.__e=Y.__c.base=null,Y.__k.some(function(Z){if(Z!=null&&Z.__e!=null)return Y.__e=Y.__c.base=Z.__e}),a0(Y)}function J0(Y){(!Y.__d&&(Y.__d=!0)&&w.push(Y)&&!u.__r++||_0!=N.debounceRendering)&&((_0=N.debounceRendering)||x0)(u)}function u(){try{for(var Y,Z=1;w.length;)w.length>Z&&w.sort(m0),Y=w.shift(),Z=w.length,j1(Y)}finally{w.length=u.__r=0}}function s0(Y,Z,G,O,X,Q,K,V,E,J,D){var H,W,q,L,I,d,U=O&&O.__k||t,R=Z.length;for(E=B1(G,Z,U,E,R),H=0;H<R;H++)(q=G.__k[H])!=null&&(W=q.__i!=-1&&U[q.__i]||l,q.__i=H,d=q0(Y,q,W,X,Q,K,V,E,J,D),L=q.__e,q.ref&&W.ref!=q.ref&&(W.ref&&D0(W.ref,null,q),D.push(q.ref,q.__c||L,q)),I==null&&L!=null&&(I=L),4&q.__u?(E=f0(q,E,Y),W.__e&&(W.__e=null)):typeof q.type=="function"&&d!==void 0?E=d:L&&(E=L.nextSibling),q.__u&=-7);return G.__e=I,E}function B1(Y,Z,G,O,X){var Q,K,V,E,J,D=G.length,H=D,W=0;for(Y.__k=Array(X),Q=0;Q<X;Q++)(K=Z[Q])!=null&&typeof K!="boolean"&&typeof K!="function"?(typeof K=="string"||typeof K=="number"||typeof K=="bigint"||K.constructor==String?K=Y.__k[Q]=a(null,K,null,null,null):f(K)?K=Y.__k[Q]=a(A,{children:K},null,null,null):K.constructor===void 0&&K.__b>0?K=Y.__k[Q]=a(K.type,K.props,K.key,K.ref?K.ref:null,K.__v):Y.__k[Q]=K,E=Q+W,K.__=Y,K.__b=Y.__b+1,V=null,(J=K.__i=g1(K,G,E,H))!=-1&&(H--,(V=G[J])&&(V.__u|=2)),V==null||V.__v==null?(J==-1&&(X>D?W--:X<D&&W++),typeof K.type!="function"&&(K.__u|=4)):J!=E&&(J==E-1?W--:J==E+1?W++:(J>E?W--:W++,K.__u|=4))):Y.__k[Q]=null;if(H)for(Q=0;Q<D;Q++)(V=G[Q])!=null&&(2&V.__u)==0&&(V.__e==O&&(O=P(V)),r0(V,V));return O}function f0(Y,Z,G){var O,X;if(typeof Y.type=="function"){for(O=Y.__k,X=0;O&&X<O.length;X++)O[X]&&(O[X].__=Y,Z=f0(O[X],Z,G));return Z}Y.__e!=Z&&(Z&&Y.type&&!Z.parentNode&&(Z=P(Y)),Z=G.insertBefore(Y.__e,Z||null));do Z=Z&&Z.nextSibling;while(Z!=null&&Z.nodeType==8);return Z}function B(Y,Z){return Z=Z||[],Y==null||typeof Y=="boolean"||(f(Y)?Y.some(function(G){B(G,Z)}):Z.push(Y)),Z}function g1(Y,Z,G,O){var X,Q,K,V=Y.key,E=Y.type,J=Z[G],D=J!=null&&(2&J.__u)==0;if(J===null&&V==null||D&&V==J.key&&E==J.type)return G;if(O>(D?1:0)){for(X=G-1,Q=G+1;X>=0||Q<Z.length;)if((J=Z[K=X>=0?X--:Q++])!=null&&(2&J.__u)==0&&V==J.key&&E==J.type)return K}return-1}function M0(Y,Z,G){Z[0]=="-"?Y.setProperty(Z,G==null?"":G):Y[Z]=G==null?"":typeof G!="number"||T1.test(Z)?G:G+"px"}function i(Y,Z,G,O,X){var Q,K;Y:if(Z=="style")if(typeof G=="string")Y.style.cssText=G;else{if(typeof O=="string"&&(Y.style.cssText=O=""),O)for(Z in O)G&&Z in G||M0(Y.style,Z,"");if(G)for(Z in G)O&&G[Z]==O[Z]||M0(Y.style,Z,G[Z])}else if(Z[0]=="o"&&Z[1]=="n")Q=Z!=(Z=Z.replace(y0,"$1")),K=Z.toLowerCase(),Z=K in Y||Z=="onFocusOut"||Z=="onFocusIn"?K.slice(2):Z.slice(2),Y.l||(Y.l={}),Y.l[Z+Q]=G,G?O?G[h]=O[h]:(G[h]=V0,Y.addEventListener(Z,Q?W0:K0,Q)):Y.removeEventListener(Z,Q?W0:K0,Q);else{if(X=="http://www.w3.org/2000/svg")Z=Z.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(Z!="width"&&Z!="height"&&Z!="href"&&Z!="list"&&Z!="form"&&Z!="tabIndex"&&Z!="download"&&Z!="rowSpan"&&Z!="colSpan"&&Z!="role"&&Z!="popover"&&Z in Y)try{Y[Z]=G==null?"":G;break Y}catch(V){}typeof G=="function"||(G==null||G===!1&&Z[4]!="-"?Y.removeAttribute(Z):Y.setAttribute(Z,Z=="popover"&&G==1?"":G))}}function v0(Y){return function(Z){if(this.l){var G=this.l[Z.type+Y];if(Z[e]==null)Z[e]=V0++;else if(Z[e]<G[h])return;return G(N.event?N.event(Z):Z)}}}function q0(Y,Z,G,O,X,Q,K,V,E,J){var D,H,W,q,L,I,d,U,R,C,m,F,y,P0,r,Q0,T=Z.type;if(Z.constructor!==void 0)return null;128&G.__u&&(E=!!(32&G.__u),Q=[V=Z.__e=G.__e]),(D=N.__b)&&D(Z);Y:if(typeof T=="function"){H=K.length;try{if(R=Z.props,C=T.prototype&&T.prototype.render,m=(D=T.contextType)&&O[D.__c],F=D?m?m.props.value:D.__:O,G.__c?U=(W=Z.__c=G.__c).__=W.__E:(C?Z.__c=W=new T(R,F):(Z.__c=W=new S(R,F),W.constructor=T,W.render=F1),m&&m.sub(W),W.state||(W.state={}),W.__n=O,q=W.__d=!0,W.__h=[],W._sb=[]),C&&W.__s==null&&(W.__s=W.state),C&&T.getDerivedStateFromProps!=null&&(W.__s==W.state&&(W.__s=j({},W.__s)),j(W.__s,T.getDerivedStateFromProps(R,W.__s))),L=W.props,I=W.state,W.__v=Z,q)C&&T.getDerivedStateFromProps==null&&W.componentWillMount!=null&&W.componentWillMount(),C&&W.componentDidMount!=null&&W.__h.push(W.componentDidMount);else{if(C&&T.getDerivedStateFromProps==null&&R!==L&&W.componentWillReceiveProps!=null&&W.componentWillReceiveProps(R,F),Z.__v==G.__v||!W.__e&&W.shouldComponentUpdate!=null&&W.shouldComponentUpdate(R,W.__s,F)===!1){Z.__v!=G.__v&&(W.props=R,W.state=W.__s,W.__d=!1),Z.__e=G.__e,Z.__k=G.__k,Z.__k.some(function(M){M&&(M.__=Z)}),t.push.apply(W.__h,W._sb),W._sb=[],W.__h.length&&K.push(W),V=P(G);break Y}W.componentWillUpdate!=null&&W.componentWillUpdate(R,W.__s,F),C&&W.componentDidUpdate!=null&&W.__h.push(function(){W.componentDidUpdate(L,I,d)})}if(W.context=F,W.props=R,W.__P=Y,W.__e=!1,y=N.__r,P0=0,C)W.state=W.__s,W.__d=!1,y&&y(Z),D=W.render(W.props,W.state,W.context),t.push.apply(W.__h,W._sb),W._sb=[];else do W.__d=!1,y&&y(Z),D=W.render(W.props,W.state,W.context),W.state=W.__s;while(W.__d&&++P0<25);W.state=W.__s,W.getChildContext!=null&&(O=j(j({},O),W.getChildContext())),C&&!q&&W.getSnapshotBeforeUpdate!=null&&(d=W.getSnapshotBeforeUpdate(L,I)),r=D!=null&&D.type===A&&D.key==null?o0(D.props.children):D,V=s0(Y,f(r)?r:[r],Z,G,O,X,Q,K,V,E,J),W.base=Z.__e,Z.__u&=-161,W.__h.length&&K.push(W),U&&(W.__E=W.__=null)}catch(M){if(K.length=H,Z.__v=null,E||Q!=null){if(M.then){for(Z.__u|=E?160:128;V&&V.nodeType==8&&V.nextSibling;)V=V.nextSibling;Q!=null&&(Q[Q.indexOf(V)]=null),Z.__e=V}else if(Q!=null)for(Q0=Q.length;Q0--;)E0(Q[Q0])}else Z.__e=G.__e;Z.__k==null&&(Z.__k=G.__k||[]),M.then||c0(Z),N.__e(M,Z,G)}}else Q==null&&Z.__v==G.__v?(Z.__k=G.__k,Z.__e=G.__e):V=Z.__e=w1(G.__e,Z,G,O,X,Q,K,E,J);return(D=N.diffed)&&D(Z),128&Z.__u?void 0:V}function c0(Y){Y&&(Y.__c&&(Y.__c.__e=!0),Y.__k&&Y.__k.some(c0))}function p0(Y,Z,G){for(var O=0;O<G.length;O++)D0(G[O],G[++O],G[++O]);N.__c&&N.__c(Z,Y),Y.some(function(X){try{Y=X.__h,X.__h=[],Y.some(function(Q){Q.call(X)})}catch(Q){N.__e(Q,X.__v)}})}function o0(Y){return typeof Y!="object"||Y==null||Y.__b>0?Y:f(Y)?Y.map(o0):Y.constructor!==void 0?null:j({},Y)}function w1(Y,Z,G,O,X,Q,K,V,E){var J,D,H,W,q,L,I,d=G.props||l,U=Z.props,R=Z.type;if(R=="svg"?X="http://www.w3.org/2000/svg":R=="math"?X="http://www.w3.org/1998/Math/MathML":X||(X="http://www.w3.org/1999/xhtml"),Q!=null){for(J=0;J<Q.length;J++)if((q=Q[J])&&"setAttribute"in q==!!R&&(R?q.localName==R:q.nodeType==3)){Y=q,Q[J]=null;break}}if(Y==null){if(R==null)return document.createTextNode(U);Y=document.createElementNS(X,R,U.is&&U),V&&(N.__m&&N.__m(Z,Q),V=!1),Q=null}if(R==null)d===U||V&&Y.data==U||(Y.data=U);else{if(Q=R=="textarea"&&U.defaultValue!=null?null:Q&&s.call(Y.childNodes),!V&&Q!=null)for(d={},J=0;J<Y.attributes.length;J++)d[(q=Y.attributes[J]).name]=q.value;for(J in d)q=d[J],J=="dangerouslySetInnerHTML"?H=q:J=="children"||(J in U)||J=="value"&&("defaultValue"in U)||J=="checked"&&("defaultChecked"in U)||i(Y,J,null,q,X);for(J in U)q=U[J],J=="children"?W=q:J=="dangerouslySetInnerHTML"?D=q:J=="value"?L=q:J=="checked"?I=q:V&&typeof q!="function"||d[J]===q||i(Y,J,q,d[J],X);if(D)V||H&&(D.__html==H.__html||D.__html==Y.innerHTML)||(Y.innerHTML=D.__html),Z.__k=[];else if(H&&(Y.innerHTML=""),s0(Z.type=="template"?Y.content:Y,f(W)?W:[W],Z,G,O,R=="foreignObject"?"http://www.w3.org/1999/xhtml":X,Q,K,Q?Q[0]:G.__k&&P(G,0),V,E),Q!=null)for(J=Q.length;J--;)E0(Q[J]);V&&R!="textarea"||(J="value",R=="progress"&&L==null?Y.removeAttribute("value"):L!=null&&(L!==Y[J]||R=="progress"&&!L||R=="option"&&L!=d[J])&&i(Y,J,L,d[J],X),J="checked",I!=null&&I!=Y[J]&&i(Y,J,I,d[J],X))}return Y}function D0(Y,Z,G){try{if(typeof Y=="function"){var O=typeof Y.__u=="function";O&&Y.__u(),O&&Z==null||(Y.__u=Y(Z))}else Y.current=Z}catch(X){N.__e(X,G)}}function r0(Y,Z,G){var O,X;if(N.unmount&&N.unmount(Y),(O=Y.ref)&&(O.current&&O.current!=Y.__e||D0(O,null,Z)),(O=Y.__c)!=null){if(O.componentWillUnmount)try{O.componentWillUnmount()}catch(Q){N.__e(Q,Z)}O.base=O.__P=O.__n=null}if(O=Y.__k)for(X=0;X<O.length;X++)O[X]&&r0(O[X],Z,G||typeof Y.type!="function");G||E0(Y.__e),Y.__c=Y.__=Y.__e=void 0}function F1(Y,Z,G){return this.constructor(Y,G)}function v(Y,Z,G){var O,X,Q,K;Z==document&&(Z=document.documentElement),N.__&&N.__(Y,Z),X=(O=typeof G=="function")?null:G&&G.__k||Z.__k,Q=[],K=[],q0(Z,Y=(!O&&G||Z).__k=$(A,null,[Y]),X||l,l,Z.namespaceURI,!O&&G?[G]:X?null:Z.firstChild?s.call(Z.childNodes):null,Q,!O&&G?G:X?X.__e:Z.firstChild,O,K),p0(Q,Y,K),Y.props.children=null}function R0(Y,Z){v(Y,Z,R0)}function i0(Y,Z,G){var O,X,Q,K,V=j({},Y.props);for(Q in Y.type&&Y.type.defaultProps&&(K=Y.type.defaultProps),Z)Q=="key"?O=Z[Q]:Q=="ref"?X=Z[Q]:V[Q]=Z[Q]===void 0&&K!=null?K[Q]:Z[Q];return arguments.length>2&&(V.children=arguments.length>3?s.call(arguments,2):G),a(Y.type,V,O||Y.key,X||Y.ref,null)}function b0(Y){function Z(G){var O,X;return this.getChildContext||(O=new Set,(X={})[Z.__c]=this,this.getChildContext=function(){return X},this.componentWillUnmount=function(){O=null},this.shouldComponentUpdate=function(Q){this.props.value!=Q.value&&O.forEach(function(K){K.__e=!0,J0(K)})},this.sub=function(Q){O.add(Q);var K=Q.componentWillUnmount;Q.componentWillUnmount=function(){O&&O.delete(Q),K&&K.call(Q)}}),G.children}return Z.__c="__cC"+h0++,Z.__=Y,Z.Provider=Z.__l=(Z.Consumer=function(G,O){return G.children(O)}).contextType=Z,Z}s=t.slice,N={__e:function(Y,Z,G,O){for(var X,Q,K;Z=Z.__;)if((X=Z.__c)&&!X.__)try{if((Q=X.constructor)&&Q.getDerivedStateFromError!=null&&(X.setState(Q.getDerivedStateFromError(Y)),K=X.__d),X.componentDidCatch!=null&&(X.componentDidCatch(Y,O||{}),K=X.__d),K)return X.__E=X}catch(V){Y=V}throw Y}},k0=0,C1=function(Y){return Y!=null&&Y.constructor===void 0},S.prototype.setState=function(Y,Z){var G;G=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=j({},this.state),typeof Y=="function"&&(Y=Y(j({},G),this.props)),Y&&j(G,Y),Y!=null&&this.__v&&(Z&&this._sb.push(Z),J0(this))},S.prototype.forceUpdate=function(Y){this.__v&&(this.__e=!0,Y&&this.__h.push(Y),J0(this))},S.prototype.render=A,w=[],x0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,m0=function(Y,Z){return Y.__v.__b-Z.__v.__b},u.__r=0,X0=Math.random().toString(8),e="__d"+X0,h="__a"+X0,y0=/(PointerCapture)$|Capture$/i,V0=0,K0=v0(!1),W0=v0(!0),h0=0;var g,b,z0,e0,k=0,O1=[],z=N,l0=z.__b,t0=z.__r,u0=z.diffed,n0=z.__c,Y1=z.unmount,Z1=z.__;function _(Y,Z){z.__h&&z.__h(b,Y,k||Z),k=0;var G=b.__H||(b.__H={__:[],__h:[]});return Y>=G.__.length&&G.__.push({}),G.__[Y]}function c(Y){return k=1,Y0(Q1,Y)}function Y0(Y,Z,G){var O=_(g++,2);if(O.t=Y,!O.__c&&(O.__=[G?G(Z):Q1(void 0,Z),function(V){var E=O.__N?O.__N[0]:O.__[0],J=O.t(E,V);E!==J&&(O.__N=[J,O.__[1]],O.__c.setState({}))}],O.__c=b,!b.__f)){var X=function(V,E,J){if(!O.__c.__H)return!0;var D=!1,H=O.__c.props!==V;if(O.__c.__H.__.some(function(q){if(q.__N){D=!0;var L=q.__[0];q.__=q.__N,q.__N=void 0,L!==q.__[0]&&(H=!0)}}),Q){var W=Q.call(this,V,E,J);return D?W||H:W}return!D||H};b.__f=!0;var{shouldComponentUpdate:Q,componentWillUpdate:K}=b;b.componentWillUpdate=function(V,E,J){if(this.__e){var D=Q;Q=void 0,X(V,E,J),Q=D}K&&K.call(this,V,E,J)},b.shouldComponentUpdate=X}return O.__N||O.__}function Z0(Y,Z){var G=_(g++,3);!z.__s&&$0(G.__H,Z)&&(G.__=Y,G.u=Z,b.__H.__h.push(G))}function x(Y,Z){var G=_(g++,4);!z.__s&&$0(G.__H,Z)&&(G.__=Y,G.u=Z,b.__h.push(G))}function L0(Y){return k=5,p(function(){return{current:Y}},[])}function U0(Y,Z,G){k=6,x(function(){if(typeof Y=="function"){var O=Y(Z());return function(){Y(null),O&&typeof O=="function"&&O()}}if(Y)return Y.current=Z(),function(){return Y.current=null}},G==null?G:G.concat(Y))}function p(Y,Z){var G=_(g++,7);return $0(G.__H,Z)&&(G.__=Y(),G.__H=Z,G.__h=Y),G.__}function d0(Y,Z){return k=8,p(function(){return Y},Z)}function A0(Y){var Z=b.context[Y.__c],G=_(g++,9);return G.c=Y,Z?(G.__==null&&(G.__=!0,Z.sub(b)),Z.props.value):Y.__}function I0(Y,Z){z.useDebugValue&&z.useDebugValue(Z?Z(Y):Y)}function V2(Y){var Z=_(g++,10),G=c();return Z.__=Y,b.componentDidCatch||(b.componentDidCatch=function(O,X){Z.__&&Z.__(O,X),G[1](O)}),[G[0],function(){G[1](void 0)}]}function S0(){var Y=_(g++,11);if(!Y.__){for(var Z=b.__v;Z!==null&&!Z.__m&&Z.__!==null;)Z=Z.__;var G=Z.__m||(Z.__m=[0,0]);Y.__="P"+G[0]+"-"+G[1]++}return Y.__}function P1(){for(var Y;Y=O1.shift();){var Z=Y.__H;if(Y.__P&&Z)try{Z.__h.some(n),Z.__h.some(H0),Z.__h=[]}catch(G){Z.__h=[],z.__e(G,Y.__v)}}}z.__b=function(Y){b=null,l0&&l0(Y)},z.__=function(Y,Z){Y&&Z.__k&&Z.__k.__m&&(Y.__m=Z.__k.__m),Z1&&Z1(Y,Z)},z.__r=function(Y){t0&&t0(Y),g=0;var Z=(b=Y.__c).__H;Z&&(z0===b?(Z.__h=[],b.__h=[],Z.__.some(function(G){G.__N&&(G.__=G.__N),G.u=G.__N=void 0})):(Z.__h.some(n),Z.__h.some(H0),Z.__h=[],g=0)),z0=b},z.diffed=function(Y){u0&&u0(Y);var Z=Y.__c;Z&&Z.__H&&(Z.__H.__h.length&&(O1.push(Z)!==1&&e0===z.requestAnimationFrame||((e0=z.requestAnimationFrame)||_1)(P1)),Z.__H.__.some(function(G){G.u&&(G.__H=G.u,G.u=void 0)})),z0=b=null},z.__c=function(Y,Z){Z.some(function(G){try{G.__h.some(n),G.__h=G.__h.filter(function(O){return!O.__||H0(O)})}catch(O){Z.some(function(X){X.__h&&(X.__h=[])}),Z=[],z.__e(O,G.__v)}}),n0&&n0(Y,Z)},z.unmount=function(Y){Y1&&Y1(Y);var Z,G=Y.__c;G&&G.__H&&(G.__H.__.some(function(O){try{n(O)}catch(X){Z=X}}),G.__H=void 0,Z&&z.__e(Z,G.__v))};var G1=typeof requestAnimationFrame=="function";function _1(Y){var Z,G=function(){clearTimeout(O),G1&&cancelAnimationFrame(Z),setTimeout(Y)},O=setTimeout(G,35);G1&&(Z=requestAnimationFrame(G))}function n(Y){var Z=b,G=Y.__c;typeof G=="function"&&(Y.__c=void 0,G()),b=Z}function H0(Y){var Z=b;Y.__c=Y.__(),b=Z}function $0(Y,Z){return!Y||Y.length!==Z.length||Z.some(function(G,O){return G!==Y[O]})}function Q1(Y,Z){return typeof Z=="function"?Z(Y):Z}function D1(Y,Z){for(var G in Z)Y[G]=Z[G];return Y}function T0(Y,Z){for(var G in Y)if(G!=="__source"&&!(G in Z))return!0;for(var O in Z)if(O!=="__source"&&Y[O]!==Z[O])return!0;return!1}function R1(Y,Z){var G=Z(),O=c({t:{__:G,u:Z}}),X=O[0].t,Q=O[1];return x(function(){X.__=G,X.u=Z,C0(X)&&Q({t:X})},[Y,G,Z]),Z0(function(){return C0(X)&&Q({t:X}),Y(function(){C0(X)&&Q({t:X})})},[Y]),G}function C0(Y){try{return!((Z=Y.__)===(G=Y.u())&&(Z!==0||1/Z==1/G)||Z!=Z&&G!=G)}catch(O){return!0}var Z,G}function b1(Y){Y()}function z1(Y){return Y}function H1(){return[!1,b1]}var L1=x;function j0(Y,Z){this.props=Y,this.context=Z}function M1(Y,Z){function G(X){var Q=this.props.ref;return Q!=X.ref&&Q&&(typeof Q=="function"?Q(null):Q.current=null),Z?!Z(this.props,X)||Q!=X.ref:T0(this.props,X)}function O(X){return this.shouldComponentUpdate=G,$(Y,X)}return O.displayName="Memo("+(Y.displayName||Y.name)+")",O.__f=O.prototype.isReactComponent=!0,O.type=Y,O}(j0.prototype=new S).isPureReactComponent=!0,j0.prototype.shouldComponentUpdate=function(Y,Z){return T0(this.props,Y)||T0(this.state,Z)};var X1=N.__b;N.__b=function(Y){Y.type&&Y.type.__f&&Y.ref&&(Y.props.ref=Y.ref,Y.ref=null),X1&&X1(Y)};var v1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function k1(Y){function Z(G){var O=D1({},G);return delete O.ref,Y(O,G.ref||null)}return Z.$$typeof=v1,Z.render=Y,Z.prototype.isReactComponent=Z.__f=!0,Z.displayName="ForwardRef("+(Y.displayName||Y.name)+")",Z}var K1=function(Y,Z){return Y==null?null:B(B(Y).map(Z))},x1={map:K1,forEach:K1,count:function(Y){return Y?B(Y).length:0},only:function(Y){var Z=B(Y);if(Z.length!==1)throw"Children.only";return Z[0]},toArray:B},m1=N.__e;N.__e=function(Y,Z,G,O){if(Y.then){for(var X,Q=Z;Q=Q.__;)if((X=Q.__c)&&X.__c)return Z.__e==null&&(Z.__e=G.__e,Z.__k=G.__k||[]),X.__c(Y,Z)}m1(Y,Z,G,O)};var W1=N.unmount;function U1(Y,Z,G){return Y&&(Y.__c&&Y.__c.__H&&(Y.__c.__H.__.forEach(function(O){typeof O.__c=="function"&&O.__c()}),Y.__c.__H=null),(Y=D1({},Y)).__c!=null&&(Y.__c.__P===G&&(Y.__c.__P=Z),Y.__c.__e=!0,Y.__c=null),Y.__k=Y.__k&&Y.__k.map(function(O){return U1(O,Z,G)})),Y}function d1(Y,Z,G){return Y&&G&&(Y.__v=null,Y.__k=Y.__k&&Y.__k.map(function(O){return d1(O,Z,G)}),Y.__c&&Y.__c.__P===Z&&(Y.__e&&G.appendChild(Y.__e),Y.__c.__e=!0,Y.__c.__P=G)),Y}function G0(){this.__u=0,this.o=null,this.__b=null}function A1(Y){var Z=Y.__&&Y.__.__c;return Z&&Z.__a&&Z.__a(Y)}function y1(Y){var Z,G,O,X=null;function Q(K){if(Z||(Z=Y()).then(function(V){V&&(X=V.default||V),O=!0},function(V){G=V,O=!0}),G)throw G;if(!O)throw Z;return X?$(X,K):null}return Q.displayName="Lazy",Q.__f=!0,Q}function o(){this.i=null,this.l=null}N.unmount=function(Y){var Z=Y.__c;Z&&(Z.__z=!0),Z&&Z.__R&&Z.__R(),Z&&32&Y.__u&&(Y.type=null),W1&&W1(Y)},(G0.prototype=new S).__c=function(Y,Z){var G=Z.__c,O=this;O.o==null&&(O.o=[]),O.o.push(G);var X=A1(O.__v),Q=!1,K=function(){Q||O.__z||(Q=!0,G.__R=null,X?X(E):E())};G.__R=K;var V=G.__P;G.__P=null;var E=function(){if(!--O.__u){if(O.state.__a){var J=O.state.__a;O.__v.__k[0]=d1(J,J.__c.__P,J.__c.__O)}var D;for(O.setState({__a:O.__b=null});D=O.o.pop();)D.__P=V,D.forceUpdate()}};O.__u++||32&Z.__u||O.setState({__a:O.__b=O.__v.__k[0]}),Y.then(K,K)},G0.prototype.componentWillUnmount=function(){this.o=[]},G0.prototype.render=function(Y,Z){if(this.__b){if(this.__v.__k){var G=document.createElement("div"),O=this.__v.__k[0].__c;this.__v.__k[0]=U1(this.__b,G,O.__O=O.__P)}this.__b=null}var X=Z.__a&&$(A,null,Y.fallback);return X&&(X.__u&=-33),[$(A,null,Z.__a?null:Y.children),X]};var J1=function(Y,Z,G){if(++G[1]===G[0]&&Y.l.delete(Z),Y.props.revealOrder&&(Y.props.revealOrder[0]!=="t"||!Y.l.size))for(G=Y.i;G;){for(;G.length>3;)G.pop()();if(G[1]<G[0])break;Y.i=G=G[2]}};function h1(Y){return this.getChildContext=function(){return Y.context},Y.children}function a1(Y){var Z=this,G=Y.h;if(Z.componentWillUnmount=function(){v(null,Z.v),Z.v=null,Z.h=null},Z.h&&Z.h!==G&&Z.componentWillUnmount(),!Z.v){for(var O=Z.__v;O!==null&&!O.__m&&O.__!==null;)O=O.__;Z.h=G,Z.v={nodeType:1,parentNode:G,childNodes:[],__k:{__m:O.__m},contains:function(){return!0},namespaceURI:G.namespaceURI,insertBefore:function(X,Q){this.childNodes.push(X),Z.h.insertBefore(X,Q)},removeChild:function(X){this.childNodes.splice(this.childNodes.indexOf(X)>>>1,1),Z.h.removeChild(X)}}}v($(h1,{context:Z.context},Y.__v),Z.v)}function s1(Y,Z){var G=$(a1,{__v:Y,h:Z});return G.containerInfo=Z,G}(o.prototype=new S).__a=function(Y){var Z=this,G=A1(Z.__v),O=Z.l.get(Y);return O[0]++,function(X){var Q=function(){Z.props.revealOrder?(O.push(X),J1(Z,Y,O)):X()};G?G(Q):Q()}},o.prototype.render=function(Y){this.i=null,this.l=new Map;var Z=B(Y.children);Y.revealOrder&&Y.revealOrder[0]==="b"&&Z.reverse();for(var G=Z.length;G--;)this.l.set(Z[G],this.i=[1,0,this.i]);return Y.children},o.prototype.componentDidUpdate=o.prototype.componentDidMount=function(){var Y=this;this.l.forEach(function(Z,G){J1(Y,G,Z)})};var I1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,f1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,c1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,p1=/[A-Z0-9]/g,o1=typeof document<"u",r1=function(Y){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(Y)};function B0(Y,Z,G){return Z.__k==null&&(Z.textContent=""),v(Y,Z),typeof G=="function"&&G(),Y?Y.__c:null}function g0(Y,Z,G){return R0(Y,Z),typeof G=="function"&&G(),Y?Y.__c:null}S.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(Y){Object.defineProperty(S.prototype,Y,{configurable:!0,get:function(){return this["UNSAFE_"+Y]},set:function(Z){Object.defineProperty(this,Y,{configurable:!0,writable:!0,value:Z})}})});var V1=N.event;N.event=function(Y){return V1&&(Y=V1(Y)),Y.persist=function(){},Y.isPropagationStopped=function(){return this.cancelBubble},Y.isDefaultPrevented=function(){return this.defaultPrevented},Y.nativeEvent=Y};var w0,i1={configurable:!0,get:function(){return this.class}},E1=N.vnode;N.vnode=function(Y){typeof Y.type=="string"&&function(Z){var{props:G,type:O}=Z,X={},Q=O.indexOf("-")==-1;for(var K in G){var V=G[K];if(!(K==="value"&&("defaultValue"in G)&&V==null||o1&&K==="children"&&O==="noscript"||K==="class"||K==="className")){var E=K.toLowerCase();K==="defaultValue"&&"value"in G&&G.value==null?K="value":K==="download"&&V===!0?V="":E==="translate"&&V==="no"?V=!1:E[0]==="o"&&E[1]==="n"?E==="ondoubleclick"?K="ondblclick":E!=="onchange"||O!=="input"&&O!=="textarea"||r1(G.type)?E==="onfocus"?K="onfocusin":E==="onblur"?K="onfocusout":c1.test(K)&&(K=E):E=K="oninput":Q&&f1.test(K)?K=K.replace(p1,"-$&").toLowerCase():V===null&&(V=void 0),E==="oninput"&&X[K=E]&&(K="oninputCapture"),X[K]=V}}O=="select"&&(X.multiple&&Array.isArray(X.value)&&(X.value=B(G.children).forEach(function(J){J.props.selected=X.value.indexOf(J.props.value)!=-1})),X.defaultValue!=null&&(X.value=B(G.children).forEach(function(J){J.props.selected=X.multiple?X.defaultValue.indexOf(J.props.value)!=-1:X.defaultValue==J.props.value}))),G.class&&!G.className?(X.class=G.class,Object.defineProperty(X,"className",i1)):G.className&&(X.class=X.className=G.className),Z.props=X}(Y),Y.$$typeof=I1,E1&&E1(Y)};var N1=N.__r;N.__r=function(Y){N1&&N1(Y),w0=Y.__c};var q1=N.diffed;N.diffed=function(Y){q1&&q1(Y);var{props:Z,__e:G}=Y;G!=null&&Y.type==="textarea"&&"value"in Z&&Z.value!==G.value&&(G.value=Z.value==null?"":Z.value),w0=null};var e1={ReactCurrentDispatcher:{current:{readContext:function(Y){return w0.__n[Y.__c].props.value},useCallback:d0,useContext:A0,useDebugValue:I0,useDeferredValue:z1,useEffect:Z0,useId:S0,useImperativeHandle:U0,useInsertionEffect:L1,useLayoutEffect:x,useMemo:p,useReducer:Y0,useRef:L0,useState:c,useSyncExternalStore:R1,useTransition:H1}}},D2="18.3.1";function l1(Y){return $.bind(null,Y)}function O0(Y){return!!Y&&Y.$$typeof===I1}function t1(Y){return O0(Y)&&Y.type===A}function u1(Y){return!!Y&&typeof Y.displayName=="string"&&Y.displayName.indexOf("Memo(")==0}function n1(Y){return O0(Y)?i0.apply(null,arguments):Y}function F0(Y){return!!Y.__k&&(v(null,Y),!0)}function Y2(Y){return Y&&(Y.base||Y.nodeType===1&&Y)||null}var Z2=function(Y,Z){return Y(Z)},G2=function(Y,Z){var G,O=N.debounceRendering;N.debounceRendering=function(Q){G=Q};try{var X=Y(Z);return G&&G(),X}finally{N.debounceRendering=O}},O2=O0,Q2={useState:c,useId:S0,useReducer:Y0,useEffect:Z0,useLayoutEffect:x,useInsertionEffect:L1,useTransition:H1,useDeferredValue:z1,useSyncExternalStore:R1,startTransition:b1,useRef:L0,useImperativeHandle:U0,useMemo:p,useCallback:d0,useContext:A0,useDebugValue:I0,version:"18.3.1",Children:x1,render:B0,hydrate:g0,unmountComponentAtNode:F0,createPortal:s1,createElement:$,createContext:b0,createFactory:l1,cloneElement:n1,createRef:N0,Fragment:A,isValidElement:O0,isElement:O2,isFragment:t1,isMemo:u1,findDOMNode:Y2,Component:S,PureComponent:j0,memo:M1,forwardRef:k1,flushSync:G2,unstable_batchedUpdates:Z2,StrictMode:A,Suspense:G0,SuspenseList:o,lazy:y1,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:e1};function S1(Y){return{render:function(Z){B0(Z,Y)},unmount:function(){F0(Y)}}}function X2(Y,Z){return g0(Z,Y),S1(Y)}var K2=0;function $1(Y,Z,G,O,X,Q){Z||(Z={});var K,V,E=Z;if("ref"in E)for(V in E={},Z)V=="ref"?K=Z[V]:E[V]=Z[V];var J={type:Y,props:E,key:G,ref:K,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--K2,__i:-1,__u:0,__source:X,__self:Q};if(typeof Y=="function"&&(K=Y.defaultProps))for(V in K)E[V]===void 0&&(E[V]=K[V]);return N.vnode&&N.vnode(J),J}export{D2 as version,H1 as useTransition,R1 as useSyncExternalStore,c as useState,L0 as useRef,Y0 as useReducer,p as useMemo,x as useLayoutEffect,L1 as useInsertionEffect,U0 as useImperativeHandle,S0 as useId,V2 as useErrorBoundary,Z0 as useEffect,z1 as useDeferredValue,I0 as useDebugValue,A0 as useContext,d0 as useCallback,Z2 as unstable_batchedUpdates,F0 as unmountComponentAtNode,b1 as startTransition,B0 as render,M1 as memo,y1 as lazy,$1 as jsxs,$1 as jsx,O0 as isValidElement,u1 as isMemo,t1 as isFragment,O2 as isElement,X2 as hydrateRoot,g0 as hydrate,k1 as forwardRef,G2 as flushSync,Y2 as findDOMNode,Q2 as default,S1 as createRoot,N0 as createRef,s1 as createPortal,l1 as createFactory,$ as createElement,b0 as createContext,n1 as cloneElement,e1 as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,o as SuspenseList,G0 as Suspense,A as StrictMode,j0 as PureComponent,A as Fragment,S as Component,x1 as Children};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as z,useContext as B,useEffect as D}from"react";import{SessionContext as U}from"@fabrika/annotations/runtime";var J=z(null);function G(){return B(J)}function M(h){let{registerResponse:j}=G();D(()=>{j(h)},[h,j])}function N(h,j,q){let{setFeedbackEntry:H,removeFeedbackEntry:I}=G();D(()=>{return H(h,{id:h,markdown:j,label:q?.label,required:q?.required}),()=>I(h)},[h,j,q?.label,q?.required])}var K=z("");function O(){return B(K)}var Q=z({setActiveView:()=>{}});export{M as useResponseRegistration,N as useFeedback,O as useCanvasFile,G as useAnnotations,U as SessionContext,K as CanvasFileCtx,J as AnnotationCtx,Q as ActiveViewCtx};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-theme="dark">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>fabrika</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Instrument+Serif&family=JetBrains+Mono:wght@400;500&display=swap" />
|
|
10
|
+
<link rel="stylesheet" href="/assets/client.css" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="min-h-screen">
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
<script type="importmap">
|
|
15
|
+
{
|
|
16
|
+
"imports": {
|
|
17
|
+
"react": "/assets/preact-compat.js",
|
|
18
|
+
"react-dom": "/assets/preact-compat.js",
|
|
19
|
+
"react-dom/client": "/assets/preact-compat.js",
|
|
20
|
+
"react/jsx-runtime": "/assets/react-jsx-runtime.js",
|
|
21
|
+
"react/jsx-dev-runtime": "/assets/react-jsx-dev-runtime.js",
|
|
22
|
+
"preact": "/assets/preact-compat.js",
|
|
23
|
+
"preact/hooks": "/assets/preact-compat.js",
|
|
24
|
+
"preact/compat": "/assets/preact-compat.js",
|
|
25
|
+
"preact/compat/client": "/assets/preact-compat.js",
|
|
26
|
+
"preact/jsx-runtime": "/assets/react-jsx-runtime.js",
|
|
27
|
+
"preact/jsx-dev-runtime": "/assets/react-jsx-dev-runtime.js",
|
|
28
|
+
"#canvas/components": "/assets/components.js",
|
|
29
|
+
"#canvas/runtime": "/assets/runtime.js",
|
|
30
|
+
"@fabrika/annotations/runtime": "/assets/annotations-runtime.js"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
<script type="module" src="/assets/client.fhjppkvr.js"></script>
|
|
35
|
+
</body>
|
|
36
|
+
</html>
|