@pan-stack/cli 0.3.66 → 0.3.67

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/bin/pan.js CHANGED
@@ -1335,7 +1335,7 @@ tfoot td{font-weight:700;border-bottom:0;border-top:1px solid color-mix(in oklab
1335
1335
  `).trim()),p.push("```"),p.push("")}}return p.push("---"),p.push(""),p.push(w("STATS_REVIEW_MD_AI_H2")),p.push(""),p.push(w("STATS_REVIEW_MD_AI_INTRO")),p.push(""),p.push(w("STATS_REVIEW_MD_AI_CRITERIA")),p.push(""),p.push(w("STATS_REVIEW_MD_AI_OUTRO")),p.join(`
1336
1336
  `)}function XZ(e){try{return(0,$Z.execFileSync)("git",e,{encoding:"utf8",maxBuffer:512*1024*1024})}catch(t){let n=t instanceof Error?t.message:String(t);throw new Error(w("STATS_GIT_ERROR__MSG",{msg:n.split(`
1337
1337
  `)[0]??""}))}}function x9e(e){let t=[],n=null;for(let r of e.split(`
1338
- `)){if(r.includes("")){n&&t.push(n);let[i,a,s,l,c]=r.split("");n={hash:i??"",date:a??"",name:s??"",email:l??"",subject:c||"",additions:0,deletions:0};continue}let o=r.match(/(\d+) insertion[s]?\(\+\)|(\d+) deletion[s]?\(-\)/g);if(o&&n)for(let i of o){let a=i.match(/(\d+) insertion/),s=i.match(/(\d+) deletion/);a?.[1]&&(n.additions+=parseInt(a[1],10)),s?.[1]&&(n.deletions+=parseInt(s[1],10))}}return n&&t.push(n),t}function _9e(e){return String(e||"").replace(/\|/g,"\\|")}function ZZ(e,t){return yR.default.mkdirSync(QZ.default.dirname(e),{recursive:!0}),yR.default.writeFileSync(e,t),e}var yR,QZ,$Z,eee=ne(()=>{"use strict";yR=Q(require("fs")),QZ=Q(require("path")),$Z=require("child_process");WS();It()});var _R={};Hn(_R,{runStats:()=>k9e});function E9e(e){let t={_:[],open:!0,diff:!0};for(let n=0;n<e.length;n++){let r=e[n];r!==void 0&&(r==="--since"?t.since=e[++n]:r==="--from"?t.from=e[++n]:r==="--to"?t.to=e[++n]:r==="--member"||r==="-m"?t.member=e[++n]:r==="--project"||r==="-p"?t.project=e[++n]:r==="--port"?t.port=parseInt(e[++n]??"",10):r==="--out"||r==="-o"?t.out=e[++n]:r==="--no-open"?t.open=!1:r==="--no-diff"?t.diff=!1:r==="--head-only"?t.headOnly=!0:r==="--max-diff-lines"?t.maxDiffLines=parseInt(e[++n]??"",10):r.startsWith("--since=")?t.since=r.slice(8):t._.push(r))}return t}function qS(){let e=Cg.default.join(tee.default.homedir(),".pan-code-graph");return VS.default.mkdirSync(e,{recursive:!0}),e}function xR(){let e=ug();if(e)return{repos:DZ(e),source:`.project.yaml (${e.project})`};let t=cg(process.cwd());if(!t.length)throw new Error(w("STATS_NO_REPOS__CWD",{cwd:process.cwd()}));return console.log(w("STATS_FALLBACK_SCAN__CWD",{cwd:process.cwd()})),{repos:t,source:w("STATS_SOURCE_FALLBACK")}}function S9e(){console.log(w("STATS_USAGE"))}async function k9e(e){let t=E9e(e),n=t._[0],r=n!==void 0&&["report","people","review"].includes(n)?t._.shift():"report";return t._[0]==="help"||t.help?S9e():r==="review"?C9e(t):r==="people"?N9e(t):A9e(t)}function T9e(e){let{repos:t}=xR(),n=Py(e),r=!e.headOnly,o=r?w("STATS_SCOPE_ALL_BRANCHES"):w("STATS_SCOPE_HEAD_ONLY");console.log(w("STATS_SCAN_RANGE__N_SCOPE_LABEL",{n:t.length,scope:o,label:n.label}));let{commits:i,repoStatus:a}=gR(t,n,{allBranches:r}),s=bR(Cg.default.join(qS(),"alias-map.json"));return{repos:t,range:n,commits:i,repoStatus:a,aliasMap:s}}function A9e(e){let{repos:t}=xR(),n=Py({}),r=!e.headOnly,o=r?w("STATS_SCOPE_ALL_BRANCHES"):w("STATS_SCOPE_HEAD_ONLY");console.log(w("STATS_SCAN_FULL__N_SCOPE",{n:t.length,scope:o}));let{commits:i,repoStatus:a}=gR(t,n,{allBranches:r}),s=bR(Cg.default.join(qS(),"alias-map.json")),l=i.map(h=>({e:KS(h.email,s),n:h.name||h.email,t:h.ts,r:h.repoName,a:h.additions,d:h.deletions})),c=a.filter(h=>!h.available).map(h=>({name:h.name,reason:h.reason}));Py(e);let u={reposTotal:a.length,reposAvailable:a.filter(h=>h.available).length,unavailable:c,initialSince:e.since!=null?Number(e.since):null,initialFrom:e.from||null,initialTo:e.to||null,initialMembers:e.member?[e.member]:[]},d=HZ(l,u),f=e.out||Cg.default.join(qS(),"report.html");VS.default.writeFileSync(f,d),console.log(w("STATS_WROTE_REPORT__PATH_N",{path:f,n:l.length})),c.length&&console.log(w("STATS_UNAVAILABLE__N",{n:c.length})),VZ(d,{port:e.port||4321,open:e.open})}function N9e(e){let{commits:t,aliasMap:n}=T9e(e),{members:r}=BZ(t,n);console.log(w("STATS_PEOPLE_HEADER__N",{n:r.length}));for(let o of r)console.log(w("STATS_PEOPLE_ROW__N_NAME_EMAIL",{n:String(o.commits).padStart(5),name:o.name,email:o.email}))}function C9e(e){if(!e.member||!e.project)throw new Error(w("STATS_REVIEW_NEED_FLAGS"));let{repos:t}=xR(),n=t.find(s=>s.name===e.project);if(!n)throw new Error(w("STATS_REVIEW_NO_PROJECT__PROJECT_NAMES",{project:e.project,names:t.map(s=>s.name).join(", ")}));if(!VS.default.existsSync(n.dir))throw new Error(w("STATS_REVIEW_NOT_CLONED__PROJECT_DIR",{project:e.project,dir:n.dir}));let r=Py(e);console.log(w("STATS_REVIEW_BUILDING__MEMBER_PROJECT_LABEL",{member:e.member,project:e.project,label:r.label}));let o=JZ(n,e.member,r,{withDiff:e.diff,maxDiffLines:e.maxDiffLines,allBranches:!e.headOnly}),i=`${e.project}_${e.member.replace(/[^a-z0-9]+/gi,"-")}`.toLowerCase(),a=e.out||Cg.default.join(qS(),`review-${i}.md`);ZZ(a,o),console.log(w("STATS_REVIEW_WROTE__PATH",{path:a})),console.log(w("STATS_REVIEW_HINT"))}var VS,Cg,tee,ER=ne(()=>{"use strict";VS=Q(require("fs")),Cg=Q(require("path")),tee=Q(require("os"));js();PZ();WS();wR();jZ();WZ();YZ();eee();It()});var SR=F((W_t,I9e)=>{I9e.exports={name:"@pan-stack/cli",version:"0.3.66",description:"PAN Stack CLI \u2014 multi-repo git and project commands from .project.yaml",license:"SEE LICENSE IN LICENSE.txt",bin:{pan:"bin/pan.js"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},files:["bin","dist/agent-plugin"],scripts:{build:"node tools/pan-stack-cli/build.mjs","build:agent-plugin":"node tools/pan-stack-cli/build-agent-plugin.ts",prepare:"node tools/pan-stack-cli/build.mjs",prepublishOnly:"node tools/pan-stack-cli/build.mjs",test:'tsc --noEmit && tsc -p tsconfig.test.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.web.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.e2e.json --noEmit && tsc -p tools/pan-ba/tsconfig.e2e.json --noEmit && node --test "tools/pan-stack-plan/test/*.test.ts" "tools/pan-stack-cli/test/*.test.ts" "tools/pan-lineage/test/*.test.ts" "tools/pan-harness/test/*.test.ts" "tools/pan-program/test/*.test.ts" "tools/pan-handover/test/*.test.ts" "tools/pan-ba-core/test/*.test.ts" "tools/pan-ba/test/*.test.ts" "agent-plugin/plugins/pan/test/*.test.mjs" && node --test "tools/pan-cicd/test/*.test.mjs"',"test:pan-cicd":'node tools/pan-stack-cli/build.mjs && node --test "tools/pan-cicd/test/*.test.mjs"',"test:pan-stack-plan":'node --test "tools/pan-stack-plan/test/*.test.ts"',"test:pan-stack-cli":'node --test "tools/pan-stack-cli/test/*.test.ts"',typecheck:"tsc --noEmit && tsc -p tsconfig.test.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.web.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.e2e.json --noEmit && tsc -p tools/pan-ba/tsconfig.e2e.json --noEmit","build:web":"node tools/pan-stack-plan/build-web.mjs",pretest:"node tools/pan-stack-plan/build-web.mjs","test:e2e":"playwright test -c tools/pan-stack-plan/playwright.config.ts","test:e2e:ba":"node tools/pan-stack-cli/build.mjs && playwright test -c tools/pan-ba/playwright.config.ts","test:pan-lineage":'node --test "tools/pan-lineage/test/*.test.ts"'},engines:{node:">=18"},keywords:["pan-stack","monorepo","git","cli"],devDependencies:{"@inquirer/core":"^11.2.1","@inquirer/prompts":"^8.5.2","@inquirer/testing":"^3.3.9","@playwright/test":"1.62.1","@radix-ui/react-dialog":"^1.1.23","@radix-ui/react-popover":"1.1.23","@radix-ui/react-separator":"^1.1.15","@radix-ui/react-slot":"^1.3.3","@radix-ui/react-switch":"^1.3.7","@radix-ui/react-tabs":"^1.1.21","@radix-ui/react-tooltip":"^1.2.16","@tailwindcss/cli":"4.3.3","@tailwindcss/typography":"0.5.20","@types/node":"22.18.8","@types/picomatch":"3.0.1","@types/react":"^19.2.18","@types/react-dom":"^19.2.5","@types/sanitize-html":"2.16.0","class-variance-authority":"0.7.1",clsx:"2.1.1",cmdk:"1.1.1","csv-parse":"7.0.1","csv-stringify":"6.8.1",docx:"9.15.2",esbuild:"0.28.1",marked:"15.0.12","pdf-lib":"1.17.1",picomatch:"4.0.2",react:"19.2.8","react-dom":"19.2.8","react-markdown":"10.1.0","remark-gfm":"4.0.1","sanitize-html":"2.16.0",serve:"^14.2.4","tailwind-merge":"3.6.0",tailwindcss:"4.3.3",typescript:"5.9.3",yaml:"2.6.1"},optionalDependencies:{"@pan-stack/powerpoint":"^0.1.0"}}});var ree={};Hn(ree,{runInteractiveMenu:()=>R9e});function O9e(e){let t=e,n=String(t&&`${String(t.name)} ${String(t.message)}`||"");return/ExitPromptError|force closed|SIGINT|cancel/i.test(n)}async function kR({message:e,choices:t,hotkeys:n=[]}){try{return await F0({message:e,choices:t,hotkeys:n})}catch(r){if(String(r?.message)!=="no-core")throw r;let o=await Ac();if(!o||typeof o.select!="function")return"__exit__";let i=n.map(s=>({name:`${s.key} ${s.label}`,value:s.value})),a=i.length?[...t,new o.Separator,...i]:t;return o.select({message:e,choices:a,pageSize:20,loop:!1,theme:la(!1)})}}async function R9e({printUsage:e,version:t}={}){let n=await aS(),r=await Ac();if(!n&&(!r||typeof r.select!="function"))return!1;let o=G6().filter(i=>uy(i).length>0).sort((i,a)=>Cu(i).localeCompare(Cu(a)));if(o.length===0)return console.log(w("NO_PAN_YAML_WITH_COMMANDS")),console.log(w("NO_PAN_YAML_BUT_GIT_STILL_WORKS")),!1;try{for(;;){let i=await kR({message:w("MENU_SELECT_PROJECT"),choices:o.map((f,h)=>({name:Cu(f),value:h,description:`${uy(f).length} ${w("COMMANDS_LABEL")} \xB7 ${f.root}`})),hotkeys:[{key:"h",label:w("HELP_LABEL"),value:"__help__"},{key:"v",label:w("VERSION_LABEL"),value:"__version__"},{key:"x",label:w("EXIT_LABEL"),value:"__exit__"}]});if(i==="__exit__")return!0;if(i==="__version__"){console.log(`@pan-stack/cli ${t||"?"}`);continue}if(i==="__help__"){typeof e=="function"&&e();continue}let a=typeof i=="number"?o[i]:void 0;if(!a)continue;let s=uy(a),l=await kR({message:`[${Cu(a)}] ${w("MENU_SELECT_COMMAND")}`,choices:s.map(f=>({name:f.name+(f.aliases&&f.aliases.length?` (${f.aliases.join(", ")})`:"")+(f.hasTargets?` [${f.targets.join("|")}]`:""),value:f.name,description:f.description||""})),hotkeys:[{key:"b",label:w("BACK_LABEL"),value:"__back__"},{key:"x",label:w("EXIT_LABEL"),value:"__exit__"}]});if(l==="__exit__")return!0;if(l==="__back__")continue;let c=a.commands[String(l)],u=[];if(c&&c.targets&&Object.keys(c.targets).length>0){let f=Object.keys(c.targets),h=await kR({message:w("SELECT_TARGET__CMD",{cmd:l}),choices:[...f.map(p=>({name:p,value:p})),{name:w("DEFAULT_LABEL"),value:"__default__"}],hotkeys:[{key:"b",label:w("BACK_LABEL"),value:"__back__"}]});if(h==="__back__")continue;h!=="__default__"&&u.push(String(h))}console.error(`
1338
+ `)){if(r.includes("")){n&&t.push(n);let[i,a,s,l,c]=r.split("");n={hash:i??"",date:a??"",name:s??"",email:l??"",subject:c||"",additions:0,deletions:0};continue}let o=r.match(/(\d+) insertion[s]?\(\+\)|(\d+) deletion[s]?\(-\)/g);if(o&&n)for(let i of o){let a=i.match(/(\d+) insertion/),s=i.match(/(\d+) deletion/);a?.[1]&&(n.additions+=parseInt(a[1],10)),s?.[1]&&(n.deletions+=parseInt(s[1],10))}}return n&&t.push(n),t}function _9e(e){return String(e||"").replace(/\|/g,"\\|")}function ZZ(e,t){return yR.default.mkdirSync(QZ.default.dirname(e),{recursive:!0}),yR.default.writeFileSync(e,t),e}var yR,QZ,$Z,eee=ne(()=>{"use strict";yR=Q(require("fs")),QZ=Q(require("path")),$Z=require("child_process");WS();It()});var _R={};Hn(_R,{runStats:()=>k9e});function E9e(e){let t={_:[],open:!0,diff:!0};for(let n=0;n<e.length;n++){let r=e[n];r!==void 0&&(r==="--since"?t.since=e[++n]:r==="--from"?t.from=e[++n]:r==="--to"?t.to=e[++n]:r==="--member"||r==="-m"?t.member=e[++n]:r==="--project"||r==="-p"?t.project=e[++n]:r==="--port"?t.port=parseInt(e[++n]??"",10):r==="--out"||r==="-o"?t.out=e[++n]:r==="--no-open"?t.open=!1:r==="--no-diff"?t.diff=!1:r==="--head-only"?t.headOnly=!0:r==="--max-diff-lines"?t.maxDiffLines=parseInt(e[++n]??"",10):r.startsWith("--since=")?t.since=r.slice(8):t._.push(r))}return t}function qS(){let e=Cg.default.join(tee.default.homedir(),".pan-code-graph");return VS.default.mkdirSync(e,{recursive:!0}),e}function xR(){let e=ug();if(e)return{repos:DZ(e),source:`.project.yaml (${e.project})`};let t=cg(process.cwd());if(!t.length)throw new Error(w("STATS_NO_REPOS__CWD",{cwd:process.cwd()}));return console.log(w("STATS_FALLBACK_SCAN__CWD",{cwd:process.cwd()})),{repos:t,source:w("STATS_SOURCE_FALLBACK")}}function S9e(){console.log(w("STATS_USAGE"))}async function k9e(e){let t=E9e(e),n=t._[0],r=n!==void 0&&["report","people","review"].includes(n)?t._.shift():"report";return t._[0]==="help"||t.help?S9e():r==="review"?C9e(t):r==="people"?N9e(t):A9e(t)}function T9e(e){let{repos:t}=xR(),n=Py(e),r=!e.headOnly,o=r?w("STATS_SCOPE_ALL_BRANCHES"):w("STATS_SCOPE_HEAD_ONLY");console.log(w("STATS_SCAN_RANGE__N_SCOPE_LABEL",{n:t.length,scope:o,label:n.label}));let{commits:i,repoStatus:a}=gR(t,n,{allBranches:r}),s=bR(Cg.default.join(qS(),"alias-map.json"));return{repos:t,range:n,commits:i,repoStatus:a,aliasMap:s}}function A9e(e){let{repos:t}=xR(),n=Py({}),r=!e.headOnly,o=r?w("STATS_SCOPE_ALL_BRANCHES"):w("STATS_SCOPE_HEAD_ONLY");console.log(w("STATS_SCAN_FULL__N_SCOPE",{n:t.length,scope:o}));let{commits:i,repoStatus:a}=gR(t,n,{allBranches:r}),s=bR(Cg.default.join(qS(),"alias-map.json")),l=i.map(h=>({e:KS(h.email,s),n:h.name||h.email,t:h.ts,r:h.repoName,a:h.additions,d:h.deletions})),c=a.filter(h=>!h.available).map(h=>({name:h.name,reason:h.reason}));Py(e);let u={reposTotal:a.length,reposAvailable:a.filter(h=>h.available).length,unavailable:c,initialSince:e.since!=null?Number(e.since):null,initialFrom:e.from||null,initialTo:e.to||null,initialMembers:e.member?[e.member]:[]},d=HZ(l,u),f=e.out||Cg.default.join(qS(),"report.html");VS.default.writeFileSync(f,d),console.log(w("STATS_WROTE_REPORT__PATH_N",{path:f,n:l.length})),c.length&&console.log(w("STATS_UNAVAILABLE__N",{n:c.length})),VZ(d,{port:e.port||4321,open:e.open})}function N9e(e){let{commits:t,aliasMap:n}=T9e(e),{members:r}=BZ(t,n);console.log(w("STATS_PEOPLE_HEADER__N",{n:r.length}));for(let o of r)console.log(w("STATS_PEOPLE_ROW__N_NAME_EMAIL",{n:String(o.commits).padStart(5),name:o.name,email:o.email}))}function C9e(e){if(!e.member||!e.project)throw new Error(w("STATS_REVIEW_NEED_FLAGS"));let{repos:t}=xR(),n=t.find(s=>s.name===e.project);if(!n)throw new Error(w("STATS_REVIEW_NO_PROJECT__PROJECT_NAMES",{project:e.project,names:t.map(s=>s.name).join(", ")}));if(!VS.default.existsSync(n.dir))throw new Error(w("STATS_REVIEW_NOT_CLONED__PROJECT_DIR",{project:e.project,dir:n.dir}));let r=Py(e);console.log(w("STATS_REVIEW_BUILDING__MEMBER_PROJECT_LABEL",{member:e.member,project:e.project,label:r.label}));let o=JZ(n,e.member,r,{withDiff:e.diff,maxDiffLines:e.maxDiffLines,allBranches:!e.headOnly}),i=`${e.project}_${e.member.replace(/[^a-z0-9]+/gi,"-")}`.toLowerCase(),a=e.out||Cg.default.join(qS(),`review-${i}.md`);ZZ(a,o),console.log(w("STATS_REVIEW_WROTE__PATH",{path:a})),console.log(w("STATS_REVIEW_HINT"))}var VS,Cg,tee,ER=ne(()=>{"use strict";VS=Q(require("fs")),Cg=Q(require("path")),tee=Q(require("os"));js();PZ();WS();wR();jZ();WZ();YZ();eee();It()});var SR=F((W_t,I9e)=>{I9e.exports={name:"@pan-stack/cli",version:"0.3.67",description:"PAN Stack CLI \u2014 multi-repo git and project commands from .project.yaml",license:"SEE LICENSE IN LICENSE.txt",bin:{pan:"bin/pan.js"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},files:["bin","dist/agent-plugin"],scripts:{build:"node tools/pan-stack-cli/build.mjs","build:agent-plugin":"node tools/pan-stack-cli/build-agent-plugin.ts",prepare:"node tools/pan-stack-cli/build.mjs",prepublishOnly:"node tools/pan-stack-cli/build.mjs",test:'tsc --noEmit && tsc -p tsconfig.test.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.web.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.e2e.json --noEmit && tsc -p tools/pan-ba/tsconfig.e2e.json --noEmit && node --test "tools/pan-stack-plan/test/*.test.ts" "tools/pan-stack-cli/test/*.test.ts" "tools/pan-lineage/test/*.test.ts" "tools/pan-harness/test/*.test.ts" "tools/pan-program/test/*.test.ts" "tools/pan-handover/test/*.test.ts" "tools/pan-ba-core/test/*.test.ts" "tools/pan-ba/test/*.test.ts" "agent-plugin/plugins/pan/test/*.test.mjs" && node --test "tools/pan-cicd/test/*.test.mjs"',"test:pan-cicd":'node tools/pan-stack-cli/build.mjs && node --test "tools/pan-cicd/test/*.test.mjs"',"test:pan-stack-plan":'node --test "tools/pan-stack-plan/test/*.test.ts"',"test:pan-stack-cli":'node --test "tools/pan-stack-cli/test/*.test.ts"',typecheck:"tsc --noEmit && tsc -p tsconfig.test.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.web.json --noEmit && tsc -p tools/pan-stack-plan/tsconfig.e2e.json --noEmit && tsc -p tools/pan-ba/tsconfig.e2e.json --noEmit","build:web":"node tools/pan-stack-plan/build-web.mjs",pretest:"node tools/pan-stack-plan/build-web.mjs","test:e2e":"playwright test -c tools/pan-stack-plan/playwright.config.ts","test:e2e:ba":"node tools/pan-stack-cli/build.mjs && playwright test -c tools/pan-ba/playwright.config.ts","test:pan-lineage":'node --test "tools/pan-lineage/test/*.test.ts"'},engines:{node:">=18"},keywords:["pan-stack","monorepo","git","cli"],devDependencies:{"@inquirer/core":"^11.2.1","@inquirer/prompts":"^8.5.2","@inquirer/testing":"^3.3.9","@playwright/test":"1.62.1","@radix-ui/react-dialog":"^1.1.23","@radix-ui/react-popover":"1.1.23","@radix-ui/react-separator":"^1.1.15","@radix-ui/react-slot":"^1.3.3","@radix-ui/react-switch":"^1.3.7","@radix-ui/react-tabs":"^1.1.21","@radix-ui/react-tooltip":"^1.2.16","@tailwindcss/cli":"4.3.3","@tailwindcss/typography":"0.5.20","@types/node":"22.18.8","@types/picomatch":"3.0.1","@types/react":"^19.2.18","@types/react-dom":"^19.2.5","@types/sanitize-html":"2.16.0","class-variance-authority":"0.7.1",clsx:"2.1.1",cmdk:"1.1.1","csv-parse":"7.0.1","csv-stringify":"6.8.1",docx:"9.15.2",esbuild:"0.28.1",marked:"15.0.12","pdf-lib":"1.17.1",picomatch:"4.0.2",react:"19.2.8","react-dom":"19.2.8","react-markdown":"10.1.0","remark-gfm":"4.0.1","sanitize-html":"2.16.0",serve:"^14.2.4","tailwind-merge":"3.6.0",tailwindcss:"4.3.3",typescript:"5.9.3",yaml:"2.6.1"},optionalDependencies:{"@pan-stack/powerpoint":"^0.1.0"}}});var ree={};Hn(ree,{runInteractiveMenu:()=>R9e});function O9e(e){let t=e,n=String(t&&`${String(t.name)} ${String(t.message)}`||"");return/ExitPromptError|force closed|SIGINT|cancel/i.test(n)}async function kR({message:e,choices:t,hotkeys:n=[]}){try{return await F0({message:e,choices:t,hotkeys:n})}catch(r){if(String(r?.message)!=="no-core")throw r;let o=await Ac();if(!o||typeof o.select!="function")return"__exit__";let i=n.map(s=>({name:`${s.key} ${s.label}`,value:s.value})),a=i.length?[...t,new o.Separator,...i]:t;return o.select({message:e,choices:a,pageSize:20,loop:!1,theme:la(!1)})}}async function R9e({printUsage:e,version:t}={}){let n=await aS(),r=await Ac();if(!n&&(!r||typeof r.select!="function"))return!1;let o=G6().filter(i=>uy(i).length>0).sort((i,a)=>Cu(i).localeCompare(Cu(a)));if(o.length===0)return console.log(w("NO_PAN_YAML_WITH_COMMANDS")),console.log(w("NO_PAN_YAML_BUT_GIT_STILL_WORKS")),!1;try{for(;;){let i=await kR({message:w("MENU_SELECT_PROJECT"),choices:o.map((f,h)=>({name:Cu(f),value:h,description:`${uy(f).length} ${w("COMMANDS_LABEL")} \xB7 ${f.root}`})),hotkeys:[{key:"h",label:w("HELP_LABEL"),value:"__help__"},{key:"v",label:w("VERSION_LABEL"),value:"__version__"},{key:"x",label:w("EXIT_LABEL"),value:"__exit__"}]});if(i==="__exit__")return!0;if(i==="__version__"){console.log(`@pan-stack/cli ${t||"?"}`);continue}if(i==="__help__"){typeof e=="function"&&e();continue}let a=typeof i=="number"?o[i]:void 0;if(!a)continue;let s=uy(a),l=await kR({message:`[${Cu(a)}] ${w("MENU_SELECT_COMMAND")}`,choices:s.map(f=>({name:f.name+(f.aliases&&f.aliases.length?` (${f.aliases.join(", ")})`:"")+(f.hasTargets?` [${f.targets.join("|")}]`:""),value:f.name,description:f.description||""})),hotkeys:[{key:"b",label:w("BACK_LABEL"),value:"__back__"},{key:"x",label:w("EXIT_LABEL"),value:"__exit__"}]});if(l==="__exit__")return!0;if(l==="__back__")continue;let c=a.commands[String(l)],u=[];if(c&&c.targets&&Object.keys(c.targets).length>0){let f=Object.keys(c.targets),h=await kR({message:w("SELECT_TARGET__CMD",{cmd:l}),choices:[...f.map(p=>({name:p,value:p})),{name:w("DEFAULT_LABEL"),value:"__default__"}],hotkeys:[{key:"b",label:w("BACK_LABEL"),value:"__back__"}]});if(h==="__back__")continue;h!=="__default__"&&u.push(String(h))}console.error(`
1339
1339
  \u25B6 pan ${l}${u.length?" "+u.join(" "):""} (${nee.default.basename(a.root)})
1340
1340
  `);let d=await zS(a,String(l),u);if(!(d&&d.backed))return!0}}catch(i){if(O9e(i))return console.error(`
1341
1341
  `+w("EXITED")),!0;throw i}}var nee,oee=ne(()=>{"use strict";nee=Q(require("path"));js();wh();aR();Np();Za();Ah();It()});function NR(e){var t="";return L9e.forEach(function(n){for(;e>=n[0];)t+=n[1],e-=n[0]}),t}function uee(e,t){var n=new Map;function r(o,i){var a=0;o.forEach(function(s){if(s.coSo!==!1){var l=i.concat([++a]),c=l.slice(1).join(".");n.set(s.key,{heading:t==="thap-phan"?l.join(".")+".":l.length===1?NR(l[0])+".":l.join(".")+".",ref:t==="thap-phan"?l.join("."):l.length===1?NR(l[0]):l.join("."),depth:l.length}),r(s.children||[],l)}})}return r(e,[]),n}function T0(e){return String(e??"").replace(/[đĐ]/g,"d").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ul(e){if(!e)return"";var t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);return t?t[3]+"/"+t[2]+"/"+t[1]:String(e)}function TR(e){if(!e)return"";var t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(e);return t?t[3]+"/"+t[2]+"/"+t[1]+" "+t[4]+":"+t[5]:Ul(e)}function YS(e){var t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);return t?Date.UTC(+t[1],+t[2]-1,+t[3])/864e5:NaN}function fee(e){return dee[e]||e}function aee(e){return IR[e]||e}function Rh(e){return ca[e]||ca.vi}function Rp(e,t){return String(e).replace(/\{(\w+)\}/g,function(n,r){return t[r]==null?"":String(t[r])})}function C0(e,t,n={}){var r=Rh(e).lint||OR;return Rp(r[t]||OR[t]||t,n||{})}function j9e(e){return e!=null&&(Array.isArray(e)?e.length>0:typeof e=="string"?e.trim()!=="":!0)}function Op(e){return typeof e=="string"?e:e.ma}function AR(e){return typeof e=="string"?[]:e.con||[]}function cee(e){return JSON.parse(JSON.stringify(e))}function Qd(e){var t=String(e),n=t.trim().replace(/^\[\[/,"").replace(/\]\]$/,""),r=null,o=n.indexOf("|");if(o>=0&&(r=n.slice(o+1).trim(),n=n.slice(0,o).trim()),n.charAt(0)==="?")return{raw:t,code:null,row:null,block:null,label:r,unregistered:!0,ten:n.slice(1).trim()};var i=null,a=null,s=n.indexOf("#");s>=0&&(i=n.slice(s+1).replace(/^"|"$/g,""),n=n.slice(0,s));var l=n.indexOf("/");return l>=0&&(a=n.slice(l+1),n=n.slice(0,l)),{raw:t,code:n.trim(),row:i,block:a?fee(a):null,label:r,unregistered:!1,ten:null}}function Ig(e){var t=[],n=String(e??""),r=0,o;for(lee.lastIndex=0;o=lee.exec(n);){o.index>r&&t.push({text:n.slice(r,o.index)});var i=Qd(o[1]),a=i.unregistered?"?"+i.ten:i.code+(i.block?"/"+i.block:"")+(i.row?"#"+i.row:"");t.push({ref:a,raw:o[0],code:i.code,row:i.row,block:i.block,label:i.label,unregistered:i.unregistered,ten:i.ten}),r=o.index+o[0].length}return r<n.length&&t.push({text:n.slice(r)}),t}function pee(e){var t=new Map,n=null;function r(){return Object.isFrozen(e)}function o(q,oe){var $=r()?t:n;if(!$||q==null)return oe();if($.has(q))return $.get(q);var se=oe();return $.set(q,se),se}function i(q){return function(){var oe=n;oe||(n=new Map);try{return q.apply(null,arguments)}finally{oe||(n=null)}}}function a(){return o("idx",function(){var q=new Map;return(e.items||[]).forEach(function(oe){q.set(oe.ma,oe)}),(e.tbd||[]).forEach(function(oe){q.set(oe.ma,oe)}),q})}function s(q){return T0(q).replace(/\s+/g,"")}function l(){return o("alias",function(){var q=new Map;return(e.items||[]).forEach(function(oe){(oe.biDanh||[]).forEach(function($){q.has(s($))||q.set(s($),oe.ma)})}),q})}function c(q){return q=q||{},{docId:q.docId||m(),variant:q.variant||"current",outlines:q.outlines||null,items:q.items||null}}function u(q){return q.outlines||q.items?null:q.docId+"|"+q.variant}function d(q,oe){return oe&&oe.items&&oe.items[q]||a().get(q)||null}function f(q){return q&&a().get(String(q).split(/[#/]/)[0])||null}function h(q){return(e.people||[]).filter(function(oe){return oe.id===q})[0]||null}function p(q){var oe=h(q);return oe?oe.ten:q||""}function v(q){return(e.docs||[]).filter(function(oe){return oe.ma===q})[0]||null}function m(){var q=(e.docs||[])[0];return q?q.ma:""}function g(){return Object.keys(e.outlines||{})[0]||""}function b(q){return(e.modules||[]).filter(function(oe){return oe.ma===q})[0]||null}function x(q,oe,$){if($&&$.outlines&&$.outlines[q])return $.outlines[q];var se=e.outlines&&e.outlines[q];return se?se[oe]||se.current||{}:{}}function y(q){var oe=[];function $(se){(se||[]).forEach(function(he){oe.push(Op(he)),$(AR(he))})}return Object.keys(q||{}).forEach(function(se){$(q[se])}),oe}function E(q,oe){if(!q)return!1;if(q.loai==="cho")return!0;if(q.daXoa)return!1;var $=e.outlines&&e.outlines[q.phanHe];return $&&$[oe]&&oe!=="current"?y($[oe]).indexOf(q.ma)>=0:!0}function _(q,oe){return!(q&&q.sauBan&&oe!=="current")}function T(q,oe,$){var se=fee(q),he=Rh($||e.lang);return oe&&he.blockShort[se]||he.blockTitle[se]||String(q)}function S(q){if(typeof q=="string"&&(q=f(q)),!q||q.loai==="cho"||q.daXoa||q.trangThai==="du-kien")return[];var oe=q.khoi||{},$=q.vanBan||{};return(P9e[q.loai]||[]).filter(function(se){return se[2]||j9e(oe[se[1]])||!!($[se[0]]&&String($[se[0]]).trim())}).map(function(se){return se[0]})}function A(q,oe,$,se,he){he=he||0;var _e=q&&q.khoi&&q.khoi[oe];if(!_e)return[];if(oe==="danhMuc")return(_e.dong||[]).slice();if(Array.isArray(_e))return _e.filter(function(Pe){return _(Pe,$)});if(_e.keThua&&he<5){var Le=d(_e.keThua.tu,se),Ne=A(Le,oe,$,se,he+1).map(function(Pe){return Object.assign({},Pe,{keThua:_e.keThua.tu})});return(_e.thayDoi||[]).forEach(function(Pe){var wt=-1;if(Ne.forEach(function(Ve,Et){wt<0&&Ve.ma===Pe.ma&&(wt=Et)}),Pe.bo)wt>=0&&Ne.splice(wt,1);else if(Pe.sua)wt>=0&&(Ne[wt]=Object.assign({},Ne[wt],Pe.sua,{thayDoi:"sua"}));else{var Me={ma:Pe.ma,ten:Pe.ten,kieu:Pe.kieu||"",batBuoc:!!Pe.batBuoc,macDinh:Pe.macDinh||"",nguon:Pe.nguon||null,mo:Pe.mo||null,moTa:Pe.moTa||"",thayDoi:"them"},ft=-1;Pe.sau&&Ne.forEach(function(Ve,Et){Ve.ma===Pe.sau&&(ft=Et)}),ft>=0?Ne.splice(ft+1,0,Me):Ne.push(Me)}}),Ne}return[]}function C(q,oe,$){var se=q&&q.khoi&&q.khoi[oe];return se?oe==="danhMuc"?(se.dong||[]).slice():Array.isArray(se)?se.filter(function(he){return!he.nhom&&_(he,$)}):(se.thayDoi||[]).filter(function(he){return!he.bo}).map(function(he){return he.sua?Object.assign({ma:he.ma},he.sua):he}):[]}function O(q,oe,$,se){for(var he=0;he<Ip.length;he++)for(var _e=A(q,Ip[he][0],$,se).filter(function(Ne){return!Ne.nhom}),Le=0;Le<_e.length;Le++)if(String(_e[Le].ma)===String(oe))return{row:_e[Le],block:Ip[he][1],index:Le+1,inherited:!!_e[Le].keThua&&_e[Le].thayDoi!=="them"};return null}function D(q,oe){var $=aee(oe),se=q&&q.khoi&&q.khoi[$];if(!se||Array.isArray(se)||!se.keThua)return!1;var he=f(se.keThua.tu),_e=he&&he.bam&&he.bam[$];return!!_e&&_e!==se.keThua.daRaSoat}function U(q,oe){var $=[];if(!q||!q.khoi)return $;function se(he,_e){Ig(he).forEach(function(Le){Le.ref&&$.push(Object.assign({},_e,{ref:Le.ref,field:"moTa",text:he}))})}return Ip.forEach(function(he){var _e=q.khoi[he[0]];_e&&(_e.keThua&&$.push({tu:q.ma+"/"+he[1],ma:q.ma,row:null,block:he[1],ref:_e.keThua.tu+"/"+he[1],field:"keThua",text:""}),C(q,he[0],oe).forEach(function(Le){var Ne={tu:q.ma+"#"+Le.ma,ma:q.ma,row:Le.ma,block:he[1]};["mo","nguon","man"].forEach(function(Pe){Le[Pe]&&$.push(Object.assign({},Ne,{ref:Le[Pe],field:Pe,text:Le.moTa||""}))}),Le.moTa&&se(Le.moTa,Ne),Le.noiDung&&se(Le.noiDung,Ne)}))}),typeof q.khoi.mucDich=="string"&&se(q.khoi.mucDich,{tu:q.ma+"/muc-dich",ma:q.ma,row:null,block:"muc-dich"}),$}function L(q){var oe=f(q),$=0;if(!oe){var se=l().get(s(q));return se||q}for(;oe&&oe.daXoa&&oe.daXoa.gopVao&&$<5;)q=oe.daXoa.gopVao,oe=f(q),$++;return q}function I(q){var oe=v(q.docId);if(!oe)return[];var $=e.khung&&e.khung[oe.khung]||[],se=oe.phamVi||[];function he(Et){var ge=Op(Et),Qe=d(ge,q);if(!Qe||Qe.daXoa||Qe.loai==="cho")return null;var jt=S(Qe).map(function(cn){return{key:ge+"/"+cn,title:CR[cn],kind:"khoi",code:ge,block:cn,status:null,children:[]}});return AR(Et).forEach(function(cn){var it=he(cn);it&&jt.push(it)}),{key:ge,title:Qe.tieuDe,kind:Qe.loai,code:ge,block:null,status:Qe.trangThai,children:jt}}var _e=[];se.forEach(function(Et){_e=_e.concat(y(x(Et,q.variant,q)))});for(var Le=x("CHUNG",q.variant,q),Ne=y(Le),Pe={},wt=_e.slice(),Me={};wt.length;){var ft=wt.shift();if(!Me[ft]){Me[ft]=!0;var Ve=d(ft,q);Ve&&U(Ve,q.variant).forEach(function(Et){var ge=Qd(Et.ref);if(ge.code){var Qe=L(ge.code);Ne.indexOf(Qe)>=0&&!Pe[Qe]&&(Pe[Qe]=!0,wt.push(Qe))}})}}return $.map(function(Et){var ge="chuong:"+Et.id,Qe=[];if(Et.nguon&&(se.forEach(function(it){var Ct=x(it,q.variant,q),Qt=(Ct[Et.nguon]||[]).concat(Et.nguon==="chuc_nang"&&it!=="CHUNG"?Ct.muc||[]:[]);if(Qt.length){var lt=b(it);Qe.push({key:"phan-he:"+Et.id+":"+it,title:lt?lt.ten:it,kind:"phan-he",code:null,phanHe:it,block:null,status:null,children:Qt.map(he).filter(Boolean)})}}),Et.dungChung)){var jt=(Le.muc||[]).filter(function(it){return Pe[Op(it)]});if(jt.length){var cn=b("CHUNG");Qe.push({key:"phan-he:"+Et.id+":CHUNG",title:cn?cn.ten:"D\xF9ng chung",kind:"phan-he",code:null,phanHe:"CHUNG",block:null,status:null,children:jt.map(he).filter(Boolean)})}}return(Et.con||[]).forEach(function(it){var Ct={key:ge+"/"+it.id,title:it.ten,kind:"khung",code:null,block:null,status:null,children:[]};it.nguon&&(se.forEach(function(Qt){(x(Qt,q.variant,q)[it.nguon]||[]).forEach(function(lt){var mt=he(lt);mt&&Ct.children.push(mt)})}),(Le[it.nguon]||[]).forEach(function(Qt){if(Pe[Op(Qt)]){var lt=he(Qt);lt&&Ct.children.push(lt)}})),Qe.push(Ct)}),{key:ge,title:Et.ten,kind:"chuong",code:null,block:null,status:null,children:Qe}})}function j(q){var oe=u(q);return o(oe?"tree|"+oe:null,function(){return I(q)})}function P(q){var oe=u(q);return o(oe?"num|"+oe:null,function(){var $=v(q.docId);return uee(j(q),$?$.kieuSo:"la-ma")})}function Y(q){return o("home|"+q,function(){for(var oe=e.docs||[],$=0;$<oe.length;$++)if(P(c({docId:oe[$].ma})).has(q))return oe[$].ma;return null})}function G(q){var oe=(e.baselines||[]).filter(function($){return $.taiLieu===q&&$.phatHanh});return oe.sort(function($,se){return $.ngay<se.ngay?-1:$.ngay>se.ngay?1:0}),oe[oe.length-1]||null}function B(q,oe){if(!oe)return G(q);var $=String(oe).replace(/^v/i,"");return(e.baselines||[]).filter(function(se){return se.taiLieu===q&&(se.phienBan===$||se.phienBan===$+".0")})[0]||null}function W(q,oe){var $=typeof q=="string"?Qd(q):q,se={ref:$.raw,label:$.label||null,code:$.code||null,row:$.row||null,block:$.block||null,target:null,number:null,itemNumber:null,homeDoc:null,homeNumber:null,homeVersion:null,via:null,reason:null,suspect:!1,rowInfo:null,targetState:null};if($.unregistered)return Object.assign(se,{state:"pending",targetState:"pending",reason:"chua-dang-ky",ten:$.ten});var he=$.code,_e=d(he,oe),Le=null,Ne=0;if(!_e){var Pe=l().get(s(he));Pe&&(_e=d(Pe,oe),Le={kieu:"bi-danh",tu:he},he=Pe)}for(;_e&&_e.daXoa;)if(_e.daXoa.gopVao&&Ne<5)Le=Le||{kieu:"gop",tu:he},he=_e.daXoa.gopVao,_e=d(he,oe),Ne++;else return Object.assign(se,{state:"broken",targetState:"broken",reason:Ne>=5?"vong-lap":"da-xoa",target:_e});if(!_e)return Object.assign(se,{state:"broken",targetState:"broken",reason:"khong-ton-tai"});if(_e.loai==="cho"){if(_e.trangThai==="da-giai"&&_e.giaiThanh){var wt=W(Object.assign({},$,{code:_e.giaiThanh}),oe);return wt.via={kieu:"muc-cho",tu:_e.ma},wt.ref=$.raw,wt}return _e.trangThai==="huy"?Object.assign(se,{state:"broken",targetState:"broken",reason:"muc-cho-huy",code:_e.ma,target:_e}):Object.assign(se,{state:"pending",targetState:"pending",code:_e.ma,target:_e})}var Me=null;if($.row&&(Me=O(_e,$.row,oe.variant,oe),!Me))return Object.assign(se,{state:"broken",targetState:"broken",reason:"khong-co-dong",code:he,target:_e,via:Le});if($.block&&S(_e).indexOf($.block)<0)return Object.assign(se,{state:"broken",targetState:"broken",reason:"khong-co-khoi",code:he,target:_e,via:Le});var ft=P(oe),Ve=$.block?he+"/"+$.block:he,Et,ge=null,Qe=null,jt=null,cn=null,it=null;if(ft.has(he))Qe=ft.get(he).ref,ge=(ft.get(Ve)||ft.get(he)).ref,jt=oe.docId,Et=_e.trangThai==="du-kien"?"planned":"ok";else{Et="external",jt=Y(he);var Ct=jt&&G(jt);Ct&&Ct.so&&Ct.so[he]&&(it=Ct.phienBan,cn=Ct.so[Ve]||Ct.so[he])}var Qt=$.block||Me&&Me.block||null,lt=!!(Qt&&D(_e,Qt));lt&&Et==="ok"&&(Et="suspect");var mt=Et;return Le&&(Et="alias"),Object.assign(se,{state:Et,targetState:mt,code:he,target:_e,via:Le,number:ge,itemNumber:Qe,homeDoc:jt,homeNumber:cn,homeVersion:it,suspect:lt,rowInfo:Me,planned:_e.trangThai==="du-kien"})}function X(q,oe,$){$=$||{};var se=v(oe.docId),he=Rh(se&&se.language||e.lang),_e=se&&se.mauThamChieu||he.refTpl,Le=he.q1,Ne=he.q2;if(q.state==="broken"){var Pe=q.reason==="khong-co-dong"||q.reason==="khong-co-khoi"?String(q.ref).replace(/^\[\[|\]\]$/g,""):q.code||String(q.ref);return(q.reason==="da-xoa"||q.reason==="muc-cho-huy"||q.reason==="vong-lap")&&(Pe=Qd(q.ref).code),{lead:null,full:Rp(he.notFound,{x:Pe})}}if(q.state==="pending"){if(q.reason==="chua-dang-ky")return{lead:null,full:Rp(he.tbdLoose,{ten:q.ten})};var wt=q.target;return $.mienTru?{lead:null,full:Rp(he.tbdWaived,{ten:wt.tenDuKien,ma:wt.ma})}:{lead:null,full:Rp(he.tbd,{ten:wt.tenDuKien,ma:wt.ma,nguoi:p(wt.phuTrach),han:Ul(wt.han)})}}var Me=q.target,ft=q.code,Ve=q.targetState==="external",Et=Me.trangThai==="du-kien"?he.planned:"";function ge(Ge,Ee){return q.homeVersion?Rp(he.extVer,{head:Ge,ma:ft,so:Ee,doc:q.homeDoc,ver:q.homeVersion}):Rp(he.extDraft,{head:Ge,ma:ft,doc:q.homeDoc||"?"})}function Qe(Ge,Ee,qe){return Ve?ge(Ge+" "+Le+Ee+Ne,qe||q.homeNumber):_e.replace("{loai}",Ge).replace("{ten}",Ee).replace("{so}",qe).replace("{ma}",ft)}function jt(Ge,Ee){return Ve?ge(Ge,q.homeNumber):_e.replace("{loai} "+Le+"{ten}"+Ne,Ge).replace("{loai} \xAB{ten}\xBB",Ge).replace("{so}",Ee).replace("{ma}",ft)}var cn=he.loaiWord[Me.loai]||he.item,it=Ve?q.homeNumber:q.itemNumber;if(q.rowInfo){var Ct=q.rowInfo.row,Qt=/^(TB|PG|TS|MSG|BR|VR|F|T|P|B)\d/.exec(String(Ct.ma)),lt=Qt?Qt[1]:null;if(lt==="VR"||lt==="BR"||lt==="MSG")return{lead:null,full:Qe((lt==="MSG"?he.msg:he.rule)+Ct.ma,Ct.noiDung,it)+Et};var mt;return q.rowInfo.block==="danh-muc"?mt=he.value+" "+Le+Ct.ten+Ne+" ("+Ct.ma+")":lt==="TB"?mt=he.button+" "+Le+Ct.ten+Ne+" ("+Ct.ma+")":lt==="PG"?mt=he.func+" "+Le+Ct.ten+Ne+" ("+Ct.ma+")":lt==="B"?mt=he.step+" "+q.rowInfo.index+" "+Le+Ct.ten+Ne:lt==="TS"?mt=he.param+" "+Ct.ma+" "+Le+Ct.chuThich+Ne:mt=he.field+" "+Le+Ct.ten+Ne+" ("+Ct.ma+")",{lead:null,full:mt+he.of+Qe(cn,Me.tieuDe,it)+Et}}if(q.block){var We=Ve?q.homeNumber:q.number;return{lead:null,full:Rp(he.part,{t:he.blockTitle[q.block]})+Qe(cn,Me.tieuDe,We)+Et}}if(q.label)return{lead:null,full:jt(q.label,it)+Et};var gt=Me.hienThi==="popup"?"popup":cn,ve=Qe(gt,Me.tieuDe,it)+Et,ke=Ve||_e.indexOf("{loai} ")===0;return{lead:ke?gt:null,full:ve,rest:ke?ve.slice(gt.length+1):ve,family:Me.loai}}function K(q,oe,$){return X(W(q,oe),oe,$).full}function ee(q,oe){var $=T0(q),se=T0(oe);return $===se+" "||$.length>se.length+1&&$.slice(-(se.length+2))===" "+se+" "||$.slice(-(se.length+2))==="("+se+" "}function ie(q,oe,$){var se="";return Ig(q).forEach(function(he){if(he.text!=null&&!he.ref&&!he.unregistered){se+=he.text;return}var _e=X(W(he.raw,oe),oe,$);if(_e.lead){var Le=[_e.lead];_e.family==="man-hinh"&&(Le=Le.concat(["m\xE0n h\xECnh","popup","m\xE0n"]));for(var Ne=0;Ne<Le.length;Ne++)if(ee(se,Le[Ne])){se+=_e.rest;return}}se+=_e.full}),se}function fe(q,oe){oe=oe||"current";var $=[],se={},he=L(q);return(e.items||[]).forEach(function(_e){E(_e,oe)&&U(_e,oe).forEach(function(Le){var Ne=Qd(Le.ref);if(Ne.code){var Pe=Ne.code===q||L(Ne.code)===he;if(!Pe){var wt=a().get(Ne.code);if(!(wt&&wt.loai==="cho"&&wt.trangThai==="da-giai"&&wt.giaiThanh===q))return}var Me=Le.tu;se[Me]||(se[Me]={tu:Le.tu,ma:Le.ma,row:Le.row,block:Le.block,ref:Le.ref,fields:[],text:Le.text||"",quaBiDanh:Ne.code!==he&&Ne.code!==q},$.push(se[Me])),se[Me].fields.indexOf(Le.field)<0&&se[Me].fields.push(Le.field),!se[Me].text&&Le.text&&(se[Me].text=Le.text)}})}),$}function Fe(q,oe,$){var se=B(oe||m(),$);return se&&se.so&&se.so[q]||null}function pe(q){var oe=String(q).split("/")[0],$=Y(oe);if(!$)return null;var se=P(c({docId:$})).get(q);return se?se.ref:null}function Ze(q){var oe=String(q||"").trim(),$=[],se={},he=/^v(\d+(?:\.\d+)?)\s+([IVXivx]+(?:\.\d+)*|\d+(?:\.\d+)*)\.?$/.exec(oe),_e=/^word\s+(\d+(?:\.\d+)*)\.?$/i.exec(oe);function Le(Me,ft,Ve,Et){var ge=ft;if(!se[ge]){se[ge]=!0;var Qe=ft.split("/")[0],jt=ft.indexOf("/")>0?ft.split("/")[1]:null,cn=pe(ft),it=Et==="word"?"s\u1ED1 trong Word c\u0169 l\xE0 "+Ve+(Me&&Me.tep?" ("+Me.tep+")":"")+", nay l\xE0 "+(cn||"\u2014"):"\u1EDF b\u1EA3n "+Me.phienBan+" l\xE0 "+Ve+", nay l\xE0 "+(cn||"\u2014");$.push({key:ft,code:Qe,block:jt,docId:Me?Me.taiLieu:Y(Qe),phienBan:Me?Me.phienBan:null,so:Ve,nay:cn,sub:it,nguon:Et})}}if(he){var Ne=he[1],Pe=he[2].toUpperCase();(e.baselines||[]).forEach(function(Me){Me.nguon!=="word"&&(Me.phienBan===Ne||Me.phienBan===Ne+".0")&&Object.keys(Me.so||{}).forEach(function(ft){String(Me.so[ft]).toUpperCase()===Pe&&Le(Me,ft,Me.so[ft],"baseline")})})}if(_e){var wt=_e[1];(e.baselines||[]).forEach(function(Me){Me.nguon==="word"&&Object.keys(Me.so||{}).forEach(function(ft){Me.so[ft]===wt&&Le(Me,ft,wt,"word")})}),(e.items||[]).forEach(function(Me){Me.nguonNhap&&Me.nguonNhap.soCu===wt&&Le({taiLieu:Y(Me.ma),phienBan:"0",tep:Me.nguonNhap.tep},Me.ma,wt,"word")})}return $}function we(q){var oe=Qd(q),$=oe.code||"";if(/^TBD-/.test($))return"05-muc-cho-kiem-tra.html#"+$;var se=f($),he=oe.row?"/"+oe.row:oe.block?"/"+oe.block:"";return se&&se.loai==="man-hinh"?"03-soan-man-hinh.html#"+$+he:"02-khong-gian-phan-he.html#"+$+he}function Ye(q,oe){oe=oe||{};var $=oe.module||g(),se=oe.limit||40,he=String(q||"").trim();if(!he)return[];var _e=[];if(he.charAt(0)===">"){var Le=T0(he.slice(1)).trim();return(e.commands||[]).forEach(function(ge,Qe){var jt=T0(ge.title),cn=!Le||jt.indexOf(Le)>=0||(ge.khoa||[]).some(function(it){return it.indexOf(Le)===0||Le.indexOf(it)===0});cn&&_e.push({group:"L\u1EC7nh",title:ge.title,sub:ge.sub||"",code:null,href:ge.href,run:ge.id,score:900-Qe})}),_e.slice(0,se)}var Ne=T0(he).replace(/\s+/g," "),Pe=Ne.replace(/\s+/g,""),wt=Ne.split(" ").filter(Boolean);function Me(ge){return wt.length>1&&wt.every(function(Qe){return ge.indexOf(Qe)>=0})}Ze(he).forEach(function(ge){var Qe=f(ge.code);_e.push({group:"S\u1ED1 \u1EDF b\u1EA3n \u0111\xE3 giao",title:Qe?Qe.tieuDe:ge.code,sub:ge.sub,code:ge.key,href:we(ge.key),score:1e3})});var ft=/^([a-z]{2,3})[\s-]*(\d{1,4})$/.exec(Ne),Ve=(e.items||[]).concat(e.tbd||[]);Ve.forEach(function(ge){var Qe=T0(ge.ma),jt=T0(ge.tieuDe),cn=(ge.phanHe===$?50:0)+(ge.loai==="man-hinh"?10:0)-(ge.daXoa?300:0),it=0;if(Qe===Ne?it=950:Ne.length>=3&&Qe.indexOf(Ne)===0?it=800:/^\d+$/.test(Ne)&&Qe.slice(-(Math.max(3,Ne.length)+1))==="-"+(Ne.length<3?("00"+Ne).slice(-3):Ne)?it=700:ft&&Qe.indexOf(ft[1]+"-")===0&&parseInt(Qe.split("-").pop(),10)===parseInt(ft[2],10)?it=780:Ne.length>=3&&Qe.indexOf(Ne)>=0&&(it=600),jt===Ne?it=Math.max(it,850):Ne.length>=3&&jt.indexOf(Ne)>=0?it=Math.max(it,500):Me(jt)&&(it=Math.max(it,300)),it){var Ct=ge.loai==="cho"?null:pe(ge.ma),Qt=ge.loai==="cho"?"M\u1EE5c ch\u1EDD \xB7 "+p(ge.phuTrach)+" \xB7 h\u1EA1n "+Ul(ge.han):ge.daXoa?"\u0110\xE3 xo\xE1"+(ge.daXoa.gopVao?" \u2014 g\u1ED9p v\xE0o "+ge.daXoa.gopVao:""):(e.labels&&e.labels.loai[ge.hienThi==="popup"?"popup":ge.loai]||ge.loai)+(Ct?" \xB7 "+Ct:"")+" \xB7 "+(e.labels&&e.labels.trangThai[ge.trangThai]||ge.trangThai);_e.push({group:ge.loai==="cho"?"M\u1EE5c ch\u1EDD":"M\u1EE5c",title:ge.tieuDe,sub:Qt,code:ge.ma,href:we(ge.ma),score:it+cn})}var lt=(ge.biDanh||[]).concat(ge.nguonNhap&&ge.nguonNhap.maCu?[ge.nguonNhap.maCu]:[]);lt.forEach(function(mt){var We=s(mt);Pe.length>=3&&We.indexOf(Pe)>=0&&_e.push({group:"M\xE3 c\u0169",title:ge.tieuDe,sub:"M\xE3 c\u0169: "+mt,code:ge.ma,href:we(ge.ma),score:700+cn})}),Ip.forEach(function(mt){mt[0]!=="danhMuc"&&C(ge,mt[0],"current").forEach(function(We){var gt=We.ten||We.chuThich||We.noiDung;if(gt){var ve=T0(gt),ke=0;T0(ge.ma+"#"+We.ma)===Ne?ke=900:ve===Ne?ke=840:Ne.length>=3&&ve.indexOf(Ne)>=0?ke=450:Me(ve)&&(ke=250),ke&&_e.push({group:"Tr\u01B0\u1EDDng & n\xFAt",title:We.ma+" "+gt,sub:ge.ma+" \xB7 "+ge.tieuDe,code:ge.ma+"#"+We.ma,href:we(ge.ma+"#"+We.ma),score:ke+cn})}})})});var Et={};return _e.forEach(function(ge,Qe){ge._i=Qe;var jt=ge.group+"|"+ge.code;(!Et[jt]||Et[jt].score<ge.score)&&(Et[jt]=ge)}),Object.keys(Et).map(function(ge){return Et[ge]}).sort(function(ge,Qe){return Qe.score-ge.score||ge._i-Qe._i}).slice(0,se).map(function(ge){return delete ge._i,ge})}var dt=["E01","E02","E03","E04","E05","E06","E07","E08","W01","W02","W03","W04","W05","W06","W07","W08","W09","W10"];function Kt(q,oe,$){oe=oe==="phat-hanh"?"phat-hanh":"nhap";var se=c({docId:q,variant:$||"current"}),he=v(se.docId)||{},_e=P(se),Le=[],Ne={},Pe=oe==="phat-hanh";function wt(ge){var Qe=ge.charAt(0)==="E"?"error":"warn",jt=!1;ge.charAt(0)==="E"&&(jt=!0),ge==="W01"&&(jt=he.tbdKhiPhatHanh==="chan"),ge==="W03"&&(jt=!0),ge==="W08"&&(jt=he.duKienKhiPhatHanh==="chan"),(ge==="W05"||ge==="W09")&&!Pe&&(Qe="info");var cn=["E03","E04","E07","E08"].indexOf(ge)>=0;return{muc:Qe,chanPhatHanh:jt,chan:Pe?jt:cn}}function Me(ge,Qe){return C0(e.lang,ge,Qe)}function ft(ge,Qe,jt,cn,it){var Ct=ge+"|"+Qe+"|"+jt;Ne[Ct]||(Ne[Ct]=!0,Le.push(Object.assign({ma:ge,noi:Qe,dich:jt,cau:cn,href:we(Qe),suaNhanh:null},wt(ge),it||{})))}var Ve=[];_e.forEach(function(ge,Qe){var jt=d(Qe,se);jt&&jt.loai!=="cho"&&Qe.indexOf("/")<0&&Ve.push(Qe)});var Et={};return Ve.forEach(function(ge){var Qe=d(ge,se);if(U(Qe,se.variant).forEach(function(lt){var mt=W(lt.ref,se),We=Qd(lt.ref);if(mt.reason==="chua-dang-ky")ft("W03",lt.tu,"?"+We.ten,Me("W03",{ten:We.ten}));else if(mt.state==="broken"&&mt.reason==="khong-ton-tai")ft("E01",lt.tu,We.code,Me("E01",{code:We.code}),{suaNhanh:{kieu:"doi-ma",tu:We.code,sang:null}});else if(mt.state==="broken"&&(mt.reason==="da-xoa"||mt.reason==="vong-lap"))ft("E02",lt.tu,We.code,Me("E02_DELETED",{code:We.code,date:Ul(mt.target&&mt.target.daXoa&&mt.target.daXoa.luc).slice(0,5)}));else if(mt.state==="broken"&&mt.reason==="muc-cho-huy")ft("E02",lt.tu,We.code,Me("E02_CANCELLED",{code:We.code}));else if(mt.state==="broken")ft("E06",lt.tu,lt.ref,Me("E06",{part:We.row||We.block,code:We.code}));else if(mt.state==="pending"){var gt=mt.target;Et[gt.ma]=!0,ft("W01",lt.tu,gt.ma,Me("W01",{code:gt.ma,name:gt.tenDuKien,owner:p(gt.phuTrach),due:Ul(gt.han)})+(wt("W01").chanPhatHanh?Me("W01_BLOCK"):""))}mt.via&&(mt.via.kieu==="gop"||mt.via.kieu==="bi-danh")&&ft("W05",lt.tu,We.code,Me(mt.via.kieu==="gop"?"W05_MERGED":"W05_ALIAS",{code:We.code,to:mt.code}),{suaNhanh:{kieu:"doi-ma",tu:We.code,sang:mt.code}})}),Ip.forEach(function(lt){if(D(Qe,lt[1])){var mt=Qe.khoi[lt[0]].keThua.tu;ft("W04",ge+"/"+lt[1],mt+"/"+lt[1],Me("W04",{block:T(lt[1],!1,e.lang),code:ge,src:mt}),{suaNhanh:{kieu:"da-ra"}})}}),Qe.thietKe){var jt=(e.designs||[]).filter(function(lt){return lt.man===Qe.thietKe.man})[0];jt&&jt.bam!==Qe.thietKe.daRaSoat&&ft("W06",ge,jt.man,Me("W06",{code:ge,screen:jt.man,who:p(jt.suaBoi),at:TR(jt.suaLuc)}),{suaNhanh:{kieu:"cap-nhat-anh"}})}var cn=[];Ip.forEach(function(lt){C(Qe,lt[0],se.variant).forEach(function(mt){mt.moTa&&cn.push({tu:ge+"#"+mt.ma,text:mt.moTa}),mt.noiDung&&cn.push({tu:ge+"#"+mt.ma,text:mt.noiDung})})}),typeof(Qe.khoi||{}).mucDich=="string"&&cn.push({tu:ge+"/muc-dich",text:Qe.khoi.mucDich}),cn.forEach(function(lt){Ig(lt.text).forEach(function(mt){if(!(mt.ref||mt.unregistered))for(var We=/(^|[\s(«"])(mục\s+((?:[IVX]+\.)?\d+(?:\.\d+)+))\.?/g,gt;gt=We.exec(mt.text);){var ve=gt[3],ke=null;_e.forEach(function(Ge,Ee){!ke&&Ee.indexOf("/")<0&&d(Ee,se)&&(Ge.heading===ve+"."||Ge.ref===ve)&&(ke={code:Ee,ref:Ge.ref})}),ft("W07",lt.tu,ke?ke.code:ve,ke?Me("W07_HIT",{text:gt[2],code:ke.code,ref:ke.ref}):Me("W07_MISS",{text:gt[2]}),{suaNhanh:ke?{kieu:"doi-chu",tu:gt[2],sang:"[["+ke.code+"]]"}:null})}})}),Qe.trangThai==="du-kien"&&ft("W08",ge,ge,Me("W08",{code:ge,title:Qe.tieuDe,due:Qe.han?Me("W08_DUE",{due:Ul(Qe.han)}):""}));var it=[];if(Ip.forEach(function(lt){C(Qe,lt[0],se.variant).forEach(function(mt){for(var We=(mt.moTa||"")+" "+(mt.noiDung||""),gt=(We.match(see)||[]).length,ve=0;ve<gt;ve++)it.push(mt.ma)})}),typeof(Qe.khoi||{}).mucDich=="string")for(var Ct=(Qe.khoi.mucDich.match(see)||[]).length,Qt=0;Qt<Ct;Qt++)it.push(Rh(e.lang).purpose);it.length&&ft("W09",ge,ge,Me("W09",{code:ge,n:it.length,list:it.join(", ")}),{viTri:it})}),(e.tbd||[]).forEach(function(ge){if(ge.trangThai==="mo"){var Qe=String(ge.noiTao||"").split(/[#/]/)[0];if(!(!Et[ge.ma]&&!_e.has(Qe))){var jt=ge.han?YS(ge.han)-YS(e.today||iee):null;!ge.phuTrach||!ge.han?ft("W02",ge.ma,ge.ma,Me(ge.phuTrach?"W02_NO_DUE":"W02_NO_OWNER",{code:ge.ma})):jt<0&&ft("W02",ge.ma,ge.ma,Me("W02_OVERDUE",{code:ge.ma,name:ge.tenDuKien,days:-jt,due:Ul(ge.han),owner:p(ge.phuTrach)}))}}}),Le.forEach(function(ge){ge.tongCung=Le.filter(function(Qe){return Qe.ma===ge.ma}).length}),Le.sort(function(ge,Qe){return dt.indexOf(ge.ma)-dt.indexOf(Qe.ma)}),Le}function ln(q,oe,$){$=$||"current";var se=Kt(q,oe,$),he=e.lint;if(!he||he.taiLieu!==q||(he.variant||"current")!==$)return se;var _e=[];return(he.dong||[]).forEach(function(Le){var Ne=se.filter(function(Pe){return Pe.ma===Le.ma&&Pe.noi===Le.noi&&(!Le.dich||Pe.dich===Le.dich)})[0];Ne&&_e.push(Object.assign({},Ne,Le.suaNhanh?{suaNhanh:Le.suaNhanh}:{}))}),_e}function Nn(q,oe){var $=typeof oe=="object"&&oe?oe:x(q,oe||"current"),se=b(q)||{ten:q,chuTri:""},he=["ma: "+q,"ten: "+se.ten,"chu_tri: "+se.chuTri,"outline:"];function _e(Ne){var Pe=f(Ne);return Pe?Pe.loai==="danh-muc"?"Danh m\u1EE5c "+Pe.tieuDe.charAt(0).toLowerCase()+Pe.tieuDe.slice(1):Pe.tieuDe:"(kh\xF4ng c\xF3 t\u1EC7p)"}function Le(Ne,Pe){Ne.forEach(function(wt){var Me=AR(wt),ft=new Array(Pe+1).join(" ")+"- "+Op(wt)+(Me.length?":":""),Ve=Math.max(25,ft.length+3);he.push(ft+new Array(Ve-ft.length+1).join(" ")+"# "+_e(Op(wt))),Me.length&&Le(Me,Pe+4)})}return["quy_trinh","chuc_nang","danh_muc","muc"].forEach(function(Ne){var Pe=$[Ne];!Pe||!Pe.length||(he.push(" "+Ne+":"),Le(Pe,4))}),he.join(`
@@ -8335,7 +8335,7 @@ pan-test: \u0111\u1EB7t guideVideo.handoverDir \u0111\u1EC3 video quay xong t\u1
8335
8335
  Token: PAN_STUDIO_TOKEN (MCP token, scope WRITE) or \`pan ui login\`. API: PAN_STUDIO_API_URL.
8336
8336
  Default folder: the nearest handover.yaml (or handover/handover.yaml) walking up from the current directory.
8337
8337
  pan-test: set guideVideo.handoverDir so recorded videos land here.`,noRoot:"No handover.yaml found \u2014 run `pan handover init` or pass --dir.",created:e=>`\u2713 Created ${e}`,exists:e=>`\u2022 ${e} already exists \u2014 left as is.`,next:'Next: `pan handover add <file> --section "\u2026"`, or set guideVideo.handoverDir in pan-test.',added:(e,t)=>`\u2713 Added lesson "${e}" \u2192 ${t}`,ok:e=>`\u2713 handover.yaml is valid (${e} warning(s))`,bad:(e,t)=>`\u2717 ${e} error(s), ${t} warning(s)`,serving:e=>`Handover guide at ${e} (Ctrl+C to stop)`,needSection:'Pass --section "Section title".',badType:`--type must be ${N2.join(" | ")}`,noToken:e=>`No token for ${e} \u2014 run \`pan ui login\` or set PAN_STUDIO_TOKEN (MCP token, scope WRITE).`,synced:(e,t,n,r)=>`\u2713 Synced \u2014 revision ${e} \xB7 uploaded ${t} file(s) (${n} KB) \xB7 ${r} unchanged`,pulled:(e,t,n)=>`\u2713 Pulled revision ${e} \u2014 ${t} new/changed file(s) \xB7 ${n} kept`,exported:(e,t)=>`\u2713 Exported ${e} (${t} KB)`},wdt=()=>yu()==="vi"?gdt:bdt});function dw(e,t){let n=Cs.default.resolve(e);if(!su.default.existsSync(n)||!su.default.statSync(n).isDirectory())throw new pt("PAN_PLAN_ROOT_NOT_FOUND",H("ERR_START_DIR_MISSING",{label:t}),{path:n},7);return su.default.realpathSync(n)}function GW(e){let t=Cs.default.resolve(e);for(;;){let n=Cs.default.join(t,".project.yaml");if(su.default.existsSync(n)&&su.default.statSync(n).isFile())return n;let r=Cs.default.dirname(t);if(r===t)return null;t=r}}function WA(e){try{let t=(0,mye.execFileSync)("git",["-C",Cs.default.resolve(e),"rev-parse","--show-toplevel"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return t?su.default.realpathSync(Cs.default.resolve(t)):null}catch{return null}}function gye({startDir:e=process.cwd(),explicitRoot:t=""}={}){let n=dw(e,H("LABEL_START_DIR"));if(t){let i=dw(t,H("LABEL_WORKSPACE_ROOT"));return{root:i,manifestPath:su.default.existsSync(Cs.default.join(i,".project.yaml"))?Cs.default.join(i,".project.yaml"):null,gitRoot:WA(i)}}let r=GW(n);if(r){let i=Cs.default.dirname(r);return{root:i,manifestPath:r,gitRoot:WA(i)}}let o=WA(n);if(o)return{root:o,manifestPath:null,gitRoot:o};throw new pt("PAN_PLAN_ROOT_NOT_FOUND",H("ERR_ROOT_NOT_FOUND",{startDir:n}),{startDir:n},7)}function bye({cwd:e=process.cwd(),workspaceRoot:t,explicit:n=""}){let r=dw(t,H("LABEL_WORKSPACE_ROOT")),o=rw(r);if(n){let l=o.find(u=>u.name===n);if(l)return l;let c=Cs.default.resolve(n);if(su.default.existsSync(c)&&su.default.statSync(c).isDirectory()){let u=o.find(d=>d.storeRoot===su.default.realpathSync(c));if(u)return u}throw new pt("PAN_STORE_NOT_FOUND",H("ERR_STORE_NOT_FOUND",{store:n,stores:o.map(u=>u.name).join(", ")}),{store:n,stores:o.map(u=>u.name)},3)}let i=dw(e,H("LABEL_START_DIR")),a=null;for(let l of o)l.dirExists&&MW(l.storeRoot,i)&&(!a||l.storeRoot.length>a.storeRoot.length)&&(a=l);let s=o[0];if(a)return a;if(!s)throw new pt("PAN_STORE_NOT_FOUND",H("ERR_STORE_NOT_FOUND",{store:"",stores:""}),{store:"",stores:[]},3);return s}function wye({cwd:e=process.cwd(),workspaceRoot:t}){let n=dw(t,H("LABEL_WORKSPACE_ROOT")),r=dw(e,H("LABEL_START_DIR")),o=WA(r);if(!o||o===n||!MW(n,o)||rw(n).some(a=>a.storeRoot===o))return;let i=Cs.default.relative(n,o);throw new pt("PAN_REPO_NOT_DECLARED",H("ERR_REPO_NOT_DECLARED",{path:i,name:Cs.default.basename(o)}),{repoPath:i,repoName:Cs.default.basename(o),workspaceRoot:n},7)}var mye,su,Cs,KA=ne(()=>{"use strict";mye=require("node:child_process"),su=Q(require("node:fs")),Cs=Q(require("node:path"));ba();wa();_d()});function _m(e,t){try{return(0,xye.execFileSync)("git",["-C",e,"config",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function xdt(e){return Ho(e).split("-").filter(Boolean).map(t=>t[0]).join("").toUpperCase()||"USER"}function W1({root:e,actorKind:t="human",actorCode:n=""}={}){if(!e)throw et(H("ERR_MISSING_ROOT"));let r=_m(e,"user.name"),o=_m(e,"user.email");if(!r||!o)throw et(H("ERR_MISSING_GIT_CONFIG"),{gitName:r,gitEmail:o});let i=t==="ai"?"ai":"human",a=(n||(i==="ai"?"AI":xdt(r))).toUpperCase();if(!/^[A-Z0-9]+$/.test(a))throw et(H("ERR_ACTOR_CODE_INVALID"),{actorCode:a});return{actorId:(0,HW.randomUUID)(),actorKind:i,actorCode:a,laneId:(0,HW.randomUUID)(),laneToken:MA(),gitName:r,gitEmail:o,gitUserSlug:Ho(r)}}function _dt(e){let t=/^author\s*:[ \t]*\n((?:[ \t]+.*(?:\n|$))*)/m.exec(e.replace(/\r\n?/g,`
8338
- `));if(!t)return null;let n=i=>{let a=new RegExp(`^[ \\t]+${i}\\s*:\\s*(.*)$`,"m").exec(t[1]??"")?.[1]?.trim()??"";if(a.startsWith('"'))try{return String(JSON.parse(a))}catch{return a}return a.replace(/^'(.*)'$/,"$1")},r=n("user"),o=n("email");return r&&o?{name:r,email:o}:null}function Edt(e){let t=qA.default.resolve(e);for(;;){let n=qA.default.join(t,".me.pan.yaml");if(WW.default.existsSync(n))return _dt(WW.default.readFileSync(n,"utf8"));let r=qA.default.dirname(t);if(r===t)return null;t=r}}function Sdt(e){let t=yye.get(e);t||(t=Edt(e)??{name:_m(e,"user.name"),email:_m(e,"user.email")},yye.set(e,t)),zW??={id:(0,Eye.machineId)(),host:_ye.default.hostname()};let n=process.env.PAN_RUN_MODE;return{principalName:t.name,principalEmail:t.email,machineId:zW.id,machineHost:zW.host,runMode:n==="autonomous"?"autonomous":"interactive"}}function hl(e,t,n={}){return{actorKind:e.actorKind,actorCode:e.actorCode,gitName:e.gitName,gitEmail:e.gitEmail,laneToken:e.laneToken,...Sdt(t),...n}}var xye,HW,WW,_ye,qA,Eye,KW,yye,zW,fw=ne(()=>{"use strict";xye=require("node:child_process"),HW=require("node:crypto"),WW=Q(require("node:fs")),_ye=Q(require("node:os")),qA=Q(require("node:path"));ba();wa();pl();Eye=Q(dE());KW=["interactive","autonomous"];yye=new Map,zW=null});function Is(e){return!e||!e.system||!e.id}function Sye(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.system=="string"&&typeof t.id=="string"}function pw(e,t){if(e===void 0||e===!0||e==="")return null;let n=String(e).trim();if(!n)return null;let r=n.match(/^([a-z][a-z0-9_-]*):(.+)$/i);if(!r)throw et(H("ERR_INVALID_EXTERNAL_REF",{ref:n}));let o=(r[1]??"").toLowerCase(),i=(r[2]??"").trim();if(!i)throw et(H("ERR_INVALID_EXTERNAL_REF",{ref:n}));let a={system:o,id:i};return t!==void 0&&t!==!0&&t!==""&&(a.url=String(t).trim()),a}function K1(e){return Sye(e)?`${e.system}:${e.id}`:""}function hw(e){return Sye(e)?`${e.system}:${e.id}`:""}function q1(e,t){return Is(t)?e&&!Is(e)?e:{}:{system:t?.system,id:t?.id,url:t?.url||e?.url||""}}function V1(e,t){let n=(e||[]).filter(r=>!String(r).startsWith("ref:"));return Is(t)||n.push(`ref:${t?.system}:${t?.id}`),n}var VA=ne(()=>{"use strict";ba();wa()});function XW(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function Iye(e){Sm=e}function e0(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(za.caret,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function Sd(e,t){if(t){if(za.escapeTest.test(e))return e.replace(za.escapeReplace,Tye)}else if(za.escapeTestNoEncode.test(e))return e.replace(za.escapeReplaceNoEncode,Tye);return e}function Aye(e){try{e=encodeURI(e).replace(za.percentDecode,"%")}catch{return null}return e}function Nye(e,t){let n=e.replace(za.findPipe,(i,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(za.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(za.slashPipe,"|");return r}function QE(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r;){let i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function oft(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Cye(e,t,n,r,o){let i=t.href,a=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function ift(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
8338
+ `));if(!t)return null;let n=i=>{let a=new RegExp(`^[ \\t]+${i}\\s*:\\s*(.*)$`,"m").exec(t[1]??"")?.[1]?.trim()??"";if(a.startsWith('"'))try{return String(JSON.parse(a))}catch{return a}return a.replace(/^'(.*)'$/,"$1")},r=n("user"),o=n("email");return r&&o?{name:r,email:o}:null}function Edt(e){let t=qA.default.resolve(e);for(;;){let n=qA.default.join(t,".me.pan.yaml");if(WW.default.existsSync(n))return _dt(WW.default.readFileSync(n,"utf8"));let r=qA.default.dirname(t);if(r===t)return null;t=r}}function Sdt(e){let t=yye.get(e);t||(t=Edt(e)??{name:_m(e,"user.name"),email:_m(e,"user.email")},yye.set(e,t)),zW??={id:process.env.PAN_MACHINE_ID?.trim()||(0,Eye.machineId)(),host:process.env.PAN_MACHINE_HOST?.trim()||_ye.default.hostname()};let n=process.env.PAN_RUN_MODE;return{principalName:t.name,principalEmail:t.email,machineId:zW.id,machineHost:zW.host,runMode:n==="autonomous"?"autonomous":"interactive"}}function hl(e,t,n={}){return{actorKind:e.actorKind,actorCode:e.actorCode,gitName:e.gitName,gitEmail:e.gitEmail,laneToken:e.laneToken,...Sdt(t),...n}}var xye,HW,WW,_ye,qA,Eye,KW,yye,zW,fw=ne(()=>{"use strict";xye=require("node:child_process"),HW=require("node:crypto"),WW=Q(require("node:fs")),_ye=Q(require("node:os")),qA=Q(require("node:path"));ba();wa();pl();Eye=Q(dE());KW=["interactive","autonomous"];yye=new Map,zW=null});function Is(e){return!e||!e.system||!e.id}function Sye(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.system=="string"&&typeof t.id=="string"}function pw(e,t){if(e===void 0||e===!0||e==="")return null;let n=String(e).trim();if(!n)return null;let r=n.match(/^([a-z][a-z0-9_-]*):(.+)$/i);if(!r)throw et(H("ERR_INVALID_EXTERNAL_REF",{ref:n}));let o=(r[1]??"").toLowerCase(),i=(r[2]??"").trim();if(!i)throw et(H("ERR_INVALID_EXTERNAL_REF",{ref:n}));let a={system:o,id:i};return t!==void 0&&t!==!0&&t!==""&&(a.url=String(t).trim()),a}function K1(e){return Sye(e)?`${e.system}:${e.id}`:""}function hw(e){return Sye(e)?`${e.system}:${e.id}`:""}function q1(e,t){return Is(t)?e&&!Is(e)?e:{}:{system:t?.system,id:t?.id,url:t?.url||e?.url||""}}function V1(e,t){let n=(e||[]).filter(r=>!String(r).startsWith("ref:"));return Is(t)||n.push(`ref:${t?.system}:${t?.id}`),n}var VA=ne(()=>{"use strict";ba();wa()});function XW(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function Iye(e){Sm=e}function e0(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(za.caret,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}function Sd(e,t){if(t){if(za.escapeTest.test(e))return e.replace(za.escapeReplace,Tye)}else if(za.escapeTestNoEncode.test(e))return e.replace(za.escapeReplaceNoEncode,Tye);return e}function Aye(e){try{e=encodeURI(e).replace(za.percentDecode,"%")}catch{return null}return e}function Nye(e,t){let n=e.replace(za.findPipe,(i,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(za.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(za.slashPipe,"|");return r}function QE(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r;){let i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function oft(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Cye(e,t,n,r,o){let i=t.href,a=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function ift(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
8339
8339
  `).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[s]=a;return s.length>=o.length?i.slice(o.length):i}).join(`
8340
8340
  `)}function zr(e,t){return Em.parse(e,t)}var Sm,$E,za,kdt,Tdt,Adt,JE,Ndt,QW,Oye,Rye,Cdt,$W,Idt,JW,Odt,Rdt,ZA,ZW,Ldt,Lye,Ddt,eK,kye,Pdt,Mdt,Bdt,jdt,Dye,Fdt,e9,tK,Pye,Udt,Mye,Gdt,zdt,Hdt,Bye,Wdt,Kdt,jye,qdt,Vdt,Ydt,Xdt,Qdt,$dt,Jdt,QA,Zdt,Fye,Uye,eft,nK,tft,qW,nft,YA,XE,rft,Tye,$A,$f,JA,rK,Jf,XA,aft,Em,POt,MOt,BOt,jOt,FOt,UOt,GOt,Gye=ne(()=>{Sm=XW();$E={exec:()=>null};za={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,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},kdt=/^(?:[ \t]*(?:\n|$))+/,Tdt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Adt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,JE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ndt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,QW=/(?:[*+-]|\d{1,9}[.)])/,Oye=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rye=e0(Oye).replace(/bull/g,QW).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(),Cdt=e0(Oye).replace(/bull/g,QW).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(),$W=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Idt=/^[^\n]+/,JW=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Odt=e0(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",JW).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rdt=e0(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,QW).getRegex(),ZA="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",ZW=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ldt=e0("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ZW).replace("tag",ZA).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lye=e0($W).replace("hr",JE).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ZA).getRegex(),Ddt=e0(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Lye).getRegex(),eK={blockquote:Ddt,code:Tdt,def:Odt,fences:Adt,heading:Ndt,hr:JE,html:Ldt,lheading:Rye,list:Rdt,newline:kdt,paragraph:Lye,table:$E,text:Idt},kye=e0("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",JE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ZA).getRegex(),Pdt={...eK,lheading:Cdt,table:kye,paragraph:e0($W).replace("hr",JE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",kye).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ZA).getRegex()},Mdt={...eK,html:e0(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ZW).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:$E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:e0($W).replace("hr",JE).replace("heading",` *#{1,6} *[^
8341
8341
  ]`).replace("lheading",Rye).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Bdt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jdt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Dye=/^( {2,}|\\)\n(?!\s*$)/,Fdt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,e9=/[\p{P}\p{S}]/u,tK=/[\s\p{P}\p{S}]/u,Pye=/[^\s\p{P}\p{S}]/u,Udt=e0(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,tK).getRegex(),Mye=/(?!~)[\p{P}\p{S}]/u,Gdt=/(?!~)[\s\p{P}\p{S}]/u,zdt=/(?:[^\s\p{P}\p{S}]|~)/u,Hdt=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Bye=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Wdt=e0(Bye,"u").replace(/punct/g,e9).getRegex(),Kdt=e0(Bye,"u").replace(/punct/g,Mye).getRegex(),jye="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qdt=e0(jye,"gu").replace(/notPunctSpace/g,Pye).replace(/punctSpace/g,tK).replace(/punct/g,e9).getRegex(),Vdt=e0(jye,"gu").replace(/notPunctSpace/g,zdt).replace(/punctSpace/g,Gdt).replace(/punct/g,Mye).getRegex(),Ydt=e0("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Pye).replace(/punctSpace/g,tK).replace(/punct/g,e9).getRegex(),Xdt=e0(/\\(punct)/,"gu").replace(/punct/g,e9).getRegex(),Qdt=e0(/^<(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(),$dt=e0(ZW).replace("(?:-->|$)","-->").getRegex(),Jdt=e0("^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",$dt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),QA=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Zdt=e0(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",QA).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fye=e0(/^!?\[(label)\]\[(ref)\]/).replace("label",QA).replace("ref",JW).getRegex(),Uye=e0(/^!?\[(ref)\](?:\[\])?/).replace("ref",JW).getRegex(),eft=e0("reflink|nolink(?!\\()","g").replace("reflink",Fye).replace("nolink",Uye).getRegex(),nK={_backpedal:$E,anyPunctuation:Xdt,autolink:Qdt,blockSkip:Hdt,br:Dye,code:jdt,del:$E,emStrongLDelim:Wdt,emStrongRDelimAst:qdt,emStrongRDelimUnd:Ydt,escape:Bdt,link:Zdt,nolink:Uye,punctuation:Udt,reflink:Fye,reflinkSearch:eft,tag:Jdt,text:Fdt,url:$E},tft={...nK,link:e0(/^!?\[(label)\]\((.*?)\)/).replace("label",QA).getRegex(),reflink:e0(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",QA).getRegex()},qW={...nK,emStrongRDelimAst:Vdt,emStrongLDelim:Kdt,url:e0(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},nft={...qW,br:e0(Dye).replace("{2,}","*").getRegex(),text:e0(qW.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},YA={normal:eK,gfm:Pdt,pedantic:Mdt},XE={normal:nK,gfm:qW,breaks:nft,pedantic:tft},rft={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Tye=e=>rft[e];$A=class{options;rules;lexer;constructor(e){this.options=e||Sm}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:QE(n,`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pan",
3
3
  "displayName": "PAN",
4
- "version": "0.3.66",
4
+ "version": "0.3.67",
5
5
  "description": "Harness cho workspace PAN Stack: mọi commit của Claude mang danh tính AI + người chủ quản + máy; nguồn tài liệu (Pan Lineage) của tệp hiện ra trước khi sửa.",
6
6
  "author": {
7
7
  "name": "n46-labs"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pan",
3
- "version": "0.3.66",
3
+ "version": "0.3.67",
4
4
  "description": "PAN Stack harness for AI agents: every commit carries AI + owner + machine identity, document sources (Pan Lineage) show before edits, and PAN skills load on their own.",
5
5
  "author": {
6
6
  "name": "n46-labs"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pan",
3
3
  "displayName": "PAN",
4
- "version": "0.3.66",
4
+ "version": "0.3.67",
5
5
  "description": "PAN Stack harness for AI agents: every commit carries AI + owner + machine identity, document sources (Pan Lineage) show before edits, and PAN skills load on their own.",
6
6
  "author": {
7
7
  "name": "n46-labs"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pan-stack/cli",
3
- "version": "0.3.66",
3
+ "version": "0.3.67",
4
4
  "description": "PAN Stack CLI — multi-repo git and project commands from .project.yaml",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "bin": {