Compare commits

...
5 Commits
Author SHA1 Message Date
yunyingk 9060a28d8b Merge pull request #149 from yunyingk/codex/release-v0.10.31
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🚀 Release / 🚀 Build & Publish GitHub Release (push) Has been cancelled
🚀 Release / 📦 Sync Gitea Mirror (push) Has been cancelled
🚀 Release / 🍺 Update Homebrew Tap (push) Has been cancelled
Release v0.10.31: User-centric skill redesign and CLI experience refinement
2026-09-20 11:44:49 +08:00
gitea 9b5e668f09 Release v0.10.31: User-centric skill redesign and CLI experience refinement 2026-09-20 11:43:26 +08:00
yunyingk 255f6a3c28 Merge pull request #148 from yunyingk/feat/homebrew-tap
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
ci: add automated homebrew-tap formula updates on release
2026-09-20 11:42:40 +08:00
gitea b5e6cc0282 Refine skill and CLI for business-user centric experience 2026-09-20 11:41:36 +08:00
gitea 7bbddd7aba ci: add automated homebrew-tap update on release and docs in skill 2026-09-19 10:40:29 +08:00
14 changed files with 563 additions and 591 deletions

No files matched your search

+55
View File
@@ -301,3 +301,58 @@ jobs:
fi
done
echo "✓ Gitea publishing step completed!"
update-brew-tap:
name: 🍺 Update Homebrew Tap
needs: [build-and-publish-github, publish-gitea]
if: ${{ !cancelled() && needs.build-and-publish-github.result == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Homebrew Tap
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
repository: yunyingk/homebrew-tap
token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
path: tap
- name: Download checksums from GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG_NAME="${{ github.event.inputs.tag || github.ref_name }}"
gh release download "${TAG_NAME}" \
--repo "${GITHUB_REPOSITORY}" \
--pattern 'checksums.txt' \
--dir . \
--clobber
- name: Update Formula
run: |
RAW_TAG="${{ github.event.inputs.tag || github.ref_name }}"
VERSION="${RAW_TAG#v}"
ARM64_SHA=$(grep 'seal-use-darwin-arm64.tar.gz' checksums.txt | awk '{print $1}')
if [ -z "$ARM64_SHA" ]; then
echo "::error::Could not find sha256 for seal-use-darwin-arm64.tar.gz"
exit 1
fi
echo "Updating Formula to version ${VERSION} with sha256 ${ARM64_SHA}"
FORMULA_FILE="tap/Formula/seal-use.rb"
sed -i -E "s/version \"[^\"]+\"/version \"${VERSION}\"/" "$FORMULA_FILE"
sed -i -E "s/sha256 \"[^\"]+\"/sha256 \"${ARM64_SHA}\"/" "$FORMULA_FILE"
cd tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if git diff --quiet; then
echo "No changes to Formula, skipping commit."
else
git add Formula/seal-use.rb
git commit -m "chore(release): bump seal-use to ${VERSION}"
git push origin main
echo "✓ Homebrew Tap formula updated successfully!"
fi
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.30",
"version": "0.10.31",
"description": "Seal Use tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, and search.",
"author": {
"name": "yingqing"
+12
View File
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.10.31] - 2026-09-20
### Added
- **Top-Level Mandatory Business Vocabulary & Output Contract**: Elevated terminology and presentation rules to Chapter 0 of `SKILL.md` as mandatory red lines across all agent output channels (rules list, rule detail, diff review, doctor tenant, feedback remediation, and conversational dialogue).
- Enforced business terms: `scope` ➔ `适用场景` (strictly prohibited: 适用范围, 适用模版), `strictness` ➔ `遵守程度` (`MUST_FOLLOW` ➔ `必须遵守`, `SHOULD_FOLLOW` ➔ `建议遵守`, `SUGGESTION` ➔ `提示参考`), `code` ➔ `规则编号` (e.g. `#0038`), `status` ➔ `启用状态`.
- Machine UUID & Internal Fields Redaction: Strictly prohibited exposing raw persistence UUIDs (`01a00f...`, `cly...`) and internal technical names (`boundCorpRole`, `permissions: ["*"]`, `tenantSlug`) to users.
- **Mandatory Image Presentation Contract for First-Time Onboarding**: Hardcoded rule in `SKILL.md` and `first-time-user.md` requiring agents to proactively render step-by-step visual screenshots using Markdown image syntax during onboarding, forbidding text-only descriptions.
- **Clean Administrator Candidate Directory with Privacy Masking**: When multiple candidate administrators exist, the CLI formats a clean, numbered directory with standard Chinese mobile masking (`138****5678`), strips raw internal IDs and technical noise, provides friendly selection guidance (by name keyword, by last 4 digits of phone, or `--force`), and retains all candidates without omission.
- **Automated Enterprise Name Resolution on Onboarding**: `corps add-hose`, `add-link`, and `extract-keys --save` now automatically query the live Seal tenant during verification and persist the human-readable enterprise name, preventing enterprises from being registered with raw machine IDs (e.g. `ID01LG7ksGroB1`).
- **Doctor Tenant Diagnosis Humanization**: Added `boundCorpRoleDescription` and `permissionLevel` to provide clear, business-friendly status summaries without exposing raw internal arrays and enums.
- **Business-Focused Rule Summary Fields**: Refined `RULE_SUMMARY_FIELDS` to prioritize `["code", "status", "strictness", "scope", "updatedAt"]`, eliminating raw UUIDs from default summaries.
## [0.10.30] - 2026-09-18
### Added
+309 -382
View File
@@ -1,33 +1,33 @@
import{createRequire as Wy0}from"node:module";var Yy0=Object.create;var{getPrototypeOf:zy0,defineProperty:mT,getOwnPropertyNames:Uy0}=Object;var Iy0=Object.prototype.hasOwnProperty;function Qy0($){return this[$]}var Jy0,Ky0,Q6=($,Y,z)=>{var U=$!=null&&typeof $==="object";if(U){var I=Y?Jy0??=new WeakMap:Ky0??=new WeakMap,Q=I.get($);if(Q)return Q}z=$!=null?Yy0(zy0($)):{};let J=Y||!$||!$.__esModule?mT(z,"default",{value:$,enumerable:!0}):z;for(let K of Uy0($))if(!Iy0.call(J,K))mT(J,K,{get:Qy0.bind($,K),enumerable:!0});if(U)I.set($,J);return J};var E=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports);var Gy0=($)=>$;function Hy0($,Y){this[$]=Gy0.bind(null,Y)}var x8=($,Y)=>{for(var z in Y)mT($,z,{get:Y[z],enumerable:!0,configurable:!0,set:Hy0.bind(Y,z)})};var o=($,Y)=>()=>($&&(Y=$($=0)),Y);var J0=Wy0(import.meta.url);var Xy0,cq,Zy0,qy0,Vy0,Ly0,R0=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports),xo=($,Y)=>{let z={};for(var U in $)cq(z,U,{get:$[U],enumerable:!0});if(Y)cq(z,Symbol.toStringTag,{value:"Module"});return z},Fy0=($,Y,z,U)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var I=qy0(Y),Q=0,J=I.length,K;Q<J;Q++)if(K=I[Q],!Ly0.call($,K)&&K!==z)cq($,K,{get:((G)=>Y[G]).bind(null,K),enumerable:!(U=Zy0(Y,K))||U.enumerable})}return $},nq=($,Y,z)=>(z=$!=null?Xy0(Vy0($)):{},Fy0(Y||!$||!$.__esModule?cq(z,"default",{value:$,enumerable:!0}):z,$));var lT=o(()=>{Xy0=Object.create,cq=Object.defineProperty,Zy0=Object.getOwnPropertyDescriptor,qy0=Object.getOwnPropertyNames,Vy0=Object.getPrototypeOf,Ly0=Object.prototype.hasOwnProperty});function uo($){return typeof $==="string"&&fo.has($.replace(/#$/,""))}function bo($,Y){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let z=$.$schema.replace(/#$/,"");if(wy0.has(z))return"2020-12";if(fo.has(z))return"2019-09";if(My0.has(z)||Oy0.has(z))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${Y}`)}var wy0,fo,My0,Oy0;var oT=o(()=>{wy0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),fo=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),My0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Oy0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function H0($,Y,z){function U(K,G){if(!K._zod)Object.defineProperty(K,"_zod",{value:{def:G,constr:J,traits:new Set},enumerable:!1});if(K._zod.traits.has($))return;K._zod.traits.add($),Y(K,G);let H=J.prototype,W=Object.keys(H);for(let X=0;X<W.length;X++){let Z=W[X];if(!(Z in K))K[Z]=H[Z].bind(K)}}let I=z?.Parent??Object;class Q extends I{}Object.defineProperty(Q,"name",{value:$});function J(K){var G;let H=z?.Parent?new Q:this;U(H,K),(G=H._zod).deferred??(G.deferred=[]);for(let W of H._zod.deferred)W();return H}return Object.defineProperty(J,"init",{value:U}),Object.defineProperty(J,Symbol.hasInstance,{value:(K)=>{if(z?.Parent&&K instanceof z.Parent)return!0;return K?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}function a4($){if($)Object.assign(AY,$);return AY}var io,mK,rT,f5,PY,AY;var BY=o(()=>{mK=Object.freeze({status:"aborted"});rT=Symbol("zod_brand");f5=class f5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};PY=class PY extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(io=globalThis).__zod_globalConfig??(io.__zod_globalConfig={});AY=globalThis.__zod_globalConfig});var y0={};x8(y0,{unwrapMessage:()=>lK,uint8ArrayToHex:()=>py0,uint8ArrayToBase64url:()=>cy0,uint8ArrayToBase64:()=>po,stringifyPrimitive:()=>v0,slugify:()=>tT,shallowClone:()=>$j,safeExtend:()=>ky0,required:()=>uy0,randomString:()=>Ry0,propertyKeyTypes:()=>sK,promiseAllObject:()=>Cy0,primitiveTypes:()=>Yj,prefixIssues:()=>f8,pick:()=>Sy0,partial:()=>fy0,parsedType:()=>S0,optionalKeys:()=>zj,omit:()=>gy0,objectClone:()=>Ty0,numKeys:()=>_y0,nullish:()=>I7,normalizeParams:()=>x0,mergeDefs:()=>i9,merge:()=>xy0,jsonStringifyReplacer:()=>uU,joinValues:()=>N0,issue:()=>iU,isPlainObject:()=>J7,isObject:()=>TY,hexToUint8Array:()=>ny0,getSizableOrigin:()=>aK,getParsedType:()=>vy0,getLengthableOrigin:()=>tK,getEnumValues:()=>oK,getElementAtPath:()=>Ey0,floatSafeRemainder:()=>aT,finalizeIssue:()=>A8,extend:()=>yy0,explicitlyAborted:()=>Qj,escapeRegex:()=>N$,esc:()=>pq,defineLazy:()=>T1,createTransparentProxy:()=>hy0,cloneDef:()=>jy0,clone:()=>D8,cleanRegex:()=>rK,cleanEnum:()=>by0,captureStackTrace:()=>dq,cached:()=>bU,base64urlToUint8Array:()=>iy0,base64ToUint8Array:()=>no,assignProp:()=>Q7,assertNotEqual:()=>Dy0,assertNever:()=>Py0,assertIs:()=>Ay0,assertEqual:()=>Ny0,assert:()=>By0,allowsEval:()=>eT,aborted:()=>K7,NUMBER_FORMAT_RANGES:()=>Uj,Class:()=>moLine truncated
`)}var lo=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,uU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},eK,u8;var Gj=o(()=>{BY();$1();eK=H0("$ZodError",lo),u8=H0("$ZodError",lo,{Parent:Error})});var cU=($)=>(Y,z,U,I)=>{let Q=U?{...U,async:!1}:{async:!1},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)throw new f5;if(J.issues.length){let K=new(I?.Err??$)(J.issues.map((G)=>A8(G,Q,a4())));throw dq(K,I?.callee),K}return J.value},mq,nU=($)=>async(Y,z,U,I)=>{let Q=U?{...U,async:!0}:{async:!0},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)J=await J;if(J.issues.length){let K=new(I?.Err??$)(J.issues.map((G)=>A8(G,Q,a4())));throw dq(K,I?.callee),K}return J.value},lq,pU=($)=>(Y,z,U)=>{let I=U?{...U,async:!1}:{async:!1},Q=Y._zod.run({value:z,issues:[]},I);if(Q instanceof Promise)throw new f5;return Q.issues.length?{success:!1,error:new($??eK)(Q.issues.map((J)=>A8(J,I,a4())))}:{success:!0,data:Q.value}},Hj,dU=($)=>async(Y,z,U)=>{let I=U?{...U,async:!0}:{async:!0},Q=Y._zod.run({value:z,issues:[]},I);if(Q instanceof Promise)Q=await Q;return Q.issues.length?{success:!1,error:new $(Q.issues.map((J)=>A8(J,I,a4())))}:{success:!0,data:Q.value}},Wj,oq=($)=>(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return cU($)(Y,z,I)},my0,rq=($)=>(Y,z,U)=>{return cU($)(Y,z,U)},ly0,sq=($)=>async(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return nU($)(Y,z,I)},oy0,aq=($)=>async(Y,z,U)=>{return nU($)(Y,z,U)},ry0,tq=($)=>(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return pU($)(Y,z,I)},sy0,eq=($)=>(Y,z,U)=>{return pU($)(Y,z,U)},ay0,$V=($)=>async(Y,z,U)=>{let I=U?{...U,direction:"backward"}:{direction:"backward"};return dU($)(Y,z,I)},ty0,YV=($)=>async(Y,z,U)=>{return dU($)(Y,z,U)},ey0;var Xj=o(()=>{BY();Gj();$1();mq=cU(u8),lq=nU(u8),Hj=pU(u8),Wj=dU(u8),my0=oq(u8),ly0=rq(u8),oy0=sq(u8),ry0=aq(u8),sy0=tq(u8),ay0=eq(u8),ty0=$V(u8),ey0=YV(u8)});var Y$={};x8(Y$,{xid:()=>Lj,uuid7:()=>Uk0,uuid6:()=>zk0,uuid4:()=>Yk0,uuid:()=>jY,uppercase:()=>bj,unicodeEmail:()=>ro,undefined:()=>fj,ulid:()=>Vj,time:()=>vj,string:()=>Sj,sha512_hex:()=>Bk0,sha512_base64url:()=>jk0,sha512_base64:()=>Tk0,sha384_hex:()=>Dk0,sha384_base64url:()=>Pk0,sha384_base64:()=>Ak0,sha256_hex:()=>Mk0,sha256_base64url:()=>Nk0,sha256_base64:()=>Ok0,sha1_hex:()=>Lk0,sha1_base64url:()=>wk0,sha1_base64:()=>Fk0,rfc5322Email:()=>Qk0,number:()=>zG,null:()=>xj,nanoid:()=>wj,md5_hex:()=>Zk0,md5_base64url:()=>Vk0,md5_base64:()=>qk0,mac:()=>Bj,lowercase:()=>uj,ksuid:()=>Fj,ipv6:()=>Pj,ipv4:()=>Aj,integer:()=>yj,idnEmail:()=>Jk0,httpProtocol:()=>Cj,html5Email:()=>Ik0,hostname:()=>Hk0,hex:()=>Xk0,guid:()=>Oj,extendedDuration:()=>$k0,emoji:()=>Dj,email:()=>Nj,e164:()=>Rj,duration:()=>Mj,domain:()=>Wk0,datetime:()=>hj,date:()=>_j,cuid2:()=>qj,cuid:()=>Zj,cidrv6:()=>jj,cidrv4:()=>Tj,browserEmail:()=>Kk0,boolean:()=>kj,bigint:()=>gj,base64url:()=>zV,base64:()=>Ej});function Dj(){return new RegExp(Gk0,"u")}function ao($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function vj($){return new RegExp(`^${ao($)}$`)}function hj($){let Y=ao({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${Y}(?:${z.join("|")})`;return new RegExp(`^${so}T(?:${U})$`)}function UG($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function IG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Zj,qj,Vj,Lj,Fj,wj,Mj,$k0,Oj,jY=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Yk0,zk0,Uk0,Nj,Ik0,Qk0,ro,Jk0,Kk0,Gk0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Aj,Pj,Bj=($)=>{let Y=N$($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},Tj,jj,Ej,zV,Hk0,Wk0,Cj,Rj,so="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_j,Sj=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},gj,yj,zG,kj,xj,fj,uj,bj,Xk0,Zk0,qk0,Vk0,Lk0,Fk0,wk0,Mk0,Ok0,Nk0,Dk0,Ak0,Pk0,Bk0,Tk0,jk0;var UV=o(()=>{$1();Zj=/^[cC][0-9a-z]{6,}$/,qj=/^[0-9a-z]+$/,Vj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Lj=/^[0-9a-vA-V]{20}$/,Fj=/^[A-Za-z0-9]{27}$/,wj=/^[a-zA-Z0-9_-]{21}$/,Mj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
`).filter((Q)=>Q),U=Math.min(...z.map((Q)=>Q.length-Q.trimStart().length)),I=z.map((Q)=>Q.slice(U)).map((Q)=>" ".repeat(this.indent*2)+Q);for(let Q of I)this.content.push(Q)}compile(){let $=Function,Y=this?.args,U=[...(this?.content??[""]).map((I)=>` ${I}`)];return new $(...Y,U.join(`
`))}}var QE;var JE=o(()=>{QE={major:4,minor:4,patch:3}});function CE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Lr($){if(!zV.test($))return!1;let Y=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),z=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return CE(z)}function Fr($,Y=null){try{let z=$.split(".");if(z.length!==3)return!1;let[U]=z;if(!U)return!1;let I=JSON.parse(atob(U));if("typ"in I&&I?.typ!=="JWT")return!1;if(!I.alg)return!1;if(Y&&(!("alg"in I)||I.alg!==Y))return!1;return!0}catch{return!1}}function Yr($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function XV($,Y,z,U,I,Q){let J=z in U;if($.issues.length){if(I&&Q&&!J)return;Y.issues.push(...f8(z,$.issues))}if(!J&&!I){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(J)Y.value[z]=void 0}else Y.value[z]=$.value}function wr($){let Y=Object.keys($.shape);for(let U of Y)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let z=zj($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(z)}}function Mr($,Y,z,U,I,Q){let J=[],K=I.keySet,G=I.catchall._zod,H=G.def.type,W=G.optin==="optional",X=G.optout==="optional";for(let Z in Y){if(Z==="__proto__")continue;if(K.has(Z))continue;if(H==="never"){J.push(Z);continue}let q=G.run({value:Y[Z],issues:[]},U);if(q instanceof Promise)$.push(q.then((V)=>XV(V,z,Z,Y,W,X)));else XV(q,z,Z,Y,W,X)}if(J.length)z.issues.push({code:"unrecognized_keys",keys:J,input:Y,inst:Q});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function zr($,Y,z,U){for(let Q of $)if(Q.issues.length===0)return Y.value=Q.value,Y;let I=$.filter((Q)=>!K7(Q));if(I.length===1)return Y.value=I[0].value,I[0];return Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((Q)=>Q.issues.map((J)=>A8(J,U,a4())))}),Y}function Ur($,Y,z,U){let I=$.filter((Q)=>Q.issues.length===0);if(I.length===1)return Y.value=I[0].value,Y;if(I.length===0)Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((Q)=>Q.issues.map((J)=>A8(J,U,a4())))});else Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:[],inclusive:!1});return Y}function KE($,Y){if($===Y)return{valid:!0,data:$};if($ instanceof Date&&Y instanceof Date&&+$===+Y)return{valid:!0,data:$};if(J7($)&&J7(Y)){let z=Object.keys(Y),U=Object.keys($).filter((Q)=>z.indexOf(Q)!==-1),I={...$,...Y};for(let Q of U){let J=KE($[Q],Y[Q]);if(!J.valid)return{valid:!1,mergeErrorPath:[Q,...J.mergeErrorPath]};I[Q]=J.data}return{valid:!0,data:I}}if(Array.isArray($)&&Array.isArray(Y)){if($.length!==Y.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let U=0;U<$.length;U++){let I=$[U],Q=Y[U],J=KE(I,Q);if(!J.valid)return{valid:!1,mergeErrorPath:[U,...J.mergeErrorPath]};z.push(J.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function Ir($,Y,z){let U=new Map,I;for(let K of Y.issues)if(K.code==="unrecognized_keys"){I??(I=K);for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).l=!0}}else $.issues.push(K);for(let K of z.issues)if(K.code==="unrecognized_keys")for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).r=!0}else $.issues.push(K);let Q=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(Q.length&&I)$.issues.push({...I,keys:Q});if(K7($))return $;let J=KE(Y.value,z.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}function Qr($,Y){for(let z=$.length-1;z>=0;z--)if($[z]._zod[Y]!=="optional")return z+1;return 0}function Jr($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function Kr($,Y,z,U,I){for(let Q=0;Q<z.length;Q++){let J=$[Q],K=Q<U.length;if(J.issues.length){if(!K&&Q>=I){Y.value.length=Q;break}Y.issues.push(...f8(Q,J.issues))}Y.value[Q]=J.value}for(let Q=Y.value.length-1;Q>=U.length;Q--)if(z[Q]._zod.optout==="optional"&&Y.value[Q]===void 0)Y.value.length=Q;else break;return Y}function Gr($,Y,z,U,I,Q,J){if($.issues.length)if(sK.has(typeof U))z.issues.push(...f8(U,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:I,inst:Q,issues:$.issues.map((K)=>A8(K,J,a4()))});if(Y.issues.length)if(sK.has(typeof U))z.issues.push(...f8(U,Y.issues));else z.issues.push({origin:"map",code:"invalid_element",input:I,inst:Q,key:U,issues:Y.issues.map((K)=>A8(K,J,a4()))});z.value.set($.value,Y.value)}function Hr($,Y){if($.issues.length)Y.issues.push(...$.issues);Y.value.add($.value)}function Wr($,Y){if(Y===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Xr($,Y){if($.value===void 0)$.value=Y.defaultValue;return $}function Zr($,Y){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:Y});return $}function GV($,Y,z){if($.issues.length)return $.aborted=!0,$;return Y._zod.run({value:$.value,issues:$.issues,fa Line truncated
if (${N}.issues.length) {
import{createRequire as Wy0}from"node:module";var Uy0=Object.create;var{getPrototypeOf:Yy0,defineProperty:mT,getOwnPropertyNames:zy0}=Object;var Qy0=Object.prototype.hasOwnProperty;function Jy0($){return this[$]}var Iy0,Ky0,J6=($,U,Y)=>{var z=$!=null&&typeof $==="object";if(z){var Q=U?Iy0??=new WeakMap:Ky0??=new WeakMap,J=Q.get($);if(J)return J}Y=$!=null?Uy0(Yy0($)):{};let I=U||!$||!$.__esModule?mT(Y,"default",{value:$,enumerable:!0}):Y;for(let K of zy0($))if(!Qy0.call(I,K))mT(I,K,{get:Jy0.bind($,K),enumerable:!0});if(z)Q.set($,I);return I};var E=($,U)=>()=>(U||$((U={exports:{}}).exports,U),U.exports);var Gy0=($)=>$;function Hy0($,U){this[$]=Gy0.bind(null,U)}var x8=($,U)=>{for(var Y in U)mT($,Y,{get:U[Y],enumerable:!0,configurable:!0,set:Hy0.bind(U,Y)})};var o=($,U)=>()=>($&&(U=$($=0)),U);var I0=Wy0(import.meta.url);var Xy0,cq,Zy0,qy0,Vy0,Ly0,R0=($,U)=>()=>(U||$((U={exports:{}}).exports,U),U.exports),xo=($,U)=>{let Y={};for(var z in $)cq(Y,z,{get:$[z],enumerable:!0});if(U)cq(Y,Symbol.toStringTag,{value:"Module"});return Y},Fy0=($,U,Y,z)=>{if(U&&typeof U==="object"||typeof U==="function"){for(var Q=qy0(U),J=0,I=Q.length,K;J<I;J++)if(K=Q[J],!Ly0.call($,K)&&K!==Y)cq($,K,{get:((G)=>U[G]).bind(null,K),enumerable:!(z=Zy0(U,K))||z.enumerable})}return $},nq=($,U,Y)=>(Y=$!=null?Xy0(Vy0($)):{},Fy0(U||!$||!$.__esModule?cq(Y,"default",{value:$,enumerable:!0}):Y,$));var lT=o(()=>{Xy0=Object.create,cq=Object.defineProperty,Zy0=Object.getOwnPropertyDescriptor,qy0=Object.getOwnPropertyNames,Vy0=Object.getPrototypeOf,Ly0=Object.prototype.hasOwnProperty});function uo($){return typeof $==="string"&&fo.has($.replace(/#$/,""))}function bo($,U){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let Y=$.$schema.replace(/#$/,"");if(wy0.has(Y))return"2020-12";if(fo.has(Y))return"2019-09";if(Oy0.has(Y)||My0.has(Y))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${U}`)}var wy0,fo,Oy0,My0;var oT=o(()=>{wy0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),fo=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Oy0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),My0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function H0($,U,Y){function z(K,G){if(!K._zod)Object.defineProperty(K,"_zod",{value:{def:G,constr:I,traits:new Set},enumerable:!1});if(K._zod.traits.has($))return;K._zod.traits.add($),U(K,G);let H=I.prototype,W=Object.keys(H);for(let X=0;X<W.length;X++){let Z=W[X];if(!(Z in K))K[Z]=H[Z].bind(K)}}let Q=Y?.Parent??Object;class J extends Q{}Object.defineProperty(J,"name",{value:$});function I(K){var G;let H=Y?.Parent?new J:this;z(H,K),(G=H._zod).deferred??(G.deferred=[]);for(let W of H._zod.deferred)W();return H}return Object.defineProperty(I,"init",{value:z}),Object.defineProperty(I,Symbol.hasInstance,{value:(K)=>{if(Y?.Parent&&K instanceof Y.Parent)return!0;return K?._zod?.traits?.has($)}}),Object.defineProperty(I,"name",{value:$}),I}function a4($){if($)Object.assign(AU,$);return AU}var io,mK,rT,f5,PU,AU;var BU=o(()=>{mK=Object.freeze({status:"aborted"});rT=Symbol("zod_brand");f5=class f5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};PU=class PU extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(io=globalThis).__zod_globalConfig??(io.__zod_globalConfig={});AU=globalThis.__zod_globalConfig});var y0={};x8(y0,{unwrapMessage:()=>lK,uint8ArrayToHex:()=>py0,uint8ArrayToBase64url:()=>cy0,uint8ArrayToBase64:()=>po,stringifyPrimitive:()=>v0,slugify:()=>tT,shallowClone:()=>$j,safeExtend:()=>ky0,required:()=>uy0,randomString:()=>Ry0,propertyKeyTypes:()=>sK,promiseAllObject:()=>Cy0,primitiveTypes:()=>Uj,prefixIssues:()=>f8,pick:()=>Sy0,partial:()=>fy0,parsedType:()=>S0,optionalKeys:()=>Yj,omit:()=>gy0,objectClone:()=>Ty0,numKeys:()=>_y0,nullish:()=>Q7,normalizeParams:()=>x0,mergeDefs:()=>i9,merge:()=>xy0,jsonStringifyReplacer:()=>uz,joinValues:()=>N0,issue:()=>iz,isPlainObject:()=>I7,isObject:()=>TU,hexToUint8Array:()=>ny0,getSizableOrigin:()=>aK,getParsedType:()=>vy0,getLengthableOrigin:()=>tK,getEnumValues:()=>oK,getElementAtPath:()=>Ey0,floatSafeRemainder:()=>aT,finalizeIssue:()=>A8,extend:()=>yy0,explicitlyAborted:()=>Jj,escapeRegex:()=>N$,esc:()=>pq,defineLazy:()=>T1,createTransparentProxy:()=>hy0,cloneDef:()=>jy0,clone:()=>D8,cleanRegex:()=>rK,cleanEnum:()=>by0,captureStackTrace:()=>dq,cached:()=>bz,base64urlToUint8Array:()=>iy0,base64ToUint8Array:()=>no,assignProp:()=>J7,assertNotEqual:()=>Dy0,assertNever:()=>Py0,assertIs:()=>Ay0,assertEqual:()=>Ny0,assert:()=>By0,allowsEval:()=>eT,aborted:()=>K7,NUMBER_FORMAT_RANGES:()=>zj,Class:()=>moLine truncated
`)}var lo=($,U)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:U,enumerable:!1}),$.message=JSON.stringify(U,uz,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},eK,u8;var Gj=o(()=>{BU();$1();eK=H0("$ZodError",lo),u8=H0("$ZodError",lo,{Parent:Error})});var cz=($)=>(U,Y,z,Q)=>{let J=z?{...z,async:!1}:{async:!1},I=U._zod.run({value:Y,issues:[]},J);if(I instanceof Promise)throw new f5;if(I.issues.length){let K=new(Q?.Err??$)(I.issues.map((G)=>A8(G,J,a4())));throw dq(K,Q?.callee),K}return I.value},mq,nz=($)=>async(U,Y,z,Q)=>{let J=z?{...z,async:!0}:{async:!0},I=U._zod.run({value:Y,issues:[]},J);if(I instanceof Promise)I=await I;if(I.issues.length){let K=new(Q?.Err??$)(I.issues.map((G)=>A8(G,J,a4())));throw dq(K,Q?.callee),K}return I.value},lq,pz=($)=>(U,Y,z)=>{let Q=z?{...z,async:!1}:{async:!1},J=U._zod.run({value:Y,issues:[]},Q);if(J instanceof Promise)throw new f5;return J.issues.length?{success:!1,error:new($??eK)(J.issues.map((I)=>A8(I,Q,a4())))}:{success:!0,data:J.value}},Hj,dz=($)=>async(U,Y,z)=>{let Q=z?{...z,async:!0}:{async:!0},J=U._zod.run({value:Y,issues:[]},Q);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((I)=>A8(I,Q,a4())))}:{success:!0,data:J.value}},Wj,oq=($)=>(U,Y,z)=>{let Q=z?{...z,direction:"backward"}:{direction:"backward"};return cz($)(U,Y,Q)},my0,rq=($)=>(U,Y,z)=>{return cz($)(U,Y,z)},ly0,sq=($)=>async(U,Y,z)=>{let Q=z?{...z,direction:"backward"}:{direction:"backward"};return nz($)(U,Y,Q)},oy0,aq=($)=>async(U,Y,z)=>{return nz($)(U,Y,z)},ry0,tq=($)=>(U,Y,z)=>{let Q=z?{...z,direction:"backward"}:{direction:"backward"};return pz($)(U,Y,Q)},sy0,eq=($)=>(U,Y,z)=>{return pz($)(U,Y,z)},ay0,$V=($)=>async(U,Y,z)=>{let Q=z?{...z,direction:"backward"}:{direction:"backward"};return dz($)(U,Y,Q)},ty0,UV=($)=>async(U,Y,z)=>{return dz($)(U,Y,z)},ey0;var Xj=o(()=>{BU();Gj();$1();mq=cz(u8),lq=nz(u8),Hj=pz(u8),Wj=dz(u8),my0=oq(u8),ly0=rq(u8),oy0=sq(u8),ry0=aq(u8),sy0=tq(u8),ay0=eq(u8),ty0=$V(u8),ey0=UV(u8)});var U$={};x8(U$,{xid:()=>Lj,uuid7:()=>zk0,uuid6:()=>Yk0,uuid4:()=>Uk0,uuid:()=>jU,uppercase:()=>bj,unicodeEmail:()=>ro,undefined:()=>fj,ulid:()=>Vj,time:()=>vj,string:()=>Sj,sha512_hex:()=>Bk0,sha512_base64url:()=>jk0,sha512_base64:()=>Tk0,sha384_hex:()=>Dk0,sha384_base64url:()=>Pk0,sha384_base64:()=>Ak0,sha256_hex:()=>Ok0,sha256_base64url:()=>Nk0,sha256_base64:()=>Mk0,sha1_hex:()=>Lk0,sha1_base64url:()=>wk0,sha1_base64:()=>Fk0,rfc5322Email:()=>Jk0,number:()=>YG,null:()=>xj,nanoid:()=>wj,md5_hex:()=>Zk0,md5_base64url:()=>Vk0,md5_base64:()=>qk0,mac:()=>Bj,lowercase:()=>uj,ksuid:()=>Fj,ipv6:()=>Pj,ipv4:()=>Aj,integer:()=>yj,idnEmail:()=>Ik0,httpProtocol:()=>Cj,html5Email:()=>Qk0,hostname:()=>Hk0,hex:()=>Xk0,guid:()=>Mj,extendedDuration:()=>$k0,emoji:()=>Dj,email:()=>Nj,e164:()=>Rj,duration:()=>Oj,domain:()=>Wk0,datetime:()=>hj,date:()=>_j,cuid2:()=>qj,cuid:()=>Zj,cidrv6:()=>jj,cidrv4:()=>Tj,browserEmail:()=>Kk0,boolean:()=>kj,bigint:()=>gj,base64url:()=>YV,base64:()=>Ej});function Dj(){return new RegExp(Gk0,"u")}function ao($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function vj($){return new RegExp(`^${ao($)}$`)}function hj($){let U=ao({precision:$.precision}),Y=["Z"];if($.local)Y.push("");if($.offset)Y.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let z=`${U}(?:${Y.join("|")})`;return new RegExp(`^${so}T(?:${z})$`)}function zG($,U){return new RegExp(`^[A-Za-z0-9+/]{${$}}${U}$`)}function QG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Zj,qj,Vj,Lj,Fj,wj,Oj,$k0,Mj,jU=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Uk0,Yk0,zk0,Nj,Qk0,Jk0,ro,Ik0,Kk0,Gk0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Aj,Pj,Bj=($)=>{let U=N$($??":");return new RegExp(`^(?:[0-9A-F]{2}${U}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${U}){5}[0-9a-f]{2}$`)},Tj,jj,Ej,YV,Hk0,Wk0,Cj,Rj,so="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_j,Sj=($)=>{let U=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${U}$`)},gj,yj,YG,kj,xj,fj,uj,bj,Xk0,Zk0,qk0,Vk0,Lk0,Fk0,wk0,Ok0,Mk0,Nk0,Dk0,Ak0,Pk0,Bk0,Tk0,jk0;var zV=o(()=>{$1();Zj=/^[cC][0-9a-z]{6,}$/,qj=/^[0-9a-z]+$/,Vj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Lj=/^[0-9a-vA-V]{20}$/,Fj=/^[A-Za-z0-9]{27}$/,wj=/^[a-zA-Z0-9_-]{21}$/,Oj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
`).filter((J)=>J),z=Math.min(...Y.map((J)=>J.length-J.trimStart().length)),Q=Y.map((J)=>J.slice(z)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of Q)this.content.push(J)}compile(){let $=Function,U=this?.args,z=[...(this?.content??[""]).map((Q)=>` ${Q}`)];return new $(...U,z.join(`
`))}}var JE;var IE=o(()=>{JE={major:4,minor:4,patch:3}});function CE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Lr($){if(!YV.test($))return!1;let U=$.replace(/[-_]/g,(z)=>z==="-"?"+":"/"),Y=U.padEnd(Math.ceil(U.length/4)*4,"=");return CE(Y)}function Fr($,U=null){try{let Y=$.split(".");if(Y.length!==3)return!1;let[z]=Y;if(!z)return!1;let Q=JSON.parse(atob(z));if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(U&&(!("alg"in Q)||Q.alg!==U))return!1;return!0}catch{return!1}}function Ur($,U,Y){if($.issues.length)U.issues.push(...f8(Y,$.issues));U.value[Y]=$.value}function XV($,U,Y,z,Q,J){let I=Y in z;if($.issues.length){if(Q&&J&&!I)return;U.issues.push(...f8(Y,$.issues))}if(!I&&!Q){if(!$.issues.length)U.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[Y]});return}if($.value===void 0){if(I)U.value[Y]=void 0}else U.value[Y]=$.value}function wr($){let U=Object.keys($.shape);for(let z of U)if(!$.shape?.[z]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${z}": expected a Zod schema`);let Y=Yj($.shape);return{...$,keys:U,keySet:new Set(U),numKeys:U.length,optionalKeys:new Set(Y)}}function Or($,U,Y,z,Q,J){let I=[],K=Q.keySet,G=Q.catchall._zod,H=G.def.type,W=G.optin==="optional",X=G.optout==="optional";for(let Z in U){if(Z==="__proto__")continue;if(K.has(Z))continue;if(H==="never"){I.push(Z);continue}let q=G.run({value:U[Z],issues:[]},z);if(q instanceof Promise)$.push(q.then((V)=>XV(V,Y,Z,U,W,X)));else XV(q,Y,Z,U,W,X)}if(I.length)Y.issues.push({code:"unrecognized_keys",keys:I,input:U,inst:J});if(!$.length)return Y;return Promise.all($).then(()=>{return Y})}function Yr($,U,Y,z){for(let J of $)if(J.issues.length===0)return U.value=J.value,U;let Q=$.filter((J)=>!K7(J));if(Q.length===1)return U.value=Q[0].value,Q[0];return U.issues.push({code:"invalid_union",input:U.value,inst:Y,errors:$.map((J)=>J.issues.map((I)=>A8(I,z,a4())))}),U}function zr($,U,Y,z){let Q=$.filter((J)=>J.issues.length===0);if(Q.length===1)return U.value=Q[0].value,U;if(Q.length===0)U.issues.push({code:"invalid_union",input:U.value,inst:Y,errors:$.map((J)=>J.issues.map((I)=>A8(I,z,a4())))});else U.issues.push({code:"invalid_union",input:U.value,inst:Y,errors:[],inclusive:!1});return U}function KE($,U){if($===U)return{valid:!0,data:$};if($ instanceof Date&&U instanceof Date&&+$===+U)return{valid:!0,data:$};if(I7($)&&I7(U)){let Y=Object.keys(U),z=Object.keys($).filter((J)=>Y.indexOf(J)!==-1),Q={...$,...U};for(let J of z){let I=KE($[J],U[J]);if(!I.valid)return{valid:!1,mergeErrorPath:[J,...I.mergeErrorPath]};Q[J]=I.data}return{valid:!0,data:Q}}if(Array.isArray($)&&Array.isArray(U)){if($.length!==U.length)return{valid:!1,mergeErrorPath:[]};let Y=[];for(let z=0;z<$.length;z++){let Q=$[z],J=U[z],I=KE(Q,J);if(!I.valid)return{valid:!1,mergeErrorPath:[z,...I.mergeErrorPath]};Y.push(I.data)}return{valid:!0,data:Y}}return{valid:!1,mergeErrorPath:[]}}function Qr($,U,Y){let z=new Map,Q;for(let K of U.issues)if(K.code==="unrecognized_keys"){Q??(Q=K);for(let G of K.keys){if(!z.has(G))z.set(G,{});z.get(G).l=!0}}else $.issues.push(K);for(let K of Y.issues)if(K.code==="unrecognized_keys")for(let G of K.keys){if(!z.has(G))z.set(G,{});z.get(G).r=!0}else $.issues.push(K);let J=[...z].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(J.length&&Q)$.issues.push({...Q,keys:J});if(K7($))return $;let I=KE(U.value,Y.value);if(!I.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(I.mergeErrorPath)}`);return $.value=I.data,$}function Jr($,U){for(let Y=$.length-1;Y>=0;Y--)if($[Y]._zod[U]!=="optional")return Y+1;return 0}function Ir($,U,Y){if($.issues.length)U.issues.push(...f8(Y,$.issues));U.value[Y]=$.value}function Kr($,U,Y,z,Q){for(let J=0;J<Y.length;J++){let I=$[J],K=J<z.length;if(I.issues.length){if(!K&&J>=Q){U.value.length=J;break}U.issues.push(...f8(J,I.issues))}U.value[J]=I.value}for(let J=U.value.length-1;J>=z.length;J--)if(Y[J]._zod.optout==="optional"&&U.value[J]===void 0)U.value.length=J;else break;return U}function Gr($,U,Y,z,Q,J,I){if($.issues.length)if(sK.has(typeof z))Y.issues.push(...f8(z,$.issues));else Y.issues.push({code:"invalid_key",origin:"map",input:Q,inst:J,issues:$.issues.map((K)=>A8(K,I,a4()))});if(U.issues.length)if(sK.has(typeof z))Y.issues.push(...f8(z,U.issues));else Y.issues.push({origin:"map",code:"invalid_element",input:Q,inst:J,key:z,issues:U.issues.map((K)=>A8(K,I,a4()))});Y.value.set($.value,U.value)}function Hr($,U){if($.issues.length)U.issues.push(...$.issues);U.value.add($.value)}function Wr($,U){if(U===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Xr($,U){if($.value===void 0)$.value=U.defaultValue;return $}function Zr($,U){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:U});return $}function GV($,U,Y){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:$.value,issues:$.issues,fa Line truncated
if (${D}.issues.length) {
if (${B} in input) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
...iss,
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
}
if (${N}.value === undefined) {
if (${D}.value === undefined) {
if (${B} in input) {
newResult[${B}] = undefined;
}
} else {
newResult[${B}] = ${N}.value;
newResult[${B}] = ${D}.value;
}
`);else if(!A)q.write(`
const ${N}_present = ${B} in input;
if (${N}.issues.length) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
const ${D}_present = ${B} in input;
if (${D}.issues.length) {
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
...iss,
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
if (!${N}_present && !${N}.issues.length) {
if (!${D}_present && !${D}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
@@ -36,132 +36,132 @@ import{createRequire as Wy0}from"node:module";var Yy0=Object.create;var{getProto
});
}
if (${N}_present) {
if (${N}.value === undefined) {
if (${D}_present) {
if (${D}.value === undefined) {
newResult[${B}] = undefined;
} else {
newResult[${B}] = ${N}.value;
newResult[${B}] = ${D}.value;
}
}
`);else q.write(`
if (${N}.issues.length) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
if (${D}.issues.length) {
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
...iss,
path: iss.path ? [${B}, ...iss.path] : [${B}]
})));
}
if (${N}.value === undefined) {
if (${D}.value === undefined) {
if (${B} in input) {
newResult[${B}] = undefined;
}
} else {
newResult[${B}] = ${N}.value;
newResult[${B}] = ${D}.value;
}
`)}q.write("payload.value = newResult;"),q.write("return payload;");let O=q.compile();return(D,N)=>O(Z,D,N)},Q,J=TY,K=!AY.jitless,H=K&&eT.value,W=Y.catchall,X;$._zod.parse=(Z,q)=>{X??(X=U.value);let V=Z.value;if(!J(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(K&&H&&q?.async===!1&&q.jitless!==!0){if(!Q)Q=I(Y.shape);if(Z=Q(Z,q),!W)return Z;return Mr([],V,Z,q,X,$)}return z(Z,q)}});JG=H0("$ZodUnion",($,Y)=>{q1.init($,Y),T1($._zod,"optin",()=>Y.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),T1($._zod,"optout",()=>Y.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),T1($._zod,"values",()=>{if(Y.options.every((U)=>U._zod.values))return new Set(Y.options.flatMap((U)=>Array.from(U._zod.values)));return}),T1($._zod,"pattern",()=>{if(Y.options.every((U)=>U._zod.pattern)){let U=Y.options.map((I)=>I._zod.pattern);return new RegExp(`^(${U.map((I)=>rK(I.source)).join("|")})$`)}return});let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,I)=>{if(z)return z(U,I);let Q=!1,J=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},I);if(G instanceof Promise)J.push(G),Q=!0;else{if(G.issues.length===0)return G;J.push(G)}}if(!Q)return zr(J,U,$,I);return Promise.all(J).then((K)=>{return zr(K,U,$,I)})}});mE=H0("$ZodXor",($,Y)=>{JG.init($,Y),Y.inclusive=!1;let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,I)=>{if(z)return z(U,I);let Q=!1,J=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},I);if(G instanceof Promise)J.push(G),Q=!0;else J.push(G)}if(!Q)return Ur(J,U,$,I);return Promise.all(J).then((K)=>{return Ur(K,U,$,I)})}}),lE=H0("$ZodDiscriminatedUnion",($,Y)=>{Y.inclusive=!1,JG.init($,Y);let z=$._zod.parse;T1($._zod,"propValues",()=>{let I={};for(let Q of Y.options){let J=Q._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(Q)}"`);for(let[K,G]of Object.entries(J)){if(!I[K])I[K]=new Set;for(let H of G)I[K].add(H)}}return I});let U=bU(()=>{let I=Y.options,Q=new Map;for(let J of I){let K=J._zod.propValues?.[Y.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(J)}"`);for(let G of K){if(Q.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);Q.set(G,J)}}return Q});$._zod.parse=(I,Q)=>{let J=I.value;if(!TY(J))return I.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),I;let K=U.value.get(J?.[Y.discriminator]);if(K)return K._zod.run(I,Q);if(Y.unionFallback||Q.direction==="backward")return z(I,Q);return I.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Y.discriminator,options:Array.from(U.value.keys()),input:J,path:[Y.discriminator],inst:$}),I}}),oE=H0("$ZodIntersection",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let I=z.value,Q=Y.left._zod.run({value:I,issues:[]},U),J=Y.right._zod.run({value:I,issues:[]},U);if(Q instanceof Promise||J instanceof Promise)return Promise.all([Q,J]).then(([G,H])=>{return Ir(z,G,H)});return Ir(z,Q,J)}});VV=H0("$ZodTuple",($,Y)=>{q1.init($,Y);let z=Y.items;$._zod.parse=(U,I)=>{let Q=U.value;if(!Array.isArray(Q))return U.issues.push({input:Q,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let J=[],K=Qr(z,"optin"),G=Qr(z,"optout");if(!Y.rest){if(Q.length<K)return U.issues.push({code:"too_small",minimum:K,inclusive:!0,input:Q,inst:$,origin:"array"}),U;if(Q.length>z.length)U.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:Q,inst:$,origin:"array"})}let H=Array(z.length);for(let W=0;W<z.length;W++){let X=z[W]._zod.run({value:Q[W],issues:[]},I);if(X instanceof Promise)J.push(X.then((Z)=>{H[W]=Z}));else H[W]=X}if(Y.rest){let W=z.length-1,X=Q.slice(z.length);for(let Z of X){W++;let q=Y.rest._zod.run({value:Z,issues:[]},I);if(q instanceof Promise)J.push(q.then((V)=>Jr(V,U,W)));else Jr(q,U,W)}}if(J.length)return Promise.all(J).then(()=>Kr(H,U,z,Q,G));return Kr(H,U,z,Q,G)}});rE=H0("$ZodRecord",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let I=z.value;if(!J7(I))return z.issues.push({expected:"record",code:"invalid_type",input:I,inst:$}),z;let Q=[],J=Y.keyType._zod.values;if(J){z.value={};let K=new Set;for(let H of J)if(typeof H==="string"||typeof H==="number"||typeof H==="symbol"){K.add(typeof H==="number"?H.toString():H);let W=Y.keyType._zod.run({value:H,issues:[]},U);if(W instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(W.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:W.issues.map((q)=>A8(q,U,a4())),input:H,path:[H],inst:$});continue}let X=W.value,Z=Y.valueType._zod.run({value:I[H],issues:[]},U);if(Z instanceof Promise)Q.push(Z.then((q)=>{if(q.issues.length)z.issues.push(...f8(H,q.issues));z.value[X]=q.value}));else{if(Z.issues.length)z.issues.push(...f8(H,Z.issues));z.value[X]=Z.value}}let G;for(let H in I)if(!K.has(H))G=G??[],G.push(H);if(G&&G.length>0)z.issues.push({code:"unrec Line truncated
`)}q.write("payload.value = newResult;"),q.write("return payload;");let M=q.compile();return(N,D)=>M(Z,N,D)},J,I=TU,K=!AU.jitless,H=K&&eT.value,W=U.catchall,X;$._zod.parse=(Z,q)=>{X??(X=z.value);let V=Z.value;if(!I(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(K&&H&&q?.async===!1&&q.jitless!==!0){if(!J)J=Q(U.shape);if(Z=J(Z,q),!W)return Z;return Or([],V,Z,q,X,$)}return Y(Z,q)}});IG=H0("$ZodUnion",($,U)=>{q1.init($,U),T1($._zod,"optin",()=>U.options.some((z)=>z._zod.optin==="optional")?"optional":void 0),T1($._zod,"optout",()=>U.options.some((z)=>z._zod.optout==="optional")?"optional":void 0),T1($._zod,"values",()=>{if(U.options.every((z)=>z._zod.values))return new Set(U.options.flatMap((z)=>Array.from(z._zod.values)));return}),T1($._zod,"pattern",()=>{if(U.options.every((z)=>z._zod.pattern)){let z=U.options.map((Q)=>Q._zod.pattern);return new RegExp(`^(${z.map((Q)=>rK(Q.source)).join("|")})$`)}return});let Y=U.options.length===1?U.options[0]._zod.run:null;$._zod.parse=(z,Q)=>{if(Y)return Y(z,Q);let J=!1,I=[];for(let K of U.options){let G=K._zod.run({value:z.value,issues:[]},Q);if(G instanceof Promise)I.push(G),J=!0;else{if(G.issues.length===0)return G;I.push(G)}}if(!J)return Yr(I,z,$,Q);return Promise.all(I).then((K)=>{return Yr(K,z,$,Q)})}});mE=H0("$ZodXor",($,U)=>{IG.init($,U),U.inclusive=!1;let Y=U.options.length===1?U.options[0]._zod.run:null;$._zod.parse=(z,Q)=>{if(Y)return Y(z,Q);let J=!1,I=[];for(let K of U.options){let G=K._zod.run({value:z.value,issues:[]},Q);if(G instanceof Promise)I.push(G),J=!0;else I.push(G)}if(!J)return zr(I,z,$,Q);return Promise.all(I).then((K)=>{return zr(K,z,$,Q)})}}),lE=H0("$ZodDiscriminatedUnion",($,U)=>{U.inclusive=!1,IG.init($,U);let Y=$._zod.parse;T1($._zod,"propValues",()=>{let Q={};for(let J of U.options){let I=J._zod.propValues;if(!I||Object.keys(I).length===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(J)}"`);for(let[K,G]of Object.entries(I)){if(!Q[K])Q[K]=new Set;for(let H of G)Q[K].add(H)}}return Q});let z=bz(()=>{let Q=U.options,J=new Map;for(let I of Q){let K=I._zod.propValues?.[U.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(I)}"`);for(let G of K){if(J.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);J.set(G,I)}}return J});$._zod.parse=(Q,J)=>{let I=Q.value;if(!TU(I))return Q.issues.push({code:"invalid_type",expected:"object",input:I,inst:$}),Q;let K=z.value.get(I?.[U.discriminator]);if(K)return K._zod.run(Q,J);if(U.unionFallback||J.direction==="backward")return Y(Q,J);return Q.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:U.discriminator,options:Array.from(z.value.keys()),input:I,path:[U.discriminator],inst:$}),Q}}),oE=H0("$ZodIntersection",($,U)=>{q1.init($,U),$._zod.parse=(Y,z)=>{let Q=Y.value,J=U.left._zod.run({value:Q,issues:[]},z),I=U.right._zod.run({value:Q,issues:[]},z);if(J instanceof Promise||I instanceof Promise)return Promise.all([J,I]).then(([G,H])=>{return Qr(Y,G,H)});return Qr(Y,J,I)}});VV=H0("$ZodTuple",($,U)=>{q1.init($,U);let Y=U.items;$._zod.parse=(z,Q)=>{let J=z.value;if(!Array.isArray(J))return z.issues.push({input:J,inst:$,expected:"tuple",code:"invalid_type"}),z;z.value=[];let I=[],K=Jr(Y,"optin"),G=Jr(Y,"optout");if(!U.rest){if(J.length<K)return z.issues.push({code:"too_small",minimum:K,inclusive:!0,input:J,inst:$,origin:"array"}),z;if(J.length>Y.length)z.issues.push({code:"too_big",maximum:Y.length,inclusive:!0,input:J,inst:$,origin:"array"})}let H=Array(Y.length);for(let W=0;W<Y.length;W++){let X=Y[W]._zod.run({value:J[W],issues:[]},Q);if(X instanceof Promise)I.push(X.then((Z)=>{H[W]=Z}));else H[W]=X}if(U.rest){let W=Y.length-1,X=J.slice(Y.length);for(let Z of X){W++;let q=U.rest._zod.run({value:Z,issues:[]},Q);if(q instanceof Promise)I.push(q.then((V)=>Ir(V,z,W)));else Ir(q,z,W)}}if(I.length)return Promise.all(I).then(()=>Kr(H,z,Y,J,G));return Kr(H,z,Y,J,G)}});rE=H0("$ZodRecord",($,U)=>{q1.init($,U),$._zod.parse=(Y,z)=>{let Q=Y.value;if(!I7(Q))return Y.issues.push({expected:"record",code:"invalid_type",input:Q,inst:$}),Y;let J=[],I=U.keyType._zod.values;if(I){Y.value={};let K=new Set;for(let H of I)if(typeof H==="string"||typeof H==="number"||typeof H==="symbol"){K.add(typeof H==="number"?H.toString():H);let W=U.keyType._zod.run({value:H,issues:[]},z);if(W instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(W.issues.length){Y.issues.push({code:"invalid_key",origin:"record",issues:W.issues.map((q)=>A8(q,z,a4())),input:H,path:[H],inst:$});continue}let X=W.value,Z=U.valueType._zod.run({value:Q[H],issues:[]},z);if(Z instanceof Promise)J.push(Z.then((q)=>{if(q.issues.length)Y.issues.push(...f8(H,q.issues));Y.value[X]=q.value}));else{if(Z.issues.length)Y.issues.push(...f8(H,Z.issues));Y.value[X]=Z.value}}let G;for(let H in Q)if(!K.has(H))G=G??[],G.push(H);if(G&&G.length>0)Y.issues.push({code:"unrec Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let K=J[1];if(Y===J[0]){Q(J);continue}if($.external){let H=$.external.registry.get(J[0])?.id;if(Y!==J[0]&&H){Q(J);continue}}if($.metadataRegistry.get(J[0])?.id){Q(J);continue}if(K.cycle){Q(J);continue}if(K.count>1){if($.reused==="ref"){Q(J);continue}}}}function Z7($,Y){let z=$.seen.get(Y);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let G=$.seen.get(K);if(G.ref===null)return;let H=G.def??G.schema,W={...H},X=G.ref;if(G.ref=null,X){U(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))H.allOf=H.allOf??[],H.allOf.push(V);else Object.assign(H,V);if(Object.assign(H,W),K._zod.parent===X)for(let M in H){if(M==="$ref"||M==="allOf")continue;if(!(M in W))delete H[M]}if(V.$ref&&q.def)for(let M in H){if(M==="$ref"||M==="allOf")continue;if(M in q.def&&JSON.stringify(H[M])===JSON.stringify(q.def[M]))delete H[M]}}let Z=K._zod.parent;if(Z&&Z!==X){U(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(H.$ref=q.schema.$ref,q.def)for(let V in H){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(H[V])===JSON.stringify(q.def[V]))delete H[V]}}}$.override({zodSchema:K,jsonSchema:H,path:G.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let I={};if($.target==="draft-2020-12")I.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")I.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")I.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(Y)?.id;if(!K)throw Error("Schema is missing an `id` property");I.$id=$.external.uri(K)}Object.assign(I,z.def??z.schema);let Q=$.metadataRegistry.get(Y)?.id;if(Q!==void 0&&I.id===Q)delete I.id;let J=$.external?.defs??{};for(let K of $.seen.entries()){let G=K[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;J[G.defId]=G.def}}if($.external);else if(Object.keys(J).length>0)if($.target==="draft-2020-12")I.$defs=J;else I.definitions=J;try{let K=JSON.parse(JSON.stringify(I));return Object.defineProperty(K,"~standard",{value:{...Y["~standard"],jsonSchema:{input:KI(Y,"input",$.processors),output:KI(Y,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function B8($,Y){let z=Y??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return B8(U.element,z);if(U.type==="set")return B8(U.valueType,z);if(U.type==="lazy")return B8(U.getter(),z);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return B8(U.innerType,z);if(U.type==="intersection")return B8(U.left,z)||B8(U.right,z);if(U.type==="record"||U.type==="map")return B8(U.keyType,z)||B8(U.valueType,z);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return B8(U.in,z)||B8(U.out,z)}if(U.type==="object"){for(let I in U.shape)if(B8(U.shape[I],z))return!0;return!1}if(U.type==="union"){for(let I of U.options)if(B8(I,z))return!0;return!1}if(U.type==="tuple"){for(let I of U.items)if(B8(I,z))return!0;if(U.rest&&B8(U.rest,z))return!0;return!1}return!1}var Q_=($,Y={})=>(z)=>{let U=W7({...z,processors:Y});return J4($,U),X7(U,$),Z7(U,$)},KI=($,Y,z={})=>(U)=>{let{libraryOptions:I,target:Q}=U??{},J=W7({...I??{},target:Q,io:Y,processors:z});return J4($,J),X7(J,$),Z7(J,$)};var FG=o(()=>{qG()});function vY($,Y){if("_idmap"in $){let U=$,I=W7({...Y,processors:nV}),Q={};for(let G of U._idmap.entries()){let[H,W]=G;J4(W,I)}let J={},K={registry:U,uri:Y?.uri,defs:Q};I.external=K;for(let G of U._idmap.entries()){let[H,W]=G;X7(I,W),J[H]=Z7(I,W)}if(Object.keys(Q).length>0){let G=I.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[G]:Q}}return{schemas:J}}let z=W7({...Y,processors:nV});return J4($,z),X7(z,$),Z7(z,$)}var ox0,J_=($,Y,z,U)=>{let I=z;I.type="string";let{minimum:Q,maximum:J,format:K,patterns:G,contentEncoding:H}=$._zod.bag;if(typeof Q==="number")I.minLength=Q;if(typeof J==="number")I.maxLength=J;if(K){if(I.format=ox0[K]??K,I.format==="")delete I.format;if(K==="time")delete I.format}if(H)I.contentEncoding=H;if(G&&G.size>0){let W=[...G];if(W.length===1)I.pattern=W[0].source;else if(W.length>1)I.allOf=[...W.map((X)=>({...Y.target==="draft-07"||Y.target==="draft-04"||Y.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},K_=($,Y,z,U)=>{let I=z,{minimum:Q,maximum:J,format:K,multipleOf:G,exclusiveMaximum:H,exclusiveMinimum:W}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))I.type="integer";else I.type="number";let X=typeof W==="number"&&W>=(Q??Number.NEGATIVE_INFINITY),Z=typeof H==="number"&&H<=(J??Number.POSITIVE_INFINITY),q=Y.target==="draft-04"||Y.target==="openapi-3.0";if(X)if(q)I.minimum=W,I.exclusiveMinimum=!0;else I.exclusiveMinimuLine truncated
`}function Cu0($){let Y=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))Y.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))Y.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))Y.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))Y.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Eu0.test($)){let z=[...$].filter((U)=>!/[A-Za-z0-9._-]/.test(U)).filter((U,I,Q)=>Q.indexOf(U)===I);return Y.push(`Tool name contains invalid characters: ${z.map((U)=>`"${U}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:Y}}return{isValid:!0,warnings:Y}}function Ru0($,Y){if(Y.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let z of Y)console.warn(` - ${z}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function zS($){let Y=Cu0($);return Ru0($,Y.warnings),Y.isValid}function _u0($){return typeof $==="object"&&$!==null&&"_zod"in $}function vu0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function hu0($){if(typeof $!=="object"||$===null)return!1;if(_I($))return!1;let Y=Object.getPrototypeOf($);if(Y!==Object.prototype&&Y!==null)return!1;return Object.values($).every((z)=>_u0(z))}function Rw($){if($===void 0)return;if(hu0($))return z0($);if(typeof $==="object"&&$!==null&&!_I($)&&Object.values($).some((Y)=>vu0(Y)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!_I($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var _h,Wf0,A1,V1,Xf0,Zt="2026-07-28",T7,Lt,Vf0,Lf0,Ff0,Mt,Ot,Mf0,qw,kf1,xf1,$t,fh,Bf0,Tf0,CI,n0,Q1,Aw,At,hI,Pw,Cf0=0,Rf0="private",_f0,ff0,Lw,ch,Tt,ff1,uf1,pf0,df0,nh,Fw,XH="2026-07-28",Ct,of0,D$=($)=>xG.safeParse($).success,j7=($)=>fG.safeParse($).success,HH=($)=>wI.safeParse($).success,Ew=($)=>MI.safeParse($).success,r9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",Qt="x-mcp-header",rf0,sf0,af0,tf0,Ow=-32020,bf1,ef0,Jt=!1,hh="draft-2020-12",zu0,Ku0,Gu0,Kt,Hu0,Lu0,vt=250,Fu0,wu0,yt,kt,Mu0,Ou0,ft=60000,Du0,Au0,Pu0,ut,th,ju0,if1,bt=10485760,$S=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??bt}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
`);if($===-1)return null;let Y=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return it(Y)}catch(z){if(z instanceof SyntaxError)continue;throw z}}return null}clear(){this._buffer=void 0}},Eu0;var _w=o(()=>{lT();oT();aa();rv();_h=Symbol.for("mcp.sdk.errorBrands");Wf0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](Y){return RI(this,Y)}static isInstance(Y){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return RI(this,Y)}constructor(Y,z,U){super(z);this.code=Y,this.errorUri=U,this.name="OAuthError",gh(this,new.target)}toResponseObject(){let Y={error:this.code,error_description:this.message};if(this.errorUri)Y.error_uri=this.errorUri;return Y}static fromResponse(Y){return new $(Y.error,Y.error_description??Y.error,Y.error_uri)}},A1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),V1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return RI(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return RI(this,$)}constructor($,Y,z){super(Y);this.code=$,this.data=z,this.name="SdkError",gh(this,new.target)}},Xf0=class extends V1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,Y,z){super($,Y,z);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};T7=[Zt];Lt=["task","inputRequests","requestState"];Lf0=new Set(["const","enum","default","examples"]),Ff0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);Mt={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ot={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Mf0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};kf1=Object.keys(Mt),xf1=Object.keys(Ot);$t={ok:!1,reason:"not-in-era"};fh={era:"2025-11-25",hasRequestMethod:Nt,hasNotificationMethod:Dt,validateRequest:($,Y)=>Vw(Df0($),Y),validateResult:($,Y)=>Vw(Nf0($),Y),validateNotification:($,Y)=>Vw(Af0($),Y),hasInputRequestMethod:()=>!1,validateInputRequest:()=>$t,validateInputResponse:()=>$t,samplingResultVariant:($,Y)=>{let z=Ft();return Vw($?z.CreateMessageResultWithToolsSchema:z.CreateMessageResultSchema,Y)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,Y){let z=Vt($),U=z.structuredContent;if(U===void 0)return z;let I=typeof U!=="object"||U===null||Array.isArray(U),Q=Y!==void 0&&wt(Y);if(!I&&!Q)return z;return{...z,structuredContent:{result:U}}},decodeResult($,Y){if(vh(Y)&&"resultType"in Y){let z={...Y};return delete z.resultType,{kind:"complete",result:zt(z)}}return{kind:"complete",result:zt(Y)}},encodeResult($,Y){if($!=="tools/list")return Y;l Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let I of $.seen.entries()){let K=I[1];if(U===I[0]){J(I);continue}if($.external){let H=$.external.registry.get(I[0])?.id;if(U!==I[0]&&H){J(I);continue}}if($.metadataRegistry.get(I[0])?.id){J(I);continue}if(K.cycle){J(I);continue}if(K.count>1){if($.reused==="ref"){J(I);continue}}}}function Z7($,U){let Y=$.seen.get(U);if(!Y)throw Error("Unprocessed schema. This is a bug in Zod.");let z=(K)=>{let G=$.seen.get(K);if(G.ref===null)return;let H=G.def??G.schema,W={...H},X=G.ref;if(G.ref=null,X){z(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))H.allOf=H.allOf??[],H.allOf.push(V);else Object.assign(H,V);if(Object.assign(H,W),K._zod.parent===X)for(let O in H){if(O==="$ref"||O==="allOf")continue;if(!(O in W))delete H[O]}if(V.$ref&&q.def)for(let O in H){if(O==="$ref"||O==="allOf")continue;if(O in q.def&&JSON.stringify(H[O])===JSON.stringify(q.def[O]))delete H[O]}}let Z=K._zod.parent;if(Z&&Z!==X){z(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(H.$ref=q.schema.$ref,q.def)for(let V in H){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(H[V])===JSON.stringify(q.def[V]))delete H[V]}}}$.override({zodSchema:K,jsonSchema:H,path:G.path??[]})};for(let K of[...$.seen.entries()].reverse())z(K[0]);let Q={};if($.target==="draft-2020-12")Q.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Q.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Q.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(U)?.id;if(!K)throw Error("Schema is missing an `id` property");Q.$id=$.external.uri(K)}Object.assign(Q,Y.def??Y.schema);let J=$.metadataRegistry.get(U)?.id;if(J!==void 0&&Q.id===J)delete Q.id;let I=$.external?.defs??{};for(let K of $.seen.entries()){let G=K[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;I[G.defId]=G.def}}if($.external);else if(Object.keys(I).length>0)if($.target==="draft-2020-12")Q.$defs=I;else Q.definitions=I;try{let K=JSON.parse(JSON.stringify(Q));return Object.defineProperty(K,"~standard",{value:{...U["~standard"],jsonSchema:{input:KQ(U,"input",$.processors),output:KQ(U,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function B8($,U){let Y=U??{seen:new Set};if(Y.seen.has($))return!1;Y.seen.add($);let z=$._zod.def;if(z.type==="transform")return!0;if(z.type==="array")return B8(z.element,Y);if(z.type==="set")return B8(z.valueType,Y);if(z.type==="lazy")return B8(z.getter(),Y);if(z.type==="promise"||z.type==="optional"||z.type==="nonoptional"||z.type==="nullable"||z.type==="readonly"||z.type==="default"||z.type==="prefault")return B8(z.innerType,Y);if(z.type==="intersection")return B8(z.left,Y)||B8(z.right,Y);if(z.type==="record"||z.type==="map")return B8(z.keyType,Y)||B8(z.valueType,Y);if(z.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return B8(z.in,Y)||B8(z.out,Y)}if(z.type==="object"){for(let Q in z.shape)if(B8(z.shape[Q],Y))return!0;return!1}if(z.type==="union"){for(let Q of z.options)if(B8(Q,Y))return!0;return!1}if(z.type==="tuple"){for(let Q of z.items)if(B8(Q,Y))return!0;if(z.rest&&B8(z.rest,Y))return!0;return!1}return!1}var J_=($,U={})=>(Y)=>{let z=W7({...Y,processors:U});return I4($,z),X7(z,$),Z7(z,$)},KQ=($,U,Y={})=>(z)=>{let{libraryOptions:Q,target:J}=z??{},I=W7({...Q??{},target:J,io:U,processors:Y});return I4($,I),X7(I,$),Z7(I,$)};var FG=o(()=>{qG()});function vU($,U){if("_idmap"in $){let z=$,Q=W7({...U,processors:nV}),J={};for(let G of z._idmap.entries()){let[H,W]=G;I4(W,Q)}let I={},K={registry:z,uri:U?.uri,defs:J};Q.external=K;for(let G of z._idmap.entries()){let[H,W]=G;X7(Q,W),I[H]=Z7(Q,W)}if(Object.keys(J).length>0){let G=Q.target==="draft-2020-12"?"$defs":"definitions";I.__shared={[G]:J}}return{schemas:I}}let Y=W7({...U,processors:nV});return I4($,Y),X7(Y,$),Z7(Y,$)}var ox0,I_=($,U,Y,z)=>{let Q=Y;Q.type="string";let{minimum:J,maximum:I,format:K,patterns:G,contentEncoding:H}=$._zod.bag;if(typeof J==="number")Q.minLength=J;if(typeof I==="number")Q.maxLength=I;if(K){if(Q.format=ox0[K]??K,Q.format==="")delete Q.format;if(K==="time")delete Q.format}if(H)Q.contentEncoding=H;if(G&&G.size>0){let W=[...G];if(W.length===1)Q.pattern=W[0].source;else if(W.length>1)Q.allOf=[...W.map((X)=>({...U.target==="draft-07"||U.target==="draft-04"||U.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},K_=($,U,Y,z)=>{let Q=Y,{minimum:J,maximum:I,format:K,multipleOf:G,exclusiveMaximum:H,exclusiveMinimum:W}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))Q.type="integer";else Q.type="number";let X=typeof W==="number"&&W>=(J??Number.NEGATIVE_INFINITY),Z=typeof H==="number"&&H<=(I??Number.POSITIVE_INFINITY),q=U.target==="draft-04"||U.target==="openapi-3.0";if(X)if(q)Q.minimum=W,Q.exclusiveMinimum=!0;else Q.exclusiveMinimuLine truncated
`}function Cu0($){let U=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))U.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))U.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))U.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))U.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Eu0.test($)){let Y=[...$].filter((z)=>!/[A-Za-z0-9._-]/.test(z)).filter((z,Q,J)=>J.indexOf(z)===Q);return U.push(`Tool name contains invalid characters: ${Y.map((z)=>`"${z}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:U}}return{isValid:!0,warnings:U}}function Ru0($,U){if(U.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let Y of U)console.warn(` - ${Y}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function YS($){let U=Cu0($);return Ru0($,U.warnings),U.isValid}function _u0($){return typeof $==="object"&&$!==null&&"_zod"in $}function vu0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function hu0($){if(typeof $!=="object"||$===null)return!1;if(_Q($))return!1;let U=Object.getPrototypeOf($);if(U!==Object.prototype&&U!==null)return!1;return Object.values($).every((Y)=>_u0(Y))}function Rw($){if($===void 0)return;if(hu0($))return Y0($);if(typeof $==="object"&&$!==null&&!_Q($)&&Object.values($).some((U)=>vu0(U)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!_Q($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var _h,Wf0,A1,V1,Xf0,Zt="2026-07-28",T7,Lt,Vf0,Lf0,Ff0,Ot,Mt,Of0,qw,xf1,ff1,$t,fh,Bf0,Tf0,CQ,n0,J1,Aw,At,hQ,Pw,Cf0=0,Rf0="private",_f0,ff0,Lw,ch,Tt,uf1,bf1,pf0,df0,nh,Fw,XH="2026-07-28",Ct,of0,D$=($)=>xG.safeParse($).success,j7=($)=>fG.safeParse($).success,HH=($)=>wQ.safeParse($).success,Ew=($)=>OQ.safeParse($).success,r9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",Jt="x-mcp-header",rf0,sf0,af0,tf0,Mw=-32020,if1,ef0,It=!1,hh="draft-2020-12",Yu0,Ku0,Gu0,Kt,Hu0,Lu0,vt=250,Fu0,wu0,yt,kt,Ou0,Mu0,ft=60000,Du0,Au0,Pu0,ut,th,ju0,cf1,bt=10485760,$S=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??bt}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
`);if($===-1)return null;let U=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return it(U)}catch(Y){if(Y instanceof SyntaxError)continue;throw Y}}return null}clear(){this._buffer=void 0}},Eu0;var _w=o(()=>{lT();oT();aa();rv();_h=Symbol.for("mcp.sdk.errorBrands");Wf0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](U){return RQ(this,U)}static isInstance(U){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return RQ(this,U)}constructor(U,Y,z){super(Y);this.code=U,this.errorUri=z,this.name="OAuthError",gh(this,new.target)}toResponseObject(){let U={error:this.code,error_description:this.message};if(this.errorUri)U.error_uri=this.errorUri;return U}static fromResponse(U){return new $(U.error,U.error_description??U.error,U.error_uri)}},A1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),V1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return RQ(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return RQ(this,$)}constructor($,U,Y){super(U);this.code=$,this.data=Y,this.name="SdkError",gh(this,new.target)}},Xf0=class extends V1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,U,Y){super($,U,Y);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};T7=[Zt];Lt=["task","inputRequests","requestState"];Lf0=new Set(["const","enum","default","examples"]),Ff0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);Ot={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Mt={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Of0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};xf1=Object.keys(Ot),ff1=Object.keys(Mt);$t={ok:!1,reason:"not-in-era"};fh={era:"2025-11-25",hasRequestMethod:Nt,hasNotificationMethod:Dt,validateRequest:($,U)=>Vw(Df0($),U),validateResult:($,U)=>Vw(Nf0($),U),validateNotification:($,U)=>Vw(Af0($),U),hasInputRequestMethod:()=>!1,validateInputRequest:()=>$t,validateInputResponse:()=>$t,samplingResultVariant:($,U)=>{let Y=Ft();return Vw($?Y.CreateMessageResultWithToolsSchema:Y.CreateMessageResultSchema,U)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,U){let Y=Vt($),z=Y.structuredContent;if(z===void 0)return Y;let Q=typeof z!=="object"||z===null||Array.isArray(z),J=U!==void 0&&wt(U);if(!Q&&!J)return Y;return{...Y,structuredContent:{result:z}}},decodeResult($,U){if(vh(U)&&"resultType"in U){let Y={...U};return delete Y.resultType,{kind:"complete",result:Yt(Y)}}return{kind:"complete",result:Yt(U)}},encodeResult($,U){if($!=="tools/list")return U;l Line truncated
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/ju0=R0(($)=>{var Y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,z=/\\([\u000b\u0020-\u00ff])/g,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=I;function I(K){if(!K)throw TypeError("argument string is required");var G=typeof K==="object"?Q(K):K;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var H=G.indexOf(";"),W=H!==-1?G.slice(0,H).trim():G.trim();if(!U.test(W))throw TypeError("invalid media type");var X=new J(W.toLowerCase());if(H!==-1){var Z,q,V;Y.lastIndex=H;while(q=Y.exec(G)){if(q.index!==H)throw TypeError("invalid parameter format");if(H+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(z,"$1")}X.parameters[Z]=V}if(H!==G.length)throw TypeError("invalid parameter format")}return X}function Q(K){var G;if(typeof K.getHeader==="function")G=K.getHeader("content-type");else if(typeof K.headers==="object")G=K.headers&&K.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function J(K){this.parameters=Object.create(null),this.type=K}}),if1=nq(ju0(),1);Eu0=/^[A-Za-z0-9._-]{1,128}$/});function US($){let Y=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return ob0(Y),Y}var vw,ct,L1,v1,U5,Sw,Su0,nt,pt,hw,gu0,I5,yu0,ku0,dt,xu0,gw,SI,qH,gI,yw,fu0,mt,uu0,bu0,iu0,IS,cu0,QS,lt,nu0,pu0,du0,mu0,lu0,ou0,ru0,su0,JS,au0,tu0,eu0,ot,rt,st,$b0,Yb0,zb0,KS,Ub0,at,Ib0,Qb0,Jb0,Kb0,Gb0,Hb0,Wb0,Xb0,tt,Zb0,et,$e,Ye,qb0,GS,Vb0,ze,Ue,Ie,Lb0,Fb0,Qe,wb0,Mb0,Ob0,Je,Nb0,Db0,Ke,Ab0,Pb0,Bb0,Tb0,jb0,Eb0,Cb0,Rb0,_b0,vb0,hb0,Sb0,gb0,yb0,kb0,xb0,fb0,ub0,bb0,ib0,cb0,nb0,pb0,Ge,db0,mb0,lb0,ob0,kw=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=US(mb0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let Y=bo($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(Y==="2020-12")return this.ajv;if(Y==="2019-09")return this._ajv2019??=US(db0.Ajv2019);return this._ajvDraft7??=US(Ge.Ajv)}getValidator($){let Y=this._engineFor($),z="$id"in $&&typeof $.$id==="string"?Y.getSchema($.$id)??Y.compile($):Y.compile($);return(U)=>{return z(U)?{valid:!0,data:U,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:Y.errorsText(z.errors)}}}},ef1;var He=o(()=>{lT();oT();vw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var Y=class{};$._CodeOrName=Y,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var z=class extends Y{constructor(w){super();if(!$.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=z;var U=class extends Y{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((O,D)=>`${O}${D}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((O,D)=>{if(D instanceof z)O[D.str]=(O[D.str]||0)+1;return O},{})}};$._Code=U,$.nil=new U("");function I(w,...O){let D=[w[0]],N=0;while(N<O.length)K(D,O[N]),D.push(w[++N]);return new U(D)}$._=I;let Q=new U("+");function J(w,...O){let D=[q(w[0])],N=0;while(N<O.length)D.push(Q),K(D,O[N]),D.push(Q,q(w[++N]));return G(D),new U(D)}$.str=J;function K(w,O){if(O instanceof U)w.push(...O._items);else if(O instanceof z)w.push(O);else w.push(X(O))}$.addCodeArg=K;function G(w){let O=1;while(O<w.length-1){if(w[O]===Q){let D=H(w[O-1],w[O+1]);if(D!==void 0){w.splice(O-1,3,D);continue}w[O++]="+"}O++}}function H(w,O){if(O==='""')return w;if(w==='""')return O;if(typeof w=="string"){if(O instanceof z||w[w.length-1]!=='"')return;if(typeof O!="string")return`${w.slice(0,-1)}${O}"`;if(O[0]==='"')return w.slice(0,-1)+O.slice(1);return}if(typeof O=="string"&&O[0]==='"'&&!(w instanceof z))return`"${w}${O.slice(1)}`}function W(w,O){return O.emptyStr()?w:w.emptyStr()?O:J`${w}${O}`}$.strConcat=W;function X(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:q(Array.isArray(w)?w.join(","):w)}function Z(w){return new U(q(w))}$.stringify=Z;function q(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(w){return typeof w=="string"&&$.IDENTIFIER.test(w)?new U(`.${w}`):I`[${w}]`}$.getProperty=V;function F(w){if(typeof w=="string"&&$.IDENTIFIER.test(w))return new U(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}$.getEsmExportName=F;function M(w){return new U(w.toStringLine truncated
`:""},this._extScope=y,this._scope=new z.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let Y0=this._extScope.value(y,s);return(this._values[Y0.prefix]||(this._values[Y0.prefix]=new Set)).add(Y0),Y0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,Y0,M0){let E0=this._scope.toName(s);if(Y0!==void 0&&M0)this._constants[E0.str]=Y0;return this._leafNode(new J(y,E0,Y0)),E0}const(y,s,Y0){return this._def(z.varKinds.const,y,s,Y0)}let(y,s,Y0){return this._def(z.varKinds.let,y,s,Y0)}var(y,s,Y0){return this._def(z.varKinds.var,y,s,Y0)}assign(y,s,Y0){return this._leafNode(new K(y,s,Y0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==Y.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[Y0,M0]of y){if(s.length>1)s.push(",");if(s.push(Y0),Y0!==M0||this.opts.es5)s.push(":"),(0,Y.addCodeArg)(s,M0)}return s.push("}"),new Y._Code(s)}if(y,s,Y0){if(this._blockNode(new w(y)),s&&Y0)this.code(s).else().code(Y0).endIf();else if(s)this.code(s).endIf();else if(Y0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new w(y))}else(){return this._elseNode(new M)}endIf(){return this._endBlockNode(w,M)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new D(y),s)}forRange(y,s,Y0,M0,E0=this.opts.es5?z.varKinds.var:z.varKinds.let){let G0=this._scope.toName(y);return this._for(new N(E0,G0,s,Y0),()=>M0(G0))}forOf(y,s,Y0,M0=z.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof Y.Name?s:this.var("_arr",s);return this.forRange("_i",0,Y._`${G0}.length`,(T0)=>{this.var(E0,Y._`${G0}[${T0}]`),Y0(E0)})}return this._for(new B("of",M0,E0,s),()=>Y0(E0))}forIn(y,s,Y0,M0=this.opts.es5?z.varKinds.var:z.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,Y._`Object.keys(${s})`,Y0);let E0=this._scope.toName(y);return this._for(new B("in",M0,E0,s),()=>Y0(E0))}endFor(){return this._endBlockNode(O)}label(y){return this._leafNode(new H(y))}break(y){return this._leafNode(new W(y))}return(y){let s=new A;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(y,s,Y0){if(!s&&!Y0)throw Error('CodeGen: "try" without "catch" and "finally"');let M0=new j;if(this._blockNode(M0),this.code(y),s){let E0=this.name("e");this._currNode=M0.catch=new C(E0),s(E0)}if(Y0)this._currNode=M0.finally=new b,this.code(Y0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let Y0=this._nodes.length-s;if(Y0<0||y!==void 0&&Y0!==y)throw Error(`CodeGen: wrong number of nodes: ${Y0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=Y.nil,Y0,M0){if(this._blockNode(new T(y,s,Y0)),M0)this.code(M0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let Y0=this._currNode;if(Y0 instanceof y||s&&Y0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=k;function h(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)+(s[Y0]||0);return y}function i(y,s){return s instanceof Y._CodeOrName?h(y,s.names):y}function c(y,s,Y0){if(y instanceof Y.Name)return M0(y);if(!E0(y))return y;return new Y._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof Y.Name)T0=M0(T0);if(T0 instanceof Y._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function M0(G0){let T0=Y0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof Y._Code&&G0._items.some((T0)=>T0 instanceof Y.Name&&s[T0.str]===1&&Y0[T0.str]!==void 0)}}function U0(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)-(s[Y0]||0)}function x(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:Y._`!${e(y)}`}$.not=x;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,Y0)=>s===Y.nil?Y0:Y0===Y.nil?s:Y._`${e(s)} ${y} ${e(Y0)}`}function Line truncated
|| (${C} == "string" && ${A} && ${A} == +${A})`).assign(b,I._`+${A}`);return;case"integer":T.elseIf(I._`${C} === "boolean" || ${A} === null
|| (${C} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(b,I._`+${A}`);return;case"boolean":T.elseIf(I._`${A} === "false" || ${A} === 0 || ${A} === null`).assign(b,!1).elseIf(I._`${A} === "true" || ${A} === 1`).assign(b,!0);return;case"null":T.elseIf(I._`${A} === "" || ${A} === 0 || ${A} === false`),T.assign(b,null);return;case"array":T.elseIf(I._`${C} === "string" || ${C} === "number"
|| ${C} === "boolean" || ${A} === null`).assign(b,I._`[${A}]`)}}}function q({gen:D,parentData:N,parentDataProperty:B},T){D.if(I._`${N} !== undefined`,()=>D.assign(I._`${N}[${B}]`,T))}function V(D,N,B,T=J.Correct){let A=T===J.Correct?I.operators.EQ:I.operators.NEQ,j;switch(D){case"null":return I._`${N} ${A} null`;case"array":j=I._`Array.isArray(${N})`;break;case"object":j=I._`${N} && typeof ${N} == "object" && !Array.isArray(${N})`;break;case"integer":j=C(I._`!(${N} % 1) && !isNaN(${N})`);break;case"number":j=C();break;default:return I._`typeof ${N} ${A} ${D}`}return T===J.Correct?j:(0,I.not)(j);function C(b=I.nil){return(0,I.and)(I._`typeof ${N} == "number"`,b,B?I._`isFinite(${N})`:I.nil)}}$.checkDataType=V;function F(D,N,B,T){if(D.length===1)return V(D[0],N,B,T);let A,j=(0,Q.toHash)(D);if(j.array&&j.object){let C=I._`typeof ${N} != "object"`;A=j.null?C:I._`!${N} || ${C}`,delete j.null,delete j.array,delete j.object}else A=I.nil;if(j.number)delete j.integer;for(let C in j)A=(0,I.and)(A,V(C,N,B,T));return A}$.checkDataTypes=F;let M={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:N})=>typeof D=="string"?I._`{type: ${D}}`:I._`{type: ${N}}`};function w(D){let N=O(D);(0,U.reportError)(N,M)}$.reportTypeError=w;function O(D){let{gen:N,data:B,schema:T}=D,A=(0,Q.schemaRefOrVal)(D,T,"type");return{gen:N,keyword:"type",data:B,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:D}}}),gu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=L1(),z=v1();function U(Q,J){let{properties:K,items:G}=Q.schema;if(J==="object"&&K)for(let H in K)I(Q,H,K[H].default);else if(J==="array"&&Array.isArray(G))G.forEach((H,W)=>I(Q,W,H.default))}$.assignDefaults=U;function I(Q,J,K){let{gen:G,compositeRule:H,data:W,opts:X}=Q;if(K===void 0)return;let Z=Y._`${W}${(0,Y.getProperty)(J)}`;if(H){(0,z.checkStrictMode)(Q,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(K)}`)}}),I5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=L1(),z=v1(),U=U5(),I=v1();function Q(D,N){let{gen:B,data:T,it:A}=D;B.if(X(B,T,N,A.opts.ownProperties),()=>{D.setParams({missingProperty:Y._`${N}`},!0),D.error()})}$.checkReportMissingProp=Q;function J({gen:D,data:N,it:{opts:B}},T,A){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(D,N,j,B.ownProperties),Y._`${A} = ${j}`)))}$.checkMissingProp=J;function K(D,N){D.setParams({missingProperty:N},!0),D.error()}$.reportMissingProp=K;function G(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(D,N,B){return Y._`${G(D)}.call(${N}, ${B})`}$.isOwnProperty=H;function W(D,N,B,T){let A=Y._`${N}${(0,Y.getProperty)(B)} !== undefined`;return T?Y._`${A} && ${H(D,N,B)}`:A}$.propertyInData=W;function X(D,N,B,T){let A=Y._`${N}${(0,Y.getProperty)(B)} === undefined`;return T?(0,Y.or)(A,(0,Y.not)(H(D,N,B))):A}$.noPropertyInData=X;function Z(D){return D?Object.keys(D).filter((N)=>N!=="__proto__"):[]}$.allSchemaProperties=Z;function q(D,N){return Z(N).filter((B)=>!(0,z.alwaysValidSchema)(D,N[B]))}$.schemaProperties=q;function V({schemaCode:D,data:N,it:{gen:B,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,k,h){let i=h?Y._`${D}, ${N}, ${T}${A}`:N,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${B.object(...c)}`;return k!==Y.nil?Y._`${b}.call(${k}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:D,it:{opts:N}},B){let T=N.unicodeRegExp?"u":"",{regExp:A}=N.code,j=A(B,T);return D.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${A.code==="new RegExp"?F:(0,I.useFunc)(D,A)}(${B}, ${T})`})}$.usePattern=M;function w(D){let{gen:N,data:B,keyword:T,it:A}=D,j=N.name("valid");if(A.allErrors){let b=N.let("valid",!0);return C(()=>N.assign(b,!1)),b}return N.var(j,!0),C(()=>N.break()),j;function C(b){let k=N.const("len",Y._`${B}.length`);N.forRange("i",0,k,(h)=>{D.subschema({keyword:T,dataProp:h,dataPropType:z.Type.Num},j),N.if((0,Y.not)(j),b)})}}$.validateArray=w;function O(D){let{gen:N,schema:B,keyword:T,it:A}=D;if(!Array.isArray(B))throw Error("ajv implementation error");if(B.some((b)=>(0,z.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=N.let("valid",!1),C=N.name("_valid");N.block(()=>B.forEach((b,k)=>{let h=D.subschema({keyword:T,schemaProp:k,compositeRule:!0},C);if(N.assign(j,Y._`${j} || ${C}`),!D.mergeValidEvaluated(h,C) Line truncated
*/ju0=R0(($)=>{var U=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Y=/\\([\u000b\u0020-\u00ff])/g,z=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=Q;function Q(K){if(!K)throw TypeError("argument string is required");var G=typeof K==="object"?J(K):K;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var H=G.indexOf(";"),W=H!==-1?G.slice(0,H).trim():G.trim();if(!z.test(W))throw TypeError("invalid media type");var X=new I(W.toLowerCase());if(H!==-1){var Z,q,V;U.lastIndex=H;while(q=U.exec(G)){if(q.index!==H)throw TypeError("invalid parameter format");if(H+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(Y,"$1")}X.parameters[Z]=V}if(H!==G.length)throw TypeError("invalid parameter format")}return X}function J(K){var G;if(typeof K.getHeader==="function")G=K.getHeader("content-type");else if(typeof K.headers==="object")G=K.headers&&K.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function I(K){this.parameters=Object.create(null),this.type=K}}),cf1=nq(ju0(),1);Eu0=/^[A-Za-z0-9._-]{1,128}$/});function zS($){let U=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return ob0(U),U}var vw,ct,L1,v1,z5,Sw,Su0,nt,pt,hw,gu0,Q5,yu0,ku0,dt,xu0,gw,SQ,qH,gQ,yw,fu0,mt,uu0,bu0,iu0,QS,cu0,JS,lt,nu0,pu0,du0,mu0,lu0,ou0,ru0,su0,IS,au0,tu0,eu0,ot,rt,st,$b0,Ub0,Yb0,KS,zb0,at,Qb0,Jb0,Ib0,Kb0,Gb0,Hb0,Wb0,Xb0,tt,Zb0,et,$e,Ue,qb0,GS,Vb0,Ye,ze,Qe,Lb0,Fb0,Je,wb0,Ob0,Mb0,Ie,Nb0,Db0,Ke,Ab0,Pb0,Bb0,Tb0,jb0,Eb0,Cb0,Rb0,_b0,vb0,hb0,Sb0,gb0,yb0,kb0,xb0,fb0,ub0,bb0,ib0,cb0,nb0,pb0,Ge,db0,mb0,lb0,ob0,kw=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=zS(mb0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let U=bo($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(U==="2020-12")return this.ajv;if(U==="2019-09")return this._ajv2019??=zS(db0.Ajv2019);return this._ajvDraft7??=zS(Ge.Ajv)}getValidator($){let U=this._engineFor($),Y="$id"in $&&typeof $.$id==="string"?U.getSchema($.$id)??U.compile($):U.compile($);return(z)=>{return Y(z)?{valid:!0,data:z,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:U.errorsText(Y.errors)}}}},$u1;var He=o(()=>{lT();oT();vw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var U=class{};$._CodeOrName=U,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Y=class extends U{constructor(w){super();if(!$.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=Y;var z=class extends U{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((M,N)=>`${M}${N}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((M,N)=>{if(N instanceof Y)M[N.str]=(M[N.str]||0)+1;return M},{})}};$._Code=z,$.nil=new z("");function Q(w,...M){let N=[w[0]],D=0;while(D<M.length)K(N,M[D]),N.push(w[++D]);return new z(N)}$._=Q;let J=new z("+");function I(w,...M){let N=[q(w[0])],D=0;while(D<M.length)N.push(J),K(N,M[D]),N.push(J,q(w[++D]));return G(N),new z(N)}$.str=I;function K(w,M){if(M instanceof z)w.push(...M._items);else if(M instanceof Y)w.push(M);else w.push(X(M))}$.addCodeArg=K;function G(w){let M=1;while(M<w.length-1){if(w[M]===J){let N=H(w[M-1],w[M+1]);if(N!==void 0){w.splice(M-1,3,N);continue}w[M++]="+"}M++}}function H(w,M){if(M==='""')return w;if(w==='""')return M;if(typeof w=="string"){if(M instanceof Y||w[w.length-1]!=='"')return;if(typeof M!="string")return`${w.slice(0,-1)}${M}"`;if(M[0]==='"')return w.slice(0,-1)+M.slice(1);return}if(typeof M=="string"&&M[0]==='"'&&!(w instanceof Y))return`"${w}${M.slice(1)}`}function W(w,M){return M.emptyStr()?w:w.emptyStr()?M:I`${w}${M}`}$.strConcat=W;function X(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:q(Array.isArray(w)?w.join(","):w)}function Z(w){return new z(q(w))}$.stringify=Z;function q(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(w){return typeof w=="string"&&$.IDENTIFIER.test(w)?new z(`.${w}`):Q`[${w}]`}$.getProperty=V;function F(w){if(typeof w=="string"&&$.IDENTIFIER.test(w))return new z(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}$.getEsmExportName=F;function O(w){return new z(w.toStringLine truncated
`:""},this._extScope=y,this._scope=new Y.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let U0=this._extScope.value(y,s);return(this._values[U0.prefix]||(this._values[U0.prefix]=new Set)).add(U0),U0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,U0,O0){let E0=this._scope.toName(s);if(U0!==void 0&&O0)this._constants[E0.str]=U0;return this._leafNode(new I(y,E0,U0)),E0}const(y,s,U0){return this._def(Y.varKinds.const,y,s,U0)}let(y,s,U0){return this._def(Y.varKinds.let,y,s,U0)}var(y,s,U0){return this._def(Y.varKinds.var,y,s,U0)}assign(y,s,U0){return this._leafNode(new K(y,s,U0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==U.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[U0,O0]of y){if(s.length>1)s.push(",");if(s.push(U0),U0!==O0||this.opts.es5)s.push(":"),(0,U.addCodeArg)(s,O0)}return s.push("}"),new U._Code(s)}if(y,s,U0){if(this._blockNode(new w(y)),s&&U0)this.code(s).else().code(U0).endIf();else if(s)this.code(s).endIf();else if(U0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new w(y))}else(){return this._elseNode(new O)}endIf(){return this._endBlockNode(w,O)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new N(y),s)}forRange(y,s,U0,O0,E0=this.opts.es5?Y.varKinds.var:Y.varKinds.let){let G0=this._scope.toName(y);return this._for(new D(E0,G0,s,U0),()=>O0(G0))}forOf(y,s,U0,O0=Y.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof U.Name?s:this.var("_arr",s);return this.forRange("_i",0,U._`${G0}.length`,(T0)=>{this.var(E0,U._`${G0}[${T0}]`),U0(E0)})}return this._for(new B("of",O0,E0,s),()=>U0(E0))}forIn(y,s,U0,O0=this.opts.es5?Y.varKinds.var:Y.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,U._`Object.keys(${s})`,U0);let E0=this._scope.toName(y);return this._for(new B("in",O0,E0,s),()=>U0(E0))}endFor(){return this._endBlockNode(M)}label(y){return this._leafNode(new H(y))}break(y){return this._leafNode(new W(y))}return(y){let s=new A;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(y,s,U0){if(!s&&!U0)throw Error('CodeGen: "try" without "catch" and "finally"');let O0=new j;if(this._blockNode(O0),this.code(y),s){let E0=this.name("e");this._currNode=O0.catch=new C(E0),s(E0)}if(U0)this._currNode=O0.finally=new b,this.code(U0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let U0=this._nodes.length-s;if(U0<0||y!==void 0&&U0!==y)throw Error(`CodeGen: wrong number of nodes: ${U0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=U.nil,U0,O0){if(this._blockNode(new T(y,s,U0)),O0)this.code(O0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let U0=this._currNode;if(U0 instanceof y||s&&U0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=x;function h(y,s){for(let U0 in s)y[U0]=(y[U0]||0)+(s[U0]||0);return y}function i(y,s){return s instanceof U._CodeOrName?h(y,s.names):y}function c(y,s,U0){if(y instanceof U.Name)return O0(y);if(!E0(y))return y;return new U._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof U.Name)T0=O0(T0);if(T0 instanceof U._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function O0(G0){let T0=U0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof U._Code&&G0._items.some((T0)=>T0 instanceof U.Name&&s[T0.str]===1&&U0[T0.str]!==void 0)}}function z0(y,s){for(let U0 in s)y[U0]=(y[U0]||0)-(s[U0]||0)}function k(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:U._`!${e(y)}`}$.not=k;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,U0)=>s===U.nil?U0:U0===U.nil?s:U._`${e(s)} ${y} ${e(U0)}`}function Line truncated
|| (${C} == "string" && ${A} && ${A} == +${A})`).assign(b,Q._`+${A}`);return;case"integer":T.elseIf(Q._`${C} === "boolean" || ${A} === null
|| (${C} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(b,Q._`+${A}`);return;case"boolean":T.elseIf(Q._`${A} === "false" || ${A} === 0 || ${A} === null`).assign(b,!1).elseIf(Q._`${A} === "true" || ${A} === 1`).assign(b,!0);return;case"null":T.elseIf(Q._`${A} === "" || ${A} === 0 || ${A} === false`),T.assign(b,null);return;case"array":T.elseIf(Q._`${C} === "string" || ${C} === "number"
|| ${C} === "boolean" || ${A} === null`).assign(b,Q._`[${A}]`)}}}function q({gen:N,parentData:D,parentDataProperty:B},T){N.if(Q._`${D} !== undefined`,()=>N.assign(Q._`${D}[${B}]`,T))}function V(N,D,B,T=I.Correct){let A=T===I.Correct?Q.operators.EQ:Q.operators.NEQ,j;switch(N){case"null":return Q._`${D} ${A} null`;case"array":j=Q._`Array.isArray(${D})`;break;case"object":j=Q._`${D} && typeof ${D} == "object" && !Array.isArray(${D})`;break;case"integer":j=C(Q._`!(${D} % 1) && !isNaN(${D})`);break;case"number":j=C();break;default:return Q._`typeof ${D} ${A} ${N}`}return T===I.Correct?j:(0,Q.not)(j);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${D} == "number"`,b,B?Q._`isFinite(${D})`:Q.nil)}}$.checkDataType=V;function F(N,D,B,T){if(N.length===1)return V(N[0],D,B,T);let A,j=(0,J.toHash)(N);if(j.array&&j.object){let C=Q._`typeof ${D} != "object"`;A=j.null?C:Q._`!${D} || ${C}`,delete j.null,delete j.array,delete j.object}else A=Q.nil;if(j.number)delete j.integer;for(let C in j)A=(0,Q.and)(A,V(C,D,B,T));return A}$.checkDataTypes=F;let O={message:({schema:N})=>`must be ${N}`,params:({schema:N,schemaValue:D})=>typeof N=="string"?Q._`{type: ${N}}`:Q._`{type: ${D}}`};function w(N){let D=M(N);(0,z.reportError)(D,O)}$.reportTypeError=w;function M(N){let{gen:D,data:B,schema:T}=N,A=(0,J.schemaRefOrVal)(N,T,"type");return{gen:D,keyword:"type",data:B,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:N}}}),gu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let U=L1(),Y=v1();function z(J,I){let{properties:K,items:G}=J.schema;if(I==="object"&&K)for(let H in K)Q(J,H,K[H].default);else if(I==="array"&&Array.isArray(G))G.forEach((H,W)=>Q(J,W,H.default))}$.assignDefaults=z;function Q(J,I,K){let{gen:G,compositeRule:H,data:W,opts:X}=J;if(K===void 0)return;let Z=U._`${W}${(0,U.getProperty)(I)}`;if(H){(0,Y.checkStrictMode)(J,`default is ignored for: ${Z}`);return}let q=U._`${Z} === undefined`;if(X.useDefaults==="empty")q=U._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,U._`${Z} = ${(0,U.stringify)(K)}`)}}),Q5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let U=L1(),Y=v1(),z=z5(),Q=v1();function J(N,D){let{gen:B,data:T,it:A}=N;B.if(X(B,T,D,A.opts.ownProperties),()=>{N.setParams({missingProperty:U._`${D}`},!0),N.error()})}$.checkReportMissingProp=J;function I({gen:N,data:D,it:{opts:B}},T,A){return(0,U.or)(...T.map((j)=>(0,U.and)(X(N,D,j,B.ownProperties),U._`${A} = ${j}`)))}$.checkMissingProp=I;function K(N,D){N.setParams({missingProperty:D},!0),N.error()}$.reportMissingProp=K;function G(N){return N.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:U._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(N,D,B){return U._`${G(N)}.call(${D}, ${B})`}$.isOwnProperty=H;function W(N,D,B,T){let A=U._`${D}${(0,U.getProperty)(B)} !== undefined`;return T?U._`${A} && ${H(N,D,B)}`:A}$.propertyInData=W;function X(N,D,B,T){let A=U._`${D}${(0,U.getProperty)(B)} === undefined`;return T?(0,U.or)(A,(0,U.not)(H(N,D,B))):A}$.noPropertyInData=X;function Z(N){return N?Object.keys(N).filter((D)=>D!=="__proto__"):[]}$.allSchemaProperties=Z;function q(N,D){return Z(D).filter((B)=>!(0,Y.alwaysValidSchema)(N,D[B]))}$.schemaProperties=q;function V({schemaCode:N,data:D,it:{gen:B,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,x,h){let i=h?U._`${N}, ${D}, ${T}${A}`:D,c=[[z.default.instancePath,(0,U.strConcat)(z.default.instancePath,j)],[z.default.parentData,C.parentData],[z.default.parentDataProperty,C.parentDataProperty],[z.default.rootData,z.default.rootData]];if(C.opts.dynamicRef)c.push([z.default.dynamicAnchors,z.default.dynamicAnchors]);let z0=U._`${i}, ${B.object(...c)}`;return x!==U.nil?U._`${b}.call(${x}, ${z0})`:U._`${b}(${z0})`}$.callValidateCode=V;let F=U._`new RegExp`;function O({gen:N,it:{opts:D}},B){let T=D.unicodeRegExp?"u":"",{regExp:A}=D.code,j=A(B,T);return N.scopeValue("pattern",{key:j.toString(),ref:j,code:U._`${A.code==="new RegExp"?F:(0,Q.useFunc)(N,A)}(${B}, ${T})`})}$.usePattern=O;function w(N){let{gen:D,data:B,keyword:T,it:A}=N,j=D.name("valid");if(A.allErrors){let b=D.let("valid",!0);return C(()=>D.assign(b,!1)),b}return D.var(j,!0),C(()=>D.break()),j;function C(b){let x=D.const("len",U._`${B}.length`);D.forRange("i",0,x,(h)=>{N.subschema({keyword:T,dataProp:h,dataPropType:Y.Type.Num},j),D.if((0,U.not)(j),b)})}}$.validateArray=w;function M(N){let{gen:D,schema:B,keyword:T,it:A}=N;if(!Array.isArray(B))throw Error("ajv implementation error");if(B.some((b)=>(0,Y.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=D.let("valid",!1),C=D.name("_valid");D.block(()=>B.forEach((b,x)=>{let h=N.subschema({keyword:T,schemaProp:x,compositeRule:!0},C);if(D.assign(j,U._`${j} || ${C}`),!N.mergeValidEvaluated(h,C) Line truncated
missingProperty: ${X},
depsCount: ${H},
deps: ${W}}`};let I={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=Q(G);J(G,H),K(G,W)}};function Q({schema:G}){let H={},W={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?H:W;Z[X]=G[X]}return[H,W]}function J(G,H=G.schema){let{gen:W,data:X,it:Z}=G;if(Object.keys(H).length===0)return;let q=W.let("missing");for(let V in H){let F=H[V];if(F.length===0)continue;let M=(0,U.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else W.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=J;function K(G,H=G.schema){let{gen:W,data:X,keyword:Z,it:q}=G,V=W.name("valid");for(let F in H){if((0,z.alwaysValidSchema)(q,H[F]))continue;W.if((0,U.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=I}),Ub0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:I})=>Y._`{propertyName: ${I.propertyName}}`},code(I){let{gen:Q,schema:J,data:K,it:G}=I;if((0,z.alwaysValidSchema)(G,J))return;let H=Q.name("valid");Q.forIn("key",K,(W)=>{I.setParams({propertyName:W}),I.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),Q.if((0,Y.not)(H),()=>{if(I.error(!0),!G.allErrors)Q.break()})}),I.ok(H)}};$.default=U}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=U5(),I=v1(),Q={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:J})=>z._`{additionalProperty: ${J.additionalProperty}}`},code(J){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=J;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,I.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);w(),J.ok(z._`${X} === ${U.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!M.length)N(T);else K.if(O(T),()=>N(T))})}function O(T){let A;if(F.length>8){let j=(0,I.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)A=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else A=z.nil;if(M.length)A=(0,z.or)(A,...M.map((j)=>z._`${(0,Y.usePattern)(J,j)}.test(${T})`));return(0,z.not)(A)}function D(T){K.code(z._`delete ${W}[${T}]`)}function N(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){D(T);return}if(G===!1){if(J.setParams({additionalProperty:T}),J.error(),!q)K.break();return}if(typeof G=="object"&&!(0,I.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")B(T,A,!1),K.if((0,z.not)(A),()=>{J.reset(),D(T)});else if(B(T,A),!q)K.if((0,z.not)(A),()=>K.break())}}function B(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:I.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});J.subschema(C,A)}}};$.default=Q}),Ib0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=SI(),z=I5(),U=v1(),I=at(),Q={keyword:"properties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=J;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)I.default.code(new Y.KeywordCxt(X,I.default,"additionalProperties"));let Z=(0,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,z.propertyInData)(K,W,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}J.it.definedProperties.add(w),J.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){J.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=Q}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=I5(),z=L1(),U=v1(),I=v1(),Q={keyword:"patternProperties",type:"object",schemaType:"object",code(J){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=J,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((B)=>(0,U.alwaysValidSchema)(X,G[B]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,I.evaluatedPropsToName)(K,X.props);let{props:w}=X;O();function O(){for(let B of q){if(F)D(B);if(X.allErrors) Line truncated
\x00`,k+=O4(j,2),k+=K.magic,k+=O4(M,2),k+=O4(w,2),k+=O4(A.crc32,4),k+=O4(A.compressedSize,4),k+=O4(A.uncompressedSize,4),k+=O4(H.length,2),k+=O4(O.length,2);var h=MO.LOCAL_FILE_HEADER+k+H+O,i=MO.CENTRAL_FILE_HEADER+O4(b,2)+k+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+H+O+Z;return{fileRecord:h,dirRecord:i}},Gr0=function($,Y,z,U,I){var Q="",J=VQ.transformTo("string",I(U));return Q=MO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(J.length,2)+J,Q},Hr0=function($){var Y="";return Y=MO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){LQ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}VQ.inherits(X5,LQ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,LQ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=_50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=_50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:Hr0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y<this.dirRecords.length;Y++)this.push({data:this.dirRecords[Y],meta:{percent:100}});var z=this.bytesWritten-$,U=Gr0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var Y=this;return $.on("data",function(z){Y.processChunk(z)}),$.on("end",function(){if(Y.closedSource(Y.previous.streamInfo),Y._sources.length)Y.prepareNextSource();else Y.end()}),$.on("error",function(z){Y.error(z)}),this};X5.prototype.resume=function(){if(!LQ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var Y=this._sources;if(!LQ.prototype.error.call(this,$))return!1;for(var z=0;z<Y.length;z++)try{Y[z].error($)}catch(U){}return!0};X5.prototype.lock=function(){LQ.prototype.lock.call(this);var $=this._sources;for(var Y=0;Y<$.length;Y++)$[Y].lock()};v50.exports=X5});var S50=E((qr0)=>{var Wr0=fy(),Xr0=h50(),Zr0=function($,Y){var z=$||Y,U=Wr0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};qr0.generateWorker=function($,Y,z){var U=new Xr0(Y.streamFiles,z,Y.platform,Y.encodeFileName),I=0;try{$.forEach(function(Q,J){I++;var K=Zr0(J.options.compression,Y.compression),G=J.options.compressionOptions||Y.compressionOptions||{},H=J.dir,W=J.date;J._compressWorker(K,G).withStreamInfo("file",{name:Q,dir:H,date:W,comment:J.comment||"",unixPermissions:J.unixPermissions,dosPermissions:J.dosPermissions}).pipe(U)}),U.entriesCount=I}catch(Q){U.error(Q)}return U}});var y50=E((np1,g50)=>{var Lr0=c4(),OO=J$();function wW($,Y){OO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}Lr0.inherits(wW,OO);wW.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};wW.prototype.pause=function(){if(!OO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wW.prototype.resume=function(){if(!OO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};g50.exports=wW});var d50=E((pp1,p50)=>{var Fr0=IQ(),MW=c4(),u50=J$(),wr0=pg(),b50=dg(),k50=$O(),Mr0=x80(),Or0=S50(),x50=sH(),Nr0=y50(),i50=function($,Y,z){var U=MW.getTypeOf(Y),I,Q=MW.extend(z||{},b50);if(Q.date=Q.date||new Date,Q.compression!==null)Q.compression=Q.compression.toUpperCase();if(typeof Q.unixPermissions==="string")Q.unixPermissions=parseInt(Q.unixPermissions,8);if(Q.unixPermissions&&Q.unixPermissions&16384)Q.dir=!0;if(Q.dosPermissions&&Q.dosPermission Line truncated
`)}openNode($,Y){let z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),Dk(U,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)y30(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Dk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(g30.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("</"),Y.push($),Y.push(">");this.open=!1,this.leaf=!1}leafNode($,Y,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}Ak.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};k30.exports=Ak});var Pk=E((Xt0)=>{var x30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Wt0($){if(typeof $==="string")return $;if(x30)return x30.decode($);return $.toString()}Xt0.bufferToString=Wt0});var c30=E((u30)=>{Object.defineProperty(u30,"__esModule",{value:!0});u30.CHAR=`
deps: ${W}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=J(G);I(G,H),K(G,W)}};function J({schema:G}){let H={},W={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?H:W;Z[X]=G[X]}return[H,W]}function I(G,H=G.schema){let{gen:W,data:X,it:Z}=G;if(Object.keys(H).length===0)return;let q=W.let("missing");for(let V in H){let F=H[V];if(F.length===0)continue;let O=(0,z.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(O,()=>{for(let w of F)(0,z.checkReportMissingProp)(G,w)});else W.if(U._`${O} && (${(0,z.checkMissingProp)(G,F,q)})`),(0,z.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=I;function K(G,H=G.schema){let{gen:W,data:X,keyword:Z,it:q}=G,V=W.name("valid");for(let F in H){if((0,Y.alwaysValidSchema)(q,H[F]))continue;W.if((0,z.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let O=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(O,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=L1(),Y=v1(),z={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>U._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q;if((0,Y.alwaysValidSchema)(G,I))return;let H=J.name("valid");J.forIn("key",K,(W)=>{Q.setParams({propertyName:W}),Q.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),J.if((0,U.not)(H),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(H)}};$.default=z}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=L1(),z=z5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>Y._`{additionalProperty: ${I.additionalProperty}}`},code(I){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=I;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,U.allSchemaProperties)(H.properties),O=(0,U.allSchemaProperties)(H.patternProperties);w(),I.ok(Y._`${X} === ${z.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!O.length)D(T);else K.if(M(T),()=>D(T))})}function M(T){let A;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,H.properties,"properties");A=(0,U.isOwnProperty)(K,j,T)}else if(F.length)A=(0,Y.or)(...F.map((j)=>Y._`${T} === ${j}`));else A=Y.nil;if(O.length)A=(0,Y.or)(A,...O.map((j)=>Y._`${(0,U.usePattern)(I,j)}.test(${T})`));return(0,Y.not)(A)}function N(T){K.code(Y._`delete ${W}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){N(T);return}if(G===!1){if(I.setParams({additionalProperty:T}),I.error(),!q)K.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")B(T,A,!1),K.if((0,Y.not)(A),()=>{I.reset(),N(T)});else if(B(T,A),!q)K.if((0,Y.not)(A),()=>K.break())}}function B(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,A)}}};$.default=J}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=SQ(),Y=Q5(),z=v1(),Q=at(),J={keyword:"properties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=I;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)Q.default.code(new U.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,Y.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=z.mergeEvaluated.props(K,(0,z.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,z.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))O(w);else{if(K.if((0,Y.propertyInData)(K,W,w,X.opts.ownProperties)),O(w),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(w),I.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function O(w){I.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let U=Q5(),Y=L1(),z=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=I,{opts:Z}=X,q=(0,U.allSchemaProperties)(G),V=q.filter((B)=>(0,z.alwaysValidSchema)(X,G[B]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,O=K.name("valid");if(X.props!==!0&&!(X.props instanceof Y.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:w}=X;M();function M(){for(let B of q){if(F)N(B);if(X.allErrors) Line truncated
\x00`,x+=M4(j,2),x+=K.magic,x+=M4(O,2),x+=M4(w,2),x+=M4(A.crc32,4),x+=M4(A.compressedSize,4),x+=M4(A.uncompressedSize,4),x+=M4(H.length,2),x+=M4(M.length,2);var h=OM.LOCAL_FILE_HEADER+x+H+M,i=OM.CENTRAL_FILE_HEADER+M4(b,2)+x+M4(Z.length,2)+"\x00\x00\x00\x00"+M4(C,4)+M4(z,4)+H+M+Z;return{fileRecord:h,dirRecord:i}},Gr0=function($,U,Y,z,Q){var J="",I=VJ.transformTo("string",Q(z));return J=OM.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+M4($,2)+M4($,2)+M4(U,4)+M4(Y,4)+M4(I.length,2)+I,J},Hr0=function($){var U="";return U=OM.DATA_DESCRIPTOR+M4($.crc32,4)+M4($.compressedSize,4)+M4($.uncompressedSize,4),U};function X5($,U,Y,z){LJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=U,this.zipPlatform=Y,this.encodeFileName=z,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}VJ.inherits(X5,LJ);X5.prototype.push=function($){var U=$.meta.percent||0,Y=this.entriesCount,z=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,LJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:Y?(U+100*(Y-z-1))/Y:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var U=this.streamFiles&&!$.file.dir;if(U){var Y=_50($,U,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Y.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var U=this.streamFiles&&!$.file.dir,Y=_50($,U,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(Y.dirRecord),U)this.push({data:Hr0($),meta:{percent:100}});else{this.push({data:Y.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var U=0;U<this.dirRecords.length;U++)this.push({data:this.dirRecords[U],meta:{percent:100}});var Y=this.bytesWritten-$,z=Gr0(this.dirRecords.length,Y,$,this.zipComment,this.encodeFileName);this.push({data:z,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var U=this;return $.on("data",function(Y){U.processChunk(Y)}),$.on("end",function(){if(U.closedSource(U.previous.streamInfo),U._sources.length)U.prepareNextSource();else U.end()}),$.on("error",function(Y){U.error(Y)}),this};X5.prototype.resume=function(){if(!LJ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var U=this._sources;if(!LJ.prototype.error.call(this,$))return!1;for(var Y=0;Y<U.length;Y++)try{U[Y].error($)}catch(z){}return!0};X5.prototype.lock=function(){LJ.prototype.lock.call(this);var $=this._sources;for(var U=0;U<$.length;U++)$[U].lock()};v50.exports=X5});var S50=E((qr0)=>{var Wr0=fy(),Xr0=h50(),Zr0=function($,U){var Y=$||U,z=Wr0[Y];if(!z)throw Error(Y+" is not a valid compression method !");return z};qr0.generateWorker=function($,U,Y){var z=new Xr0(U.streamFiles,Y,U.platform,U.encodeFileName),Q=0;try{$.forEach(function(J,I){Q++;var K=Zr0(I.options.compression,U.compression),G=I.options.compressionOptions||U.compressionOptions||{},H=I.dir,W=I.date;I._compressWorker(K,G).withStreamInfo("file",{name:J,dir:H,date:W,comment:I.comment||"",unixPermissions:I.unixPermissions,dosPermissions:I.dosPermissions}).pipe(z)}),z.entriesCount=Q}catch(J){z.error(J)}return z}});var y50=E((pp1,g50)=>{var Lr0=c4(),MM=I$();function wW($,U){MM.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(U)}Lr0.inherits(wW,MM);wW.prototype._bindStream=function($){var U=this;this._stream=$,$.pause(),$.on("data",function(Y){U.push({data:Y,meta:{percent:0}})}).on("error",function(Y){if(U.isPaused)this.generatedError=Y;else U.error(Y)}).on("end",function(){if(U.isPaused)U._upstreamEnded=!0;else U.end()})};wW.prototype.pause=function(){if(!MM.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wW.prototype.resume=function(){if(!MM.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};g50.exports=wW});var d50=E((dp1,p50)=>{var Fr0=QJ(),OW=c4(),u50=I$(),wr0=pg(),b50=dg(),k50=$M(),Or0=x80(),Mr0=S50(),x50=sH(),Nr0=y50(),i50=function($,U,Y){var z=OW.getTypeOf(U),Q,J=OW.extend(Y||{},b50);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermission Line truncated
`)}openNode($,U){let Y=this.tos,z=this._xml;if(Y&&this.open)z.push(">");this._stack.push($),z.push("<"),z.push($),Dk(z,U),this.leaf=!0,this.open=!0}addAttribute($,U){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(U!==void 0)y30(this._xml,$,U)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Dk(this._xml,$)}writeText($){let U=this._xml;if(this.open)U.push(">"),this.open=!1;this.leaf=!1,U.push(g30.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),U=this._xml;if(this.leaf)U.push("/>");else U.push("</"),U.push($),U.push(">");this.open=!1,this.leaf=!1}leafNode($,U,Y){if(this.openNode($,U),Y!==void 0)this.writeText(Y);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}Ak.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};k30.exports=Ak});var Pk=E((Xt0)=>{var x30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Wt0($){if(typeof $==="string")return $;if(x30)return x30.decode($);return $.toString()}Xt0.bufferToString=Wt0});var c30=E((u30)=>{Object.defineProperty(u30,"__esModule",{value:!0});u30.CHAR=`
\r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;u30.S=` \r
`;u30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";u30.NAME_CHAR="-"+u30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";u30.CHAR_RE=new RegExp("^["+u30.CHAR+"]$","u");u30.S_RE=new RegExp("^["+u30.S+"]+$","u");u30.NAME_START_CHAR_RE=new RegExp("^["+u30.NAME_START_CHAR+"]$","u");u30.NAME_CHAR_RE=new RegExp("^["+u30.NAME_CHAR+"]$","u");u30.NAME_RE=new RegExp("^["+u30.NAME_START_CHAR+"]["+u30.NAME_CHAR+"]*$","u");u30.NMTOKEN_RE=new RegExp("^["+u30.NAME_CHAR+"]+$","u");var Bk=9,Tk=10,jk=13,Ek=32;u30.S_LIST=[Ek,Tk,jk,Bk];function qt0($){return $>=Ek&&$<=55295||$===Tk||$===jk||$===Bk||$>=57344&&$<=65533||$>=65536&&$<=1114111}u30.isChar=qt0;function Vt0($){return $===Ek||$===Tk||$===jk||$===Bk}u30.isS=Vt0;function f30($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}u30.isNameStartChar=f30;function Lt0($){return f30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}u30.isNameChar=Lt0});var t30=E((o30)=>{Object.defineProperty(o30,"__esModule",{value:!0});o30.CHAR="\x01-퟿-�\uD800\uDC00-\uDBFF\uDFFF";o30.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F-„†-Ÿ";o30.S=` \r
`;o30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";o30.NAME_CHAR="-"+o30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";o30.CHAR_RE=new RegExp("^["+o30.CHAR+"]$","u");o30.RESTRICTED_CHAR_RE=new RegExp("^["+o30.RESTRICTED_CHAR+"]$","u");o30.S_RE=new RegExp("^["+o30.S+"]+$","u");o30.NAME_START_CHAR_RE=new RegExp("^["+o30.NAME_START_CHAR+"]$","u");o30.NAME_CHAR_RE=new RegExp("^["+o30.NAME_CHAR+"]$","u");o30.NAME_RE=new RegExp("^["+o30.NAME_START_CHAR+"]["+o30.NAME_CHAR+"]*$","u");o30.NMTOKEN_RE=new RegExp("^["+o30.NAME_CHAR+"]+$","u");var n30=9,p30=10,d30=13,m30=32;o30.S_LIST=[m30,p30,d30,n30];function Et0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}o30.isChar=Et0;function Ct0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}o30.isRestrictedChar=Ct0;function Rt0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}o30.isCharAndNotRestricted=Rt0;function _t0($){return $===m30||$===p30||$===d30||$===n30}o30.isS=_t0;function l30($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}o30.isNameStartChar=l30;function vt0($){return l30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}o30.isNameChar=vt0});var Y70=E(($70)=>{Object.defineProperty($70,"__esModule",{value:!0});$70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";$70.NC_NAME_CHAR="-"+$70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";$70.NC_NAME_START_CHAR_RE=new RegExp("^["+$70.NC_NAME_START_CHAR+"]$","u");$70.NC_NAME_CHAR_RE=new RegExp("^["+$70.NC_NAME_CHAR+"]$","u");$70.NC_NAME_RE=new RegExp("^["+$70.NC_NAME_START_CHAR+"]["+$70.NC_NAME_CHAR+"]*$","u");function e30($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}$70.isNCNameStartChar=e30;function mt0($){return e30($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}$70.isNCNameChar=mt0});var P70=E((A70)=>{Object.defineProperty(A70,"__esModule",{value:!0});var EQ=c30(),tt0=t30(),ik=Y70(),p8=EQ.isS,et0=EQ.isChar,vW=EQ.isNameStartChar,z70=EQ.isNameChar,F70=EQ.S_LIST,$e0=EQ.NAME_RE,Ye0=tt0.isChar,ze0=ik.isNCNameStartChar,Ue0=ik.isNCNameChar,Ie0=ik.NC_NAME_RE,oO="http://www.w3.org/XML/1998/namespace",jQ="http://www.w3.org/2000/xmlns/",Qe0={__proto__:null,xml:oO,xmlns:jQ},Je0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,Q9=-2,U70=0,Ke0=1,Rk=2,Ge0=3,PQ=4,He0=5,We0=6,Xe0=7,_k=8,Ze0=9,qe0=10,Ve0=11,Le0=12,C8=13,nO=14,vk=15,Fe0=16,hk=17,we0=18,Me0=19,Sk=20,Oe0=21,Ne0=22,De0=23,I70=24,gk=25,pO=26,Q70=27,Ae0=28,Pe0=29,J70=30,Be0=31,Te0=32,Gz=33,je0=34,yk=35,hW=36,kk=37,Ee0=38,K70=39,G70=40,Ce0=41,H70=42,Re0=43,_e0=44,xk=9,q5=10,fk=13,W70=32,X70=33,w70=34,SW=38,M70=39,dO=45,mO=47,ve0=59,r7=60,BQ=61,B6=62,o6=63,O70=91,TQ=93,Z70=133,q70=8232,lO=($)=>$===w70||$===M70,N70=[w70,M70],he0=[...N70,O70,B6],Se0=[...N70,r7,TQ],ge0=[BQ,o6,...F70],ye0=[...F70,B6,SW,r7];function bk($,Y,z){switch(Y){case"xml":if(z!==oO)$.fail(`xml prefix must be bound to ${oO}.`);break;case"xmlns":if(z!==jQ)$.fail(`xmlns prefix must be bound to ${jQ}.`);break;default:}switch(z){case jQ:$.fail(Y===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${jQ}.`);break;case oO:switch(Y){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function ke0($,Y){for(let z of Object.keys(Y))bk($,z,Y[z])}var xe0=($)=>Ie0.test($),fe0=($)=>$e0.test($),Hz=0,V70=1,uk=2;A70.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var L70={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class D70{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let Y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,Y){this.nameStartCheck=ze0,this.nameCheck=Ue0,this.isName=xe0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Qe0);let z=this.opt.additionalNamesp Line truncated
`,Y=this.i}}captureToChar($){let{i:Y}=this,{chunk:z}=this;while(!0){let U=this.getCode();switch(U){case Q9:this.text+=`${z.slice(Y,this.prevI)}
`,Y=this.i,U=q5;break;case k4:return this.text+=z.slice(Y),!1;default:}if(U===$)return this.text+=z.slice(Y,this.prevI),!0}}captureNameChars(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCode();if(z===k4)return this.name+=$.slice(Y),k4;if(!z70(z))return this.name+=$.slice(Y,this.prevI),z===Q9?q5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!p8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=et0,this.getCode=this.getCode10;else this.isChar=Ye0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Ke0}sBeginWhitespace(){let $=this.i,Y=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(Y){case r7:if(this.state=vk,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let Y=this.captureTo(he0);switch(Y){case B6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(Y),Y===O70)this.state=PQ;else if(lO(Y))this.state=Ge0,this.q=Y}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Rk}sDTD(){let $=this.captureTo(Se0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===TQ)this.state=Rk;else if($===r7)this.state=We0;else if(lO($))this.state=He0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=PQ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case X70:this.state=Xe0,this.openWakaBang="";break;case o6:this.state=Ve0;break;default:this.state=PQ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),Y=this.openWakaBang+=$;if(this.text+=$,Y!=="-")this.state=Y==="--"?_k:PQ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(dO))this.text+="-",this.state=Ze0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===dO?qe0:_k}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===B6)this.state=PQ;else this.fail("malformed comment."),this.state=_k}sDTDPI(){if(this.captureToChar(o6))this.text+="?",this.state=Le0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===B6)this.state=PQ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:Y}=this;$:while(!0)switch(this.getCode()){case Q9:this.entity+=`${Y.slice($,this.prevI)}
`,$=this.i;break;case ve0:{let{entityReturnState:z}=this,U=this.entity+Y.slice($,this.prevI);this.state=z;let I;if(U==="")this.fail("empty entity name."),I="&;";else I=this.parseEntity(U),this.entity="";if(z!==C8||this.textHandler!==void 0)this.text+=I;break $}case k4:this.entity+=Y.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(vW($))this.state=je0,this.unget(),this.xmlDeclPossible=!1;else switch($){case mO:this.state=Re0,this.xmlDeclPossible=!1;break;case X70:this.state=Fe0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case o6:this.state=De0;break;default:this.fail("disallowed character in tag name"),this.state=C8,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=Sk,this.openWakaBang="";break;case"--":this.state=hk,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Rk,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(dO))this.state=we0}sCommentEnding(){var $;let Y=this.getCodeNorm();if(Y===dO)this.state=Me0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(Y)}`,this.state=hk}sCommentEnded(){let $=this.getCodeNorm();if($!==B6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=hk;else this.state=C8}sCData(){if(this.captureToChar(TQ))this.state=Oe0}sCDataEnding(){let $=this.getCodeNorm();if($===TQ)this.state=Ne0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Sk}sCDataEnding2(){var $;let Y=this.getCodeNorm();switch(Y){case B6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case TQ:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(Y)}`,this.state=Sk}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=I70;else if($===o6||p8($))this.fail("processing instruction without a target."),this.state=$===o6?pO:gk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=I70}sPIRest(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCodeNorm();if(z===k4){this.piTarget+=$.slice(Y);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(Y,this.prevI);let U=z===o6;if(U||p8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?Gz:Q70}else this.state=U?pO:gk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===o6)this.state=pO;else if(!p8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(o6))this.state=pO}sPIEnding(){var $;let Y=this.getCodeNorm();if(Y===B6){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(Y===o6)this.text+="?";else this.text+=`?${String.fromCodePoint(Y)}`,this.state=gk;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===o6){this.state=Gz;return}if($!==k4)this.state=Ae0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(ge0);if($===o6){this.state=Gz,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p8($)||$===BQ))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===BQ?J70:Pe0}sXMLDeclEq(){let $=this.getCodeNorm();if($===o6){this.state=Gz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if($!==BQ)this.fail("value required.");this.state=J70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===o6){this.state=Gz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if(!lO($))this.fail("value must be quoted."),this.q=W70;else this.q=$;this.state=Be0}sXMLDeclValue(){let $=this.captureTo([this.q,o6]);if($===o6){this.state=Gz,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let Y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=Y;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver Line truncated
`;$=this.i,Y=Hz;break;case k4:if(U!==void 0)this.text+=z.slice($);break $;default:Y=Hz}this.forbiddenState=Y}handleTextOutsideRoot(){let{i:$}=this,{chunk:Y,textHandler:z}=this,U=!1;$:while(!0){let I=this.getCode();switch(I){case r7:{if(this.state=vk,z!==void 0){let{text:Q}=this,J=Y.slice($,this.prevI);if(Q.length!==0)z(Q+J),this.text="";else if(J.length!==0)z(J)}break $}case SW:if(this.state=nO,this.entityReturnState=C8,z!==void 0)this.text+=Y.slice($,this.prevI);U=!0;break $;case Q9:if(z!==void 0)this.text+=`${Y.slice($,this.prevI)}
`;$=this.i;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:if(!p8(I))U=!0}}if(!U)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,Y){var z;let{prefix:U,local:I}=this.qname($),Q={name:$,prefix:U,local:I,value:Y};if(this.attribList.push(Q),(z=this.attributeHandler)===null||z===void 0||z.call(this,Q),U==="xmlns"){let J=Y.trim();if(this.currentXMLVersion==="1.0"&&J==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[I]=J,bk(this,I,J)}else if($==="xmlns"){let J=Y.trim();this.topNS[""]=J,bk(this,"",J)}}pushAttribPlain($,Y){var z;let U={name:$,value:Y};this.attribList.push(U),(z=this.attributeHandler)===null||z===void 0||z.call(this,U)}end(){var $,Y;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let I=z.pop();this.fail(`unclosed tag: ${I.name}`)}if(this.state!==U70&&this.state!==C8)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(Y=this.endHandler)===null||Y===void 0||Y.call(this),this._init(),this}resolve($){var Y,z;let U=this.topNS[$];if(U!==void 0)return U;let{tags:I}=this;for(let Q=I.length-1;Q>=0;Q--)if(U=I[Q].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(z=(Y=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(Y,$)}qname($){let Y=$.indexOf(":");if(Y===-1)return{prefix:"",local:$};let z=$.slice(Y+1),U=$.slice(0,Y);if(U===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:z}}processAttribsNS(){var $;let{attribList:Y}=this,z=this.tag;{let{prefix:Q,local:J}=this.qname(z.name);z.prefix=Q,z.local=J;let K=z.uri=($=this.resolve(Q))!==null&&$!==void 0?$:"";if(Q!==""){if(Q==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(Q)}.`),z.uri=Q}}if(Y.length===0)return;let{attributes:U}=z,I=new Set;for(let Q of Y){let{name:J,prefix:K,local:G}=Q,H,W;if(K==="")H=J==="xmlns"?jQ:"",W=J;else{if(H=this.resolve(K),H===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),H=K;W=`{${H}}${G}`}if(I.has(W))this.fail(`duplicate attribute: ${W}.`);I.add(W),Q.uri=H,U[J]=Q}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,Y=this.tag.attributes;for(let{name:z,value:U}of $){if(Y[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);Y[z]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:Y}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),Y.push(z),this.state=C8,this.name=""}openSelfClosingTag(){var $,Y,z;this.processAttribs();let{tags:U}=this,I=this.tag;if(I.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,I),(Y=this.closeTagHandler)===null||Y===void 0||Y.call(this,I),(this.tag=(z=U[U.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:Y}=this;if(this.state=C8,this.name="",Y===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,U=$.length;while(U-- >0){let I=this.tag=$.pop();if(this.topNS=I.ns,z===null||z===void 0||z(I),I.name===Y)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${Y}.`),this.text+=`</${Y}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let Y=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))Y=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))Y=parseInt($.slice(1),10);if(!this.isChar(Y))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(Y)}}A70.SaxesParser=D70});var gW=E((Ed1,B70)=>{var{SaxesParser:ie0}=P70(),{PassThrough:ce0}=E8(),{bufferToString:ne0}=Pk();B70.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new ce0);let Y=new ie0,z;Y.on("error",(I)=>{z=I});let U=[];Y.on("opentag",(I)=>U.push({eventType:"opentag",value:I})),Y.on("text",(I)=>U.push({eventType:"text",value:I})),Y.on("closetag",(I)=>U.push({eventType:"closetag",value:I}));for await(let I of $){if(Y.write(ne0(I)),z)throw z;yield U,U=[]}}});var g0=E((Cd1,T70)=>{var pe0=gW(),de0=l6();class CQ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,Y){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof CQ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let Y of $)for(let{eventType:z,value:U}of Y)if(z==="opentag")this.parseOpen(U);else if(z==="text")this.parseText(U);else if(z==="closetag"){if(!this.parseClose(U.name))return thLine truncated
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((Y=$.writeHeaders)!==null&&Y!==void 0?Y:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}YJ0.FormatterOptions=$J0});var EN=E((el1,JJ0)=>{var Y51="[object AsyncFunction]",z51="[object Function]",U51="[object GeneratorFunction]",I51="[object Null]",Q51="[object Proxy]",J51="[object Undefined]",K51=typeof global=="object"&&global&&global.Object===Object&&global,G51=typeof self=="object"&&self&&self.Object===Object&&self,H51=K51||G51||Function("return this")(),IJ0=Object.prototype,W51=IJ0.hasOwnProperty,QJ0=IJ0.toString,UJ0=H51.Symbol,Fz=UJ0?UJ0.toStringTag:void 0;function X51($){if($==null)return $===void 0?J51:I51;return Fz&&Fz in Object($)?Z51($):q51($)}function Z51($){var Y=W51.call($,Fz),z=$[Fz];try{$[Fz]=void 0;var U=!0}catch(Q){}var I=QJ0.call($);if(U)if(Y)$[Fz]=z;else delete $[Fz];return I}function q51($){return QJ0.call($)}function V51($){if(!L51($))return!1;var Y=X51($);return Y==z51||Y==U51||Y==Y51||Y==Q51}function L51($){var Y=typeof $;return $!=null&&(Y=="object"||Y=="function")}JJ0.exports=V51});var iJ0=E((CN,fQ)=>{var F51=200,Wf="__lodash_hash_undefined__",kN=1,MJ0=2,OJ0=9007199254740991,RN="[object Arguments]",Uf="[object Array]",w51="[object AsyncFunction]",NJ0="[object Boolean]",DJ0="[object Date]",AJ0="[object Error]",PJ0="[object Function]",M51="[object GeneratorFunction]",_N="[object Map]",BJ0="[object Number]",O51="[object Null]",xQ="[object Object]",KJ0="[object Promise]",N51="[object Proxy]",TJ0="[object RegExp]",vN="[object Set]",jJ0="[object String]",D51="[object Symbol]",A51="[object Undefined]",If="[object WeakMap]",EJ0="[object ArrayBuffer]",hN="[object DataView]",P51="[object Float32Array]",B51="[object Float64Array]",T51="[object Int8Array]",j51="[object Int16Array]",E51="[object Int32Array]",C51="[object Uint8Array]",R51="[object Uint8ClampedArray]",_51="[object Uint16Array]",v51="[object Uint32Array]",h51=/[\\^$.*+?()[\]{}|]/g,S51=/^\[object .+?Constructor\]$/,g51=/^(?:0|[1-9]\d*)$/,B4={};B4[P51]=B4[B51]=B4[T51]=B4[j51]=B4[E51]=B4[C51]=B4[R51]=B4[_51]=B4[v51]=!0;B4[RN]=B4[Uf]=B4[EJ0]=B4[NJ0]=B4[hN]=B4[DJ0]=B4[AJ0]=B4[PJ0]=B4[_N]=B4[BJ0]=B4[xQ]=B4[TJ0]=B4[vN]=B4[jJ0]=B4[If]=!1;var CJ0=typeof global=="object"&&global&&global.Object===Object&&global,y51=typeof self=="object"&&self&&self.Object===Object&&self,Z3=CJ0||y51||Function("return this")(),RJ0=typeof CN=="object"&&CN&&!CN.nodeType&&CN,GJ0=RJ0&&typeof fQ=="object"&&fQ&&!fQ.nodeType&&fQ,_J0=GJ0&&GJ0.exports===RJ0,$f=_J0&&CJ0.process,HJ0=function(){try{return $f&&$f.binding&&$f.binding("util")}catch($){}}(),WJ0=HJ0&&HJ0.isTypedArray;function k51($,Y){var z=-1,U=$==null?0:$.length,I=0,Q=[];while(++z<U){var J=$[z];if(Y(J,z,$))Q[I++]=J}return Q}function x51($,Y){var z=-1,U=Y.length,I=$.length;while(++z<U)$[I+z]=Y[z];return $}function f51($,Y){var z=-1,U=$==null?0:$.length;while(++z<U)if(Y($[z],z,$))return!0;return!1}function u51($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}function b51($){return function(Y){return $(Y)}}function i51($,Y){return $.has(Y)}function c51($,Y){return $==null?void 0:$[Y]}function n51($){var Y=-1,z=Array($.size);return $.forEach(function(U,I){z[++Y]=[I,U]}),z}function p51($,Y){return function(z){return $(Y(z))}}function d51($){var Y=-1,z=Array($.size);return $.forEach(function(U){z[++Y]=U}),z}var m51=Array.prototype,l51=Function.prototype,xN=Object.prototype,Yf=Z3["__core-js_shared__"],vJ0=l51.toString,K9=xN.hasOwnProperty,XJ0=function(){var $=/[^.]+$/.exec(Yf&&Yf.keys&&Yf.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),hJ0=xN.toString,o51=RegExp("^"+vJ0.call(K9).replace(h51,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ZJ0=_J0?Z3.Buffer:void 0,SN=Z3.Symbol,qJ0=Z3.Uint8Array,SJ0=xN.propertyIsEnumerable,r51=m51.splice,wz=SN?SN.toStringTag:void 0,VJ0=Object.getOwnPropertySymbols,s51=ZJ0?ZJ0.isBuffer:void 0,a51=p51(Object.keys,Object),Qf=uQ(Z3,"DataView"),iW=uQ(Z3,"Map"),Jf=uQ(Z3,"Promise"),Kf=uQ(Z3,"Set"),Gf=uQ(Z3,"WeakMap"),cW=uQ(Object,"create"),t51=Nz(Qf),e51=Nz(iW),$91=Nz(Jf),Y91=Nz(Kf),z91=Nz(Gf),LJ0=SN?SN.prototype:void 0,zf=LJ0?LJ0.valueOf:void 0;function Mz($){var Y=-1,z=$==null?0:$.length;this.clear();while(++Y<z){var U=$[Y];this.set(U[0],U[1])}}function U91(){this.__data__=cW?cW(null):{},this.size=0}function I91($){var Y=this.has($)&&delete this.__data__[$];return this.size-=Y?1:0,Y}function Q91($){var Y=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(Y)}set headers($){this._headers=$}shouldQuote($,Y){let z=Y?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(X31.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,Y,z){let U=`${Z31.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:I}=this;if(I.quote!==""){if(U.indexOf(I.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,I.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(Y,z))return this.quoteField(U);return U}quoteField($){let{quote:Y}=this.formatterOptions;return`${Y}${$}${Y}`}}bQ.FieldFormatter=sJ0});var Lf=E((aJ0)=>{Object.defineProperty(aJ0,"__esModule",{value:!0});aJ0.isSyncTransform=void 0;aJ0.isSyncTransform=($)=>$.length===1});var $K0=E((iQ)=>{var eJ0=iQ&&iQ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(iQ,"__esModule",{value:!0});iQ.RowFormatter=void 0;var V31=eJ0(EN()),L31=eJ0(iJ0()),F31=Vf(),w31=Lf();class Dz{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new F31.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(Dz.isRowHashArray($))return $.map((Y)=>Y[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(w31.isSyncTransform($))return(Y,z)=>{let U=null;try{U=$(Y)}catch(I){return z(I)}return z(null,U)};return(Y,z)=>{$(Y,z)}}set rowTransform($){if(!V31.default($))throw TypeError("The transform should be a function");this._rowTransform=Dz.createTransform($)}format($,Y){this.callTransformer($,(z,U)=>{if(z)return Y(z);if(!$)return Y(null);let I=[];if(U){let{shouldFormatColumns:Q,headers:J}=this.checkHeaders(U);if(this.shouldWriteHeaders&&J&&!this.hasWrittenHeaders)I.push(this.formatColumns(J,!0)),this.hasWrittenHeaders=!0;if(Q){let K=this.gatherColumns(U);I.push(this.formatColumns(K,!1))}}return Y(null,I)})}finish($){let Y=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));Y.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)Y.push(this.formatterOptions.rowDelimiter);return $(null,Y)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let Y=Dz.gatherHeaders($);if(this.headers=Y,this.fieldFormatter.headers=Y,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!L31.default(Y,$),headers:Y}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((Y)=>$[Y]);if(Dz.isRowHashArray($))return this.headers.map((Y,z)=>{let U=$[z];if(U)return U[1];return""});if(Dz.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((Y,z)=>$[z])}callTransformer($,Y){if(!this._rowTransform)return Y(null,$);return this._rowTransform($,Y)}formatColumns($,Y){let z=$.map((I,Q)=>this.fieldFormatter.format(I,Q,Y)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,z].join("");return z}}iQ.RowFormatter=Dz});var YK0=E((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});bN.FieldFormatter=bN.RowFormatter=void 0;var M31=$K0();Object.defineProperty(bN,"RowFormatter",{enumerable:!0,get:function(){return M31.RowFormatter}});var O31=Vf();Object.defineProperty(bN,"FieldFormatter",{enumerable:!0,get:function(){return O31.FieldFormatter}})});var Ff=E((UK0)=>{Object.defineProperty(UK0,"__esModule",{value:!0});UK0.CsvFormatterStream=void 0;var D31=J0("stream"),A31=YK0();class zK0 extends D31.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new A31.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,Y,z){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(I,Q)=>{if(I)return U=!0,z(I);if(Q)Q.forEach((J)=>{this.push(Buffer.from(J,"utf8"))});return U=!0,z()})}catch(I){if(U)throw I;z(I)}}_flush($){this.rowFormatter.finish((Y,z)=>{if(Y)return $(Y);if(z)z.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}UK0.CsvFormatterStream=zK0});var JK0=E((s1)=>{var QK0=s1&&s1.__createBinding||(Object.create?function($,Y,z,U){if(U===void 0)U=z;Object.defineProperty($,U,{enumerable:!0,get:function(){return Y[z]}})}:function($,Y,z,U){if(U===void 0)U=z;$[U]=Y[z]}),P31=s1&&s1.__setModuleDefault||(Object.create?function($,Y){O Line truncated
`||Y===`\r
`}static isTokenCarriageReturn($,Y){return $.token===Y.carriageReturn}static isTokenComment($,Y){return Y.supportsComments&&!!$&&$.token===Y.comment}static isTokenEscapeCharacter($,Y){return $.token===Y.escapeChar}static isTokenQuote($,Y){return $.token===Y.quote}static isTokenDelimiter($,Y){return $.token===Y.delimiter}}KG0.Token=JG0});var bf=E((XG0)=>{Object.defineProperty(XG0,"__esModule",{value:!0});XG0.Scanner=void 0;var HG0=J2(),vY1=/((?:\r\n)|\n|\r)/;class WG0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,Y=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(Y)===-1)return null;let z=Y.exec($);if(z==null)return null;let U=z[1],I=this.cursor+(z.index||0);return new HG0.Token({token:U,startCursor:I,endCursor:I+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:Y}=this;if(Y<=$)return null;return new HG0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=vY1.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}XG0.Scanner=WG0});var HD=E((VG0)=>{Object.defineProperty(VG0,"__esModule",{value:!0});VG0.ColumnFormatter=void 0;class qG0{constructor($){if($.trim)this.format=(Y)=>Y.trim();else if($.ltrim)this.format=(Y)=>Y.trimLeft();else if($.rtrim)this.format=(Y)=>Y.trimRight();else this.format=(Y)=>Y}}VG0.ColumnFormatter=qG0});var cf=E((MG0)=>{Object.defineProperty(MG0,"__esModule",{value:!0});MG0.NonQuotedColumnParser=void 0;var hY1=HD(),FG0=J2();class wG0{constructor($){this.parserOptions=$,this.columnFormatter=new hY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:Y}=this,z=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(FG0.Token.isTokenDelimiter(U,Y)||FG0.Token.isTokenRowDelimiter(U))break;z.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(z.join(""))}}MG0.NonQuotedColumnParser=wG0});var nf=E((DG0)=>{Object.defineProperty(DG0,"__esModule",{value:!0});DG0.QuotedColumnParser=void 0;var SY1=HD(),tQ=J2();class NG0{constructor($){this.parserOptions=$,this.columnFormatter=new SY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let Y=$.cursor,{foundClosingQuote:z,col:U}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(Y),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:Y}=this,z=!1,U=!1,I=[],Q=$.nextCharacterToken;for(;!U&&Q!==null;Q=$.nextCharacterToken){let J=tQ.Token.isTokenQuote(Q,Y);if(!z&&J)z=!0;else if(z)if(tQ.Token.isTokenEscapeCharacter(Q,Y)){$.advancePastToken(Q);let K=$.nextCharacterToken;if(K!==null&&(tQ.Token.isTokenQuote(K,Y)||tQ.Token.isTokenEscapeCharacter(K,Y)))I.push(K.token),Q=K;else if(J)U=!0;else I.push(Q.token)}else if(J)U=!0;else I.push(Q.token);$.advancePastToken(Q)}return{col:this.columnFormatter.format(I.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:Y}=this,{nextNonSpaceToken:z}=$;if(z){let U=tQ.Token.isTokenDelimiter(z,Y),I=tQ.Token.isTokenRowDelimiter(z);if(!(U||I)){let Q=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${Y.escapedDelimiter}' OR new line got: '${z.token}'. at '${Q}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}DG0.QuotedColumnParser=NG0});var jG0=E((BG0)=>{Object.defineProperty(BG0,"__esModule",{value:!0});BG0.ColumnParser=void 0;var gY1=cf(),yY1=nf(),kY1=J2();class PG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new yY1.QuotedColumnParser($),this.nonQuotedColumnParser=new gY1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:Y}=$;if(Y!==null&&kY1.Token.isTokenQuote(Y,this.parserOptions))return $.advanceToToken(Y),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}BG0.ColumnParser=PG0});var pf=E((eQ)=>{Object.defineProperty(eQ,"__esModule",{value:!0});eQ.ColumnFormatter=eQ.QuotedColumnParser=eQ.NonQuotedColumnParser=eQ.ColumnParser=void 0;var xY1=jG0();Object.defineProperty(eQ,"ColumnParser",{enumerable:!0,get:function(){return xY1.ColumnParser}});var fY1=cf();Object.defineProperty(eQ,"NonQuotedColumnParser",{enumerable:!0,get:function(){return fY1.NonQuotedColumnParser}});var uY1=nf();Object.defineProperty(eQ,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,T,T,q,U);let A=q.type==="*"?Qu:q.type==="?"?Gu:"\\"+q.type;I=!0,U=U.slice(0,q.reStart)+A+"\\("+T}if(D(),Q)U+="\\\\";let N=_z1[U.charAt(0)];for(let T=K.length-1;T>-1;T--){let A=K[T],j=U.slice(0,A.reStart),C=U.slice(A.reStart,A.reEnd-8),b=U.slice(A.reEnd),k=U.slice(A.reEnd-8,A.reEnd)+b,h=j.split(")").length,i=j.split("(").length-h,c=b;for(let x=0;x<i;x++)c=c.replace(/\)[+*?]?/,"");b=c;let U0=b===""&&Y!==Ju?"(?:$|\\/)":"";U=j+C+b+U0+k}if(U!==""&&I)U="(?=.)"+U;if(N)U=w()+U;if(Y===Ju)return[U,I];if(z.nocase&&!I)I=$.toUpperCase()!==$.toLowerCase();if(!I)return hz1($);let B=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",B),{_glob:$,_src:U})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,z=Y.noglobstar?Qu:Y.dot?Cz1:Rz1,U=Y.nocase?"i":"",I=$.map((Q)=>{return Q=Q.map((J)=>typeof J==="string"?gz1(J):J===R8?R8:J._src).reduce((J,K)=>{if(!(J[J.length-1]===R8&&K===R8))J.push(K);return J},[]),Q.forEach((J,K)=>{if(J!==R8||Q[K-1]===R8)return;if(K===0)if(Q.length>1)Q[K+1]="(?:\\/|"+z+"\\/)?"+Q[K+1];else Q[K]=z;else if(K===Q.length-1)Q[K-1]+="(?:\\/|"+z+")?";else Q[K-1]+="(?:\\/|\\/"+z+"\\/)"+Q[K+1],Q[K+1]=R8}),Q.filter((J)=>J!==R8).join("/")}).join("|");if(I="^(?:"+I+")$",this.negate)I="^(?!"+I+").*$";try{this.regexp=new RegExp(I,U)}catch(Q){this.regexp=!1}return this.regexp}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let z=this.options;if(Ku.sep!=="/")$=$.split(Ku.sep).join("/");$=$.split(OH0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let I;for(let Q=$.length-1;Q>=0;Q--)if(I=$[Q],I)break;for(let Q=0;Q<U.length;Q++){let J=U[Q],K=$;if(z.matchBase&&J.length===1)K=[I];if(this.matchOne(K,J,Y)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return H$.defaults($).Minimatch}}H$.Minimatch=sW});var EH0=E((Gr1,jH0)=>{jH0.exports=TH0;var Xu=J0("fs"),{EventEmitter:kz1}=J0("events"),{Minimatch:Wu}=AH0(),{resolve:xz1}=J0("path");function fz1($,Y){return new Promise((z,U)=>{Xu.readdir($,{withFileTypes:!0},(I,Q)=>{if(I)switch(I.code){case"ENOTDIR":if(Y)U(I);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:U(I);break}else z(Q)})})}function PH0($,Y){return new Promise((z,U)=>{(Y?Xu.stat:Xu.lstat)($,(Q,J)=>{if(Q)switch(Q.code){case"ENOENT":if(Y)z(PH0($,!1));else z(null);break;default:z(null);break}else z(J)})})}async function*BH0($,Y,z,U,I,Q){let J=await fz1(Y+$,Q);for(let K of J){let G=K.name;if(G===void 0)G=K,U=!0;let H=$+"/"+G,W=H.slice(1),X=Y+"/"+W,Z=null;if(U||z)Z=await PH0(X,z);if(!Z&&K.name!==void 0)Z=K;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!I(W))yield{relative:W,absolute:X,stats:Z},yield*BH0(H,Y,z,U,I,!1)}else yield{relative:W,absolute:X,stats:Z}}}async function*uz1($,Y,z,U){yield*BH0("",$,Y,z,U,!0)}function bz1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class Zu extends kz1{constructor($,Y,z){super();if(typeof Y==="function")z=Y,Y=null;if(this.options=bz1(Y||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((I)=>new Wu(I,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((I)=>new Wu(I,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((I)=>new Wu(I,{dot:!0}))}if(this.iterator=uz1(xz1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>z(U)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((Y)=>Y.match($))}_fileMatches($,Y){let z=$+(Y?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(z)))&&!this.ignoreMatchers.some((U)=>U.match(z))&&(!this.options.nodir||!Y)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let Y=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,Y)){let z=$.value.relative,U=$.value.absolute;if(this.options.mark&&Y)z+="/",U+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:U,stat:$.value.stats});else this.emit("match",{relative:z Line truncated
`;o30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";o30.NAME_CHAR="-"+o30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";o30.CHAR_RE=new RegExp("^["+o30.CHAR+"]$","u");o30.RESTRICTED_CHAR_RE=new RegExp("^["+o30.RESTRICTED_CHAR+"]$","u");o30.S_RE=new RegExp("^["+o30.S+"]+$","u");o30.NAME_START_CHAR_RE=new RegExp("^["+o30.NAME_START_CHAR+"]$","u");o30.NAME_CHAR_RE=new RegExp("^["+o30.NAME_CHAR+"]$","u");o30.NAME_RE=new RegExp("^["+o30.NAME_START_CHAR+"]["+o30.NAME_CHAR+"]*$","u");o30.NMTOKEN_RE=new RegExp("^["+o30.NAME_CHAR+"]+$","u");var n30=9,p30=10,d30=13,m30=32;o30.S_LIST=[m30,p30,d30,n30];function Et0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}o30.isChar=Et0;function Ct0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}o30.isRestrictedChar=Ct0;function Rt0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}o30.isCharAndNotRestricted=Rt0;function _t0($){return $===m30||$===p30||$===d30||$===n30}o30.isS=_t0;function l30($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}o30.isNameStartChar=l30;function vt0($){return l30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}o30.isNameChar=vt0});var U70=E(($70)=>{Object.defineProperty($70,"__esModule",{value:!0});$70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";$70.NC_NAME_CHAR="-"+$70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";$70.NC_NAME_START_CHAR_RE=new RegExp("^["+$70.NC_NAME_START_CHAR+"]$","u");$70.NC_NAME_CHAR_RE=new RegExp("^["+$70.NC_NAME_CHAR+"]$","u");$70.NC_NAME_RE=new RegExp("^["+$70.NC_NAME_START_CHAR+"]["+$70.NC_NAME_CHAR+"]*$","u");function e30($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}$70.isNCNameStartChar=e30;function mt0($){return e30($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}$70.isNCNameChar=mt0});var P70=E((A70)=>{Object.defineProperty(A70,"__esModule",{value:!0});var EJ=c30(),tt0=t30(),ik=U70(),p8=EJ.isS,et0=EJ.isChar,vW=EJ.isNameStartChar,Y70=EJ.isNameChar,F70=EJ.S_LIST,$e0=EJ.NAME_RE,Ue0=tt0.isChar,Ye0=ik.isNCNameStartChar,ze0=ik.isNCNameChar,Qe0=ik.NC_NAME_RE,oM="http://www.w3.org/XML/1998/namespace",jJ="http://www.w3.org/2000/xmlns/",Je0={__proto__:null,xml:oM,xmlns:jJ},Ie0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,J9=-2,z70=0,Ke0=1,Rk=2,Ge0=3,PJ=4,He0=5,We0=6,Xe0=7,_k=8,Ze0=9,qe0=10,Ve0=11,Le0=12,C8=13,nM=14,vk=15,Fe0=16,hk=17,we0=18,Oe0=19,Sk=20,Me0=21,Ne0=22,De0=23,Q70=24,gk=25,pM=26,J70=27,Ae0=28,Pe0=29,I70=30,Be0=31,Te0=32,GY=33,je0=34,yk=35,hW=36,kk=37,Ee0=38,K70=39,G70=40,Ce0=41,H70=42,Re0=43,_e0=44,xk=9,q5=10,fk=13,W70=32,X70=33,w70=34,SW=38,O70=39,dM=45,mM=47,ve0=59,r7=60,BJ=61,B6=62,o6=63,M70=91,TJ=93,Z70=133,q70=8232,lM=($)=>$===w70||$===O70,N70=[w70,O70],he0=[...N70,M70,B6],Se0=[...N70,r7,TJ],ge0=[BJ,o6,...F70],ye0=[...F70,B6,SW,r7];function bk($,U,Y){switch(U){case"xml":if(Y!==oM)$.fail(`xml prefix must be bound to ${oM}.`);break;case"xmlns":if(Y!==jJ)$.fail(`xmlns prefix must be bound to ${jJ}.`);break;default:}switch(Y){case jJ:$.fail(U===""?`the default namespace may not be set to ${Y}.`:`may not assign a prefix (even "xmlns") to the URI ${jJ}.`);break;case oM:switch(U){case"xml":break;case"":$.fail(`the default namespace may not be set to ${Y}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function ke0($,U){for(let Y of Object.keys(U))bk($,Y,U[Y])}var xe0=($)=>Qe0.test($),fe0=($)=>$e0.test($),HY=0,V70=1,uk=2;A70.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var L70={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class D70{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let U=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,U){this.nameStartCheck=Ye0,this.nameCheck=ze0,this.isName=xe0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Je0);let Y=this.opt.additionalNamesp Line truncated
`,U=this.i}}captureToChar($){let{i:U}=this,{chunk:Y}=this;while(!0){let z=this.getCode();switch(z){case J9:this.text+=`${Y.slice(U,this.prevI)}
`,U=this.i,z=q5;break;case k4:return this.text+=Y.slice(U),!1;default:}if(z===$)return this.text+=Y.slice(U,this.prevI),!0}}captureNameChars(){let{chunk:$,i:U}=this;while(!0){let Y=this.getCode();if(Y===k4)return this.name+=$.slice(U),k4;if(!Y70(Y))return this.name+=$.slice(U,this.prevI),Y===J9?q5:Y}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!p8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=et0,this.getCode=this.getCode10;else this.isChar=Ue0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Ke0}sBeginWhitespace(){let $=this.i,U=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(U){case r7:if(this.state=vk,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let U=this.captureTo(he0);switch(U){case B6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(U),U===M70)this.state=PJ;else if(lM(U))this.state=Ge0,this.q=U}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Rk}sDTD(){let $=this.captureTo(Se0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===TJ)this.state=Rk;else if($===r7)this.state=We0;else if(lM($))this.state=He0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=PJ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case X70:this.state=Xe0,this.openWakaBang="";break;case o6:this.state=Ve0;break;default:this.state=PJ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),U=this.openWakaBang+=$;if(this.text+=$,U!=="-")this.state=U==="--"?_k:PJ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(dM))this.text+="-",this.state=Ze0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===dM?qe0:_k}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===B6)this.state=PJ;else this.fail("malformed comment."),this.state=_k}sDTDPI(){if(this.captureToChar(o6))this.text+="?",this.state=Le0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===B6)this.state=PJ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:U}=this;$:while(!0)switch(this.getCode()){case J9:this.entity+=`${U.slice($,this.prevI)}
`,$=this.i;break;case ve0:{let{entityReturnState:Y}=this,z=this.entity+U.slice($,this.prevI);this.state=Y;let Q;if(z==="")this.fail("empty entity name."),Q="&;";else Q=this.parseEntity(z),this.entity="";if(Y!==C8||this.textHandler!==void 0)this.text+=Q;break $}case k4:this.entity+=U.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(vW($))this.state=je0,this.unget(),this.xmlDeclPossible=!1;else switch($){case mM:this.state=Re0,this.xmlDeclPossible=!1;break;case X70:this.state=Fe0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case o6:this.state=De0;break;default:this.fail("disallowed character in tag name"),this.state=C8,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=Sk,this.openWakaBang="";break;case"--":this.state=hk,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Rk,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(dM))this.state=we0}sCommentEnding(){var $;let U=this.getCodeNorm();if(U===dM)this.state=Oe0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(U)}`,this.state=hk}sCommentEnded(){let $=this.getCodeNorm();if($!==B6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=hk;else this.state=C8}sCData(){if(this.captureToChar(TJ))this.state=Me0}sCDataEnding(){let $=this.getCodeNorm();if($===TJ)this.state=Ne0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Sk}sCDataEnding2(){var $;let U=this.getCodeNorm();switch(U){case B6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case TJ:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(U)}`,this.state=Sk}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=Q70;else if($===o6||p8($))this.fail("processing instruction without a target."),this.state=$===o6?pM:gk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=Q70}sPIRest(){let{chunk:$,i:U}=this;while(!0){let Y=this.getCodeNorm();if(Y===k4){this.piTarget+=$.slice(U);return}if(!this.nameCheck(Y)){this.piTarget+=$.slice(U,this.prevI);let z=Y===o6;if(z||p8(Y))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=z?GY:J70}else this.state=z?pM:gk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(Y);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===o6)this.state=pM;else if(!p8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(o6))this.state=pM}sPIEnding(){var $;let U=this.getCodeNorm();if(U===B6){let{piTarget:Y}=this;if(Y.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:Y,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(U===o6)this.text+="?";else this.text+=`?${String.fromCodePoint(U)}`,this.state=gk;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===o6){this.state=GY;return}if($!==k4)this.state=Ae0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(ge0);if($===o6){this.state=GY,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p8($)||$===BJ))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===BJ?I70:Pe0}sXMLDeclEq(){let $=this.getCodeNorm();if($===o6){this.state=GY,this.fail("XML declaration is incomplete.");return}if(p8($))return;if($!==BJ)this.fail("value required.");this.state=I70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===o6){this.state=GY,this.fail("XML declaration is incomplete.");return}if(p8($))return;if(!lM($))this.fail("value must be quoted."),this.q=W70;else this.q=$;this.state=Be0}sXMLDeclValue(){let $=this.captureTo([this.q,o6]);if($===o6){this.state=GY,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let U=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let Y=U;if(this.xmlDecl.version=Y,!/^1\.[0-9]+$/.test(Y))this.fail("ver Line truncated
`;$=this.i,U=HY;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:U=HY}this.forbiddenState=U}handleTextOutsideRoot(){let{i:$}=this,{chunk:U,textHandler:Y}=this,z=!1;$:while(!0){let Q=this.getCode();switch(Q){case r7:{if(this.state=vk,Y!==void 0){let{text:J}=this,I=U.slice($,this.prevI);if(J.length!==0)Y(J+I),this.text="";else if(I.length!==0)Y(I)}break $}case SW:if(this.state=nM,this.entityReturnState=C8,Y!==void 0)this.text+=U.slice($,this.prevI);z=!0;break $;case J9:if(Y!==void 0)this.text+=`${U.slice($,this.prevI)}
`;$=this.i;break;case k4:if(Y!==void 0)this.text+=U.slice($);break $;default:if(!p8(Q))z=!0}}if(!z)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,U){var Y;let{prefix:z,local:Q}=this.qname($),J={name:$,prefix:z,local:Q,value:U};if(this.attribList.push(J),(Y=this.attributeHandler)===null||Y===void 0||Y.call(this,J),z==="xmlns"){let I=U.trim();if(this.currentXMLVersion==="1.0"&&I==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Q]=I,bk(this,Q,I)}else if($==="xmlns"){let I=U.trim();this.topNS[""]=I,bk(this,"",I)}}pushAttribPlain($,U){var Y;let z={name:$,value:U};this.attribList.push(z),(Y=this.attributeHandler)===null||Y===void 0||Y.call(this,z)}end(){var $,U;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:Y}=this;while(Y.length>0){let Q=Y.pop();this.fail(`unclosed tag: ${Q.name}`)}if(this.state!==z70&&this.state!==C8)this.fail("unexpected end.");let{text:z}=this;if(z.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,z),this.text="";return this._closed=!0,(U=this.endHandler)===null||U===void 0||U.call(this),this._init(),this}resolve($){var U,Y;let z=this.topNS[$];if(z!==void 0)return z;let{tags:Q}=this;for(let J=Q.length-1;J>=0;J--)if(z=Q[J].ns[$],z!==void 0)return z;if(z=this.ns[$],z!==void 0)return z;return(Y=(U=this.opt).resolvePrefix)===null||Y===void 0?void 0:Y.call(U,$)}qname($){let U=$.indexOf(":");if(U===-1)return{prefix:"",local:$};let Y=$.slice(U+1),z=$.slice(0,U);if(z===""||Y===""||Y.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:z,local:Y}}processAttribsNS(){var $;let{attribList:U}=this,Y=this.tag;{let{prefix:J,local:I}=this.qname(Y.name);Y.prefix=J,Y.local=I;let K=Y.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),Y.uri=J}}if(U.length===0)return;let{attributes:z}=Y,Q=new Set;for(let J of U){let{name:I,prefix:K,local:G}=J,H,W;if(K==="")H=I==="xmlns"?jJ:"",W=I;else{if(H=this.resolve(K),H===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),H=K;W=`{${H}}${G}`}if(Q.has(W))this.fail(`duplicate attribute: ${W}.`);Q.add(W),J.uri=H,z[I]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,U=this.tag.attributes;for(let{name:Y,value:z}of $){if(U[Y]!==void 0)this.fail(`duplicate attribute: ${Y}.`);U[Y]=z}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:U}=this,Y=this.tag;Y.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,Y),U.push(Y),this.state=C8,this.name=""}openSelfClosingTag(){var $,U,Y;this.processAttribs();let{tags:z}=this,Q=this.tag;if(Q.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Q),(U=this.closeTagHandler)===null||U===void 0||U.call(this,Q),(this.tag=(Y=z[z.length-1])!==null&&Y!==void 0?Y:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:U}=this;if(this.state=C8,this.name="",U===""){this.fail("weird empty close tag."),this.text+="</>";return}let Y=this.closeTagHandler,z=$.length;while(z-- >0){let Q=this.tag=$.pop();if(this.topNS=Q.ns,Y===null||Y===void 0||Y(Q),Q.name===U)break;this.fail("unexpected close tag.")}if(z===0)this.closedRoot=!0;else if(z<0)this.fail(`unmatched closing tag: ${U}.`),this.text+=`</${U}>`}parseEntity($){if($[0]!=="#"){let Y=this.ENTITIES[$];if(Y!==void 0)return Y;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let U=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))U=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))U=parseInt($.slice(1),10);if(!this.isChar(U))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(U)}}A70.SaxesParser=D70});var gW=E((Cd1,B70)=>{var{SaxesParser:ie0}=P70(),{PassThrough:ce0}=E8(),{bufferToString:ne0}=Pk();B70.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new ce0);let U=new ie0,Y;U.on("error",(Q)=>{Y=Q});let z=[];U.on("opentag",(Q)=>z.push({eventType:"opentag",value:Q})),U.on("text",(Q)=>z.push({eventType:"text",value:Q})),U.on("closetag",(Q)=>z.push({eventType:"closetag",value:Q}));for await(let Q of $){if(U.write(ne0(Q)),Y)throw Y;yield z,z=[]}}});var g0=E((Rd1,T70)=>{var pe0=gW(),de0=l6();class CJ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,U){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof CJ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let U of $)for(let{eventType:Y,value:z}of U)if(Y==="opentag")this.parseOpen(z);else if(Y==="text")this.parseText(z);else if(Y==="closetag"){if(!this.parseClose(z.name))return thLine truncated
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((U=$.writeHeaders)!==null&&U!==void 0?U:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}UI0.FormatterOptions=$I0});var EN=E(($o1,II0)=>{var U51="[object AsyncFunction]",Y51="[object Function]",z51="[object GeneratorFunction]",Q51="[object Null]",J51="[object Proxy]",I51="[object Undefined]",K51=typeof global=="object"&&global&&global.Object===Object&&global,G51=typeof self=="object"&&self&&self.Object===Object&&self,H51=K51||G51||Function("return this")(),QI0=Object.prototype,W51=QI0.hasOwnProperty,JI0=QI0.toString,zI0=H51.Symbol,FY=zI0?zI0.toStringTag:void 0;function X51($){if($==null)return $===void 0?I51:Q51;return FY&&FY in Object($)?Z51($):q51($)}function Z51($){var U=W51.call($,FY),Y=$[FY];try{$[FY]=void 0;var z=!0}catch(J){}var Q=JI0.call($);if(z)if(U)$[FY]=Y;else delete $[FY];return Q}function q51($){return JI0.call($)}function V51($){if(!L51($))return!1;var U=X51($);return U==Y51||U==z51||U==U51||U==J51}function L51($){var U=typeof $;return $!=null&&(U=="object"||U=="function")}II0.exports=V51});var iI0=E((CN,fJ)=>{var F51=200,Wf="__lodash_hash_undefined__",kN=1,OI0=2,MI0=9007199254740991,RN="[object Arguments]",zf="[object Array]",w51="[object AsyncFunction]",NI0="[object Boolean]",DI0="[object Date]",AI0="[object Error]",PI0="[object Function]",O51="[object GeneratorFunction]",_N="[object Map]",BI0="[object Number]",M51="[object Null]",xJ="[object Object]",KI0="[object Promise]",N51="[object Proxy]",TI0="[object RegExp]",vN="[object Set]",jI0="[object String]",D51="[object Symbol]",A51="[object Undefined]",Qf="[object WeakMap]",EI0="[object ArrayBuffer]",hN="[object DataView]",P51="[object Float32Array]",B51="[object Float64Array]",T51="[object Int8Array]",j51="[object Int16Array]",E51="[object Int32Array]",C51="[object Uint8Array]",R51="[object Uint8ClampedArray]",_51="[object Uint16Array]",v51="[object Uint32Array]",h51=/[\\^$.*+?()[\]{}|]/g,S51=/^\[object .+?Constructor\]$/,g51=/^(?:0|[1-9]\d*)$/,B4={};B4[P51]=B4[B51]=B4[T51]=B4[j51]=B4[E51]=B4[C51]=B4[R51]=B4[_51]=B4[v51]=!0;B4[RN]=B4[zf]=B4[EI0]=B4[NI0]=B4[hN]=B4[DI0]=B4[AI0]=B4[PI0]=B4[_N]=B4[BI0]=B4[xJ]=B4[TI0]=B4[vN]=B4[jI0]=B4[Qf]=!1;var CI0=typeof global=="object"&&global&&global.Object===Object&&global,y51=typeof self=="object"&&self&&self.Object===Object&&self,Z3=CI0||y51||Function("return this")(),RI0=typeof CN=="object"&&CN&&!CN.nodeType&&CN,GI0=RI0&&typeof fJ=="object"&&fJ&&!fJ.nodeType&&fJ,_I0=GI0&&GI0.exports===RI0,$f=_I0&&CI0.process,HI0=function(){try{return $f&&$f.binding&&$f.binding("util")}catch($){}}(),WI0=HI0&&HI0.isTypedArray;function k51($,U){var Y=-1,z=$==null?0:$.length,Q=0,J=[];while(++Y<z){var I=$[Y];if(U(I,Y,$))J[Q++]=I}return J}function x51($,U){var Y=-1,z=U.length,Q=$.length;while(++Y<z)$[Q+Y]=U[Y];return $}function f51($,U){var Y=-1,z=$==null?0:$.length;while(++Y<z)if(U($[Y],Y,$))return!0;return!1}function u51($,U){var Y=-1,z=Array($);while(++Y<$)z[Y]=U(Y);return z}function b51($){return function(U){return $(U)}}function i51($,U){return $.has(U)}function c51($,U){return $==null?void 0:$[U]}function n51($){var U=-1,Y=Array($.size);return $.forEach(function(z,Q){Y[++U]=[Q,z]}),Y}function p51($,U){return function(Y){return $(U(Y))}}function d51($){var U=-1,Y=Array($.size);return $.forEach(function(z){Y[++U]=z}),Y}var m51=Array.prototype,l51=Function.prototype,xN=Object.prototype,Uf=Z3["__core-js_shared__"],vI0=l51.toString,K9=xN.hasOwnProperty,XI0=function(){var $=/[^.]+$/.exec(Uf&&Uf.keys&&Uf.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),hI0=xN.toString,o51=RegExp("^"+vI0.call(K9).replace(h51,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ZI0=_I0?Z3.Buffer:void 0,SN=Z3.Symbol,qI0=Z3.Uint8Array,SI0=xN.propertyIsEnumerable,r51=m51.splice,wY=SN?SN.toStringTag:void 0,VI0=Object.getOwnPropertySymbols,s51=ZI0?ZI0.isBuffer:void 0,a51=p51(Object.keys,Object),Jf=uJ(Z3,"DataView"),iW=uJ(Z3,"Map"),If=uJ(Z3,"Promise"),Kf=uJ(Z3,"Set"),Gf=uJ(Z3,"WeakMap"),cW=uJ(Object,"create"),t51=NY(Jf),e51=NY(iW),$91=NY(If),U91=NY(Kf),Y91=NY(Gf),LI0=SN?SN.prototype:void 0,Yf=LI0?LI0.valueOf:void 0;function OY($){var U=-1,Y=$==null?0:$.length;this.clear();while(++U<Y){var z=$[U];this.set(z[0],z[1])}}function z91(){this.__data__=cW?cW(null):{},this.size=0}function Q91($){var U=this.has($)&&delete this.__data__[$];return this.size-=U?1:0,U}function J91($){var U=this.__data Line truncated
]`;this.ESCAPE_REGEXP=new RegExp(U)}set headers($){this._headers=$}shouldQuote($,U){let Y=U?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(X31.default(Y))return Y;if(Array.isArray(Y))return Y[$];if(this._headers!==null)return Y[this._headers[$]];return!1}format($,U,Y){let z=`${Z31.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Q}=this;if(Q.quote!==""){if(z.indexOf(Q.quote)!==-1)return this.quoteField(z.replace(this.REPLACE_REGEXP,Q.escapedQuote))}if(z.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(U,Y))return this.quoteField(z);return z}quoteField($){let{quote:U}=this.formatterOptions;return`${U}${$}${U}`}}bJ.FieldFormatter=sI0});var Lf=E((aI0)=>{Object.defineProperty(aI0,"__esModule",{value:!0});aI0.isSyncTransform=void 0;aI0.isSyncTransform=($)=>$.length===1});var $K0=E((iJ)=>{var eI0=iJ&&iJ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(iJ,"__esModule",{value:!0});iJ.RowFormatter=void 0;var V31=eI0(EN()),L31=eI0(iI0()),F31=Vf(),w31=Lf();class DY{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new F31.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(DY.isRowHashArray($))return $.map((U)=>U[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(w31.isSyncTransform($))return(U,Y)=>{let z=null;try{z=$(U)}catch(Q){return Y(Q)}return Y(null,z)};return(U,Y)=>{$(U,Y)}}set rowTransform($){if(!V31.default($))throw TypeError("The transform should be a function");this._rowTransform=DY.createTransform($)}format($,U){this.callTransformer($,(Y,z)=>{if(Y)return U(Y);if(!$)return U(null);let Q=[];if(z){let{shouldFormatColumns:J,headers:I}=this.checkHeaders(z);if(this.shouldWriteHeaders&&I&&!this.hasWrittenHeaders)Q.push(this.formatColumns(I,!0)),this.hasWrittenHeaders=!0;if(J){let K=this.gatherColumns(z);Q.push(this.formatColumns(K,!1))}}return U(null,Q)})}finish($){let U=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));U.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)U.push(this.formatterOptions.rowDelimiter);return $(null,U)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let U=DY.gatherHeaders($);if(this.headers=U,this.fieldFormatter.headers=U,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!L31.default(U,$),headers:U}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((U)=>$[U]);if(DY.isRowHashArray($))return this.headers.map((U,Y)=>{let z=$[Y];if(z)return z[1];return""});if(DY.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((U,Y)=>$[Y])}callTransformer($,U){if(!this._rowTransform)return U(null,$);return this._rowTransform($,U)}formatColumns($,U){let Y=$.map((Q,J)=>this.fieldFormatter.format(Q,J,U)).join(this.formatterOptions.delimiter),{rowCount:z}=this;if(this.rowCount+=1,z)return[this.formatterOptions.rowDelimiter,Y].join("");return Y}}iJ.RowFormatter=DY});var UK0=E((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});bN.FieldFormatter=bN.RowFormatter=void 0;var O31=$K0();Object.defineProperty(bN,"RowFormatter",{enumerable:!0,get:function(){return O31.RowFormatter}});var M31=Vf();Object.defineProperty(bN,"FieldFormatter",{enumerable:!0,get:function(){return M31.FieldFormatter}})});var Ff=E((zK0)=>{Object.defineProperty(zK0,"__esModule",{value:!0});zK0.CsvFormatterStream=void 0;var D31=I0("stream"),A31=UK0();class YK0 extends D31.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new A31.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,U,Y){let z=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Q,J)=>{if(Q)return z=!0,Y(Q);if(J)J.forEach((I)=>{this.push(Buffer.from(I,"utf8"))});return z=!0,Y()})}catch(Q){if(z)throw Q;Y(Q)}}_flush($){this.rowFormatter.finish((U,Y)=>{if(U)return $(U);if(Y)Y.forEach((z)=>{this.push(Buffer.from(z,"utf8"))});return $()})}}zK0.CsvFormatterStream=YK0});var IK0=E((s1)=>{var JK0=s1&&s1.__createBinding||(Object.create?function($,U,Y,z){if(z===void 0)z=Y;Object.defineProperty($,z,{enumerable:!0,get:function(){return U[Y]}})}:function($,U,Y,z){if(z===void 0)z=Y;$[z]=U[Y]}),P31=s1&&s1.__setModuleDefault||(Object.create?function($,U){O Line truncated
`||U===`\r
`}static isTokenCarriageReturn($,U){return $.token===U.carriageReturn}static isTokenComment($,U){return U.supportsComments&&!!$&&$.token===U.comment}static isTokenEscapeCharacter($,U){return $.token===U.escapeChar}static isTokenQuote($,U){return $.token===U.quote}static isTokenDelimiter($,U){return $.token===U.delimiter}}KG0.Token=IG0});var bf=E((XG0)=>{Object.defineProperty(XG0,"__esModule",{value:!0});XG0.Scanner=void 0;var HG0=I2(),vU1=/((?:\r\n)|\n|\r)/;class WG0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,U=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(U)===-1)return null;let Y=U.exec($);if(Y==null)return null;let z=Y[1],Q=this.cursor+(Y.index||0);return new HG0.Token({token:z,startCursor:Q,endCursor:Q+z.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:U}=this;if(U<=$)return null;return new HG0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=vU1.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}XG0.Scanner=WG0});var HD=E((VG0)=>{Object.defineProperty(VG0,"__esModule",{value:!0});VG0.ColumnFormatter=void 0;class qG0{constructor($){if($.trim)this.format=(U)=>U.trim();else if($.ltrim)this.format=(U)=>U.trimLeft();else if($.rtrim)this.format=(U)=>U.trimRight();else this.format=(U)=>U}}VG0.ColumnFormatter=qG0});var cf=E((OG0)=>{Object.defineProperty(OG0,"__esModule",{value:!0});OG0.NonQuotedColumnParser=void 0;var hU1=HD(),FG0=I2();class wG0{constructor($){this.parserOptions=$,this.columnFormatter=new hU1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:U}=this,Y=[],z=$.nextCharacterToken;for(;z;z=$.nextCharacterToken){if(FG0.Token.isTokenDelimiter(z,U)||FG0.Token.isTokenRowDelimiter(z))break;Y.push(z.token),$.advancePastToken(z)}return this.columnFormatter.format(Y.join(""))}}OG0.NonQuotedColumnParser=wG0});var nf=E((DG0)=>{Object.defineProperty(DG0,"__esModule",{value:!0});DG0.QuotedColumnParser=void 0;var SU1=HD(),tJ=I2();class NG0{constructor($){this.parserOptions=$,this.columnFormatter=new SU1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let U=$.cursor,{foundClosingQuote:Y,col:z}=this.gatherDataBetweenQuotes($);if(!Y){if($.advanceTo(U),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),z}gatherDataBetweenQuotes($){let{parserOptions:U}=this,Y=!1,z=!1,Q=[],J=$.nextCharacterToken;for(;!z&&J!==null;J=$.nextCharacterToken){let I=tJ.Token.isTokenQuote(J,U);if(!Y&&I)Y=!0;else if(Y)if(tJ.Token.isTokenEscapeCharacter(J,U)){$.advancePastToken(J);let K=$.nextCharacterToken;if(K!==null&&(tJ.Token.isTokenQuote(K,U)||tJ.Token.isTokenEscapeCharacter(K,U)))Q.push(K.token),J=K;else if(I)z=!0;else Q.push(J.token)}else if(I)z=!0;else Q.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Q.join("")),foundClosingQuote:z}}checkForMalformedColumn($){let{parserOptions:U}=this,{nextNonSpaceToken:Y}=$;if(Y){let z=tJ.Token.isTokenDelimiter(Y,U),Q=tJ.Token.isTokenRowDelimiter(Y);if(!(z||Q)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${U.escapedDelimiter}' OR new line got: '${Y.token}'. at '${J}`)}$.advanceToToken(Y)}else if(!$.hasMoreData)$.advancePastLine()}}DG0.QuotedColumnParser=NG0});var jG0=E((BG0)=>{Object.defineProperty(BG0,"__esModule",{value:!0});BG0.ColumnParser=void 0;var gU1=cf(),yU1=nf(),kU1=I2();class PG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new yU1.QuotedColumnParser($),this.nonQuotedColumnParser=new gU1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:U}=$;if(U!==null&&kU1.Token.isTokenQuote(U,this.parserOptions))return $.advanceToToken(U),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}BG0.ColumnParser=PG0});var pf=E((eJ)=>{Object.defineProperty(eJ,"__esModule",{value:!0});eJ.ColumnFormatter=eJ.QuotedColumnParser=eJ.NonQuotedColumnParser=eJ.ColumnParser=void 0;var xU1=jG0();Object.defineProperty(eJ,"ColumnParser",{enumerable:!0,get:function(){return xU1.ColumnParser}});var fU1=cf();Object.defineProperty(eJ,"NonQuotedColumnParser",{enumerable:!0,get:function(){return fU1.NonQuotedColumnParser}});var uU1=nf();Object.defineProperty(eJ,"QuotedColumnParser",{enumerable:!0,get:function(){re Line truncated
%s`,T,T,q,z);let A=q.type==="*"?Ju:q.type==="?"?Gu:"\\"+q.type;Q=!0,z=z.slice(0,q.reStart)+A+"\\("+T}if(N(),J)z+="\\\\";let D=_Y1[z.charAt(0)];for(let T=K.length-1;T>-1;T--){let A=K[T],j=z.slice(0,A.reStart),C=z.slice(A.reStart,A.reEnd-8),b=z.slice(A.reEnd),x=z.slice(A.reEnd-8,A.reEnd)+b,h=j.split(")").length,i=j.split("(").length-h,c=b;for(let k=0;k<i;k++)c=c.replace(/\)[+*?]?/,"");b=c;let z0=b===""&&U!==Iu?"(?:$|\\/)":"";z=j+C+b+z0+x}if(z!==""&&Q)z="(?=.)"+z;if(D)z=w()+z;if(U===Iu)return[z,Q];if(Y.nocase&&!Q)Q=$.toUpperCase()!==$.toLowerCase();if(!Q)return hY1($);let B=Y.nocase?"i":"";try{return Object.assign(new RegExp("^"+z+"$",B),{_glob:$,_src:z})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let U=this.options,Y=U.noglobstar?Ju:U.dot?CY1:RY1,z=U.nocase?"i":"",Q=$.map((J)=>{return J=J.map((I)=>typeof I==="string"?gY1(I):I===R8?R8:I._src).reduce((I,K)=>{if(!(I[I.length-1]===R8&&K===R8))I.push(K);return I},[]),J.forEach((I,K)=>{if(I!==R8||J[K-1]===R8)return;if(K===0)if(J.length>1)J[K+1]="(?:\\/|"+Y+"\\/)?"+J[K+1];else J[K]=Y;else if(K===J.length-1)J[K-1]+="(?:\\/|"+Y+")?";else J[K-1]+="(?:\\/|\\/"+Y+"\\/)"+J[K+1],J[K+1]=R8}),J.filter((I)=>I!==R8).join("/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,z)}catch(J){this.regexp=!1}return this.regexp}match($,U=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&U)return!0;let Y=this.options;if(Ku.sep!=="/")$=$.split(Ku.sep).join("/");$=$.split(MH0),this.debug(this.pattern,"split",$);let z=this.set;this.debug(this.pattern,"set",z);let Q;for(let J=$.length-1;J>=0;J--)if(Q=$[J],Q)break;for(let J=0;J<z.length;J++){let I=z[J],K=$;if(Y.matchBase&&I.length===1)K=[Q];if(this.matchOne(K,I,U)){if(Y.flipNegate)return!0;return!this.negate}}if(Y.flipNegate)return!1;return this.negate}static defaults($){return H$.defaults($).Minimatch}}H$.Minimatch=sW});var EH0=E((Hr1,jH0)=>{jH0.exports=TH0;var Xu=I0("fs"),{EventEmitter:kY1}=I0("events"),{Minimatch:Wu}=AH0(),{resolve:xY1}=I0("path");function fY1($,U){return new Promise((Y,z)=>{Xu.readdir($,{withFileTypes:!0},(Q,J)=>{if(Q)switch(Q.code){case"ENOTDIR":if(U)z(Q);else Y([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":Y([]);break;case"ELOOP":default:z(Q);break}else Y(J)})})}function PH0($,U){return new Promise((Y,z)=>{(U?Xu.stat:Xu.lstat)($,(J,I)=>{if(J)switch(J.code){case"ENOENT":if(U)Y(PH0($,!1));else Y(null);break;default:Y(null);break}else Y(I)})})}async function*BH0($,U,Y,z,Q,J){let I=await fY1(U+$,J);for(let K of I){let G=K.name;if(G===void 0)G=K,z=!0;let H=$+"/"+G,W=H.slice(1),X=U+"/"+W,Z=null;if(z||Y)Z=await PH0(X,Y);if(!Z&&K.name!==void 0)Z=K;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!Q(W))yield{relative:W,absolute:X,stats:Z},yield*BH0(H,U,Y,z,Q,!1)}else yield{relative:W,absolute:X,stats:Z}}}async function*uY1($,U,Y,z){yield*BH0("",$,U,Y,z,!0)}function bY1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class Zu extends kY1{constructor($,U,Y){super();if(typeof U==="function")Y=U,U=null;if(this.options=bY1(U||{}),this.matchers=[],this.options.pattern){let z=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=z.map((Q)=>new Wu(Q,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let z=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=z.map((Q)=>new Wu(Q,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let z=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=z.map((Q)=>new Wu(Q,{dot:!0}))}if(this.iterator=uY1(xY1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,Y)this._matches=[],this.on("match",(z)=>this._matches.push(this.options.absolute?z.absolute:z.relative)),this.on("error",(z)=>Y(z)),this.on("end",()=>Y(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((U)=>U.match($))}_fileMatches($,U){let Y=$+(U?"/":"");return(this.matchers.length===0||this.matchers.some((z)=>z.match(Y)))&&!this.ignoreMatchers.some((z)=>z.match(Y))&&(!this.options.nodir||!U)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let U=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,U)){let Y=$.value.relative,z=$.value.absolute;if(this.options.mark&&U)Y+="/",z+="/";if(this.options.stat)this.emit("match",{relative:Y,absolute:z,stat:$.value.stats});else this.emit("match",{relative:Y Line truncated
`,m);m=w0===-1?f.length:w0}else if(K0!==-1&&f[m]==="/"&&f[m+1]==="*"){let w0=f.indexOf("*/",m);if(w0!==-1)m=w0+2,K0=f.indexOf("*/",m);else n+=f[m],m++}else n+=f[m],m++;return n}function i0(f){let n=u0(f.toString()),m=n.match(a);if(!m)m=n.match(W0);if(!m)throw Error(`could not parse args in autoInject
Source:
`+n);let[,K0]=m;return K0.replace(/\s/g,"").split(F0).map((w0)=>w0.replace(f0,"").trim())}function D1(f,n){var m={};return Object.keys(f).forEach((K0)=>{var w0=f[K0],D0,B0=q(w0),j0=!B0&&w0.length===1||B0&&w0.length===0;if(Array.isArray(w0))D0=[...w0],w0=D0.pop(),m[K0]=D0.concat(D0.length>0?h0:w0);else if(j0)m[K0]=w0;else{if(D0=i0(w0),w0.length===0&&!B0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!B0)D0.pop();m[K0]=D0.concat(h0)}function h0(z1,x1){var m1=D0.map((i1)=>z1[i1]);m1.push(x1),M(w0)(...m1)}}),Y1(m,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:m}=n;if(f(n))this.removeLink(n);n=m}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,m){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var K0=M(f),w0=0,D0=[];let B0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){B0[G1].push(e0)}function h0(G1,e0){let H1=(...c1)=>{z1(G1,H1),e0(...c1)};B0[G1].push(H1)}function z1(G1,e0){if(!G1)return Object.keys(B0).forEach((H1)=>B0[H1]=[]);if(!e0)return B0[G1]=[];B0[G1]=B0[G1].filter((H1)=>H1!==e0)}function x1(G1,...e0){B0[G1].forEach((H1)=>H1(...e0))}var m1=!1;function i1(G1,e0,H1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function O$(DY,...dK){if(DY)return H1?v6(DY):g4();if(dK.length<=1)return g4(dK[0]);g4(dK)}var fU=l1._createTaskItem(G1,H1?O$:c1||O$);if(e0)l1._tasks.unshift(fU);else l1._tasks.push(fU);if(!m1)m1=!0,H(()=>{m1=!1,l1.process()});if(H1||!c1)return new Promise((DY,dK)=>{g4=DY,v6=dK})}function M$(G1){return function(e0,...H1){w0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],O$=D0.indexOf(v6);if(O$===0)D0.shift();else if(O$>0)D0.splice(O$,1);if(v6.callback(e0,...H1),e0!=null)x1("error",e0,v6.data)}if(w0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function xU(G1){if(G1.length===0&&l1.idle())return H(()=>x1("drain")),!0;return!1}let NY=(G1)=>(e0)=>{if(!e0)return new Promise((H1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);H1(v6)})});z1(G1),j0(G1,e0)};var pK=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:m,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){z1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(xU(G1))return;return G1.map((H1)=>i1(H1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(pK)return;pK=!0;while(!l1.paused&&w0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],H1=l1._tasks.length;if(l1.payload)H1=Math.min(H1,l1.payload);for(var c1=0;c1<H1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(w0+=1,l1._tasks.length===0)x1("empty");if(w0===l1.concurrency)x1("saturated");var v6=h(M$(G1));K0(e0,v6)}pK=!1},length(){return l1._tasks.length},running(){return w0},workersList(){return D0},idle(){return l1._tasks.length+w0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,H(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:NY("saturated")},unsaturated:{writable:!1,value:NY("unsaturated")},empty:{writable:!1,value:NY("empty")},drain:{writable:!1,value:NY("drain")},error:{writable:!1,value:NY("error")}}),l1}function A0(f,n){return b1(f,1,n)}function I0(f,n,m){return b1(f,n,m)}function P(f,n,m,K0){K0=T(K0);var w0=M(m);return Y0(f,(D0,B0,j0)=>{w0(n,D0,(h0,z1)=>{n=z1,j0(h0)})},(D0)=>K0(D0,n))}var v=w(P,4);function u(...f){var n=f.map(M);return function(...m){var K0=this,w0=m[m.length-1];if(typeof w0=="function")m.pop();else w0=b0();return v(n,m,(D0,B0,j0)=>{B0.apply(K0,D0.concat((h0,...z1)=>{j0(h0,z1)}))},(D0,B0)=>w0(D0,...B0)),w0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,m,K0){return D(c(n),f,m,K0)}var Q Line truncated
GFS4: `),console.error($)};if(!p4[s6]){if(Vu=global[s6]||[],xH0(p4,Vu),p4.close=function($){function Y(z,U){return $.call(p4,z,function(I){if(!I)kH0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(Y,OD,{value:$}),Y}(p4.close),p4.closeSync=function($){function Y(z){$.apply(p4,arguments),kH0()}return Object.defineProperty(Y,OD,{value:$}),Y}(p4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Tz(p4[s6]),J0("assert").equal(p4[s6].length,0)})}var Vu;if(!global[s6])xH0(global,p4[s6]);wu.exports=Lu(rz1(p4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!p4.__patched)wu.exports=Lu(p4),p4.__patched=!0;function Lu($){lz1($),$.gracefulify=Lu,$.createReadStream=B,$.createWriteStream=T;var Y=$.readFile;$.readFile=z;function z(C,b,k){if(typeof b==="function")k=b,b=null;return h(C,b,k);function h(i,c,U0,x){return Y(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))zJ([h,[i,c,U0],d,x||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=I;function I(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return U(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var Q=$.appendFile;if(Q)$.appendFile=J;function J(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return Q(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=G;function G(C,b,k,h){if(typeof k==="function")h=k,k=0;return i(C,b,k,h);function i(c,U0,x,d,t){return K(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var H=$.readdir;$.readdir=X;var W=/^v[0-5]\./;function X(C,b,k){if(typeof b==="function")k=b,b=null;var h=W.test(process.version)?function(U0,x,d,t){return H(U0,i(U0,x,d,t))}:function(U0,x,d,t){return H(U0,x,i(U0,x,d,t))};return h(C,b,k);function i(c,U0,x,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))zJ([h,[c,U0,x],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof x==="function")x.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=oz1($);w=Z.ReadStream,D=Z.WriteStream}var q=$.ReadStream;if(q)w.prototype=Object.create(q.prototype),w.prototype.open=O;var V=$.WriteStream;if(V)D.prototype=Object.create(V.prototype),D.prototype.open=N;Object.defineProperty($,"ReadStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return D},set:function(C){D=C},enumerable:!0,configurable:!0});var F=w;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var M=D;Object.defineProperty($,"FileWriteStream",{get:function(){return M},set:function(C){M=C},enumerable:!0,configurable:!0});function w(C,b){if(this instanceof w)return q.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function O(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=k,C.emit("open",k),C.read()})}function D(C,b){if(this instanceof D)return V.apply(this,arguments),this;else return D.apply(Object.create(D.prototype),arguments)}function N(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b)C.destroy(),C.emit("error",b);else C.fd=k,C.emit("open",k)})}function B(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var A=$.open;$.open=j;function j(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return A(c,U0,x,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zJ([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function zJ($){Tz("ENQUEUE",$[0].name,$[1]),p4[s6].push($),Fu()}var MD;function kH0(){var $=Date.now();for(var Y=0;Y<p4[s6].length;++Y)if(p4[s6][Y].length>2)p4[s6][Y][3]=$,p4[s6][Y][4]=$;Fu()}function Fu(){if(clearTimeout(MD),MD=void 0,p4[s6].length===0)return;var $=p4[s6].shift(),Y=$[0],z=$[1],U=$[2],I=$[3],Q=$[4];if(I===void 0)Tz("RETRY",Y.name,z),Y.apply(null,z);else if(Date.now()-I>=60000){Tz("TIMEOUT",Y.name,z);var J=z.pop();if(typeof J==="function")J.call(null,U)}else{var K=Date.now()-Q,G=Math.max(Q-I,1),H=Math.min(G*1.2,100);if(K>=H)Tz("RETRY",Y.name,z),Y.apply(null,z.concat([I]));else p4[s6].push($)}if(MD===void 0)MD=setTimeout(Fu,0)}});var uH0=E((qr1,Mu)=>{function az1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var fH0=K6().Buffer,aW=J0("util");function tz1($,Y,z){$.copy(Y,z)}Mu.exports=function(){function $(){az1(this,$),this.h Line truncated
`+n);let[,K0]=m;return K0.replace(/\s/g,"").split(F0).map((w0)=>w0.replace(f0,"").trim())}function D1(f,n){var m={};return Object.keys(f).forEach((K0)=>{var w0=f[K0],D0,B0=q(w0),j0=!B0&&w0.length===1||B0&&w0.length===0;if(Array.isArray(w0))D0=[...w0],w0=D0.pop(),m[K0]=D0.concat(D0.length>0?h0:w0);else if(j0)m[K0]=w0;else{if(D0=i0(w0),w0.length===0&&!B0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!B0)D0.pop();m[K0]=D0.concat(h0)}function h0(Y1,x1){var m1=D0.map((i1)=>Y1[i1]);m1.push(x1),O(w0)(...m1)}}),U1(m,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:m}=n;if(f(n))this.removeLink(n);n=m}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,m){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var K0=O(f),w0=0,D0=[];let B0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){B0[G1].push(e0)}function h0(G1,e0){let H1=(...c1)=>{Y1(G1,H1),e0(...c1)};B0[G1].push(H1)}function Y1(G1,e0){if(!G1)return Object.keys(B0).forEach((H1)=>B0[H1]=[]);if(!e0)return B0[G1]=[];B0[G1]=B0[G1].filter((H1)=>H1!==e0)}function x1(G1,...e0){B0[G1].forEach((H1)=>H1(...e0))}var m1=!1;function i1(G1,e0,H1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function M$(DU,...dK){if(DU)return H1?v6(DU):g4();if(dK.length<=1)return g4(dK[0]);g4(dK)}var fz=l1._createTaskItem(G1,H1?M$:c1||M$);if(e0)l1._tasks.unshift(fz);else l1._tasks.push(fz);if(!m1)m1=!0,H(()=>{m1=!1,l1.process()});if(H1||!c1)return new Promise((DU,dK)=>{g4=DU,v6=dK})}function O$(G1){return function(e0,...H1){w0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],M$=D0.indexOf(v6);if(M$===0)D0.shift();else if(M$>0)D0.splice(M$,1);if(v6.callback(e0,...H1),e0!=null)x1("error",e0,v6.data)}if(w0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function xz(G1){if(G1.length===0&&l1.idle())return H(()=>x1("drain")),!0;return!1}let NU=(G1)=>(e0)=>{if(!e0)return new Promise((H1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);H1(v6)})});Y1(G1),j0(G1,e0)};var pK=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:m,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(xz(G1))return;return G1.map((H1)=>i1(H1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(xz(G1))return;return G1.map((H1)=>i1(H1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){Y1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(xz(G1))return;return G1.map((H1)=>i1(H1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(xz(G1))return;return G1.map((H1)=>i1(H1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(pK)return;pK=!0;while(!l1.paused&&w0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],H1=l1._tasks.length;if(l1.payload)H1=Math.min(H1,l1.payload);for(var c1=0;c1<H1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(w0+=1,l1._tasks.length===0)x1("empty");if(w0===l1.concurrency)x1("saturated");var v6=h(O$(G1));K0(e0,v6)}pK=!1},length(){return l1._tasks.length},running(){return w0},workersList(){return D0},idle(){return l1._tasks.length+w0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,H(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:NU("saturated")},unsaturated:{writable:!1,value:NU("unsaturated")},empty:{writable:!1,value:NU("empty")},drain:{writable:!1,value:NU("drain")},error:{writable:!1,value:NU("error")}}),l1}function A0(f,n){return b1(f,1,n)}function Q0(f,n,m){return b1(f,n,m)}function P(f,n,m,K0){K0=T(K0);var w0=O(m);return U0(f,(D0,B0,j0)=>{w0(n,D0,(h0,Y1)=>{n=Y1,j0(h0)})},(D0)=>K0(D0,n))}var v=w(P,4);function u(...f){var n=f.map(O);return function(...m){var K0=this,w0=m[m.length-1];if(typeof w0=="function")m.pop();else w0=b0();return v(n,m,(D0,B0,j0)=>{B0.apply(K0,D0.concat((h0,...Y1)=>{j0(h0,Y1)}))},(D0,B0)=>w0(D0,...B0)),w0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,m,K0){return N(c(n),f,m,K0)}var J Line truncated
GFS4: `),console.error($)};if(!p4[s6]){if(Vu=global[s6]||[],xH0(p4,Vu),p4.close=function($){function U(Y,z){return $.call(p4,Y,function(Q){if(!Q)kH0();if(typeof z==="function")z.apply(this,arguments)})}return Object.defineProperty(U,MD,{value:$}),U}(p4.close),p4.closeSync=function($){function U(Y){$.apply(p4,arguments),kH0()}return Object.defineProperty(U,MD,{value:$}),U}(p4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){TY(p4[s6]),I0("assert").equal(p4[s6].length,0)})}var Vu;if(!global[s6])xH0(global,p4[s6]);wu.exports=Lu(rY1(p4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!p4.__patched)wu.exports=Lu(p4),p4.__patched=!0;function Lu($){lY1($),$.gracefulify=Lu,$.createReadStream=B,$.createWriteStream=T;var U=$.readFile;$.readFile=Y;function Y(C,b,x){if(typeof b==="function")x=b,b=null;return h(C,b,x);function h(i,c,z0,k){return U(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))YI([h,[i,c,z0],d,k||Date.now(),Date.now()]);else if(typeof z0==="function")z0.apply(this,arguments)})}}var z=$.writeFile;$.writeFile=Q;function Q(C,b,x,h){if(typeof x==="function")h=x,x=null;return i(C,b,x,h);function i(c,z0,k,d,t){return z(c,z0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))YI([i,[c,z0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=I;function I(C,b,x,h){if(typeof x==="function")h=x,x=null;return i(C,b,x,h);function i(c,z0,k,d,t){return J(c,z0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))YI([i,[c,z0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=G;function G(C,b,x,h){if(typeof x==="function")h=x,x=0;return i(C,b,x,h);function i(c,z0,k,d,t){return K(c,z0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))YI([i,[c,z0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var H=$.readdir;$.readdir=X;var W=/^v[0-5]\./;function X(C,b,x){if(typeof b==="function")x=b,b=null;var h=W.test(process.version)?function(z0,k,d,t){return H(z0,i(z0,k,d,t))}:function(z0,k,d,t){return H(z0,k,i(z0,k,d,t))};return h(C,b,x);function i(c,z0,k,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))YI([h,[c,z0,k],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof k==="function")k.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=oY1($);w=Z.ReadStream,N=Z.WriteStream}var q=$.ReadStream;if(q)w.prototype=Object.create(q.prototype),w.prototype.open=M;var V=$.WriteStream;if(V)N.prototype=Object.create(V.prototype),N.prototype.open=D;Object.defineProperty($,"ReadStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return N},set:function(C){N=C},enumerable:!0,configurable:!0});var F=w;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var O=N;Object.defineProperty($,"FileWriteStream",{get:function(){return O},set:function(C){O=C},enumerable:!0,configurable:!0});function w(C,b){if(this instanceof w)return q.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function M(){var C=this;j(C.path,C.flags,C.mode,function(b,x){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=x,C.emit("open",x),C.read()})}function N(C,b){if(this instanceof N)return V.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function D(){var C=this;j(C.path,C.flags,C.mode,function(b,x){if(b)C.destroy(),C.emit("error",b);else C.fd=x,C.emit("open",x)})}function B(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var A=$.open;$.open=j;function j(C,b,x,h){if(typeof x==="function")h=x,x=null;return i(C,b,x,h);function i(c,z0,k,d,t){return A(c,z0,k,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))YI([i,[c,z0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function YI($){TY("ENQUEUE",$[0].name,$[1]),p4[s6].push($),Fu()}var OD;function kH0(){var $=Date.now();for(var U=0;U<p4[s6].length;++U)if(p4[s6][U].length>2)p4[s6][U][3]=$,p4[s6][U][4]=$;Fu()}function Fu(){if(clearTimeout(OD),OD=void 0,p4[s6].length===0)return;var $=p4[s6].shift(),U=$[0],Y=$[1],z=$[2],Q=$[3],J=$[4];if(Q===void 0)TY("RETRY",U.name,Y),U.apply(null,Y);else if(Date.now()-Q>=60000){TY("TIMEOUT",U.name,Y);var I=Y.pop();if(typeof I==="function")I.call(null,z)}else{var K=Date.now()-J,G=Math.max(J-Q,1),H=Math.min(G*1.2,100);if(K>=H)TY("RETRY",U.name,Y),U.apply(null,Y.concat([Q]));else p4[s6].push($)}if(OD===void 0)OD=setTimeout(Fu,0)}});var uH0=E((Vr1,Ou)=>{function aY1($,U){if(!($ instanceof U))throw TypeError("Cannot call a class as a function")}var fH0=K6().Buffer,aW=I0("util");function tY1($,U,Y){$.copy(U,Y)}Ou.exports=function(){function $(){aY1(this,$),this.h Line truncated
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/TW0.exports=function($,Y){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var U="";if(z>4&&$[3]==="\\"){var I=$[2];if((I==="?"||I===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var Q=$.split(/[/\\]+/);if(Y!==!1&&Q[Q.length-1]==="")Q.pop();return U+Q.join("/")}});var xu=E((Tr1,hW0)=>{var EW0=9007199254740991,II1="[object Arguments]",QI1="[object Function]",JI1="[object GeneratorFunction]",KI1=/^(?:0|[1-9]\d*)$/;function CW0($,Y,z){switch(z.length){case 0:return $.call(Y);case 1:return $.call(Y,z[0]);case 2:return $.call(Y,z[0],z[1]);case 3:return $.call(Y,z[0],z[1],z[2])}return $.apply(Y,z)}function GI1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}var JX=Object.prototype,KX=JX.hasOwnProperty,RW0=JX.toString,HI1=JX.propertyIsEnumerable,jW0=Math.max;function WI1($,Y){var z=NI1($)||OI1($)?GI1($.length,String):[],U=z.length,I=!!U;for(var Q in $)if((Y||KX.call($,Q))&&!(I&&(Q=="length"||vW0(Q,U))))z.push(Q);return z}function XI1($,Y,z,U){if($===void 0||gu($,JX[z])&&!KX.call(U,z))return Y;return $}function ZI1($,Y,z){var U=$[Y];if(!(KX.call($,Y)&&gu(U,z))||z===void 0&&!(Y in $))$[Y]=z}function qI1($){if(!ku($))return MI1($);var Y=wI1($),z=[];for(var U in $)if(!(U=="constructor"&&(Y||!KX.call($,U))))z.push(U);return z}function _W0($,Y){return Y=jW0(Y===void 0?$.length-1:Y,0),function(){var z=arguments,U=-1,I=jW0(z.length-Y,0),Q=Array(I);while(++U<I)Q[U]=z[Y+U];U=-1;var J=Array(Y+1);while(++U<Y)J[U]=z[U];return J[Y]=Q,CW0($,this,J)}}function VI1($,Y,z,U){z||(z={});var I=-1,Q=Y.length;while(++I<Q){var J=Y[I],K=U?U(z[J],$[J],J,z,$):void 0;ZI1(z,J,K===void 0?$[J]:K)}return z}function LI1($){return _W0(function(Y,z){var U=-1,I=z.length,Q=I>1?z[I-1]:void 0,J=I>2?z[2]:void 0;if(Q=$.length>3&&typeof Q=="function"?(I--,Q):void 0,J&&FI1(z[0],z[1],J))Q=I<3?void 0:Q,I=1;Y=Object(Y);while(++U<I){var K=z[U];if(K)$(Y,K,U,Q)}return Y})}function vW0($,Y){return Y=Y==null?EW0:Y,!!Y&&(typeof $=="number"||KI1.test($))&&($>-1&&$%1==0&&$<Y)}function FI1($,Y,z){if(!ku(z))return!1;var U=typeof Y;if(U=="number"?yu(z)&&vW0(Y,z.length):U=="string"&&(Y in z))return gu(z[Y],$);return!1}function wI1($){var Y=$&&$.constructor,z=typeof Y=="function"&&Y.prototype||JX;return $===z}function MI1($){var Y=[];if($!=null)for(var z in Object($))Y.push(z);return Y}function gu($,Y){return $===Y||$!==$&&Y!==Y}function OI1($){return DI1($)&&KX.call($,"callee")&&(!HI1.call($,"callee")||RW0.call($)==II1)}var NI1=Array.isArray;function yu($){return $!=null&&PI1($.length)&&!AI1($)}function DI1($){return BI1($)&&yu($)}function AI1($){var Y=ku($)?RW0.call($):"";return Y==QI1||Y==JI1}function PI1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=EW0}function ku($){var Y=typeof $;return!!$&&(Y=="object"||Y=="function")}function BI1($){return!!$&&typeof $=="object"}var TI1=LI1(function($,Y,z,U){VI1(Y,EI1(Y),$,U)}),jI1=_W0(function($){return $.push(void 0,XI1),CW0(TI1,void 0,$)});function EI1($){return yu($)?WI1($,!0):qI1($)}hW0.exports=jI1});var gW0=E((jr1,fu)=>{function CI1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var SW0=K6().Buffer,GX=J0("util");function RI1($,Y,z){$.copy(Y,z)}fu.exports=function(){function $(){CI1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,I=""+U.data;while(U=U.next)I+=z+U.data;return I},$.prototype.concat=function(z){if(this.length===0)return SW0.alloc(0);var U=SW0.allocUnsafe(z>>>0),I=this.head,Q=0;while(I)RI1(I.data,U,Q),Q+=I.data.length,I=I.next;return U},$}();if(GX&&GX.inspect&&GX.inspect.custom)fu.exports.prototype[GX.inspect.custom]=function(){var $=GX.inspect({length:this.length});return this.constructor.name+" "+$}});var uu=E((Er1,yW0)=>{var hD=J6();function _I1($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,I=this._writableState&&this._writableState.destroyed;if(U||I){if(Y)Y($);else if($){if(!this._writableState)hD.nextTick(SD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,hD.nextTick(SD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(Q){if(!Y&&Q){if(!z._writableState)hD.nextTick(SD,z,Q);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,hD.nextTick(SD,z,Q)}else if(Y)Y(Q)}),this}function vI1(){if(this._readableState)this._readabl Line truncated
%s`,B,B,O,U);var T=O.type==="*"?Pb:O.type==="?"?Ab:"\\"+O.type;I=!0,U=U.slice(0,O.reStart)+T+"\\("+B}if(V(),Q)U+="\\\\";var A=!1;switch(U.charAt(0)){case"[":case".":case"(":A=!0}for(var j=K.length-1;j>-1;j--){var C=K[j],b=U.slice(0,C.reStart),k=U.slice(C.reStart,C.reEnd-8),h=U.slice(C.reEnd-8,C.reEnd),i=U.slice(C.reEnd);h+=i;var c=b.split("(").length-1,U0=i;for(F=0;F<c;F++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var x="";if(i===""&&Y!==rD)x="$";var d=b+k+i+x+h;U=d}if(U!==""&&I)U="(?=.)"+U;if(A)U=Z+U;if(Y===rD)return[U,I];if(!I)return sG1($);var t=z.nocase?"i":"";try{var $0=new RegExp("^"+U+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=U,$0}W$.makeRe=function($,Y){return new L6($,Y||{}).makeRe()};L6.prototype.makeRe=rG1;function rG1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var Y=this.options,z=Y.noglobstar?Pb:Y.dot?iG1:cG1,U=Y.nocase?"i":"",I=$.map(function(Q){return Q.map(function(J){return J===gz?z:typeof J==="string"?aG1(J):J._src}).join("\\/")}).join("|");if(I="^(?:"+I+")$",this.negate)I="^(?!"+I+").*$";try{this.regexp=new RegExp(I,U)}catch(Q){this.regexp=!1}return this.regexp}W$.match=function($,Y,z){z=z||{};var U=new L6(Y,z);if($=$.filter(function(I){return U.match(I)}),U.options.nonull&&!$.length)$.push(Y);return $};L6.prototype.match=function(Y,z){if(typeof z>"u")z=this.partial;if(this.debug("match",Y,this.pattern),this.comment)return!1;if(this.empty)return Y==="";if(Y==="/"&&z)return!0;var U=this.options;if(NX.sep!=="/")Y=Y.split(NX.sep).join("/");Y=Y.split(VZ0),this.debug(this.pattern,"split",Y);var I=this.set;this.debug(this.pattern,"set",I);var Q,J;for(J=Y.length-1;J>=0;J--)if(Q=Y[J],Q)break;for(J=0;J<I.length;J++){var K=I[J],G=Y;if(U.matchBase&&K.length===1)G=[Q];var H=this.matchOne(G,K,z);if(H){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};L6.prototype.matchOne=function($,Y,z){if(Y.indexOf(gz)!==-1)return this._matchGlobstar($,Y,z,0,0);return this._matchOne($,Y,z,0,0)};L6.prototype._matchGlobstar=function($,Y,z,U,I){var Q,J=-1;for(Q=I;Q<Y.length;Q++)if(Y[Q]===gz){J=Q;break}var K=-1;for(Q=Y.length-1;Q>=0;Q--)if(Y[Q]===gz){K=Q;break}var G=Y.slice(I,J),H=z?Y.slice(J+1):Y.slice(J+1,K),W=z?[]:Y.slice(K+1);if(G.length){var X=$.slice(U,U+G.length);if(!this._matchOne(X,G,z,0,0))return!1;U+=G.length}var Z=0;if(W.length){if(W.length+U>$.length)return!1;var q=$.length-W.length;if(this._matchOne($,W,z,q,0))Z=W.length;else{if($[$.length-1]!==""||U+W.length===$.length)return!1;if(q--,!this._matchOne($,W,z,q,0))return!1;Z=W.length+1}}if(!H.length){var V=!!Z;for(Q=U;Q<$.length-Z;Q++){var F=String($[Q]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return z||V}var M=[[[],0]],w=M[0],O=0,D=[0];for(var N=0;N<H.length;N++){var B=H[N];if(B===gz)D.push(O),w=[[],0],M.push(w);else w[0].push(B),O++}var T=M.length-1,A=$.length-Z;for(var j=0;j<M.length;j++)M[j][1]=A-(D[T--]+M[j][0].length);return!!this._matchGlobStarBodySections($,M,U,0,z,0,!!Z)};L6.prototype._matchGlobStarBodySections=function($,Y,z,U,I,Q,J){var K=Y[U];if(!K){for(var G=z;G<$.length;G++){J=!0;var H=$[G];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1}return J}var W=K[0],X=K[1];while(z<=X){var Z=this._matchOne($.slice(0,z+W.length),W,I,z,0);if(Z&&Q<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,Y,z+W.length,U+1,I,Q+1,J);if(q!==!1)return q}var H=$[z];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1;z++}return I||null};L6.prototype._matchOne=function($,Y,z,U,I){var Q,J,K,G;for(Q=U,J=I,K=$.length,G=Y.length;Q<K&&J<G;Q++,J++){this.debug("matchOne loop");var H=Y[J],W=$[Q];if(this.debug(Y,H,W),H===!1||H===gz)return!1;var X;if(typeof H==="string")X=W===H,this.debug("string match",H,W,X);else X=W.match(H),this.debug("pattern match",H,W,X);if(!X)return!1}if(Q===K&&J===G)return!0;else if(Q===K)return z;else if(J===G)return Q===K-1&&$[Q]==="";throw Error("wtf?")};function sG1($){return $.replace(/\\(.)/g,"$1")}function aG1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var eD=E((lr1,tD)=>{function wZ0($){return $.charAt(0)==="/"}function MZ0($){var Y=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=Y.exec($),U=z[1]||"",I=Boolean(U&&U.charAt(1)!==":");return Boolean(z[2]||I)}tD.exports=process.platform==="win32"?MZ0:wZ0;tD.exports.posix=wZ0;tD.exports.win32=MZ0});var Tb=E((KH1)=>{KH1.setopts=UH1;KH1.ownProp=OZ0;KH1.makeAbs=DX;KH1.finish=IH1;KH1.mark=QH1;KH1.isIgnored=DZ0;KH1.childrenIgnored=JH1;function OZ0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}var tG1=J0("fs"),LJ=J0("path"),eG1=aD(),NZ0=eD(),Bb=eG1.Minimatch;function $H1($,Y){return $.localeCompare(Y,"en")}function YH1($,Y){if($.ignore=Y.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(zH1)}function zH1($){var Y=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");Y=new Bb(z,{dot:!0})}return{ma Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new T6($,Y).found}function T6($,Y){if(!$)throw Error("must provide pattern");if(typeof Y==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,Y);if(FH1(this,$,Y),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var U=0;U<z;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}T6.prototype._finish=function(){if(PZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(Y,z){var U=$.matches[z]=Object.create(null);for(var I in Y)try{I=$._makeAbs(I);var Q=LH1.realpathSync(I,$.realpathCache);U[Q]=!0}catch(J){if(J.syscall==="stat")U[$._makeAbs(I)]=!0;else throw J}})}yz.finish(this)};T6.prototype._process=function($,Y,z){PZ0.ok(this instanceof T6);var U=0;while(typeof $[U]==="string")U++;var I;switch(U){case $.length:this._processSimple($.join("/"),Y);return;case 0:I=null;break;default:I=$.slice(0,U).join("/");break}var Q=$.slice(U),J;if(I===null)J=".";else if($A(I)||$A($.map(function(H){return typeof H==="string"?H:"[*]"}).join("/"))){if(!I||!$A(I))I="/"+I;J=I}else J=I;var K=this._makeAbs(J);if(wH1(this,J))return;var G=Q[0]===AZ0.GLOBSTAR;if(G)this._processGlobStar(I,J,K,Q,Y,z);else this._processReaddir(I,J,K,Q,Y,z)};T6.prototype._processReaddir=function($,Y,z,U,I,Q){var J=this._readdir(z,Q);if(!J)return;var K=U[0],G=!!this.minimatch.negate,H=K._glob,W=this.dot||H.charAt(0)===".",X=[];for(var Z=0;Z<J.length;Z++){var q=J[Z];if(q.charAt(0)!=="."||W){var V;if(G&&!$)V=!q.match(K);else V=q.match(K);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[I])this.matches[I]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=jb.join(this.root,q);this._emitMatch(I,q)}return}U.shift();for(var Z=0;Z<F;Z++){var q=X[Z],M;if($)M=[$,q];else M=[q];this._process(M.concat(U),I,Q)}};T6.prototype._emitMatch=function($,Y){if(MH1(this,Y))return;var z=this._makeAbs(Y);if(this.mark)Y=this._mark(Y);if(this.absolute)Y=z;if(this.matches[$][Y])return;if(this.nodir){var U=this.cache[z];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][Y]=!0,this.stat)this._stat(Y)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var Y,z,U;try{z=this.fs.lstatSync($)}catch(Q){if(Q.code==="ENOENT")return null}var I=z&&z.isSymbolicLink();if(this.symlinks[$]=I,!I&&z&&!z.isDirectory())this.cache[$]="FILE";else Y=this._readdir($,!1);return Y};T6.prototype._readdir=function($,Y){var z;if(Y&&!Eb(this.symlinks,$))return this._readdirInGlobStar($);if(Eb(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(I){return this._readdirError($,I),null}};T6.prototype._readdirEntries=function($,Y){if(!this.mark&&!this.stat)for(var z=0;z<Y.length;z++){var U=Y[z];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=Y,Y};T6.prototype._readdirError=function($,Y){switch(Y.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var U=Error(Y.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=Y.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw Y;if(!this.silent)console.error("glob error",Y);break}};T6.prototype._processGlobStar=function($,Y,z,U,I,Q){var J=this._readdir(z,Q);if(!J)return;var K=U.slice(1),G=$?[$]:[],H=G.concat(K);this._process(H,I,!1);var W=J.length,X=this.symlinks[z];if(X&&Q)return;for(var Z=0;Z<W;Z++){var q=J[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(J[Z],K);this._process(V,I,!0);var F=G.concat(J[Z],U);this._process(F,I,!0)}};T6.prototype._processSimple=function($,Y){var z=this._stat($);if(!this.matches[Y])this.matches[Y]=Object.create(null);if(!z)return;if($&&$A($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=jb.join(this.root,$);else if($=jb.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(Y,$)};T6.prototype._stat=function($){var Y=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Eb(this.cache,Y)){var J=this.cache[Y];if(Array.isArray(J))J="DIR";if(!z||J==="DIR")return J;if(z&&J==="FILE")return!1}var U,I=this.statCache[Y];if(!I){var Q;try{Q=this.fs.lstatSync(Y)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[Y]=!1,!1}if(Q&&Q.isSymbolicLink())try{I=this.fs.statSync(Y)}catch(K){I=Q}else I=Q}this.statCache[Y]=I;var J=!0;if(I)J=I.isDirectory()?"DIR":"FILE";if(this.cache[Y]=this.cache[Y]||J,z&&J==="FILE")return!1;return J};T6.prototype._mark=function($){return yz.mark(this,$)};T6.prototype._makeAbs=function($){return yz.makeAbs(this,$)}});var Cb=E((er1,CZ0)=>{CZ0.exports=EZ0;function EZ0($,Y){if($&&Y)return EZ0($)(Y);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){z[U]=$[U]}),z;f Line truncated
`);if($.linkname)Y+=ji(" linkpath="+$.linkname+`
`);var z=$.pax;if(z)for(var U in z)Y+=ji(" "+U+"="+z[U]+`
`);return Buffer.from(Y)};CZ1.decodePax=function($){var Y={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var U=parseInt($.slice(0,z).toString(),10);if(!U)return Y;var I=$.slice(z+1,U-1).toString(),Q=I.indexOf("=");if(Q===-1)return Y;Y[I.slice(0,Q)]=I.slice(Q+1),$=$.slice(U)}return Y};CZ1.encode=function($){var Y=wZ1(512),z=$.name,U="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var I=z.indexOf("/");if(I===-1)return null;U+=U?"/"+z.slice(0,I):z.slice(0,I),z=z.slice(I+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(Y.write(z),Y.write(D2($.mode&PZ1,6),100),Y.write(D2($.uid,6),108),Y.write(D2($.gid,6),116),Y.write(D2($.size,11),124),Y.write(D2($.mtime.getTime()/1000|0,11),136),Y[156]=cV0+jZ1($.type),$.linkname)Y.write($.linkname,157);if(nV0.copy(Y,xX),NZ1.copy(Y,Ei),$.uname)Y.write($.uname,265);if($.gname)Y.write($.gname,297);if(Y.write(D2($.devmajor||0,6),329),Y.write(D2($.devminor||0,6),337),U)Y.write(U,345);return Y.write(D2(dV0(Y),6),148),Y};CZ1.decode=function($,Y,z){var U=$[156]===0?0:$[156]-cV0,I=BJ($,0,100,Y),Q=A2($,100,8),J=A2($,108,8),K=A2($,116,8),G=A2($,124,12),H=A2($,136,12),W=TZ1(U),X=$[157]===0?null:BJ($,157,100,Y),Z=BJ($,265,32),q=BJ($,297,32),V=A2($,329,8),F=A2($,337,8),M=dV0($);if(M===256)return null;if(M!==A2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(nV0.compare($,xX,xX+6)===0){if($[345])I=BJ($,345,155,Y)+"/"+I}else if(DZ1.compare($,xX,xX+6)===0&&AZ1.compare($,Ei,Ei+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(U===0&&I&&I[I.length-1]==="/")U=5;return{name:I,mode:Q,uid:J,gid:K,size:G,mtime:new Date(1000*H),type:W,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var tV0=E((ls1,aV0)=>{var lV0=J0("util"),gZ1=iV0(),fX=Ci(),oV0=E8().Writable,rV0=E8().PassThrough,sV0=function(){},mV0=function($){return $&=511,$&&512-$},yZ1=function($,Y){var z=new NA($,Y);return z.end(),z},kZ1=function($,Y){if(Y.path)$.name=Y.path;if(Y.linkpath)$.linkname=Y.linkpath;if(Y.size)$.size=parseInt(Y.size,10);return $.pax=Y,$},NA=function($,Y){this._parent=$,this.offset=Y,rV0.call(this,{autoDestroy:!1})};lV0.inherits(NA,rV0);NA.prototype.destroy=function($){this._parent.destroy($)};var P3=function($){if(!(this instanceof P3))return new P3($);oV0.call(this,$),$=$||{},this._offset=0,this._buffer=gZ1(),this._missing=0,this._partial=!1,this._onparse=sV0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var Y=this,z=Y._buffer,U=function(){Y._continue()},I=function(Z){if(Y._locked=!1,Z)return Y.destroy(Z);if(!Y._stream)U()},Q=function(){Y._stream=null;var Z=mV0(Y._header.size);if(Z)Y._parse(Z,J);else Y._parse(512,X);if(!Y._locked)U()},J=function(){Y._buffer.consume(mV0(Y._header.size)),Y._parse(512,X),U()},K=function(){var Z=Y._header.size;Y._paxGlobal=fX.decodePax(z.slice(0,Z)),z.consume(Z),Q()},G=function(){var Z=Y._header.size;if(Y._pax=fX.decodePax(z.slice(0,Z)),Y._paxGlobal)Y._pax=Object.assign({},Y._paxGlobal,Y._pax);z.consume(Z),Q()},H=function(){var Z=Y._header.size;this._gnuLongPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),Q()},W=function(){var Z=Y._header.size;this._gnuLongLinkPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),Q()},X=function(){var Z=Y._offset,q;try{q=Y._header=fX.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){Y.emit("error",V)}if(z.consume(512),!q){Y._parse(512,X),U();return}if(q.type==="gnu-long-path"){Y._parse(q.size,H),U();return}if(q.type==="gnu-long-link-path"){Y._parse(q.size,W),U();return}if(q.type==="pax-global-header"){Y._parse(q.size,K),U();return}if(q.type==="pax-header"){Y._parse(q.size,G),U();return}if(Y._gnuLongPath)q.name=Y._gnuLongPath,Y._gnuLongPath=null;if(Y._gnuLongLinkPath)q.linkname=Y._gnuLongLinkPath,Y._gnuLongLinkPath=null;if(Y._pax)Y._header=q=kZ1(q,Y._pax),Y._pax=null;if(Y._locked=!0,!q.size||q.type==="directory"){Y._parse(512,X),Y.emit("entry",q,yZ1(Y,Z),I);return}Y._stream=new NA(Y,Z),Y.emit("entry",q,Y._stream,I),Y._parse(q.size,Q),U()};this._onheader=X,this._parse(512,X)};lV0.inherits(P3,oV0);P3.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};P3.prototype._parse=function($,Y){if(this._destroyed)return;if(this._offset+=$,this._missing=$,Y===this._onheader)this._partial=!1;this._onparse=Y};P3.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=sV0,this._overflow)this._write(this._overflow,void 0,$);else $()};P3.prototype._write=function($,Y,z){if(this._destroyed)return;var U=this._stream,I=this._buffer,Q=this._missing;if($.length)this._partial=!0;if($.length<Q) Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let Y=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${Yq1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${$.Target}"/>`);return Y}_writeClose(){this.stream.write("</Relationships>")}}BL0.exports=PL0});var _L0=E((Ua1,RL0)=>{var jL0=l6(),EL0=e7(),Uq1=i4(),Iq1=ix(),Qq1=nx();class CL0{constructor($,Y,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=Y}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:EL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let Y={Type:EL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(Y)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,Y){let z=new Iq1,U=new jL0;z.render(U,$),this.commentsStream.write(U.xml);let I=new Qq1,Q=new jL0;I.render(Q,$,Y),this.vmlStream.write(Q.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((Y)=>{Y.refAddress=Uq1.decodeAddress(Y.ref)}),$.forEach((Y)=>{this._writeComment(Y,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}RL0.exports=CL0});var kL0=E((Ia1,yL0)=>{var Jq1=Y6(),Kq1=e7(),vi=i4(),vL0=Jg(),hL0=$3(),Gq1=Nk(),SL0=TM(),hi=EM(),Hq1=TL0(),Wq1=_L0(),Xq1=Ig(),y6=new Gq1,Si=s7(),Zq1=Lx(),qq1=Fx(),Vq1=wx(),Lq1=Xx(),Fq1=Hx(),wq1=Zx(),Mq1=Mx(),Oq1=Ox(),Nq1=Nx(),Dq1=Dx(),Aq1=Ax(),Pq1=Px(),Bq1=Cx(),Tq1=Tx(),jq1=Bx(),k6={dataValidations:new Zq1,sheetProperties:new qq1,sheetFormatProperties:new Vq1,columns:new Si({tag:"cols",length:!1,childXform:new Lq1}),row:new Fq1,hyperlinks:new Si({tag:"hyperlinks",length:!1,childXform:new wq1}),sheetViews:new Si({tag:"sheetViews",length:!1,childXform:new Mq1}),sheetProtection:new Oq1,pageMargins:new Nq1,pageSeteup:new Dq1,autoFilter:new Aq1,picture:new Pq1,conditionalFormattings:new Bq1,headerFooter:new Tq1,rowBreaks:new jq1};class gL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new Hq1($),this._sheetCommentsWriter=new Wq1(this,this._sheetRelsWriter,$),this._dimensions=new hL0,this._rowZero=1,this.committed=!1,this.dataValidations=new Xq1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
*/TW0.exports=function($,U){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var Y=$.length;if(Y<=1)return $;var z="";if(Y>4&&$[3]==="\\"){var Q=$[2];if((Q==="?"||Q===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),z="//"}var J=$.split(/[/\\]+/);if(U!==!1&&J[J.length-1]==="")J.pop();return z+J.join("/")}});var xu=E((jr1,hW0)=>{var EW0=9007199254740991,QQ1="[object Arguments]",JQ1="[object Function]",IQ1="[object GeneratorFunction]",KQ1=/^(?:0|[1-9]\d*)$/;function CW0($,U,Y){switch(Y.length){case 0:return $.call(U);case 1:return $.call(U,Y[0]);case 2:return $.call(U,Y[0],Y[1]);case 3:return $.call(U,Y[0],Y[1],Y[2])}return $.apply(U,Y)}function GQ1($,U){var Y=-1,z=Array($);while(++Y<$)z[Y]=U(Y);return z}var IX=Object.prototype,KX=IX.hasOwnProperty,RW0=IX.toString,HQ1=IX.propertyIsEnumerable,jW0=Math.max;function WQ1($,U){var Y=NQ1($)||MQ1($)?GQ1($.length,String):[],z=Y.length,Q=!!z;for(var J in $)if((U||KX.call($,J))&&!(Q&&(J=="length"||vW0(J,z))))Y.push(J);return Y}function XQ1($,U,Y,z){if($===void 0||gu($,IX[Y])&&!KX.call(z,Y))return U;return $}function ZQ1($,U,Y){var z=$[U];if(!(KX.call($,U)&&gu(z,Y))||Y===void 0&&!(U in $))$[U]=Y}function qQ1($){if(!ku($))return OQ1($);var U=wQ1($),Y=[];for(var z in $)if(!(z=="constructor"&&(U||!KX.call($,z))))Y.push(z);return Y}function _W0($,U){return U=jW0(U===void 0?$.length-1:U,0),function(){var Y=arguments,z=-1,Q=jW0(Y.length-U,0),J=Array(Q);while(++z<Q)J[z]=Y[U+z];z=-1;var I=Array(U+1);while(++z<U)I[z]=Y[z];return I[U]=J,CW0($,this,I)}}function VQ1($,U,Y,z){Y||(Y={});var Q=-1,J=U.length;while(++Q<J){var I=U[Q],K=z?z(Y[I],$[I],I,Y,$):void 0;ZQ1(Y,I,K===void 0?$[I]:K)}return Y}function LQ1($){return _W0(function(U,Y){var z=-1,Q=Y.length,J=Q>1?Y[Q-1]:void 0,I=Q>2?Y[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Q--,J):void 0,I&&FQ1(Y[0],Y[1],I))J=Q<3?void 0:J,Q=1;U=Object(U);while(++z<Q){var K=Y[z];if(K)$(U,K,z,J)}return U})}function vW0($,U){return U=U==null?EW0:U,!!U&&(typeof $=="number"||KQ1.test($))&&($>-1&&$%1==0&&$<U)}function FQ1($,U,Y){if(!ku(Y))return!1;var z=typeof U;if(z=="number"?yu(Y)&&vW0(U,Y.length):z=="string"&&(U in Y))return gu(Y[U],$);return!1}function wQ1($){var U=$&&$.constructor,Y=typeof U=="function"&&U.prototype||IX;return $===Y}function OQ1($){var U=[];if($!=null)for(var Y in Object($))U.push(Y);return U}function gu($,U){return $===U||$!==$&&U!==U}function MQ1($){return DQ1($)&&KX.call($,"callee")&&(!HQ1.call($,"callee")||RW0.call($)==QQ1)}var NQ1=Array.isArray;function yu($){return $!=null&&PQ1($.length)&&!AQ1($)}function DQ1($){return BQ1($)&&yu($)}function AQ1($){var U=ku($)?RW0.call($):"";return U==JQ1||U==IQ1}function PQ1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=EW0}function ku($){var U=typeof $;return!!$&&(U=="object"||U=="function")}function BQ1($){return!!$&&typeof $=="object"}var TQ1=LQ1(function($,U,Y,z){VQ1(U,EQ1(U),$,z)}),jQ1=_W0(function($){return $.push(void 0,XQ1),CW0(TQ1,void 0,$)});function EQ1($){return yu($)?WQ1($,!0):qQ1($)}hW0.exports=jQ1});var gW0=E((Er1,fu)=>{function CQ1($,U){if(!($ instanceof U))throw TypeError("Cannot call a class as a function")}var SW0=K6().Buffer,GX=I0("util");function RQ1($,U,Y){$.copy(U,Y)}fu.exports=function(){function $(){CQ1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(Y){var z={data:Y,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(Y){var z={data:Y,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length},$.prototype.shift=function(){if(this.length===0)return;var Y=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,Y},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(Y){if(this.length===0)return"";var z=this.head,Q=""+z.data;while(z=z.next)Q+=Y+z.data;return Q},$.prototype.concat=function(Y){if(this.length===0)return SW0.alloc(0);var z=SW0.allocUnsafe(Y>>>0),Q=this.head,J=0;while(Q)RQ1(Q.data,z,J),J+=Q.data.length,Q=Q.next;return z},$}();if(GX&&GX.inspect&&GX.inspect.custom)fu.exports.prototype[GX.inspect.custom]=function(){var $=GX.inspect({length:this.length});return this.constructor.name+" "+$}});var uu=E((Cr1,yW0)=>{var hD=I6();function _Q1($,U){var Y=this,z=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(z||Q){if(U)U($);else if($){if(!this._writableState)hD.nextTick(SD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,hD.nextTick(SD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!U&&J){if(!Y._writableState)hD.nextTick(SD,Y,J);else if(!Y._writableState.errorEmitted)Y._writableState.errorEmitted=!0,hD.nextTick(SD,Y,J)}else if(U)U(J)}),this}function vQ1(){if(this._readableState)this._readabl Line truncated
%s`,B,B,M,z);var T=M.type==="*"?Pb:M.type==="?"?Ab:"\\"+M.type;Q=!0,z=z.slice(0,M.reStart)+T+"\\("+B}if(V(),J)z+="\\\\";var A=!1;switch(z.charAt(0)){case"[":case".":case"(":A=!0}for(var j=K.length-1;j>-1;j--){var C=K[j],b=z.slice(0,C.reStart),x=z.slice(C.reStart,C.reEnd-8),h=z.slice(C.reEnd-8,C.reEnd),i=z.slice(C.reEnd);h+=i;var c=b.split("(").length-1,z0=i;for(F=0;F<c;F++)z0=z0.replace(/\)[+*?]?/,"");i=z0;var k="";if(i===""&&U!==rD)k="$";var d=b+x+i+k+h;z=d}if(z!==""&&Q)z="(?=.)"+z;if(A)z=Z+z;if(U===rD)return[z,Q];if(!Q)return sG1($);var t=Y.nocase?"i":"";try{var $0=new RegExp("^"+z+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=z,$0}W$.makeRe=function($,U){return new L6($,U||{}).makeRe()};L6.prototype.makeRe=rG1;function rG1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var U=this.options,Y=U.noglobstar?Pb:U.dot?iG1:cG1,z=U.nocase?"i":"",Q=$.map(function(J){return J.map(function(I){return I===gY?Y:typeof I==="string"?aG1(I):I._src}).join("\\/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,z)}catch(J){this.regexp=!1}return this.regexp}W$.match=function($,U,Y){Y=Y||{};var z=new L6(U,Y);if($=$.filter(function(Q){return z.match(Q)}),z.options.nonull&&!$.length)$.push(U);return $};L6.prototype.match=function(U,Y){if(typeof Y>"u")Y=this.partial;if(this.debug("match",U,this.pattern),this.comment)return!1;if(this.empty)return U==="";if(U==="/"&&Y)return!0;var z=this.options;if(NX.sep!=="/")U=U.split(NX.sep).join("/");U=U.split(VZ0),this.debug(this.pattern,"split",U);var Q=this.set;this.debug(this.pattern,"set",Q);var J,I;for(I=U.length-1;I>=0;I--)if(J=U[I],J)break;for(I=0;I<Q.length;I++){var K=Q[I],G=U;if(z.matchBase&&K.length===1)G=[J];var H=this.matchOne(G,K,Y);if(H){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate};L6.prototype.matchOne=function($,U,Y){if(U.indexOf(gY)!==-1)return this._matchGlobstar($,U,Y,0,0);return this._matchOne($,U,Y,0,0)};L6.prototype._matchGlobstar=function($,U,Y,z,Q){var J,I=-1;for(J=Q;J<U.length;J++)if(U[J]===gY){I=J;break}var K=-1;for(J=U.length-1;J>=0;J--)if(U[J]===gY){K=J;break}var G=U.slice(Q,I),H=Y?U.slice(I+1):U.slice(I+1,K),W=Y?[]:U.slice(K+1);if(G.length){var X=$.slice(z,z+G.length);if(!this._matchOne(X,G,Y,0,0))return!1;z+=G.length}var Z=0;if(W.length){if(W.length+z>$.length)return!1;var q=$.length-W.length;if(this._matchOne($,W,Y,q,0))Z=W.length;else{if($[$.length-1]!==""||z+W.length===$.length)return!1;if(q--,!this._matchOne($,W,Y,q,0))return!1;Z=W.length+1}}if(!H.length){var V=!!Z;for(J=z;J<$.length-Z;J++){var F=String($[J]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return Y||V}var O=[[[],0]],w=O[0],M=0,N=[0];for(var D=0;D<H.length;D++){var B=H[D];if(B===gY)N.push(M),w=[[],0],O.push(w);else w[0].push(B),M++}var T=O.length-1,A=$.length-Z;for(var j=0;j<O.length;j++)O[j][1]=A-(N[T--]+O[j][0].length);return!!this._matchGlobStarBodySections($,O,z,0,Y,0,!!Z)};L6.prototype._matchGlobStarBodySections=function($,U,Y,z,Q,J,I){var K=U[z];if(!K){for(var G=Y;G<$.length;G++){I=!0;var H=$[G];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1}return I}var W=K[0],X=K[1];while(Y<=X){var Z=this._matchOne($.slice(0,Y+W.length),W,Q,Y,0);if(Z&&J<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,U,Y+W.length,z+1,Q,J+1,I);if(q!==!1)return q}var H=$[Y];if(H==="."||H===".."||!this.options.dot&&H.charAt(0)===".")return!1;Y++}return Q||null};L6.prototype._matchOne=function($,U,Y,z,Q){var J,I,K,G;for(J=z,I=Q,K=$.length,G=U.length;J<K&&I<G;J++,I++){this.debug("matchOne loop");var H=U[I],W=$[J];if(this.debug(U,H,W),H===!1||H===gY)return!1;var X;if(typeof H==="string")X=W===H,this.debug("string match",H,W,X);else X=W.match(H),this.debug("pattern match",H,W,X);if(!X)return!1}if(J===K&&I===G)return!0;else if(J===K)return Y;else if(I===G)return J===K-1&&$[J]==="";throw Error("wtf?")};function sG1($){return $.replace(/\\(.)/g,"$1")}function aG1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var eD=E((or1,tD)=>{function wZ0($){return $.charAt(0)==="/"}function OZ0($){var U=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,Y=U.exec($),z=Y[1]||"",Q=Boolean(z&&z.charAt(1)!==":");return Boolean(Y[2]||Q)}tD.exports=process.platform==="win32"?OZ0:wZ0;tD.exports.posix=wZ0;tD.exports.win32=OZ0});var Tb=E((KH1)=>{KH1.setopts=zH1;KH1.ownProp=MZ0;KH1.makeAbs=DX;KH1.finish=QH1;KH1.mark=JH1;KH1.isIgnored=DZ0;KH1.childrenIgnored=IH1;function MZ0($,U){return Object.prototype.hasOwnProperty.call($,U)}var tG1=I0("fs"),LI=I0("path"),eG1=aD(),NZ0=eD(),Bb=eG1.Minimatch;function $H1($,U){return $.localeCompare(U,"en")}function UH1($,U){if($.ignore=U.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(YH1)}function YH1($){var U=null;if($.slice(-3)==="/**"){var Y=$.replace(/(\/\*\*)+$/,"");U=new Bb(Y,{dot:!0})}return{ma Line truncated
See: https://github.com/isaacs/node-glob/issues/167`);return new T6($,U).found}function T6($,U){if(!$)throw Error("must provide pattern");if(typeof U==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,U);if(FH1(this,$,U),this.noprocess)return this;var Y=this.minimatch.set.length;this.matches=Array(Y);for(var z=0;z<Y;z++)this._process(this.minimatch.set[z],z,!1);this._finish()}T6.prototype._finish=function(){if(PZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(U,Y){var z=$.matches[Y]=Object.create(null);for(var Q in U)try{Q=$._makeAbs(Q);var J=LH1.realpathSync(Q,$.realpathCache);z[J]=!0}catch(I){if(I.syscall==="stat")z[$._makeAbs(Q)]=!0;else throw I}})}yY.finish(this)};T6.prototype._process=function($,U,Y){PZ0.ok(this instanceof T6);var z=0;while(typeof $[z]==="string")z++;var Q;switch(z){case $.length:this._processSimple($.join("/"),U);return;case 0:Q=null;break;default:Q=$.slice(0,z).join("/");break}var J=$.slice(z),I;if(Q===null)I=".";else if($A(Q)||$A($.map(function(H){return typeof H==="string"?H:"[*]"}).join("/"))){if(!Q||!$A(Q))Q="/"+Q;I=Q}else I=Q;var K=this._makeAbs(I);if(wH1(this,I))return;var G=J[0]===AZ0.GLOBSTAR;if(G)this._processGlobStar(Q,I,K,J,U,Y);else this._processReaddir(Q,I,K,J,U,Y)};T6.prototype._processReaddir=function($,U,Y,z,Q,J){var I=this._readdir(Y,J);if(!I)return;var K=z[0],G=!!this.minimatch.negate,H=K._glob,W=this.dot||H.charAt(0)===".",X=[];for(var Z=0;Z<I.length;Z++){var q=I[Z];if(q.charAt(0)!=="."||W){var V;if(G&&!$)V=!q.match(K);else V=q.match(K);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(z.length===1&&!this.mark&&!this.stat){if(!this.matches[Q])this.matches[Q]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=jb.join(this.root,q);this._emitMatch(Q,q)}return}z.shift();for(var Z=0;Z<F;Z++){var q=X[Z],O;if($)O=[$,q];else O=[q];this._process(O.concat(z),Q,J)}};T6.prototype._emitMatch=function($,U){if(OH1(this,U))return;var Y=this._makeAbs(U);if(this.mark)U=this._mark(U);if(this.absolute)U=Y;if(this.matches[$][U])return;if(this.nodir){var z=this.cache[Y];if(z==="DIR"||Array.isArray(z))return}if(this.matches[$][U]=!0,this.stat)this._stat(U)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var U,Y,z;try{Y=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Q=Y&&Y.isSymbolicLink();if(this.symlinks[$]=Q,!Q&&Y&&!Y.isDirectory())this.cache[$]="FILE";else U=this._readdir($,!1);return U};T6.prototype._readdir=function($,U){var Y;if(U&&!Eb(this.symlinks,$))return this._readdirInGlobStar($);if(Eb(this.cache,$)){var z=this.cache[$];if(!z||z==="FILE")return null;if(Array.isArray(z))return z}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Q){return this._readdirError($,Q),null}};T6.prototype._readdirEntries=function($,U){if(!this.mark&&!this.stat)for(var Y=0;Y<U.length;Y++){var z=U[Y];if($==="/")z=$+z;else z=$+"/"+z;this.cache[z]=!0}return this.cache[$]=U,U};T6.prototype._readdirError=function($,U){switch(U.code){case"ENOTSUP":case"ENOTDIR":var Y=this._makeAbs($);if(this.cache[Y]="FILE",Y===this.cwdAbs){var z=Error(U.code+" invalid cwd "+this.cwd);throw z.path=this.cwd,z.code=U.code,z}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw U;if(!this.silent)console.error("glob error",U);break}};T6.prototype._processGlobStar=function($,U,Y,z,Q,J){var I=this._readdir(Y,J);if(!I)return;var K=z.slice(1),G=$?[$]:[],H=G.concat(K);this._process(H,Q,!1);var W=I.length,X=this.symlinks[Y];if(X&&J)return;for(var Z=0;Z<W;Z++){var q=I[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(I[Z],K);this._process(V,Q,!0);var F=G.concat(I[Z],z);this._process(F,Q,!0)}};T6.prototype._processSimple=function($,U){var Y=this._stat($);if(!this.matches[U])this.matches[U]=Object.create(null);if(!Y)return;if($&&$A($)&&!this.nomount){var z=/[\/\\]$/.test($);if($.charAt(0)==="/")$=jb.join(this.root,$);else if($=jb.resolve(this.root,$),z)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(U,$)};T6.prototype._stat=function($){var U=this._makeAbs($),Y=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Eb(this.cache,U)){var I=this.cache[U];if(Array.isArray(I))I="DIR";if(!Y||I==="DIR")return I;if(Y&&I==="FILE")return!1}var z,Q=this.statCache[U];if(!Q){var J;try{J=this.fs.lstatSync(U)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[U]=!1,!1}if(J&&J.isSymbolicLink())try{Q=this.fs.statSync(U)}catch(K){Q=J}else Q=J}this.statCache[U]=Q;var I=!0;if(Q)I=Q.isDirectory()?"DIR":"FILE";if(this.cache[U]=this.cache[U]||I,Y&&I==="FILE")return!1;return I};T6.prototype._mark=function($){return yY.mark(this,$)};T6.prototype._makeAbs=function($){return yY.makeAbs(this,$)}});var Cb=E(($s1,CZ0)=>{CZ0.exports=EZ0;function EZ0($,U){if($&&U)return EZ0($)(U);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(z){Y[z]=$[z]}),Y;f Line truncated
`);if($.linkname)U+=ji(" linkpath="+$.linkname+`
`);var Y=$.pax;if(Y)for(var z in Y)U+=ji(" "+z+"="+Y[z]+`
`);return Buffer.from(U)};CZ1.decodePax=function($){var U={};while($.length){var Y=0;while(Y<$.length&&$[Y]!==32)Y++;var z=parseInt($.slice(0,Y).toString(),10);if(!z)return U;var Q=$.slice(Y+1,z-1).toString(),J=Q.indexOf("=");if(J===-1)return U;U[Q.slice(0,J)]=Q.slice(J+1),$=$.slice(z)}return U};CZ1.encode=function($){var U=wZ1(512),Y=$.name,z="";if($.typeflag===5&&Y[Y.length-1]!=="/")Y+="/";if(Buffer.byteLength(Y)!==Y.length)return null;while(Buffer.byteLength(Y)>100){var Q=Y.indexOf("/");if(Q===-1)return null;z+=z?"/"+Y.slice(0,Q):Y.slice(0,Q),Y=Y.slice(Q+1)}if(Buffer.byteLength(Y)>100||Buffer.byteLength(z)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(U.write(Y),U.write(D2($.mode&PZ1,6),100),U.write(D2($.uid,6),108),U.write(D2($.gid,6),116),U.write(D2($.size,11),124),U.write(D2($.mtime.getTime()/1000|0,11),136),U[156]=cV0+jZ1($.type),$.linkname)U.write($.linkname,157);if(nV0.copy(U,xX),NZ1.copy(U,Ei),$.uname)U.write($.uname,265);if($.gname)U.write($.gname,297);if(U.write(D2($.devmajor||0,6),329),U.write(D2($.devminor||0,6),337),z)U.write(z,345);return U.write(D2(dV0(U),6),148),U};CZ1.decode=function($,U,Y){var z=$[156]===0?0:$[156]-cV0,Q=BI($,0,100,U),J=A2($,100,8),I=A2($,108,8),K=A2($,116,8),G=A2($,124,12),H=A2($,136,12),W=TZ1(z),X=$[157]===0?null:BI($,157,100,U),Z=BI($,265,32),q=BI($,297,32),V=A2($,329,8),F=A2($,337,8),O=dV0($);if(O===256)return null;if(O!==A2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(nV0.compare($,xX,xX+6)===0){if($[345])Q=BI($,345,155,U)+"/"+Q}else if(DZ1.compare($,xX,xX+6)===0&&AZ1.compare($,Ei,Ei+2)===0);else if(!Y)throw Error("Invalid tar header: unknown format.");if(z===0&&Q&&Q[Q.length-1]==="/")z=5;return{name:Q,mode:J,uid:I,gid:K,size:G,mtime:new Date(1000*H),type:W,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var tV0=E((os1,aV0)=>{var lV0=I0("util"),gZ1=iV0(),fX=Ci(),oV0=E8().Writable,rV0=E8().PassThrough,sV0=function(){},mV0=function($){return $&=511,$&&512-$},yZ1=function($,U){var Y=new NA($,U);return Y.end(),Y},kZ1=function($,U){if(U.path)$.name=U.path;if(U.linkpath)$.linkname=U.linkpath;if(U.size)$.size=parseInt(U.size,10);return $.pax=U,$},NA=function($,U){this._parent=$,this.offset=U,rV0.call(this,{autoDestroy:!1})};lV0.inherits(NA,rV0);NA.prototype.destroy=function($){this._parent.destroy($)};var P3=function($){if(!(this instanceof P3))return new P3($);oV0.call(this,$),$=$||{},this._offset=0,this._buffer=gZ1(),this._missing=0,this._partial=!1,this._onparse=sV0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var U=this,Y=U._buffer,z=function(){U._continue()},Q=function(Z){if(U._locked=!1,Z)return U.destroy(Z);if(!U._stream)z()},J=function(){U._stream=null;var Z=mV0(U._header.size);if(Z)U._parse(Z,I);else U._parse(512,X);if(!U._locked)z()},I=function(){U._buffer.consume(mV0(U._header.size)),U._parse(512,X),z()},K=function(){var Z=U._header.size;U._paxGlobal=fX.decodePax(Y.slice(0,Z)),Y.consume(Z),J()},G=function(){var Z=U._header.size;if(U._pax=fX.decodePax(Y.slice(0,Z)),U._paxGlobal)U._pax=Object.assign({},U._paxGlobal,U._pax);Y.consume(Z),J()},H=function(){var Z=U._header.size;this._gnuLongPath=fX.decodeLongPath(Y.slice(0,Z),$.filenameEncoding),Y.consume(Z),J()},W=function(){var Z=U._header.size;this._gnuLongLinkPath=fX.decodeLongPath(Y.slice(0,Z),$.filenameEncoding),Y.consume(Z),J()},X=function(){var Z=U._offset,q;try{q=U._header=fX.decode(Y.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){U.emit("error",V)}if(Y.consume(512),!q){U._parse(512,X),z();return}if(q.type==="gnu-long-path"){U._parse(q.size,H),z();return}if(q.type==="gnu-long-link-path"){U._parse(q.size,W),z();return}if(q.type==="pax-global-header"){U._parse(q.size,K),z();return}if(q.type==="pax-header"){U._parse(q.size,G),z();return}if(U._gnuLongPath)q.name=U._gnuLongPath,U._gnuLongPath=null;if(U._gnuLongLinkPath)q.linkname=U._gnuLongLinkPath,U._gnuLongLinkPath=null;if(U._pax)U._header=q=kZ1(q,U._pax),U._pax=null;if(U._locked=!0,!q.size||q.type==="directory"){U._parse(512,X),U.emit("entry",q,yZ1(U,Z),Q);return}U._stream=new NA(U,Z),U.emit("entry",q,U._stream,Q),U._parse(q.size,J),z()};this._onheader=X,this._parse(512,X)};lV0.inherits(P3,oV0);P3.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};P3.prototype._parse=function($,U){if(this._destroyed)return;if(this._offset+=$,this._missing=$,U===this._onheader)this._partial=!1;this._onparse=U};P3.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=sV0,this._overflow)this._write(this._overflow,void 0,$);else $()};P3.prototype._write=function($,U,Y){if(this._destroyed)return;var z=this._stream,Q=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J) Line truncated
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let U=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${U}" Type="${$.Type}" Target="${Uq1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${U}" Type="${$.Type}" Target="${$.Target}"/>`);return U}_writeClose(){this.stream.write("</Relationships>")}}BL0.exports=PL0});var _L0=E((Qa1,RL0)=>{var jL0=l6(),EL0=e7(),zq1=i4(),Qq1=ix(),Jq1=nx();class CL0{constructor($,U,Y){this.id=Y.id,this.count=0,this._worksheet=$,this._workbook=Y.workbook,this._sheetRelsWriter=U}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:EL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let U={Type:EL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(U)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,U){let Y=new Qq1,z=new jL0;Y.render(z,$),this.commentsStream.write(z.xml);let Q=new Jq1,J=new jL0;Q.render(J,$,U),this.vmlStream.write(J.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((U)=>{U.refAddress=zq1.decodeAddress(U.ref)}),$.forEach((U)=>{this._writeComment(U,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}RL0.exports=CL0});var kL0=E((Ja1,yL0)=>{var Iq1=U6(),Kq1=e7(),vi=i4(),vL0=Ig(),hL0=$3(),Gq1=Nk(),SL0=TO(),hi=EO(),Hq1=TL0(),Wq1=_L0(),Xq1=Qg(),y6=new Gq1,Si=s7(),Zq1=Lx(),qq1=Fx(),Vq1=wx(),Lq1=Xx(),Fq1=Hx(),wq1=Zx(),Oq1=Ox(),Mq1=Mx(),Nq1=Nx(),Dq1=Dx(),Aq1=Ax(),Pq1=Px(),Bq1=Cx(),Tq1=Tx(),jq1=Bx(),k6={dataValidations:new Zq1,sheetProperties:new qq1,sheetFormatProperties:new Vq1,columns:new Si({tag:"cols",length:!1,childXform:new Lq1}),row:new Fq1,hyperlinks:new Si({tag:"hyperlinks",length:!1,childXform:new wq1}),sheetViews:new Si({tag:"sheetViews",length:!1,childXform:new Oq1}),sheetProtection:new Mq1,pageMargins:new Nq1,pageSeteup:new Dq1,autoFilter:new Aq1,picture:new Pq1,conditionalFormattings:new Bq1,headerFooter:new Tq1,rowBreaks:new jq1};class gL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new Hq1($),this._sheetCommentsWriter=new Wq1(this,this._sheetRelsWriter,$),this._dimensions=new hL0,this._rowZero=1,this.committed=!1,this.dataValidations=new Xq1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get Line truncated
See http://goo.gl/MqrFmX
`)},ai=ti.getNativePromise();if(ti.isNode&&typeof MutationObserver>"u")ei=global.setImmediate,$c=process.nextTick,lz=ti.isRecentNode?function($){ei.call(global,$)}:function($){$c.call(process,$)};else if(typeof ai==="function"&&typeof ai.resolve==="function")Yc=ai.resolve(),lz=function($){Yc.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))lz=function(){var $=document.createElement("div"),Y={attributes:!0},z=!1,U=document.createElement("div"),I=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});I.observe(U,Y);var Q=function(){if(z)return;z=!0,U.classList.toggle("foo")};return function(K){var G=new MutationObserver(function(){G.disconnect(),K()});G.observe($,Y),Q()}}();else if(typeof setImmediate<"u")lz=function($){setImmediate($)};else if(typeof setTimeout<"u")lz=function($){setTimeout($,0)};else lz=wV1;var ei,$c,Yc;LF0.exports=lz});var MF0=E((Fa1,wF0)=>{function MV1($,Y,z,U,I){for(var Q=0;Q<I;++Q)z[Q+U]=$[Q+Y],$[Q+Y]=void 0}function T2($){this._capacity=$,this._length=0,this._front=0}T2.prototype._willBeOverCapacity=function($){return this._capacity<$};T2.prototype._pushOne=function($){var Y=this.length();this._checkCapacity(Y+1);var z=this._front+Y&this._capacity-1;this[z]=$,this._length=Y+1};T2.prototype.push=function($,Y,z){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(Y),this._pushOne(z);return}var I=this._front+U-3;this._checkCapacity(U);var Q=this._capacity-1;this[I+0&Q]=$,this[I+1&Q]=Y,this[I+2&Q]=z,this._length=U};T2.prototype.shift=function(){var $=this._front,Y=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,Y};T2.prototype.length=function(){return this._length};T2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};T2.prototype._resizeTo=function($){var Y=this._capacity;this._capacity=$;var z=this._front,U=this._length,I=z+U&Y-1;MV1(this,0,this,Y,I)};wF0.exports=T2});var TF0=E((wa1,zc)=>{var PF0;try{throw Error()}catch($){PF0=$}var OV1=FF0(),OF0=MF0(),BF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new OF0(16),this._normalQueue=new OF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=OV1}x6.prototype.setScheduler=function($){var Y=this._schedule;return this._schedule=$,this._customScheduler=!0,Y};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(BF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,Y){if(Y)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};x6.prototype.throwLater=function($,Y){if(arguments.length===1)Y=$,$=function(){throw Y};if(typeof setTimeout<"u")setTimeout(function(){$(Y)},0);else try{this._schedule(function(){$(Y)})}catch(z){throw Error(`No async scheduler available
`)},ai=ti.getNativePromise();if(ti.isNode&&typeof MutationObserver>"u")ei=global.setImmediate,$c=process.nextTick,lY=ti.isRecentNode?function($){ei.call(global,$)}:function($){$c.call(process,$)};else if(typeof ai==="function"&&typeof ai.resolve==="function")Uc=ai.resolve(),lY=function($){Uc.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))lY=function(){var $=document.createElement("div"),U={attributes:!0},Y=!1,z=document.createElement("div"),Q=new MutationObserver(function(){$.classList.toggle("foo"),Y=!1});Q.observe(z,U);var J=function(){if(Y)return;Y=!0,z.classList.toggle("foo")};return function(K){var G=new MutationObserver(function(){G.disconnect(),K()});G.observe($,U),J()}}();else if(typeof setImmediate<"u")lY=function($){setImmediate($)};else if(typeof setTimeout<"u")lY=function($){setTimeout($,0)};else lY=wV1;var ei,$c,Uc;LF0.exports=lY});var OF0=E((wa1,wF0)=>{function OV1($,U,Y,z,Q){for(var J=0;J<Q;++J)Y[J+z]=$[J+U],$[J+U]=void 0}function T2($){this._capacity=$,this._length=0,this._front=0}T2.prototype._willBeOverCapacity=function($){return this._capacity<$};T2.prototype._pushOne=function($){var U=this.length();this._checkCapacity(U+1);var Y=this._front+U&this._capacity-1;this[Y]=$,this._length=U+1};T2.prototype.push=function($,U,Y){var z=this.length()+3;if(this._willBeOverCapacity(z)){this._pushOne($),this._pushOne(U),this._pushOne(Y);return}var Q=this._front+z-3;this._checkCapacity(z);var J=this._capacity-1;this[Q+0&J]=$,this[Q+1&J]=U,this[Q+2&J]=Y,this._length=z};T2.prototype.shift=function(){var $=this._front,U=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,U};T2.prototype.length=function(){return this._length};T2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};T2.prototype._resizeTo=function($){var U=this._capacity;this._capacity=$;var Y=this._front,z=this._length,Q=Y+z&U-1;OV1(this,0,this,U,Q)};wF0.exports=T2});var TF0=E((Oa1,Yc)=>{var PF0;try{throw Error()}catch($){PF0=$}var MV1=FF0(),MF0=OF0(),BF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new MF0(16),this._normalQueue=new MF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=MV1}x6.prototype.setScheduler=function($){var U=this._schedule;return this._schedule=$,this._customScheduler=!0,U};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(BF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,U){if(U)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
`),process.exit(2);else this.throwLater($)};x6.prototype.throwLater=function($,U){if(arguments.length===1)U=$,$=function(){throw U};if(typeof setTimeout<"u")setTimeout(function(){$(U)},0);else try{this._schedule(function(){$(U)})}catch(Y){throw Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function NF0($,Y,z){this._lateQueue.push($,Y,z),this._queueTick()}function DF0($,Y,z){this._normalQueue.push($,Y,z),this._queueTick()}function AF0($){this._normalQueue._pushOne($),this._queueTick()}if(!BF0.hasDevTools)x6.prototype.invokeLater=NF0,x6.prototype.invoke=DF0,x6.prototype.settlePromises=AF0;else x6.prototype.invokeLater=function($,Y,z){if(this._trampolineEnabled)NF0.call(this,$,Y,z);else this._schedule(function(){setTimeout(function(){$.call(Y,z)},100)})},x6.prototype.invoke=function($,Y,z){if(this._trampolineEnabled)DF0.call(this,$,Y,z);else this._schedule(function(){$.call(Y,z)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)AF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var Y=$.shift();if(typeof Y!=="function"){Y._settlePromises();continue}var z=$.shift(),U=$.shift();Y.call(z,U)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};zc.exports=x6;zc.exports.firstLineError=PF0});var T3=E((Ma1,CF0)=>{var Qc=mz(),NV1=Qc.freeze,jF0=F4(),EF0=jF0.inherits,RJ=jF0.notEnumerableProp;function _J($,Y){function z(U){if(!(this instanceof z))return new z(U);if(RJ(this,"message",typeof U==="string"?U:Y),RJ(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return EF0(z,Error),z}var Uc,Ic,DV1=_J("Warning","warning"),AV1=_J("CancellationError","cancellation error"),PV1=_J("TimeoutError","timeout error"),pX=_J("AggregateError","aggregate error");try{Uc=TypeError,Ic=RangeError}catch($){Uc=_J("TypeError","type error"),Ic=_J("RangeError","range error")}var RA="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(oz=0;oz<RA.length;++oz)if(typeof Array.prototype[RA[oz]]==="function")pX.prototype[RA[oz]]=Array.prototype[RA[oz]];var oz;Qc.defineProperty(pX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});pX.prototype.isOperational=!0;var _A=0;pX.prototype.toString=function(){var $=Array(_A*4+1).join(" "),Y=`
`)}};function NF0($,U,Y){this._lateQueue.push($,U,Y),this._queueTick()}function DF0($,U,Y){this._normalQueue.push($,U,Y),this._queueTick()}function AF0($){this._normalQueue._pushOne($),this._queueTick()}if(!BF0.hasDevTools)x6.prototype.invokeLater=NF0,x6.prototype.invoke=DF0,x6.prototype.settlePromises=AF0;else x6.prototype.invokeLater=function($,U,Y){if(this._trampolineEnabled)NF0.call(this,$,U,Y);else this._schedule(function(){setTimeout(function(){$.call(U,Y)},100)})},x6.prototype.invoke=function($,U,Y){if(this._trampolineEnabled)DF0.call(this,$,U,Y);else this._schedule(function(){$.call(U,Y)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)AF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var U=$.shift();if(typeof U!=="function"){U._settlePromises();continue}var Y=$.shift(),z=$.shift();U.call(Y,z)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};Yc.exports=x6;Yc.exports.firstLineError=PF0});var T3=E((Ma1,CF0)=>{var Jc=mY(),NV1=Jc.freeze,jF0=F4(),EF0=jF0.inherits,RI=jF0.notEnumerableProp;function _I($,U){function Y(z){if(!(this instanceof Y))return new Y(z);if(RI(this,"message",typeof z==="string"?z:U),RI(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return EF0(Y,Error),Y}var zc,Qc,DV1=_I("Warning","warning"),AV1=_I("CancellationError","cancellation error"),PV1=_I("TimeoutError","timeout error"),pX=_I("AggregateError","aggregate error");try{zc=TypeError,Qc=RangeError}catch($){zc=_I("TypeError","type error"),Qc=_I("RangeError","range error")}var RA="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(oY=0;oY<RA.length;++oY)if(typeof Array.prototype[RA[oY]]==="function")pX.prototype[RA[oY]]=Array.prototype[RA[oY]];var oY;Jc.defineProperty(pX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});pX.prototype.isOperational=!0;var _A=0;pX.prototype.toString=function(){var $=Array(_A*4+1).join(" "),U=`
`+$+`AggregateError of:
`;_A++,$=Array(_A*4+1).join(" ");for(var z=0;z<this.length;++z){var U=this[z]===this?"[Circular AggregateError]":this[z]+"",I=U.split(`
`);for(var Q=0;Q<I.length;++Q)I[Q]=$+I[Q];U=I.join(`
`),Y+=U+`
`}return _A--,Y};function nX($){if(!(this instanceof nX))return new nX($);if(RJ(this,"name","OperationalError"),RJ(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)RJ(this,"message",$.message),RJ(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}EF0(nX,Error);var rz=Error.__BluebirdErrorTypes__;if(!rz)rz=NV1({CancellationError:AV1,TimeoutError:PV1,OperationalError:nX,RejectionError:nX,AggregateError:pX}),Qc.defineProperty(Error,"__BluebirdErrorTypes__",{value:rz,writable:!1,enumerable:!1,configurable:!1});CF0.exports={Error,TypeError:Uc,RangeError:Ic,CancellationError:rz.CancellationError,OperationalError:rz.OperationalError,TimeoutError:rz.TimeoutError,AggregateError:rz.AggregateError,Warning:DV1}});var _F0=E((Oa1,RF0)=>{RF0.exports=function($,Y){var z=F4(),U=z.errorObj,I=z.isObject;function Q(X,Z){if(I(X)){if(X instanceof $)return X;var q=K(X);if(q===U){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(H(X)){var V=new $(Y);return X._then(V._fulfill,V._reject,void 0,V,null),V}return W(X,q,Z)}}return X}function J(X){return X.then}function K(X){try{return J(X)}catch(Z){return U.e=Z,U}}var G={}.hasOwnProperty;function H(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function W(X,Z,q){var V=new $(Y),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var M=!0,w=z.tryCatch(Z).call(X,O,D);if(M=!1,V&&w===U)V._rejectCallback(w.e,!0,!0),V=null;function O(N){if(!V)return;V._resolveCallback(N),V=null}function D(N){if(!V)return;V._rejectCallback(N,M,!0),V=null}return F}return Q}});var hF0=E((Na1,vF0)=>{vF0.exports=function($,Y,z,U,I){var Q=F4(),J=Q.isArray;function K(H){switch(H){case-2:return[];case-3:return{}}}function G(H){var W=this._promise=new $(Y);if(H instanceof $)W._propagateFrom(H,3);W._setOnCancel(this),this._values=H,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return Q.inherits(G,I),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function H(W,X){var Z=z(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(H,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=Q.asArray(Z),Z===null){var V=U("expecting an array or an iterable object but got "+Q.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(K(X));return}this._iterate(Z)},G.prototype._iterate=function(H){var W=this.getActualLength(H.length);this._length=W,this._values=this.shouldCopyValues()?Array(W):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<W;++V){var F=z(H[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(H){this._values=null,this._promise._fulfill(H)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(H){this._values=null,this._promise._rejectCallback(H,!1)},G.prototype._promiseFulfilled=function(H,W){this._values[W]=H;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(H){return this._totalResolved++,this._reject(H),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var H=this._values;if(this._cancel(),H instanceof $)H.cancel();else for(var W=0;W<H.length;++W)if(H[W]instanceof $)H[W].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(H){return H},G}});var gF0=E((Da1,SF0)=>{SF0.exports=function($){var Y=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(Q())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var J=z.pop(),K=J._promiseCreated;return J._promiseCreated=null,K}return null};function I(){if(Y)return new U}function Q(){var J=z.length-1;if(J>=0)return z[J];return}return U.CapturedTrace=null,U.create=I,U.deactivateLong Line truncated
`;_A++,$=Array(_A*4+1).join(" ");for(var Y=0;Y<this.length;++Y){var z=this[Y]===this?"[Circular AggregateError]":this[Y]+"",Q=z.split(`
`);for(var J=0;J<Q.length;++J)Q[J]=$+Q[J];z=Q.join(`
`),U+=z+`
`}return _A--,U};function nX($){if(!(this instanceof nX))return new nX($);if(RI(this,"name","OperationalError"),RI(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)RI(this,"message",$.message),RI(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}EF0(nX,Error);var rY=Error.__BluebirdErrorTypes__;if(!rY)rY=NV1({CancellationError:AV1,TimeoutError:PV1,OperationalError:nX,RejectionError:nX,AggregateError:pX}),Jc.defineProperty(Error,"__BluebirdErrorTypes__",{value:rY,writable:!1,enumerable:!1,configurable:!1});CF0.exports={Error,TypeError:zc,RangeError:Qc,CancellationError:rY.CancellationError,OperationalError:rY.OperationalError,TimeoutError:rY.TimeoutError,AggregateError:rY.AggregateError,Warning:DV1}});var _F0=E((Na1,RF0)=>{RF0.exports=function($,U){var Y=F4(),z=Y.errorObj,Q=Y.isObject;function J(X,Z){if(Q(X)){if(X instanceof $)return X;var q=K(X);if(q===z){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(H(X)){var V=new $(U);return X._then(V._fulfill,V._reject,void 0,V,null),V}return W(X,q,Z)}}return X}function I(X){return X.then}function K(X){try{return I(X)}catch(Z){return z.e=Z,z}}var G={}.hasOwnProperty;function H(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function W(X,Z,q){var V=new $(U),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var O=!0,w=Y.tryCatch(Z).call(X,M,N);if(O=!1,V&&w===z)V._rejectCallback(w.e,!0,!0),V=null;function M(D){if(!V)return;V._resolveCallback(D),V=null}function N(D){if(!V)return;V._rejectCallback(D,O,!0),V=null}return F}return J}});var hF0=E((Da1,vF0)=>{vF0.exports=function($,U,Y,z,Q){var J=F4(),I=J.isArray;function K(H){switch(H){case-2:return[];case-3:return{}}}function G(H){var W=this._promise=new $(U);if(H instanceof $)W._propagateFrom(H,3);W._setOnCancel(this),this._values=H,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(G,Q),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function H(W,X){var Z=Y(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(H,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=J.asArray(Z),Z===null){var V=z("expecting an array or an iterable object but got "+J.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(K(X));return}this._iterate(Z)},G.prototype._iterate=function(H){var W=this.getActualLength(H.length);this._length=W,this._values=this.shouldCopyValues()?Array(W):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<W;++V){var F=Y(H[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(H){this._values=null,this._promise._fulfill(H)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(H){this._values=null,this._promise._rejectCallback(H,!1)},G.prototype._promiseFulfilled=function(H,W){this._values[W]=H;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(H){return this._totalResolved++,this._reject(H),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var H=this._values;if(this._cancel(),H instanceof $)H.cancel();else for(var W=0;W<H.length;++W)if(H[W]instanceof $)H[W].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(H){return H},G}});var gF0=E((Aa1,SF0)=>{SF0.exports=function($){var U=!1,Y=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function z(){this._trace=new z.CapturedTrace(J())}z.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,Y.push(this._trace)},z.prototype._popContext=function(){if(this._trace!==void 0){var I=Y.pop(),K=I._promiseCreated;return I._promiseCreated=null,K}return null};function Q(){if(U)return new z}function J(){var I=Y.length-1;if(I>=0)return Y[I];return}return z.CapturedTrace=null,z.create=Q,z.deactivateLong Line truncated
See http://goo.gl/MqrFmX
`);if(!A0.longStackTraces&&f0()){var I0=$.prototype._captureStackTrace,P=$.prototype._attachExtraTrace;A0.longStackTraces=!0,N=function(){if(U.haveItemsQueued()&&!A0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
`);if(!A0.longStackTraces&&f0()){var Q0=$.prototype._captureStackTrace,P=$.prototype._attachExtraTrace;A0.longStackTraces=!0,D=function(){if(z.haveItemsQueued()&&!A0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);$.prototype._captureStackTrace=I0,$.prototype._attachExtraTrace=P,Y.deactivateLongStackTraces(),U.enableTrampoline(),A0.longStackTraces=!1},$.prototype._captureStackTrace=g,$.prototype._attachExtraTrace=p,Y.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return A0.longStackTraces&&f0()};var B=function(){try{if(typeof CustomEvent==="function"){var I0=new CustomEvent("CustomEvent");return Q.global.dispatchEvent(I0),function(P,v){var u=new CustomEvent(P.toLowerCase(),{detail:v,cancelable:!0});return!Q.global.dispatchEvent(u)}}else if(typeof Event==="function"){var I0=new Event("CustomEvent");return Q.global.dispatchEvent(I0),function(v,u){var r=new Event(v.toLowerCase(),{cancelable:!0});return r.detail=u,!Q.global.dispatchEvent(r)}}else{var I0=document.createEvent("CustomEvent");return I0.initCustomEvent("testingtheevent",!1,!0,{}),Q.global.dispatchEvent(I0),function(v,u){var r=document.createEvent("CustomEvent");return r.initCustomEvent(v.toLowerCase(),!1,!0,u),!Q.global.dispatchEvent(r)}}}catch(P){}return function(){return!1}}(),T=function(){if(Q.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!Q.global)return function(){return!1};return function(I0){var P="on"+I0.toLowerCase(),v=Q.global[P];if(!v)return!1;return v.apply(Q.global,[].slice.call(arguments,1)),!0}}}();function A(I0,P){return{promise:P}}var j={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(I0,P,v){return{promise:P,child:v}},warning:function(I0,P){return{warning:P}},unhandledRejection:function(I0,P,v){return{reason:P,promise:v}},rejectionHandled:A},C=function(I0){var P=!1;try{P=T.apply(null,arguments)}catch(u){U.throwLater(u),P=!0}var v=!1;try{v=B(I0,j[I0].apply(null,arguments))}catch(u){U.throwLater(u),v=!0}return v||P};$.config=function(I0){if(I0=Object(I0),"longStackTraces"in I0){if(I0.longStackTraces)$.longStackTraces();else if(!I0.longStackTraces&&$.hasLongStackTraces())N()}if("warnings"in I0){var P=I0.warnings;if(A0.warnings=!!P,D=A0.warnings,Q.isObject(P)){if("wForgottenReturn"in P)D=!!P.wForgottenReturn}}if("cancellation"in I0&&I0.cancellation&&!A0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=U0,$.prototype._propagateFrom=x,$.prototype._onCancel=i,$.prototype._setOnCancel=c,$.prototype._attachCancellationCallback=h,$.prototype._execute=k,t=x,A0.cancellation=!0}if("monitoring"in I0){if(I0.monitoring&&!A0.monitoring)A0.monitoring=!0,$.prototype._fireEvent=C;else if(!I0.monitoring&&A0.monitoring)A0.monitoring=!1,$.prototype._fireEvent=b}return $};function b(){return!1}$.prototype._fireEvent=b,$.prototype._execute=function(I0,P,v){try{I0(P,v)}catch(u){return u}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(I0){},$.prototype._attachCancellationCallback=function(I0){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(I0,P){};function k(I0,P,v){var u=this;try{I0(P,v,function(r){if(typeof r!=="function")throw TypeError("onCancel must be a function, got: "+Q.toString(r));u._attachCancellationCallback(r)})}catch(r){return r}}function h(I0){if(!this._isCancellable())return this;var P=this._onCancel();if(P!==void 0)if(Q.isArray(P))P.push(I0);else this._setOnCancel([P,I0]);else this._setOnCancel(I0)}function i(){return this._onCancelField}function c(I0){this._onCancelField=I0}function U0(){this._cancellationParent=void 0,this._onCancelField=void 0}function x(I0,P){if((P&1)!==0){this._cancellationParent=I0;var v=I0._branchesRemainingToCancel;if(v===void 0)v=0;I0._branchesRemainingToCancel=v+1}if((P&2)!==0&&I0._isBound())this._setBoundTo(I0._boundTo)}function d(I0,P){if((P&2)!==0&&I0._isBound())this._setBoundTo(I0._boundTo)}var t=d;function $0(){var I0=this._boundTo;if(I0!==void 0){if(I0 instanceof $)if(I0.isFulfilled())return I0.value();else return}return I0}function g(){this._trace=new u1(this._peekContext())}function p(I0,P){if(J(I0)){var v=this._trace;if(v!==void 0){if(P)v=v._parent}if(v!==void 0)v.attachExtraTrace(I0);else if(!I0.__stackCleaned__){var u=b0(I0);Q.notEnumerableProp(I0,"stack",u.message+`
`);$.prototype._captureStackTrace=Q0,$.prototype._attachExtraTrace=P,U.deactivateLongStackTraces(),z.enableTrampoline(),A0.longStackTraces=!1},$.prototype._captureStackTrace=g,$.prototype._attachExtraTrace=p,U.activateLongStackTraces(),z.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return A0.longStackTraces&&f0()};var B=function(){try{if(typeof CustomEvent==="function"){var Q0=new CustomEvent("CustomEvent");return J.global.dispatchEvent(Q0),function(P,v){var u=new CustomEvent(P.toLowerCase(),{detail:v,cancelable:!0});return!J.global.dispatchEvent(u)}}else if(typeof Event==="function"){var Q0=new Event("CustomEvent");return J.global.dispatchEvent(Q0),function(v,u){var r=new Event(v.toLowerCase(),{cancelable:!0});return r.detail=u,!J.global.dispatchEvent(r)}}else{var Q0=document.createEvent("CustomEvent");return Q0.initCustomEvent("testingtheevent",!1,!0,{}),J.global.dispatchEvent(Q0),function(v,u){var r=document.createEvent("CustomEvent");return r.initCustomEvent(v.toLowerCase(),!1,!0,u),!J.global.dispatchEvent(r)}}}catch(P){}return function(){return!1}}(),T=function(){if(J.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!J.global)return function(){return!1};return function(Q0){var P="on"+Q0.toLowerCase(),v=J.global[P];if(!v)return!1;return v.apply(J.global,[].slice.call(arguments,1)),!0}}}();function A(Q0,P){return{promise:P}}var j={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(Q0,P,v){return{promise:P,child:v}},warning:function(Q0,P){return{warning:P}},unhandledRejection:function(Q0,P,v){return{reason:P,promise:v}},rejectionHandled:A},C=function(Q0){var P=!1;try{P=T.apply(null,arguments)}catch(u){z.throwLater(u),P=!0}var v=!1;try{v=B(Q0,j[Q0].apply(null,arguments))}catch(u){z.throwLater(u),v=!0}return v||P};$.config=function(Q0){if(Q0=Object(Q0),"longStackTraces"in Q0){if(Q0.longStackTraces)$.longStackTraces();else if(!Q0.longStackTraces&&$.hasLongStackTraces())D()}if("warnings"in Q0){var P=Q0.warnings;if(A0.warnings=!!P,N=A0.warnings,J.isObject(P)){if("wForgottenReturn"in P)N=!!P.wForgottenReturn}}if("cancellation"in Q0&&Q0.cancellation&&!A0.cancellation){if(z.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=z0,$.prototype._propagateFrom=k,$.prototype._onCancel=i,$.prototype._setOnCancel=c,$.prototype._attachCancellationCallback=h,$.prototype._execute=x,t=k,A0.cancellation=!0}if("monitoring"in Q0){if(Q0.monitoring&&!A0.monitoring)A0.monitoring=!0,$.prototype._fireEvent=C;else if(!Q0.monitoring&&A0.monitoring)A0.monitoring=!1,$.prototype._fireEvent=b}return $};function b(){return!1}$.prototype._fireEvent=b,$.prototype._execute=function(Q0,P,v){try{Q0(P,v)}catch(u){return u}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(Q0){},$.prototype._attachCancellationCallback=function(Q0){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(Q0,P){};function x(Q0,P,v){var u=this;try{Q0(P,v,function(r){if(typeof r!=="function")throw TypeError("onCancel must be a function, got: "+J.toString(r));u._attachCancellationCallback(r)})}catch(r){return r}}function h(Q0){if(!this._isCancellable())return this;var P=this._onCancel();if(P!==void 0)if(J.isArray(P))P.push(Q0);else this._setOnCancel([P,Q0]);else this._setOnCancel(Q0)}function i(){return this._onCancelField}function c(Q0){this._onCancelField=Q0}function z0(){this._cancellationParent=void 0,this._onCancelField=void 0}function k(Q0,P){if((P&1)!==0){this._cancellationParent=Q0;var v=Q0._branchesRemainingToCancel;if(v===void 0)v=0;Q0._branchesRemainingToCancel=v+1}if((P&2)!==0&&Q0._isBound())this._setBoundTo(Q0._boundTo)}function d(Q0,P){if((P&2)!==0&&Q0._isBound())this._setBoundTo(Q0._boundTo)}var t=d;function $0(){var Q0=this._boundTo;if(Q0!==void 0){if(Q0 instanceof $)if(Q0.isFulfilled())return Q0.value();else return}return Q0}function g(){this._trace=new u1(this._peekContext())}function p(Q0,P){if(I(Q0)){var v=this._trace;if(v!==void 0){if(P)v=v._parent}if(v!==void 0)v.attachExtraTrace(Q0);else if(!Q0.__stackCleaned__){var u=b0(Q0);J.notEnumerableProp(Q0,"stack",u.message+`
`+u.stack.join(`
`)),Q.notEnumerableProp(I0,"__stackCleaned__",!0)}}}function e(I0,P,v,u,r){if(I0===void 0&&P!==null&&D){if(r!==void 0&&r._returnedNonUndefined())return;if((u._bitField&65535)===0)return;if(v)v=v+" ";var X0="",Q0="";if(P._trace){var Z0=P._trace.stack.split(`
`),O0=G0(Z0);for(var P0=O0.length-1;P0>=0;--P0){var r0=O0[P0];if(!W.test(r0)){var J1=r0.match(X);if(J1)X0="at "+J1[1]+":"+J1[2]+":"+J1[3]+" ";break}}if(O0.length>0){var U1=O0[0];for(var P0=0;P0<Z0.length;++P0)if(Z0[P0]===U1){if(P0>0)Q0=`
`+Z0[P0-1];break}}}var N1="a promise was created in a "+v+"handler "+X0+"but was not returned from it, see http://goo.gl/rRqMUw"+Q0;u._warn(N1,!0,P)}}function y(I0,P){var v=I0+" is deprecated and will be removed in a future version.";if(P)v+=" Use "+P+" instead.";return s(v)}function s(I0,P,v){if(!A0.warnings)return;var u=new I(I0),r;if(P)v._attachExtraTrace(u);else if(A0.longStackTraces&&(r=$._peekContext()))r.attachExtraTrace(u);else{var X0=b0(u);u.stack=X0.message+`
`)),J.notEnumerableProp(Q0,"__stackCleaned__",!0)}}}function e(Q0,P,v,u,r){if(Q0===void 0&&P!==null&&N){if(r!==void 0&&r._returnedNonUndefined())return;if((u._bitField&65535)===0)return;if(v)v=v+" ";var X0="",J0="";if(P._trace){var Z0=P._trace.stack.split(`
`),M0=G0(Z0);for(var P0=M0.length-1;P0>=0;--P0){var r0=M0[P0];if(!W.test(r0)){var I1=r0.match(X);if(I1)X0="at "+I1[1]+":"+I1[2]+":"+I1[3]+" ";break}}if(M0.length>0){var z1=M0[0];for(var P0=0;P0<Z0.length;++P0)if(Z0[P0]===z1){if(P0>0)J0=`
`+Z0[P0-1];break}}}var N1="a promise was created in a "+v+"handler "+X0+"but was not returned from it, see http://goo.gl/rRqMUw"+J0;u._warn(N1,!0,P)}}function y(Q0,P){var v=Q0+" is deprecated and will be removed in a future version.";if(P)v+=" Use "+P+" instead.";return s(v)}function s(Q0,P,v){if(!A0.warnings)return;var u=new Q(Q0),r;if(P)v._attachExtraTrace(u);else if(A0.longStackTraces&&(r=$._peekContext()))r.attachExtraTrace(u);else{var X0=b0(u);u.stack=X0.message+`
`+X0.stack.join(`
`)}if(!C("warning",u))Y1(u,"",!0)}function Y0(I0,P){for(var v=0;v<P.length-1;++v)P[v].push("From previous event:"),P[v]=P[v].join(`
`)}if(!C("warning",u))U1(u,"",!0)}function U0(Q0,P){for(var v=0;v<P.length-1;++v)P[v].push("From previous event:"),P[v]=P[v].join(`
`);if(v<P.length)P[v]=P[v].join(`
`);return I0+`
`);return Q0+`
`+P.join(`
`)}function M0(I0){for(var P=0;P<I0.length;++P)if(I0[P].length===0||P+1<I0.length&&I0[P][0]===I0[P+1][0])I0.splice(P,1),P--}function E0(I0){var P=I0[0];for(var v=1;v<I0.length;++v){var u=I0[v],r=P.length-1,X0=P[r],Q0=-1;for(var Z0=u.length-1;Z0>=0;--Z0)if(u[Z0]===X0){Q0=Z0;break}for(var Z0=Q0;Z0>=0;--Z0){var O0=u[Z0];if(P[r]===O0)P.pop(),r--;else break}P=u}}function G0(I0){var P=[];for(var v=0;v<I0.length;++v){var u=I0[v],r=u===" (No stack trace)"||Z.test(u),X0=r&&u0(u);if(r&&!X0){if(V&&u.charAt(0)!==" ")u=" "+u;P.push(u)}}return P}function T0(I0){var P=I0.stack.replace(/\s+$/g,"").split(`
`);for(var v=0;v<P.length;++v){var u=P[v];if(u===" (No stack trace)"||Z.test(u))break}if(v>0&&I0.name!="SyntaxError")P=P.slice(v);return P}function b0(I0){var P=I0.stack,v=I0.toString();return P=typeof P==="string"&&P.length>0?T0(I0):[" (No stack trace)"],{message:v,stack:I0.name=="SyntaxError"?P:G0(P)}}function Y1(I0,P,v){if(typeof console<"u"){var u;if(Q.isObject(I0)){var r=I0.stack;u=P+q(r,I0)}else u=P+String(I0);if(typeof F==="function")F(u,v);else if(typeof console.log==="function"||typeof console.log==="object")console.log(u)}}function a(I0,P,v,u){var r=!1;try{if(typeof P==="function")if(r=!0,I0==="rejectionHandled")P(u);else P(v,u)}catch(X0){U.throwLater(X0)}if(I0==="unhandledRejection"){if(!C(I0,v,u)&&!r)Y1(v,"Unhandled rejection ")}else C(I0,u)}function W0(I0){var P;if(typeof I0==="function")P="[function "+(I0.name||"anonymous")+"]";else{P=I0&&typeof I0.toString==="function"?I0.toString():Q.toString(I0);var v=/\[object [a-zA-Z0-9$_]+\]/;if(v.test(P))try{var u=JSON.stringify(I0);P=u}catch(r){}if(P.length===0)P="(empty array)"}return"(<"+F0(P)+">, no stack trace)"}function F0(I0){var P=41;if(I0.length<P)return I0;return I0.substr(0,P-3)+"..."}function f0(){return typeof b1==="function"}var u0=function(){return!1},i0=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function D1(I0){var P=I0.match(i0);if(P)return{fileName:P[1],line:parseInt(P[2],10)}}function k1(I0,P){if(!f0())return;var v=I0.stack.split(`
`)}function O0(Q0){for(var P=0;P<Q0.length;++P)if(Q0[P].length===0||P+1<Q0.length&&Q0[P][0]===Q0[P+1][0])Q0.splice(P,1),P--}function E0(Q0){var P=Q0[0];for(var v=1;v<Q0.length;++v){var u=Q0[v],r=P.length-1,X0=P[r],J0=-1;for(var Z0=u.length-1;Z0>=0;--Z0)if(u[Z0]===X0){J0=Z0;break}for(var Z0=J0;Z0>=0;--Z0){var M0=u[Z0];if(P[r]===M0)P.pop(),r--;else break}P=u}}function G0(Q0){var P=[];for(var v=0;v<Q0.length;++v){var u=Q0[v],r=u===" (No stack trace)"||Z.test(u),X0=r&&u0(u);if(r&&!X0){if(V&&u.charAt(0)!==" ")u=" "+u;P.push(u)}}return P}function T0(Q0){var P=Q0.stack.replace(/\s+$/g,"").split(`
`);for(var v=0;v<P.length;++v){var u=P[v];if(u===" (No stack trace)"||Z.test(u))break}if(v>0&&Q0.name!="SyntaxError")P=P.slice(v);return P}function b0(Q0){var P=Q0.stack,v=Q0.toString();return P=typeof P==="string"&&P.length>0?T0(Q0):[" (No stack trace)"],{message:v,stack:Q0.name=="SyntaxError"?P:G0(P)}}function U1(Q0,P,v){if(typeof console<"u"){var u;if(J.isObject(Q0)){var r=Q0.stack;u=P+q(r,Q0)}else u=P+String(Q0);if(typeof F==="function")F(u,v);else if(typeof console.log==="function"||typeof console.log==="object")console.log(u)}}function a(Q0,P,v,u){var r=!1;try{if(typeof P==="function")if(r=!0,Q0==="rejectionHandled")P(u);else P(v,u)}catch(X0){z.throwLater(X0)}if(Q0==="unhandledRejection"){if(!C(Q0,v,u)&&!r)U1(v,"Unhandled rejection ")}else C(Q0,u)}function W0(Q0){var P;if(typeof Q0==="function")P="[function "+(Q0.name||"anonymous")+"]";else{P=Q0&&typeof Q0.toString==="function"?Q0.toString():J.toString(Q0);var v=/\[object [a-zA-Z0-9$_]+\]/;if(v.test(P))try{var u=JSON.stringify(Q0);P=u}catch(r){}if(P.length===0)P="(empty array)"}return"(<"+F0(P)+">, no stack trace)"}function F0(Q0){var P=41;if(Q0.length<P)return Q0;return Q0.substr(0,P-3)+"..."}function f0(){return typeof b1==="function"}var u0=function(){return!1},i0=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function D1(Q0){var P=Q0.match(i0);if(P)return{fileName:P[1],line:parseInt(P[2],10)}}function k1(Q0,P){if(!f0())return;var v=Q0.stack.split(`
`),u=P.stack.split(`
`),r=-1,X0=-1,Q0,Z0;for(var O0=0;O0<v.length;++O0){var P0=D1(v[O0]);if(P0){Q0=P0.fileName,r=P0.line;break}}for(var O0=0;O0<u.length;++O0){var P0=D1(u[O0]);if(P0){Z0=P0.fileName,X0=P0.line;break}}if(r<0||X0<0||!Q0||!Z0||Q0!==Z0||r>=X0)return;u0=function(r0){if(H.test(r0))return!0;var J1=D1(r0);if(J1){if(J1.fileName===Q0&&(r<=J1.line&&J1.line<=X0))return!0}return!1}}function u1(I0){this._parent=I0,this._promisesCreated=0;var P=this._length=1+(I0===void 0?0:I0._length);if(b1(this,u1),P>32)this.uncycle()}Q.inherits(u1,Error),Y.CapturedTrace=u1,u1.prototype.uncycle=function(){var I0=this._length;if(I0<2)return;var P=[],v={};for(var u=0,r=this;r!==void 0;++u)P.push(r),r=r._parent;I0=this._length=u;for(var u=I0-1;u>=0;--u){var X0=P[u].stack;if(v[X0]===void 0)v[X0]=u}for(var u=0;u<I0;++u){var Q0=P[u].stack,Z0=v[Q0];if(Z0!==void 0&&Z0!==u){if(Z0>0)P[Z0-1]._parent=void 0,P[Z0-1]._length=1;P[u]._parent=void 0,P[u]._length=1;var O0=u>0?P[u-1]:this;if(Z0<I0-1)O0._parent=P[Z0+1],O0._parent.uncycle(),O0._length=O0._parent._length+1;else O0._parent=void 0,O0._length=1;var P0=O0._length+1;for(var r0=u-2;r0>=0;--r0)P[r0]._length=P0,P0++;return}}},u1.prototype.attachExtraTrace=function(I0){if(I0.__stackCleaned__)return;this.uncycle();var P=b0(I0),v=P.message,u=[P.stack],r=this;while(r!==void 0)u.push(G0(r.stack.split(`
`))),r=r._parent;E0(u),M0(u),Q.notEnumerableProp(I0,"stack",Y0(v,u)),Q.notEnumerableProp(I0,"__stackCleaned__",!0)};var b1=function(){var P=/^\s*at\s*/,v=function(Q0,Z0){if(typeof Q0==="string")return Q0;if(Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return W0(Z0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,Z=P,q=v;var u=Error.captureStackTrace;return u0=function(Q0){return H.test(Q0)},function(Q0,Z0){Error.stackTraceLimit+=6,u(Q0,Z0),Error.stackTraceLimit-=6}}var r=Error();if(typeof r.stack==="string"&&r.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,q=v,V=!0,function(Z0){Z0.stack=Error().stack};var X0;try{throw Error()}catch(Q0){X0="stack"in Q0}if(!("stack"in r)&&X0&&typeof Error.stackTraceLimit==="number")return Z=P,q=v,function(Z0){Error.stackTraceLimit+=6;try{throw Error()}catch(O0){Z0.stack=O0.stack}Error.stackTraceLimit-=6};return q=function(Q0,Z0){if(typeof Q0==="string")return Q0;if((typeof Z0==="object"||typeof Z0==="function")&&Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return W0(Z0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(F=function(I0){console.warn(I0)},Q.isNode&&process.stderr.isTTY)F=function(I0,P){var v=P?"\x1B[33m":"\x1B[31m";console.warn(v+I0+`\x1B[0m
`)};else if(!Q.isNode&&typeof Error().stack==="string")F=function(I0,P){console.warn("%c"+I0,P?"color: darkorange":"color: red")}}var A0={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};if(O)$.longStackTraces();return{longStackTraces:function(){return A0.longStackTraces},warnings:function(){return A0.warnings},cancellation:function(){return A0.cancellation},monitoring:function(){return A0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:B,fireGlobalEvent:T}}});var fF0=E((Pa1,xF0)=>{xF0.exports=function($,Y){var z=F4(),U=$.CancellationError,I=z.errorObj;function Q(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}Q.prototype.isFinallyHandler=function(){return this.type===0};function J(X){this.finallyHandler=X}J.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return W.call(this,this.promise._target()._settledValue())}function H(X){if(K(this,X))return;return I.e=X,I}function W(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=Y(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var M=new U("late cancellation observer");return Z._attachExtraTrace(M),I.e=M,I}else if(F.isPending())F._attachCancellationCallback(new J(this))}return F._then(G,H,void 0,this,void 0)}}}if(Z.isRejected())return K(this),I.e=X,I;else return K(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new Q(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,W,W)},$.prototype.tap=function(X){return this._passThrough(X,1,W)},Q}});var bF0=E((Ba1,uF0)=>{uF0.exports=function($){var Y=F4(),z=mz().keys,U=Y.tryCatch,I=Y.errorObj;function Q(J,K,G){return function(H){var W=G._boundValue();$:for(var X=0;X<J.length;++X){var Z=J[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(H instanceof Z)return U(K).call(W,H)}else if(typeof Z==="function"){var q=U(Z).call(W,H);if(q===I)return q;else if(q)return U(K).call(W,H)}else if(Y.isObject(H)){var V=z(Z);for(var F=0;F<V.length;++F){var M=V[F];if(Z[M]!=H[M])continue $}return U(K).call(W,H)}}return $}}return Q}});var Jc=E((Ta1,nF0)=>{var iF0=F4(),BV1=iF0.maybeWrapAsError,TV1=T3(),jV1=TV1.OperationalError,cF0=mz();function EV1($){return $ instanceof Error&&cF0.getPrototypeOf($)===Error.prototype}var CV1=/^(?:name|message|stack|cause)$/;function RV1($){var Y;if(EV1($)){Y=new jV1($),Y.name=$.name,Y.message=$.message,Y.stack=$.stack;var z=cF0.keys($);for(var U=0;U<z.length;++U){var I=z[U];if(!CV1.test(I))Y[I]=$[I]}return Y}return iF0.markAsOriginatingFromRejection($),$}function _V1($,Y){return function(z,U){if($===null)return;if(z){var I=RV1(BV1(z));$._attachExtraTrace(I),$._reject(I)}else if(!Y)$._fulfill(U);else{var Q=arguments.length,J=Array(Math.max(Q-1,0));for(var K=1;K<Q;++K)J[K-1]=arguments[K];$._fulfill(J)}$=null}}nF0.exports=_V1});var dF0=E((ja1,pF0)=>{pF0.exports=function($,Y,z,U,I){var Q=F4(),J=Q.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+Q.classString(K));return function(){var G=new $(Y);G._captureStackTrace(),G._pushContext();var H=J(K).apply(this,arguments),W=G._popContext();return I.checkForgottenReturns(H,W,"Promise.method",G),G._resolveFromSyncValue(H),G}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+Q.classString(K));var G=new $(Y);G._captureStackTrace(),G._pushContext();var H;if(arguments.length>1){I.deprecated("calling Promise.try with more than 1 argument");var W=arguments[1],X=arguments[2];H=Q.isArray(W)?J(K).apply(X,W):J(K).call(X,W)}else H=J(K)();var Z=G._popContext();return I.checkForgottenReturns(H,Z,"Promise.try",G),G._resolveFromSyncValue(H),G},$.prototype._resolveFromSyncValue=function(K){if(K===Q.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var lF0=E((Ea1,mF0)=>{mF0.exports=function($,Y,z,U){var I=!1,Q=function(H,W){this._reject(W)},J=function(H,W){W.promiseRejectionQueued=!0,W.bindingPromise._then(Q,Q,null,this,H)},K=function(H,W){if((this._bitField&50397184)===0)this._resolveCallback(W.target)},G=function(H,W){if(!W.promiseRejectionQueued)this._reject(H)};$.prototype.bind=function(H){if(!I)I=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var W=z(H),X=new $(Y);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(W),W instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:W};Z._then(Y,J,voi Line truncated
`),r=-1,X0=-1,J0,Z0;for(var M0=0;M0<v.length;++M0){var P0=D1(v[M0]);if(P0){J0=P0.fileName,r=P0.line;break}}for(var M0=0;M0<u.length;++M0){var P0=D1(u[M0]);if(P0){Z0=P0.fileName,X0=P0.line;break}}if(r<0||X0<0||!J0||!Z0||J0!==Z0||r>=X0)return;u0=function(r0){if(H.test(r0))return!0;var I1=D1(r0);if(I1){if(I1.fileName===J0&&(r<=I1.line&&I1.line<=X0))return!0}return!1}}function u1(Q0){this._parent=Q0,this._promisesCreated=0;var P=this._length=1+(Q0===void 0?0:Q0._length);if(b1(this,u1),P>32)this.uncycle()}J.inherits(u1,Error),U.CapturedTrace=u1,u1.prototype.uncycle=function(){var Q0=this._length;if(Q0<2)return;var P=[],v={};for(var u=0,r=this;r!==void 0;++u)P.push(r),r=r._parent;Q0=this._length=u;for(var u=Q0-1;u>=0;--u){var X0=P[u].stack;if(v[X0]===void 0)v[X0]=u}for(var u=0;u<Q0;++u){var J0=P[u].stack,Z0=v[J0];if(Z0!==void 0&&Z0!==u){if(Z0>0)P[Z0-1]._parent=void 0,P[Z0-1]._length=1;P[u]._parent=void 0,P[u]._length=1;var M0=u>0?P[u-1]:this;if(Z0<Q0-1)M0._parent=P[Z0+1],M0._parent.uncycle(),M0._length=M0._parent._length+1;else M0._parent=void 0,M0._length=1;var P0=M0._length+1;for(var r0=u-2;r0>=0;--r0)P[r0]._length=P0,P0++;return}}},u1.prototype.attachExtraTrace=function(Q0){if(Q0.__stackCleaned__)return;this.uncycle();var P=b0(Q0),v=P.message,u=[P.stack],r=this;while(r!==void 0)u.push(G0(r.stack.split(`
`))),r=r._parent;E0(u),O0(u),J.notEnumerableProp(Q0,"stack",U0(v,u)),J.notEnumerableProp(Q0,"__stackCleaned__",!0)};var b1=function(){var P=/^\s*at\s*/,v=function(J0,Z0){if(typeof J0==="string")return J0;if(Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return W0(Z0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,Z=P,q=v;var u=Error.captureStackTrace;return u0=function(J0){return H.test(J0)},function(J0,Z0){Error.stackTraceLimit+=6,u(J0,Z0),Error.stackTraceLimit-=6}}var r=Error();if(typeof r.stack==="string"&&r.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,q=v,V=!0,function(Z0){Z0.stack=Error().stack};var X0;try{throw Error()}catch(J0){X0="stack"in J0}if(!("stack"in r)&&X0&&typeof Error.stackTraceLimit==="number")return Z=P,q=v,function(Z0){Error.stackTraceLimit+=6;try{throw Error()}catch(M0){Z0.stack=M0.stack}Error.stackTraceLimit-=6};return q=function(J0,Z0){if(typeof J0==="string")return J0;if((typeof Z0==="object"||typeof Z0==="function")&&Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return W0(Z0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(F=function(Q0){console.warn(Q0)},J.isNode&&process.stderr.isTTY)F=function(Q0,P){var v=P?"\x1B[33m":"\x1B[31m";console.warn(v+Q0+`\x1B[0m
`)};else if(!J.isNode&&typeof Error().stack==="string")F=function(Q0,P){console.warn("%c"+Q0,P?"color: darkorange":"color: red")}}var A0={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};if(M)$.longStackTraces();return{longStackTraces:function(){return A0.longStackTraces},warnings:function(){return A0.warnings},cancellation:function(){return A0.cancellation},monitoring:function(){return A0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:B,fireGlobalEvent:T}}});var fF0=E((Ba1,xF0)=>{xF0.exports=function($,U){var Y=F4(),z=$.CancellationError,Q=Y.errorObj;function J(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function I(X){this.finallyHandler=X}I.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return W.call(this,this.promise._target()._settledValue())}function H(X){if(K(this,X))return;return Q.e=X,Q}function W(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=U(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var O=new z("late cancellation observer");return Z._attachExtraTrace(O),Q.e=O,Q}else if(F.isPending())F._attachCancellationCallback(new I(this))}return F._then(G,H,void 0,this,void 0)}}}if(Z.isRejected())return K(this),Q.e=X,Q;else return K(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new J(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,W,W)},$.prototype.tap=function(X){return this._passThrough(X,1,W)},J}});var bF0=E((Ta1,uF0)=>{uF0.exports=function($){var U=F4(),Y=mY().keys,z=U.tryCatch,Q=U.errorObj;function J(I,K,G){return function(H){var W=G._boundValue();$:for(var X=0;X<I.length;++X){var Z=I[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(H instanceof Z)return z(K).call(W,H)}else if(typeof Z==="function"){var q=z(Z).call(W,H);if(q===Q)return q;else if(q)return z(K).call(W,H)}else if(U.isObject(H)){var V=Y(Z);for(var F=0;F<V.length;++F){var O=V[F];if(Z[O]!=H[O])continue $}return z(K).call(W,H)}}return $}}return J}});var Ic=E((ja1,nF0)=>{var iF0=F4(),BV1=iF0.maybeWrapAsError,TV1=T3(),jV1=TV1.OperationalError,cF0=mY();function EV1($){return $ instanceof Error&&cF0.getPrototypeOf($)===Error.prototype}var CV1=/^(?:name|message|stack|cause)$/;function RV1($){var U;if(EV1($)){U=new jV1($),U.name=$.name,U.message=$.message,U.stack=$.stack;var Y=cF0.keys($);for(var z=0;z<Y.length;++z){var Q=Y[z];if(!CV1.test(Q))U[Q]=$[Q]}return U}return iF0.markAsOriginatingFromRejection($),$}function _V1($,U){return function(Y,z){if($===null)return;if(Y){var Q=RV1(BV1(Y));$._attachExtraTrace(Q),$._reject(Q)}else if(!U)$._fulfill(z);else{var J=arguments.length,I=Array(Math.max(J-1,0));for(var K=1;K<J;++K)I[K-1]=arguments[K];$._fulfill(I)}$=null}}nF0.exports=_V1});var dF0=E((Ea1,pF0)=>{pF0.exports=function($,U,Y,z,Q){var J=F4(),I=J.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+J.classString(K));return function(){var G=new $(U);G._captureStackTrace(),G._pushContext();var H=I(K).apply(this,arguments),W=G._popContext();return Q.checkForgottenReturns(H,W,"Promise.method",G),G._resolveFromSyncValue(H),G}},$.attempt=$.try=function(K){if(typeof K!=="function")return z("expecting a function but got "+J.classString(K));var G=new $(U);G._captureStackTrace(),G._pushContext();var H;if(arguments.length>1){Q.deprecated("calling Promise.try with more than 1 argument");var W=arguments[1],X=arguments[2];H=J.isArray(W)?I(K).apply(X,W):I(K).call(X,W)}else H=I(K)();var Z=G._popContext();return Q.checkForgottenReturns(H,Z,"Promise.try",G),G._resolveFromSyncValue(H),G},$.prototype._resolveFromSyncValue=function(K){if(K===J.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var lF0=E((Ca1,mF0)=>{mF0.exports=function($,U,Y,z){var Q=!1,J=function(H,W){this._reject(W)},I=function(H,W){W.promiseRejectionQueued=!0,W.bindingPromise._then(J,J,null,this,H)},K=function(H,W){if((this._bitField&50397184)===0)this._resolveCallback(W.target)},G=function(H,W){if(!W.promiseRejectionQueued)this._reject(H)};$.prototype.bind=function(H){if(!Q)Q=!0,$.prototype._propagateFrom=z.propagateFromFunction(),$.prototype._boundValue=z.boundValueFunction();var W=Y(H),X=new $(U);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(W),W instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:W};Z._then(U,I,voi Line truncated
See http://goo.gl/MqrFmX
`);return this._settledValue()},U=Y.prototype.error=Y.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
`);return this._settledValue()},z=U.prototype.error=U.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
See http://goo.gl/MqrFmX
`);return this._settledValue()},I=Y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},Q=Y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},J=Y.prototype.isPending=function(){return(this._bitField&50397184)===0},K=Y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};Y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return J.call(this._target())},$.prototype.isRejected=function(){return Q.call(this._target())},$.prototype.isFulfilled=function(){return I.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),U.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=Y}});var Yw0=E((va1,$w0)=>{$w0.exports=function($,Y,z,U,I,Q){var J=F4(),K=J.canEvaluate,G=J.tryCatch,H=J.errorObj,W;if(K){var X=function(O){return Function("value","holder",`
`);return this._settledValue()},Q=U.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=U.prototype.isRejected=function(){return(this._bitField&16777216)!==0},I=U.prototype.isPending=function(){return(this._bitField&50397184)===0},K=U.prototype.isResolved=function(){return(this._bitField&50331648)!==0};U.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return I.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Q.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return Y.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),z.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=U}});var Uw0=E((ha1,$w0)=>{$w0.exports=function($,U,Y,z,Q,J){var I=F4(),K=I.canEvaluate,G=I.tryCatch,H=I.errorObj,W;if(K){var X=function(M){return Function("value","holder",`
'use strict';
holder.pIndex = value;
holder.checkFulfillment(this);
`.replace(/Index/g,O))},Z=function(O){return Function("promise","holder",`
`.replace(/Index/g,M))},Z=function(M){return Function("promise","holder",`
'use strict';
holder.pIndex = promise;
`.replace(/Index/g,O))},q=function(O){var D=Array(O);for(var N=0;N<D.length;++N)D[N]="this.p"+(N+1);var B=D.join(" = ")+" = null;",T=`var promise;
`+D.map(function(b){return`
`.replace(/Index/g,M))},q=function(M){var N=Array(M);for(var D=0;D<N.length;++D)N[D]="this.p"+(D+1);var B=N.join(" = ")+" = null;",T=`var promise;
`+N.map(function(b){return`
promise = `+b+`;
if (promise instanceof Promise) {
promise.cancel();
}
`}).join(`
`),A=D.join(", "),j="Holder$"+O,C=`return function(tryCatch, errorObj, Promise, async) {
`),A=N.join(", "),j="Holder$"+M,C=`return function(tryCatch, errorObj, Promise, async) {
'use strict';
function [TheName](fn) {
[TheProperties]
@@ -199,7 +199,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
return [TheName];
}(tryCatch, errorObj, Promise, async);
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,O).replace(/\[ThePassedArguments\]/g,A).replace(/\[TheProperties\]/g,B).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,H,$,I)},V=[],F=[],M=[];for(var w=0;w<8;++w)V.push(q(w+1)),F.push(X(w+1)),M.push(Z(w+1));W=function(O){this._reject(O)}}$.join=function(){var O=arguments.length-1,D;if(O>0&&typeof arguments[O]==="function"){if(D=arguments[O],O<=8&&K){var c=new $(U);c._captureStackTrace();var N=V[O-1],B=new N(D),T=F;for(var A=0;A<O;++A){var j=z(arguments[A],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[A],W,void 0,c,B),M[A](j,B),B.asyncNeeded=!1;else if((C&33554432)!==0)T[A].call(c,j._value(),B);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[A].call(c,j,B)}if(!c._isFateSealed()){if(B.asyncNeeded){var b=Q();if(b!==null)B.fn=J.domainBind(b,B.fn)}c._setAsyncGuaranteed(),c._setOnCancel(B)}return c}}var k=arguments.length,h=Array(k);for(var i=0;i<k;++i)h[i]=arguments[i];if(D)h.pop();var c=new Y(h).promise();return D!==void 0?c.spread(D):c}}});var Uw0=E((ha1,zw0)=>{zw0.exports=function($,Y,z,U,I,Q){var J=$._getDomain,K=F4(),G=K.tryCatch,H=K.errorObj,W=$._async;function X(q,V,F,M){this.constructor$(q),this._promise._captureStackTrace();var w=J();this._callback=w===null?V:K.domainBind(w,V),this._preservedValues=M===I?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],W.invoke(this._asyncInit,this,void 0)}K.inherits(X,Y),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,M=this.length(),w=this._preservedValues,O=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,O>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(O>=1&&this._inFlight>=O)return F[V]=q,this._queue.push(V),!1;if(w!==null)w[V]=q;var D=this._promise,N=this._callback,B=D._boundValue();D._pushContext();var T=G(N).call(B,q,V,M),A=D._popContext();if(Q.checkForgottenReturns(T,A,w!==null?"Promise.filter":"Promise.map",D),T===H)return this._reject(T.e),!0;var j=U(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(O>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=M){if(w!==null)this._filter(F,w);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var M=q.pop();this._promiseFulfilled(F[M],M)}},X.prototype._filter=function(q,V){var F=V.length,M=Array(F),w=0;for(var O=0;O<F;++O)if(q[O])M[w++]=V[O];M.length=w,this._resolve(M)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,M){if(typeof V!=="function")return z("expecting a function but got "+K.classString(V));var w=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(F.concurrency)));w=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(F)));return w=typeof w==="number"&&isFinite(w)&&w>=1?w:0,new X(q,V,w,M).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,M){return Z(q,V,F,M)}}});var Qw0=E((Sa1,Iw0)=>{var Kc=Object.create;if(Kc)vA=Kc(null),hA=Kc(null),vA[" size"]=hA[" size"]=0;var vA,hA;Iw0.exports=function($){var Y=F4(),z=Y.canEvaluate,U=Y.isIdentifier,I,Q,J=function(q){return Function("ensureMethod",`
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,M).replace(/\[ThePassedArguments\]/g,A).replace(/\[TheProperties\]/g,B).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,H,$,Q)},V=[],F=[],O=[];for(var w=0;w<8;++w)V.push(q(w+1)),F.push(X(w+1)),O.push(Z(w+1));W=function(M){this._reject(M)}}$.join=function(){var M=arguments.length-1,N;if(M>0&&typeof arguments[M]==="function"){if(N=arguments[M],M<=8&&K){var c=new $(z);c._captureStackTrace();var D=V[M-1],B=new D(N),T=F;for(var A=0;A<M;++A){var j=Y(arguments[A],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[A],W,void 0,c,B),O[A](j,B),B.asyncNeeded=!1;else if((C&33554432)!==0)T[A].call(c,j._value(),B);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[A].call(c,j,B)}if(!c._isFateSealed()){if(B.asyncNeeded){var b=J();if(b!==null)B.fn=I.domainBind(b,B.fn)}c._setAsyncGuaranteed(),c._setOnCancel(B)}return c}}var x=arguments.length,h=Array(x);for(var i=0;i<x;++i)h[i]=arguments[i];if(N)h.pop();var c=new U(h).promise();return N!==void 0?c.spread(N):c}}});var zw0=E((Sa1,Yw0)=>{Yw0.exports=function($,U,Y,z,Q,J){var I=$._getDomain,K=F4(),G=K.tryCatch,H=K.errorObj,W=$._async;function X(q,V,F,O){this.constructor$(q),this._promise._captureStackTrace();var w=I();this._callback=w===null?V:K.domainBind(w,V),this._preservedValues=O===Q?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],W.invoke(this._asyncInit,this,void 0)}K.inherits(X,U),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,O=this.length(),w=this._preservedValues,M=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,M>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(M>=1&&this._inFlight>=M)return F[V]=q,this._queue.push(V),!1;if(w!==null)w[V]=q;var N=this._promise,D=this._callback,B=N._boundValue();N._pushContext();var T=G(D).call(B,q,V,O),A=N._popContext();if(J.checkForgottenReturns(T,A,w!==null?"Promise.filter":"Promise.map",N),T===H)return this._reject(T.e),!0;var j=z(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(M>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=O){if(w!==null)this._filter(F,w);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var O=q.pop();this._promiseFulfilled(F[O],O)}},X.prototype._filter=function(q,V){var F=V.length,O=Array(F),w=0;for(var M=0;M<F;++M)if(q[M])O[w++]=V[M];O.length=w,this._resolve(O)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,O){if(typeof V!=="function")return Y("expecting a function but got "+K.classString(V));var w=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(F.concurrency)));w=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(F)));return w=typeof w==="number"&&isFinite(w)&&w>=1?w:0,new X(q,V,w,O).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,O){return Z(q,V,F,O)}}});var Jw0=E((ga1,Qw0)=>{var Kc=Object.create;if(Kc)vA=Kc(null),hA=Kc(null),vA[" size"]=hA[" size"]=0;var vA,hA;Qw0.exports=function($){var U=F4(),Y=U.canEvaluate,z=U.isIdentifier,Q,J,I=function(q){return Function("ensureMethod",`
return function(obj) {
'use strict'
var len = this.length;
@@ -216,26 +216,26 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
`.replace(/methodName/g,q))(H)},K=function(q){return Function("obj",`
'use strict';
return obj.propertyName;
`.replace("propertyName",q))},G=function(q,V,F){var M=F[q];if(typeof M!=="function"){if(!U(q))return null;if(M=V(q),F[q]=M,F[" size"]++,F[" size"]>512){var w=Object.keys(F);for(var O=0;O<256;++O)delete F[w[O]];F[" size"]=w.length-256}}return M};I=function(q){return G(q,J,vA)},Q=function(q){return G(q,K,hA)};function H(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var M="Object "+Y.classString(q)+" has no method '"+Y.toString(V)+"'";throw new $.TypeError(M)}return F}function W(q){var V=this.pop(),F=H(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var M=1;M<V;++M)F[M-1]=arguments[M];if(z){var w=I(q);if(w!==null)return this._then(w,void 0,void 0,F,void 0)}return F.push(q),this._then(W,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(z){var M=Q(q);F=M!==null?M:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var Kw0=E((ga1,Jw0)=>{Jw0.exports=function($,Y,z,U,I,Q){var J=F4(),K=T3().TypeError,G=F4().inherits,H=J.errorObj,W=J.tryCatch,X={};function Z(D){setTimeout(function(){throw D},0)}function q(D){var N=z(D);if(N!==D&&typeof D._isDisposable==="function"&&typeof D._getDisposer==="function"&&D._isDisposable())N._setDisposable(D._getDisposer());return N}function V(D,N){var B=0,T=D.length,A=new $(I);function j(){if(B>=T)return A._fulfill();var C=q(D[B++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(N),D.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),A}function F(D,N,B){this._data=D,this._promise=N,this._context=B}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(D){var N=this.resource(),B=this._context;if(B!==void 0)B._pushContext();var T=N!==X?this.doDispose(N,D):null;if(B!==void 0)B._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(D){return D!=null&&typeof D.resource==="function"&&typeof D.tryDispose==="function"};function M(D,N,B){this.constructor$(D,N,B)}G(M,F),M.prototype.doDispose=function(D,N){var B=this.data();return B.call(D,D,N)};function w(D){if(F.isDisposer(D))return this.resources[this.index]._setDisposable(D),D.promise();return D}function O(D){this.length=D,this.promise=null,this[D-1]=null}O.prototype._resultCancelled=function(){var D=this.length;for(var N=0;N<D;++N){var B=this[N];if(B instanceof $)B.cancel()}},$.using=function(){var D=arguments.length;if(D<2)return Y("you must pass at least 2 arguments to Promise.using");var N=arguments[D-1];if(typeof N!=="function")return Y("expecting a function but got "+J.classString(N));var B,T=!0;if(D===2&&Array.isArray(arguments[0]))B=arguments[0],D=B.length,T=!1;else B=arguments,D--;var A=new O(D);for(var j=0;j<D;++j){var C=B[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var k=z(C);if(k instanceof $)C=k._then(w,null,null,{resources:A,index:j},void 0)}A[j]=C}var h=Array(A.length);for(var j=0;j<h.length;++j)h[j]=$.resolve(A[j]).reflect();var i=$.all(h).then(function(U0){for(var x=0;x<U0.length;++x){var d=U0[x];if(d.isRejected())return H.e=d.error(),H;else if(!d.isFulfilled()){i.cancel();return}U0[x]=d.value()}c._pushContext(),N=W(N);var t=T?N.apply(void 0,U0):N(U0),$0=c._popContext();return Q.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var U0=new $.PromiseInspection(i);return V(A,U0)});return A.promise=c,c._setOnCancel(A),c},$.prototype._setDisposable=function(D){this._bitField=this._bitField|131072,this._disposer=D},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(D){if(typeof D==="function")return new M(D,this,U());throw new K}}});var Hw0=E((ya1,Gw0)=>{Gw0.exports=function($,Y,z){var U=F4(),I=$.TimeoutError;function Q(X){this.handle=X}Q.prototype._resultCancelled=function(){clearTimeout(this.handle)};var J=function(X){return K(+this).thenReturn(X)},K=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(J,null,null,X,void 0),z.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(Y),V=setTimeout(function(){q._fulfill()},+X),z.cancellation())q._setOnCancel(new Q(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return K(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new I("operation timed out");else V=new I(Z);if(U.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function H(X){return clearTimeout(this.handle),X Line truncated
`.replace("propertyName",q))},G=function(q,V,F){var O=F[q];if(typeof O!=="function"){if(!z(q))return null;if(O=V(q),F[q]=O,F[" size"]++,F[" size"]>512){var w=Object.keys(F);for(var M=0;M<256;++M)delete F[w[M]];F[" size"]=w.length-256}}return O};Q=function(q){return G(q,I,vA)},J=function(q){return G(q,K,hA)};function H(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var O="Object "+U.classString(q)+" has no method '"+U.toString(V)+"'";throw new $.TypeError(O)}return F}function W(q){var V=this.pop(),F=H(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var O=1;O<V;++O)F[O-1]=arguments[O];if(Y){var w=Q(q);if(w!==null)return this._then(w,void 0,void 0,F,void 0)}return F.push(q),this._then(W,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(Y){var O=J(q);F=O!==null?O:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var Kw0=E((ya1,Iw0)=>{Iw0.exports=function($,U,Y,z,Q,J){var I=F4(),K=T3().TypeError,G=F4().inherits,H=I.errorObj,W=I.tryCatch,X={};function Z(N){setTimeout(function(){throw N},0)}function q(N){var D=Y(N);if(D!==N&&typeof N._isDisposable==="function"&&typeof N._getDisposer==="function"&&N._isDisposable())D._setDisposable(N._getDisposer());return D}function V(N,D){var B=0,T=N.length,A=new $(Q);function j(){if(B>=T)return A._fulfill();var C=q(N[B++]);if(C instanceof $&&C._isDisposable()){try{C=Y(C._getDisposer().tryDispose(D),N.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),A}function F(N,D,B){this._data=N,this._promise=D,this._context=B}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(N){var D=this.resource(),B=this._context;if(B!==void 0)B._pushContext();var T=D!==X?this.doDispose(D,N):null;if(B!==void 0)B._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(N){return N!=null&&typeof N.resource==="function"&&typeof N.tryDispose==="function"};function O(N,D,B){this.constructor$(N,D,B)}G(O,F),O.prototype.doDispose=function(N,D){var B=this.data();return B.call(N,N,D)};function w(N){if(F.isDisposer(N))return this.resources[this.index]._setDisposable(N),N.promise();return N}function M(N){this.length=N,this.promise=null,this[N-1]=null}M.prototype._resultCancelled=function(){var N=this.length;for(var D=0;D<N;++D){var B=this[D];if(B instanceof $)B.cancel()}},$.using=function(){var N=arguments.length;if(N<2)return U("you must pass at least 2 arguments to Promise.using");var D=arguments[N-1];if(typeof D!=="function")return U("expecting a function but got "+I.classString(D));var B,T=!0;if(N===2&&Array.isArray(arguments[0]))B=arguments[0],N=B.length,T=!1;else B=arguments,N--;var A=new M(N);for(var j=0;j<N;++j){var C=B[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var x=Y(C);if(x instanceof $)C=x._then(w,null,null,{resources:A,index:j},void 0)}A[j]=C}var h=Array(A.length);for(var j=0;j<h.length;++j)h[j]=$.resolve(A[j]).reflect();var i=$.all(h).then(function(z0){for(var k=0;k<z0.length;++k){var d=z0[k];if(d.isRejected())return H.e=d.error(),H;else if(!d.isFulfilled()){i.cancel();return}z0[k]=d.value()}c._pushContext(),D=W(D);var t=T?D.apply(void 0,z0):D(z0),$0=c._popContext();return J.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var z0=new $.PromiseInspection(i);return V(A,z0)});return A.promise=c,c._setOnCancel(A),c},$.prototype._setDisposable=function(N){this._bitField=this._bitField|131072,this._disposer=N},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(N){if(typeof N==="function")return new O(N,this,z());throw new K}}});var Hw0=E((ka1,Gw0)=>{Gw0.exports=function($,U,Y){var z=F4(),Q=$.TimeoutError;function J(X){this.handle=X}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var I=function(X){return K(+this).thenReturn(X)},K=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(I,null,null,X,void 0),Y.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(U),V=setTimeout(function(){q._fulfill()},+X),Y.cancellation())q._setOnCancel(new J(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return K(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new Q("operation timed out");else V=new Q(Z);if(z.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function H(X){return clearTimeout(this.handle),X Line truncated
See http://goo.gl/MqrFmX
`.replace("%s",M)+`From coroutine:
`.replace("%s",O)+`From coroutine:
`+this._stack.split(`
`).slice(1,-7).join(`
`)));return}}w=w._target();var O=w._bitField;if((O&50397184)===0)this._yieldedPromise=w,w._proxy(this,null);else if((O&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,w._value());else if((O&16777216)!==0)$._async.invoke(this._promiseRejected,this,w._reason());else this._promiseCancelled()}},$.coroutine=function(V,F){if(typeof V!=="function")throw new K(`generatorFunction must be a function
`)));return}}w=w._target();var M=w._bitField;if((M&50397184)===0)this._yieldedPromise=w,w._proxy(this,null);else if((M&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,w._value());else if((M&16777216)!==0)$._async.invoke(this._promiseRejected,this,w._reason());else this._promiseCancelled()}},$.coroutine=function(V,F){if(typeof V!=="function")throw new K(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var M=Object(F).yieldHandler,w=q,O=Error().stack;return function(){var D=V.apply(this,arguments),N=new w(void 0,void 0,M,O),B=N.promise();return N._generator=D,N._promiseFulfilled(void 0),B}},$.coroutine.addYieldHandler=function(V){if(typeof V!=="function")throw new K("expecting a function but got "+G.classString(V));X.push(V)},$.spawn=function(V){if(Q.deprecated("Promise.spawn()","Promise.coroutine()"),typeof V!=="function")return Y(`generatorFunction must be a function
`);var O=Object(F).yieldHandler,w=q,M=Error().stack;return function(){var N=V.apply(this,arguments),D=new w(void 0,void 0,O,M),B=D.promise();return D._generator=N,D._promiseFulfilled(void 0),B}},$.coroutine.addYieldHandler=function(V){if(typeof V!=="function")throw new K("expecting a function but got "+G.classString(V));X.push(V)},$.spawn=function(V){if(J.deprecated("Promise.spawn()","Promise.coroutine()"),typeof V!=="function")return U(`generatorFunction must be a function
See http://goo.gl/MqrFmX
`);var F=new q(V,this),M=F.promise();return F._run($.spawn),M}}});var qw0=E((xa1,Zw0)=>{Zw0.exports=function($){var Y=F4(),z=$._async,U=Y.tryCatch,I=Y.errorObj;function Q(G,H){var W=this;if(!Y.isArray(G))return J.call(W,G,H);var X=U(H).apply(W._boundValue(),[null].concat(G));if(X===I)z.throwLater(X.e)}function J(G,H){var W=this,X=W._boundValue(),Z=G===void 0?U(H).call(X,null):U(H).call(X,null,G);if(Z===I)z.throwLater(Z.e)}function K(G,H){var W=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=U(H).call(W._boundValue(),G);if(Z===I)z.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,H){if(typeof G=="function"){var W=J;if(H!==void 0&&Object(H).spread)W=Q;this._then(W,K,void 0,this,G)}return this}}});var Lw0=E((fa1,Vw0)=>{Vw0.exports=function($,Y){var z={},U=F4(),I=Jc(),Q=U.withAppended,J=U.maybeWrapAsError,K=U.canEvaluate,G=T3().TypeError,H="Async",W={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return U.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function M(i,c,U0){var x=U.getDataPropertyOrDefault(i,c+U0,W);return x?F(x):!1}function w(i,c,U0){for(var x=0;x<i.length;x+=2){var d=i[x];if(U0.test(d)){var t=d.replace(U0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
`);var F=new q(V,this),O=F.promise();return F._run($.spawn),O}}});var qw0=E((fa1,Zw0)=>{Zw0.exports=function($){var U=F4(),Y=$._async,z=U.tryCatch,Q=U.errorObj;function J(G,H){var W=this;if(!U.isArray(G))return I.call(W,G,H);var X=z(H).apply(W._boundValue(),[null].concat(G));if(X===Q)Y.throwLater(X.e)}function I(G,H){var W=this,X=W._boundValue(),Z=G===void 0?z(H).call(X,null):z(H).call(X,null,G);if(Z===Q)Y.throwLater(Z.e)}function K(G,H){var W=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=z(H).call(W._boundValue(),G);if(Z===Q)Y.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,H){if(typeof G=="function"){var W=I;if(H!==void 0&&Object(H).spread)W=J;this._then(W,K,void 0,this,G)}return this}}});var Lw0=E((ua1,Vw0)=>{Vw0.exports=function($,U){var Y={},z=F4(),Q=Ic(),J=z.withAppended,I=z.maybeWrapAsError,K=z.canEvaluate,G=T3().TypeError,H="Async",W={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return z.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function O(i,c,z0){var k=z.getDataPropertyOrDefault(i,c+z0,W);return k?F(k):!1}function w(i,c,z0){for(var k=0;k<i.length;k+=2){var d=i[k];if(z0.test(d)){var t=d.replace(z0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
See http://goo.gl/MqrFmX
`.replace("%s",c))}}}function O(i,c,U0,x){var d=U.inheritedDataKeys(i),t=[];for(var $0=0;$0<d.length;++$0){var g=d[$0],p=i[g],e=x===q?!0:q(g,p,i);if(typeof p==="function"&&!F(p)&&!M(i,g,c)&&x(g,p,i,e))t.push(g,p)}return w(t,c,U0),t}var D=function(i){return i.replace(/([$])/,"\\$")},N,B=function(i){var c=[i],U0=Math.max(0,i-1-3);for(var x=i-1;x>=U0;--x)c.push(x);for(var x=i+1;x<=3;++x)c.push(x);return c},T=function(i){return U.filledRange(i,"_arg","")},A=function(i){return U.filledRange(Math.max(i,3),"_arg","")},j=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};N=function(i,c,U0,x,d,t){var $0=Math.max(0,j(x)-1),g=B($0),p=typeof i==="string"||c===z;function e(M0){var E0=T(M0).join(", "),G0=M0>0?", ":"",T0;if(p)T0=`ret = callback.call(this, {{args}}, nodeback); break;
`.replace("%s",c))}}}function M(i,c,z0,k){var d=z.inheritedDataKeys(i),t=[];for(var $0=0;$0<d.length;++$0){var g=d[$0],p=i[g],e=k===q?!0:q(g,p,i);if(typeof p==="function"&&!F(p)&&!O(i,g,c)&&k(g,p,i,e))t.push(g,p)}return w(t,c,z0),t}var N=function(i){return i.replace(/([$])/,"\\$")},D,B=function(i){var c=[i],z0=Math.max(0,i-1-3);for(var k=i-1;k>=z0;--k)c.push(k);for(var k=i+1;k<=3;++k)c.push(k);return c},T=function(i){return z.filledRange(i,"_arg","")},A=function(i){return z.filledRange(Math.max(i,3),"_arg","")},j=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};D=function(i,c,z0,k,d,t){var $0=Math.max(0,j(k)-1),g=B($0),p=typeof i==="string"||c===Y;function e(O0){var E0=T(O0).join(", "),G0=O0>0?", ":"",T0;if(p)T0=`ret = callback.call(this, {{args}}, nodeback); break;
`;else T0=c===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`;return T0.replace("{{args}}",E0).replace(", ",G0)}function y(){var M0="";for(var E0=0;E0<g.length;++E0)M0+="case "+g[E0]+":"+e(g[E0]);return M0+=`
`;return T0.replace("{{args}}",E0).replace(", ",G0)}function y(){var O0="";for(var E0=0;E0<g.length;++E0)O0+="case "+g[E0]+":"+e(g[E0]);return O0+=`
default:
var args = new Array(len + 1);
var i = 0;
@@ -247,7 +247,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
break;
`.replace("[CodeForCall]",p?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),M0}var s=typeof i==="string"?"this != null ? this['"+i+"'] : fn":"fn",Y0=`'use strict';
`),O0}var s=typeof i==="string"?"this != null ? this['"+i+"'] : fn":"fn",U0=`'use strict';
var ret = function (Parameters) {
'use strict';
var len = arguments.length;
@@ -267,25 +267,25 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
};
notEnumerableProp(ret, '__isPromisified__', true);
return ret;
`.replace("[CodeForSwitchCase]",y()).replace("[GetFunctionCode]",s);return Y0=Y0.replace("Parameters",A($0)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",Y0)($,x,c,Q,J,I,U.tryCatch,U.errorObj,U.notEnumerableProp,Y)};function C(i,c,U0,x,d,t){var $0=function(){return this}(),g=i;if(typeof g==="string")i=x;function p(){var e=c;if(c===z)e=this;var y=new $(Y);y._captureStackTrace();var s=typeof g==="string"&&this!==$0?this[g]:i,Y0=I(y,t);try{s.apply(e,Q(arguments,Y0))}catch(M0){y._rejectCallback(J(M0),!0,!0)}if(!y._isFateSealed())y._setAsyncGuaranteed();return y}return U.notEnumerableProp(p,"__isPromisified__",!0),p}var b=K?N:C;function k(i,c,U0,x,d){var t=new RegExp(D(c)+"$"),$0=O(i,c,t,U0);for(var g=0,p=$0.length;g<p;g+=2){var e=$0[g],y=$0[g+1],s=e+c;if(x===b)i[s]=b(e,z,e,y,c,d);else{var Y0=x(y,function(){return b(e,z,e,y,c,d)});U.notEnumerableProp(Y0,"__isPromisified__",!0),i[s]=Y0}}return U.toFastProperties(i),i}function h(i,c,U0){return b(i,c,void 0,i,null,U0)}$.promisify=function(i,c){if(typeof i!=="function")throw new G("expecting a function but got "+U.classString(i));if(F(i))return i;c=Object(c);var U0=c.context===void 0?z:c.context,x=!!c.multiArgs,d=h(i,U0,x);return U.copyDescriptors(i,d,V),d},$.promisifyAll=function(i,c){if(typeof i!=="function"&&typeof i!=="object")throw new G(`the target of promisifyAll must be an object or a function
`.replace("[CodeForSwitchCase]",y()).replace("[GetFunctionCode]",s);return U0=U0.replace("Parameters",A($0)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",U0)($,k,c,J,I,Q,z.tryCatch,z.errorObj,z.notEnumerableProp,U)};function C(i,c,z0,k,d,t){var $0=function(){return this}(),g=i;if(typeof g==="string")i=k;function p(){var e=c;if(c===Y)e=this;var y=new $(U);y._captureStackTrace();var s=typeof g==="string"&&this!==$0?this[g]:i,U0=Q(y,t);try{s.apply(e,J(arguments,U0))}catch(O0){y._rejectCallback(I(O0),!0,!0)}if(!y._isFateSealed())y._setAsyncGuaranteed();return y}return z.notEnumerableProp(p,"__isPromisified__",!0),p}var b=K?D:C;function x(i,c,z0,k,d){var t=new RegExp(N(c)+"$"),$0=M(i,c,t,z0);for(var g=0,p=$0.length;g<p;g+=2){var e=$0[g],y=$0[g+1],s=e+c;if(k===b)i[s]=b(e,Y,e,y,c,d);else{var U0=k(y,function(){return b(e,Y,e,y,c,d)});z.notEnumerableProp(U0,"__isPromisified__",!0),i[s]=U0}}return z.toFastProperties(i),i}function h(i,c,z0){return b(i,c,void 0,i,null,z0)}$.promisify=function(i,c){if(typeof i!=="function")throw new G("expecting a function but got "+z.classString(i));if(F(i))return i;c=Object(c);var z0=c.context===void 0?Y:c.context,k=!!c.multiArgs,d=h(i,z0,k);return z.copyDescriptors(i,d,V),d},$.promisifyAll=function(i,c){if(typeof i!=="function"&&typeof i!=="object")throw new G(`the target of promisifyAll must be an object or a function
See http://goo.gl/MqrFmX
`);c=Object(c);var U0=!!c.multiArgs,x=c.suffix;if(typeof x!=="string")x=H;var d=c.filter;if(typeof d!=="function")d=q;var t=c.promisifier;if(typeof t!=="function")t=b;if(!U.isIdentifier(x))throw RangeError(`suffix must be a valid identifier
`);c=Object(c);var z0=!!c.multiArgs,k=c.suffix;if(typeof k!=="string")k=H;var d=c.filter;if(typeof d!=="function")d=q;var t=c.promisifier;if(typeof t!=="function")t=b;if(!z.isIdentifier(k))throw RangeError(`suffix must be a valid identifier
See http://goo.gl/MqrFmX
`);var $0=U.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&U.isClass(p))k(p.prototype,x,d,t,U0),k(p,x,d,t,U0)}return k(i,x,d,t,U0)}}});var ww0=E((ua1,Fw0)=>{Fw0.exports=function($,Y,z,U){var I=F4(),Q=I.isObject,J=mz(),K;if(typeof Map==="function")K=Map;var G=function(){var Z=0,q=0;function V(F,M){this[Z]=F,this[Z+q]=M,Z++}return function(M){q=M.size,Z=0;var w=Array(M.size*2);return M.forEach(V,w),w}}(),H=function(Z){var q=new K,V=Z.length/2|0;for(var F=0;F<V;++F){var M=Z[V+F],w=Z[F];q.set(M,w)}return q};function W(Z){var q=!1,V;if(K!==void 0&&Z instanceof K)V=G(Z),q=!0;else{var F=J.keys(Z),M=F.length;V=Array(M*2);for(var w=0;w<M;++w){var O=F[w];V[w]=Z[O],V[w+M]=O}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}I.inherits(W,Y),W.prototype._init=function(){},W.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=H(this._values);else{F={};var M=this.length();for(var w=0,O=this.length();w<O;++w)F[this._values[w+M]]=this._values[w]}return this._resolve(F),!0}return!1},W.prototype.shouldCopyValues=function(){return!1},W.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=z(Z);if(!Q(V))return U(`cannot await properties of a non-object
`);var $0=z.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&z.isClass(p))x(p.prototype,k,d,t,z0),x(p,k,d,t,z0)}return x(i,k,d,t,z0)}}});var ww0=E((ba1,Fw0)=>{Fw0.exports=function($,U,Y,z){var Q=F4(),J=Q.isObject,I=mY(),K;if(typeof Map==="function")K=Map;var G=function(){var Z=0,q=0;function V(F,O){this[Z]=F,this[Z+q]=O,Z++}return function(O){q=O.size,Z=0;var w=Array(O.size*2);return O.forEach(V,w),w}}(),H=function(Z){var q=new K,V=Z.length/2|0;for(var F=0;F<V;++F){var O=Z[V+F],w=Z[F];q.set(O,w)}return q};function W(Z){var q=!1,V;if(K!==void 0&&Z instanceof K)V=G(Z),q=!0;else{var F=I.keys(Z),O=F.length;V=Array(O*2);for(var w=0;w<O;++w){var M=F[w];V[w]=Z[M],V[w+O]=M}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}Q.inherits(W,U),W.prototype._init=function(){},W.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=H(this._values);else{F={};var O=this.length();for(var w=0,M=this.length();w<M;++w)F[this._values[w+O]]=this._values[w]}return this._resolve(F),!0}return!1},W.prototype.shouldCopyValues=function(){return!1},W.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=Y(Z);if(!J(V))return z(`cannot await properties of a non-object
See http://goo.gl/MqrFmX
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new W(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var Ow0=E((ba1,Mw0)=>{Mw0.exports=function($,Y,z,U){var I=F4(),Q=function(K){return K.then(function(G){return J(G,K)})};function J(K,G){var H=z(K);if(H instanceof $)return Q(H);else if(K=I.asArray(K),K===null)return U("expecting an array or an iterable object but got "+I.classString(K));var W=new $(Y);if(G!==void 0)W._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=W;for(var q=0,V=K.length;q<V;++q){var F=K[q];if(F===void 0&&!(q in K))continue;$.cast(F)._then(X,Z,void 0,W,null)}return W}$.race=function(K){return J(K,void 0)},$.prototype.race=function(){return J(this,void 0)}}});var Dw0=E((ia1,Nw0)=>{Nw0.exports=function($,Y,z,U,I,Q){var J=$._getDomain,K=F4(),G=K.tryCatch;function H(V,F,M,w){this.constructor$(V);var O=J();if(this._fn=O===null?F:K.domainBind(O,F),M!==void 0)M=$.resolve(M),M._attachCancellationCallback(this);if(this._initialValue=M,this._currentCancellable=null,w===I)this._eachValues=Array(this._length);else if(w===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(H,Y),H.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==I)this._eachValues.push(V)},H.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},H.prototype._init=function(){},H.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},H.prototype.shouldCopyValues=function(){return!1},H.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},H.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},H.prototype._iterate=function(V){this._values=V;var F,M,w=V.length;if(this._initialValue!==void 0)F=this._initialValue,M=0;else F=$.resolve(V[0]),M=1;if(this._currentCancellable=F,!F.isRejected())for(;M<w;++M){var O={accum:null,value:V[M],index:M,length:w,array:this};F=F._then(Z,void 0,void 0,O,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(W,W,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,M,w){return X(V,F,M,w)};function W(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,M,w){if(typeof F!=="function")return z("expecting a function but got "+K.classString(F));var O=new H(V,F,M,w);return O.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=U(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,M=F._promise,w=G(F._fn);M._pushContext();var O;if(F._eachValues!==void 0)O=w.call(M._boundValue(),V,this.index,this.length);else O=w.call(M._boundValue(),this.accum,V,this.index,this.length);if(O instanceof $)F._currentCancellable=O;var D=M._popContext();return Q.checkForgottenReturns(O,D,F._eachValues!==void 0?"Promise.each":"Promise.reduce",M),O}}});var Pw0=E((ca1,Aw0)=>{Aw0.exports=function($,Y,z){var U=$.PromiseInspection,I=F4();function Q(J){this.constructor$(J)}I.inherits(Q,Y),Q.prototype._promiseResolved=function(J,K){this._values[J]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},Q.prototype._promiseFulfilled=function(J,K){var G=new U;return G._bitField=33554432,G._settledValueField=J,this._promiseResolved(K,G)},Q.prototype._promiseRejected=function(J,K){var G=new U;return G._bitField=16777216,G._settledValueField=J,this._promiseResolved(K,G)},$.settle=function(J){return z.deprecated(".settle()",".reflect()"),new Q(J).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Tw0=E((na1,Bw0)=>{Bw0.exports=function($,Y,z){var U=F4(),I=T3().RangeError,Q=T3().AggregateError,J=U.isArray,K={};function G(W){this.constructor$(W),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(G,Y),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var W=J(this._values);if(!this._isResolved()&&W&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(W){this._howMany=W},G.prototype._promiseFulfilled=function(W){if(this._addFulfilled(W),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new W(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var Mw0=E((ia1,Ow0)=>{Ow0.exports=function($,U,Y,z){var Q=F4(),J=function(K){return K.then(function(G){return I(G,K)})};function I(K,G){var H=Y(K);if(H instanceof $)return J(H);else if(K=Q.asArray(K),K===null)return z("expecting an array or an iterable object but got "+Q.classString(K));var W=new $(U);if(G!==void 0)W._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=W;for(var q=0,V=K.length;q<V;++q){var F=K[q];if(F===void 0&&!(q in K))continue;$.cast(F)._then(X,Z,void 0,W,null)}return W}$.race=function(K){return I(K,void 0)},$.prototype.race=function(){return I(this,void 0)}}});var Dw0=E((ca1,Nw0)=>{Nw0.exports=function($,U,Y,z,Q,J){var I=$._getDomain,K=F4(),G=K.tryCatch;function H(V,F,O,w){this.constructor$(V);var M=I();if(this._fn=M===null?F:K.domainBind(M,F),O!==void 0)O=$.resolve(O),O._attachCancellationCallback(this);if(this._initialValue=O,this._currentCancellable=null,w===Q)this._eachValues=Array(this._length);else if(w===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(H,U),H.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==Q)this._eachValues.push(V)},H.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},H.prototype._init=function(){},H.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},H.prototype.shouldCopyValues=function(){return!1},H.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},H.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},H.prototype._iterate=function(V){this._values=V;var F,O,w=V.length;if(this._initialValue!==void 0)F=this._initialValue,O=0;else F=$.resolve(V[0]),O=1;if(this._currentCancellable=F,!F.isRejected())for(;O<w;++O){var M={accum:null,value:V[O],index:O,length:w,array:this};F=F._then(Z,void 0,void 0,M,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(W,W,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,O,w){return X(V,F,O,w)};function W(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,O,w){if(typeof F!=="function")return Y("expecting a function but got "+K.classString(F));var M=new H(V,F,O,w);return M.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=z(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,O=F._promise,w=G(F._fn);O._pushContext();var M;if(F._eachValues!==void 0)M=w.call(O._boundValue(),V,this.index,this.length);else M=w.call(O._boundValue(),this.accum,V,this.index,this.length);if(M instanceof $)F._currentCancellable=M;var N=O._popContext();return J.checkForgottenReturns(M,N,F._eachValues!==void 0?"Promise.each":"Promise.reduce",O),M}}});var Pw0=E((na1,Aw0)=>{Aw0.exports=function($,U,Y){var z=$.PromiseInspection,Q=F4();function J(I){this.constructor$(I)}Q.inherits(J,U),J.prototype._promiseResolved=function(I,K){this._values[I]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(I,K){var G=new z;return G._bitField=33554432,G._settledValueField=I,this._promiseResolved(K,G)},J.prototype._promiseRejected=function(I,K){var G=new z;return G._bitField=16777216,G._settledValueField=I,this._promiseResolved(K,G)},$.settle=function(I){return Y.deprecated(".settle()",".reflect()"),new J(I).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Tw0=E((pa1,Bw0)=>{Bw0.exports=function($,U,Y){var z=F4(),Q=T3().RangeError,J=T3().AggregateError,I=z.isArray,K={};function G(W){this.constructor$(W),this._howMany=0,this._unwrap=!1,this._initialized=!1}z.inherits(G,U),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var W=I(this._values);if(!this._isResolved()&&W&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(W){this._howMany=W},G.prototype._promiseFulfilled=function(W){if(this._addFulfilled(W),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()= Line truncated
See http://goo.gl/MqrFmX
`);var Z=new G(W),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(W,X){return H(W,X)},$.prototype.some=function(W){return H(this,W)},$._SomePromiseArray=G}});var Ew0=E((pa1,jw0)=>{jw0.exports=function($,Y){var z=$.map;$.prototype.filter=function(U,I){return z(this,U,I,Y)},$.filter=function(U,I,Q){return z(U,I,Q,Y)}}});var Rw0=E((da1,Cw0)=>{Cw0.exports=function($,Y){var{reduce:z,all:U}=$;function I(){return U(this)}function Q(J,K){return z(J,K,Y,Y)}$.prototype.each=function(J){return z(this,J,Y,0)._then(I,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(J){return z(this,J,Y,Y)},$.each=function(J,K){return z(J,K,Y,0)._then(I,void 0,void 0,J,void 0)},$.mapSeries=Q}});var vw0=E((ma1,_w0)=>{_w0.exports=function($){var Y=$._SomePromiseArray;function z(U){var I=new Y(U),Q=I.promise();return I.setHowMany(1),I.setUnwrap(),I.init(),Q}$.any=function(U){return z(U)},$.prototype.any=function(){return z(this)}}});var hw0=E((la1,Gc)=>{Gc.exports=function(){var $=function(){return new X(`circular promise resolution chain
`);var Z=new G(W),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(W,X){return H(W,X)},$.prototype.some=function(W){return H(this,W)},$._SomePromiseArray=G}});var Ew0=E((da1,jw0)=>{jw0.exports=function($,U){var Y=$.map;$.prototype.filter=function(z,Q){return Y(this,z,Q,U)},$.filter=function(z,Q,J){return Y(z,Q,J,U)}}});var Rw0=E((ma1,Cw0)=>{Cw0.exports=function($,U){var{reduce:Y,all:z}=$;function Q(){return z(this)}function J(I,K){return Y(I,K,U,U)}$.prototype.each=function(I){return Y(this,I,U,0)._then(Q,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(I){return Y(this,I,U,U)},$.each=function(I,K){return Y(I,K,U,0)._then(Q,void 0,void 0,I,void 0)},$.mapSeries=J}});var vw0=E((la1,_w0)=>{_w0.exports=function($){var U=$._SomePromiseArray;function Y(z){var Q=new U(z),J=Q.promise();return Q.setHowMany(1),Q.setUnwrap(),Q.init(),J}$.any=function(z){return Y(z)},$.prototype.any=function(){return Y(this)}}});var hw0=E((oa1,Gc)=>{Gc.exports=function(){var $=function(){return new X(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},Y=function(){return new h.PromiseInspection(this._target())},z=function(x){return h.reject(new X(x))};function U(){}var I={},Q=F4(),J;if(Q.isNode)J=function(){var x=process.domain;if(x===void 0)x=null;return x};else J=function(){return null};Q.notEnumerableProp(h,"_getDomain",J);var K=mz(),G=TF0(),H=new G;K.defineProperty(h,"_async",{value:H});var W=T3(),X=h.TypeError=W.TypeError;h.RangeError=W.RangeError;var Z=h.CancellationError=W.CancellationError;h.TimeoutError=W.TimeoutError,h.OperationalError=W.OperationalError,h.RejectionError=W.OperationalError,h.AggregateError=W.AggregateError;var q=function(){},V={},F={},M=_F0()(h,q),w=hF0()(h,q,M,z,U),O=gF0()(h),D=O.create,N=kF0()(h,O),B=N.CapturedTrace,T=fF0()(h,M),A=bF0()(F),j=Jc(),C=Q.errorObj,b=Q.tryCatch;function k(x,d){if(typeof d!=="function")throw new X("expecting a function but got "+Q.classString(d));if(x.constructor!==h)throw new X(`the promise constructor cannot be invoked directly
`)},U=function(){return new h.PromiseInspection(this._target())},Y=function(k){return h.reject(new X(k))};function z(){}var Q={},J=F4(),I;if(J.isNode)I=function(){var k=process.domain;if(k===void 0)k=null;return k};else I=function(){return null};J.notEnumerableProp(h,"_getDomain",I);var K=mY(),G=TF0(),H=new G;K.defineProperty(h,"_async",{value:H});var W=T3(),X=h.TypeError=W.TypeError;h.RangeError=W.RangeError;var Z=h.CancellationError=W.CancellationError;h.TimeoutError=W.TimeoutError,h.OperationalError=W.OperationalError,h.RejectionError=W.OperationalError,h.AggregateError=W.AggregateError;var q=function(){},V={},F={},O=_F0()(h,q),w=hF0()(h,q,O,Y,z),M=gF0()(h),N=M.create,D=kF0()(h,M),B=D.CapturedTrace,T=fF0()(h,O),A=bF0()(F),j=Ic(),C=J.errorObj,b=J.tryCatch;function x(k,d){if(typeof d!=="function")throw new X("expecting a function but got "+J.classString(d));if(k.constructor!==h)throw new X(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`)}function h(x){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,x!==q)k(this,x),this._resolveFromExecutor(x);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(x){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(Q.isObject(p))t[$0++]=p;else return z("expecting an object but got A catch statement predicate "+Q.classString(p))}return t.length=$0,x=arguments[g],this.then(void 0,A(t,x,this))}return this.then(void 0,x)},h.prototype.reflect=function(){return this._then(Y,Y,void 0,this,void 0)},h.prototype.then=function(x,d){if(N.warnings()&&arguments.length>0&&typeof x!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+Q.classString(x);if(arguments.length>1)t+=", "+Q.classString(d);this._warn(t)}return this._then(x,d,void 0,void 0,void 0)},h.prototype.done=function(x,d){var t=this._then(x,d,void 0,void 0,void 0);t._setIsFinal()},h.prototype.spread=function(x){if(typeof x!=="function")return z("expecting a function but got "+Q.classString(x));return this.all()._then(x,void 0,void 0,V,void 0)},h.prototype.toJSON=function(){var x={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())x.fulfillmentValue=this.value(),x.isFulfilled=!0;else if(this.isRejected())x.rejectionReason=this.reason(),x.isRejected=!0;return x},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new w(this).promise()},h.prototype.error=function(x){return this.caught(Q.originatesFromRejection,x)},h.getNewLibraryCopy=Gc.exports,h.is=function(x){return x instanceof h},h.fromNode=h.fromCallback=function(x){var d=new h(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(x)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},h.all=function(x){return new w(x).promise()},h.cast=function(x){var d=M(x);if(!(d instanceof h))d=new h(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=x;return d},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(x){var d=new h(q);return d._captureStackTrace(),d._rejectCallback(x,!0),d},h.setScheduler=function(x){if(typeof x!=="function")throw new X("expecting a function but got "+Q.classString(x));return H.setScheduler(x)},h.prototype._then=function(x,d,t,$0,g){var p=g!==void 0,e=p?g:new h(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var Y0=J();if((s&50397184)!==0){var M0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,M0=x;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,M0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),M0=d;H.invoke(G0,y,{handler:Y0===null?M0:typeof M0==="function"&&Q.domainBind(Y0,M0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(x,d,e,$0,Y0);return e},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(x){this._bitField=this._bitField&-65536|x&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(H.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(x){var d=x===0?this._receiver0:this[x*4-4+3];if(d===I)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},h.prototype._promiseAt=function(x){return this[x*4-4+2]},h.prototype._fulfillmentHandlerAt=function(x){return this[x*4-4+0]},h.prototype._rejectionHandlerAt=function(x){return this[x*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(x){var{_bitField:d,_fulfillmentHandler Line truncated
`)}function h(k){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,k!==q)x(this,k),this._resolveFromExecutor(k);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(k){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(J.isObject(p))t[$0++]=p;else return Y("expecting an object but got A catch statement predicate "+J.classString(p))}return t.length=$0,k=arguments[g],this.then(void 0,A(t,k,this))}return this.then(void 0,k)},h.prototype.reflect=function(){return this._then(U,U,void 0,this,void 0)},h.prototype.then=function(k,d){if(D.warnings()&&arguments.length>0&&typeof k!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+J.classString(k);if(arguments.length>1)t+=", "+J.classString(d);this._warn(t)}return this._then(k,d,void 0,void 0,void 0)},h.prototype.done=function(k,d){var t=this._then(k,d,void 0,void 0,void 0);t._setIsFinal()},h.prototype.spread=function(k){if(typeof k!=="function")return Y("expecting a function but got "+J.classString(k));return this.all()._then(k,void 0,void 0,V,void 0)},h.prototype.toJSON=function(){var k={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())k.fulfillmentValue=this.value(),k.isFulfilled=!0;else if(this.isRejected())k.rejectionReason=this.reason(),k.isRejected=!0;return k},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new w(this).promise()},h.prototype.error=function(k){return this.caught(J.originatesFromRejection,k)},h.getNewLibraryCopy=Gc.exports,h.is=function(k){return k instanceof h},h.fromNode=h.fromCallback=function(k){var d=new h(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(k)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},h.all=function(k){return new w(k).promise()},h.cast=function(k){var d=O(k);if(!(d instanceof h))d=new h(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=k;return d},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(k){var d=new h(q);return d._captureStackTrace(),d._rejectCallback(k,!0),d},h.setScheduler=function(k){if(typeof k!=="function")throw new X("expecting a function but got "+J.classString(k));return H.setScheduler(k)},h.prototype._then=function(k,d,t,$0,g){var p=g!==void 0,e=p?g:new h(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var U0=I();if((s&50397184)!==0){var O0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,O0=k;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,O0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),O0=d;H.invoke(G0,y,{handler:U0===null?O0:typeof O0==="function"&&J.domainBind(U0,O0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(k,d,e,$0,U0);return e},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(k){this._bitField=this._bitField&-65536|k&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(H.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(k){var d=k===0?this._receiver0:this[k*4-4+3];if(d===Q)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},h.prototype._promiseAt=function(k){return this[k*4-4+2]},h.prototype._fulfillmentHandlerAt=function(k){return this[k*4-4+0]},h.prototype._rejectionHandlerAt=function(k){return this[k*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(k){var{_bitField:d,_fulfillmentHandler Line truncated
path = %s
syscall = %s
fstream_type = %s
@@ -294,26 +294,26 @@ fstream_unc_path = %s
fstream_class = %s
fstream_stack =
%s
`,Y||"UNKNOWN",U.stack,U.path,U.syscall,U.fstream_type,U.fstream_path,U.fstream_unc_path,U.fstream_class,U.fstream_stack.join(`
`));else z.emit("warn",U)};C2.prototype.info=function($,Y){this.emit("info",$,Y)};C2.prototype.error=function($,Y,z){var U=XO0($,Y,this);if(z)throw U;else this.emit("error",U)};function XO0($,Y,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||Y,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var qZ=E((Pt1,qO0)=>{qO0.exports=Hw1;function Hw1($){var Y=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&Y.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,I=Y.length;U<I;U++){z=Y[U];var Q=$[z]||$["is"+z];if(typeof Q==="function")Q=Q.call($);if(Q)return $[z]=!0,$.type=z,z}return null}});var oc=E((Bt1,VO0)=>{VO0.exports=VZ;var Ww1=l8(),Xw1=X1(),lc=YU();Xw1(VZ,lc);function VZ($){var Y=this;if(!(Y instanceof VZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);lc.call(Y,$)}VZ.prototype._stat=function($){var Y=this;Ww1.readlink(Y._path,function(z,U){if(z)return Y.error(z);Y.linkpath=Y.props.linkpath=U,Y.emit("linkpath",U),lc.prototype._stat.call(Y,$)})};VZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var sc=E((Tt1,wO0)=>{wO0.exports=w9;var FO0=l8(),Zw1=X1(),LZ=J0("path"),rc=YU(),LO0=J0("assert").ok;Zw1(w9,rc);function w9($){var Y=this;if(!(Y instanceof w9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(Y.entries=null,Y._index=-1,Y._paused=!1,Y._length=-1,$.sort)this.sort=$.sort;rc.call(this,$)}w9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,FO0.readdir($._path,function(Y,z){if(Y)return $.error(Y);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};w9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var Y=LZ.resolve($._path,$.entries[$._index]);LO0(Y!==$._path),LO0($.entries[$._index]),$._currentEntry=Y,FO0[$.props.follow?"stat":"lstat"](Y,function(z,U){if(z)return $.error(z);var I=$._proxy||$;U.path=Y,U.basename=LZ.basename(Y),U.dirname=LZ.dirname(Y);var Q=$.getChildProps.call(I,U);Q.path=Y,Q.basename=LZ.basename(Y),Q.dirname=LZ.dirname(Y);var J=rc(Q,U);$._currentEntry=J,J.on("pause",function(H){if(!$._paused&&!J._disowned)$.pause(H)}),J.on("resume",function(H){if($._paused&&!J._disowned)$.resume(H)}),J.on("stat",function(H){if($.emit("_entryStat",J,H),J._aborted)return;if(J._paused)J.once("resume",function(){$.emit("entryStat",J,H)});else $.emit("entryStat",J,H)}),J.on("ready",function H(){if($._paused)return J.pause($),$.once("resume",H);if(J.type==="Socket")$.emit("socket",J);else $.emitEntry(J)});var K=!1;J.on("close",G),J.on("disown",G);function G(){if(K)return;if(K=!0,$.emit("childEnd",J),$.emit("entryEnd",J),$._currentEntry=null,!$._paused)$._read()}J.on("error",function(H){if(J._swallowErrors)$.warn(H),J.emit("end"),J.emit("close");else $.emit("error",H)}),["child","childEnd","warn"].forEach(function(H){J.on(H,$.emit.bind($,H))})})};w9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};w9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};w9.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._currentEntry&&Y._currentEntry.pause)Y._currentEntry.pause($);Y.emit("pause",$)};w9.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y._paused=!1,Y.emit("resume",$),Y._paused)return;if(Y._currentEntry){if(Y._currentEntry.resume)Y._currentEntry.resume($)}else Y._read()};w9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var ac=E((jt1,DO0)=>{DO0.exports=zU;var qw1=l8(),Vw1=X1(),MO0=YU(),OO0={EOF:!0},NO0={CLOSE:!0};Vw1(zU,MO0);function zU($){var Y=this;if(!(Y instanceof zU))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);Y._buffer=[],Y._bytesEmitted=0,MO0.call(Y,$)}zU.prototype._getStream=function(){var $=this,Y=$._stream=qw1.createReadStream($._path,$.p Line truncated
`,U||"UNKNOWN",z.stack,z.path,z.syscall,z.fstream_type,z.fstream_path,z.fstream_unc_path,z.fstream_class,z.fstream_stack.join(`
`));else Y.emit("warn",z)};C2.prototype.info=function($,U){this.emit("info",$,U)};C2.prototype.error=function($,U,Y){var z=XM0($,U,this);if(Y)throw z;else this.emit("error",z)};function XM0($,U,Y){if(!($ instanceof Error))$=Error($);if($.code=$.code||U,$.path=$.path||Y.path,$.fstream_type=$.fstream_type||Y.type,$.fstream_path=$.fstream_path||Y.path,Y._path!==Y.path)$.fstream_unc_path=$.fstream_unc_path||Y._path;if(Y.linkpath)$.fstream_linkpath=$.fstream_linkpath||Y.linkpath;return $.fstream_class=$.fstream_class||Y.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(z){return z.replace(/^ {4}at /,"")}),$}});var qZ=E((Bt1,qM0)=>{qM0.exports=Hw1;function Hw1($){var U=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],Y;if($.type&&U.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var z=0,Q=U.length;z<Q;z++){Y=U[z];var J=$[Y]||$["is"+Y];if(typeof J==="function")J=J.call($);if(J)return $[Y]=!0,$.type=Y,Y}return null}});var oc=E((Tt1,VM0)=>{VM0.exports=VZ;var Ww1=l8(),Xw1=X1(),lc=Uz();Xw1(VZ,lc);function VZ($){var U=this;if(!(U instanceof VZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);lc.call(U,$)}VZ.prototype._stat=function($){var U=this;Ww1.readlink(U._path,function(Y,z){if(Y)return U.error(Y);U.linkpath=U.props.linkpath=z,U.emit("linkpath",z),lc.prototype._stat.call(U,$)})};VZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var sc=E((jt1,wM0)=>{wM0.exports=w9;var FM0=l8(),Zw1=X1(),LZ=I0("path"),rc=Uz(),LM0=I0("assert").ok;Zw1(w9,rc);function w9($){var U=this;if(!(U instanceof w9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(U.entries=null,U._index=-1,U._paused=!1,U._length=-1,$.sort)this.sort=$.sort;rc.call(this,$)}w9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,FM0.readdir($._path,function(U,Y){if(U)return $.error(U);if($.entries=Y,$.emit("entries",Y),$._paused)$.once("resume",z);else z();function z(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};w9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var U=LZ.resolve($._path,$.entries[$._index]);LM0(U!==$._path),LM0($.entries[$._index]),$._currentEntry=U,FM0[$.props.follow?"stat":"lstat"](U,function(Y,z){if(Y)return $.error(Y);var Q=$._proxy||$;z.path=U,z.basename=LZ.basename(U),z.dirname=LZ.dirname(U);var J=$.getChildProps.call(Q,z);J.path=U,J.basename=LZ.basename(U),J.dirname=LZ.dirname(U);var I=rc(J,z);$._currentEntry=I,I.on("pause",function(H){if(!$._paused&&!I._disowned)$.pause(H)}),I.on("resume",function(H){if($._paused&&!I._disowned)$.resume(H)}),I.on("stat",function(H){if($.emit("_entryStat",I,H),I._aborted)return;if(I._paused)I.once("resume",function(){$.emit("entryStat",I,H)});else $.emit("entryStat",I,H)}),I.on("ready",function H(){if($._paused)return I.pause($),$.once("resume",H);if(I.type==="Socket")$.emit("socket",I);else $.emitEntry(I)});var K=!1;I.on("close",G),I.on("disown",G);function G(){if(K)return;if(K=!0,$.emit("childEnd",I),$.emit("entryEnd",I),$._currentEntry=null,!$._paused)$._read()}I.on("error",function(H){if(I._swallowErrors)$.warn(H),I.emit("end"),I.emit("close");else $.emit("error",H)}),["child","childEnd","warn"].forEach(function(H){I.on(H,$.emit.bind($,H))})})};w9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};w9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};w9.prototype.pause=function($){var U=this;if(U._paused)return;if($=$||U,U._paused=!0,U._currentEntry&&U._currentEntry.pause)U._currentEntry.pause($);U.emit("pause",$)};w9.prototype.resume=function($){var U=this;if(!U._paused)return;if($=$||U,U._paused=!1,U.emit("resume",$),U._paused)return;if(U._currentEntry){if(U._currentEntry.resume)U._currentEntry.resume($)}else U._read()};w9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var ac=E((Et1,DM0)=>{DM0.exports=Yz;var qw1=l8(),Vw1=X1(),OM0=Uz(),MM0={EOF:!0},NM0={CLOSE:!0};Vw1(Yz,OM0);function Yz($){var U=this;if(!(U instanceof Yz))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);U._buffer=[],U._bytesEmitted=0,OM0.call(U,$)}Yz.prototype._getStream=function(){var $=this,U=$._stream=qw1.createReadStream($._path,$.p Line truncated
expect: `+$.props.size+`
actual: `+$._bytesEmitted)}),Y.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(NO0),$._read();else $.emit("close")}),Y.on("error",function(z){$.emit("error",z)}),$._read()};zU.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var Y=$._buffer;for(var z=0,U=Y.length;z<U;z++){var I=Y[z];if(I===OO0)$.emit("end");else if(I===NO0)$.emit("close");else $.emit("data",I);if($._paused){$._buffer=Y.slice(z);return}}$._buffer.length=0}};zU.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._stream)Y._stream.pause();Y.emit("pause",$)};zU.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y.emit("resume",$),Y._paused=!1,Y._stream)Y._stream.resume();Y._read()}});var BO0=E((Et1,PO0)=>{PO0.exports=IP;var Lw1=X1(),AO0=YU();Lw1(IP,AO0);function IP($){var Y=this;if(!(Y instanceof IP))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);AO0.call(Y,$)}IP.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var ec=E((Ct1,TO0)=>{TO0.exports=UU;var tc=YU(),Fw1=qZ(),ww1=X1(),Mw1=l8();ww1(UU,tc);function UU($){var Y=this;if(!(Y instanceof UU))throw Error("ProxyReader must be called as constructor.");Y.props=$,Y._buffer=[],Y.ready=!1,tc.call(Y,$)}UU.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";Mw1[z](Y.path,function(U,I){var Q;if(U||!I)Q="File";else Q=Fw1(I);Y[Q]=!0,Y.type=$.type=Q,$._old=I,$._addProxy(tc(Y,I))})};UU.prototype._addProxy=function($){var Y=this;if(Y._proxyTarget)return Y.error("proxy already set");Y._proxyTarget=$,$._proxy=Y,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$),$.on("ready",function(){Y.ready=!0,Y.emit("ready")});var z=Y._buffer;Y._buffer.length=0,z.forEach(function(U){$[U[0]].apply($,U[1])})};UU.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};UU.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var YU=E((Rt1,CO0)=>{CO0.exports=O5;var Ow1=l8(),Nw1=J0("stream").Stream,Dw1=X1(),$n=J0("path"),Yn=qZ(),QP=O5.hardLinks={},jO0=UP();Dw1(O5,jO0);var EO0=oc();function O5($,Y){var z=this;if(!(z instanceof O5))return new O5($,Y);if(typeof $==="string")$={path:$};var U,I;if($.type&&typeof $.type==="function")U=$.type,I=U;else U=Yn($),I=O5;if(Y&&!U)U=Yn(Y),$[U]=!0,$.type=U;switch(U){case"Directory":I=sc();break;case"Link":case"File":I=ac();break;case"SymbolicLink":I=EO0;break;case"Socket":I=BO0();break;case null:I=ec();break}if(!(z instanceof I))return new I($);if(jO0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=U,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=$n.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=$n.basename(z.path),z.dirname=$.dirname=$n.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=Aw1;z._stat(Y)}function Aw1($,Y){return $===Y?0:$.toLowerCase()>Y.toLowerCase()?1:$.toLowerCase()<Y.toLowerCase()?-1:$>Y?1:-1}O5.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat";if($)process.nextTick(I.bind(null,null,$));else Ow1[U](Y._path,I);function I(Q,J){if(Q)return Y.error(Q);if(Object.keys(J).forEach(function(q){z[q]=J[q]}),Y.size!==void 0&&z.size!==Y.size)return Y.error("incorrect size");Y.size=z.size;var K=Yn(z),G=z.hardlinks!==!1;if(G&&K!=="Directory"&&z.nlink&&z.nlink>1){var H=z.dev+":"+z.ino;if(QP[H]===Y._path||!QP[H])QP[H]=Y._path;else K=Y.type=Y.props.type="Link",Y.Link=Y.props.Link=!0,Y.linkpath=Y.props.linkpath=QP[H],Y._stat=Y._read=EO0.prototype._read}if(Y.type&&Y.type!==K)Y.error("Unexpected type: "+K);if(Y.filter){var W=Y._proxy||Y;if(!Y.filter.call(W,W,z)){if(!Y._disowned)Y.abort(),Y.emit("end"),Y.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(Y._aborted){Y.emit("end"),Y.emit("close");return}if(Y._paused&&Y.type!=="Directory"){Y.once("resume",q);return}var V=X[Z++];if(!V)return Y._read();Y.emit(V,z),q()})()}};O5.prototype.pipe=function($){var Y=this;if(typeof $.add==="function")Y.on("entry",function(z){var U=$.add(z);if(U===!1)Y.pause()});return Nw1.prototype.pipe.apply(this,arguments)};O5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};O5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};O5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Qn=E((_t1,kO0)=> Line truncated
actual: `+$._bytesEmitted)}),U.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(NM0),$._read();else $.emit("close")}),U.on("error",function(Y){$.emit("error",Y)}),$._read()};Yz.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var U=$._buffer;for(var Y=0,z=U.length;Y<z;Y++){var Q=U[Y];if(Q===MM0)$.emit("end");else if(Q===NM0)$.emit("close");else $.emit("data",Q);if($._paused){$._buffer=U.slice(Y);return}}$._buffer.length=0}};Yz.prototype.pause=function($){var U=this;if(U._paused)return;if($=$||U,U._paused=!0,U._stream)U._stream.pause();U.emit("pause",$)};Yz.prototype.resume=function($){var U=this;if(!U._paused)return;if($=$||U,U.emit("resume",$),U._paused=!1,U._stream)U._stream.resume();U._read()}});var BM0=E((Ct1,PM0)=>{PM0.exports=QP;var Lw1=X1(),AM0=Uz();Lw1(QP,AM0);function QP($){var U=this;if(!(U instanceof QP))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);AM0.call(U,$)}QP.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var ec=E((Rt1,TM0)=>{TM0.exports=zz;var tc=Uz(),Fw1=qZ(),ww1=X1(),Ow1=l8();ww1(zz,tc);function zz($){var U=this;if(!(U instanceof zz))throw Error("ProxyReader must be called as constructor.");U.props=$,U._buffer=[],U.ready=!1,tc.call(U,$)}zz.prototype._stat=function(){var $=this,U=$.props,Y=U.follow?"stat":"lstat";Ow1[Y](U.path,function(z,Q){var J;if(z||!Q)J="File";else J=Fw1(Q);U[J]=!0,U.type=$.type=J,$._old=Q,$._addProxy(tc(U,Q))})};zz.prototype._addProxy=function($){var U=this;if(U._proxyTarget)return U.error("proxy already set");U._proxyTarget=$,$._proxy=U,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(z){$.on(z,U.emit.bind(U,z))}),U.emit("proxy",$),$.on("ready",function(){U.ready=!0,U.emit("ready")});var Y=U._buffer;U._buffer.length=0,Y.forEach(function(z){$[z[0]].apply($,z[1])})};zz.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};zz.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var Uz=E((_t1,CM0)=>{CM0.exports=M5;var Mw1=l8(),Nw1=I0("stream").Stream,Dw1=X1(),$n=I0("path"),Un=qZ(),JP=M5.hardLinks={},jM0=zP();Dw1(M5,jM0);var EM0=oc();function M5($,U){var Y=this;if(!(Y instanceof M5))return new M5($,U);if(typeof $==="string")$={path:$};var z,Q;if($.type&&typeof $.type==="function")z=$.type,Q=z;else z=Un($),Q=M5;if(U&&!z)z=Un(U),$[z]=!0,$.type=z;switch(z){case"Directory":Q=sc();break;case"Link":case"File":Q=ac();break;case"SymbolicLink":Q=EM0;break;case"Socket":Q=BM0();break;case null:Q=ec();break}if(!(Y instanceof Q))return new Q($);if(jM0.call(Y),!$.path)Y.error("Must provide a path",null,!0);if(Y.readable=!0,Y.writable=!1,Y.type=z,Y.props=$,Y.depth=$.depth=$.depth||0,Y.parent=$.parent||null,Y.root=$.root||$.parent&&$.parent.root||Y,Y._path=Y.path=$n.resolve($.path),process.platform==="win32"){if(Y.path=Y._path=Y.path.replace(/\?/g,"_"),Y._path.length>=260)Y._swallowErrors=!0,Y._path="\\\\?\\"+Y.path.replace(/\//g,"\\")}if(Y.basename=$.basename=$n.basename(Y.path),Y.dirname=$.dirname=$n.dirname(Y.path),$.parent=$.root=null,Y.size=$.size,Y.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=Aw1;Y._stat(U)}function Aw1($,U){return $===U?0:$.toLowerCase()>U.toLowerCase()?1:$.toLowerCase()<U.toLowerCase()?-1:$>U?1:-1}M5.prototype._stat=function($){var U=this,Y=U.props,z=Y.follow?"stat":"lstat";if($)process.nextTick(Q.bind(null,null,$));else Mw1[z](U._path,Q);function Q(J,I){if(J)return U.error(J);if(Object.keys(I).forEach(function(q){Y[q]=I[q]}),U.size!==void 0&&Y.size!==U.size)return U.error("incorrect size");U.size=Y.size;var K=Un(Y),G=Y.hardlinks!==!1;if(G&&K!=="Directory"&&Y.nlink&&Y.nlink>1){var H=Y.dev+":"+Y.ino;if(JP[H]===U._path||!JP[H])JP[H]=U._path;else K=U.type=U.props.type="Link",U.Link=U.props.Link=!0,U.linkpath=U.props.linkpath=JP[H],U._stat=U._read=EM0.prototype._read}if(U.type&&U.type!==K)U.error("Unexpected type: "+K);if(U.filter){var W=U._proxy||U;if(!U.filter.call(W,W,Y)){if(!U._disowned)U.abort(),U.emit("end"),U.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(U._aborted){U.emit("end"),U.emit("close");return}if(U._paused&&U.type!=="Directory"){U.once("resume",q);return}var V=X[Z++];if(!V)return U._read();U.emit(V,Y),q()})()}};M5.prototype.pipe=function($){var U=this;if(typeof $.add==="function")U.on("entry",function(Y){var z=$.add(Y);if(z===!1)U.pause()});return Nw1.prototype.pipe.apply(this,arguments)};M5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};M5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};M5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Jn=E((vt1,kM0)=> Line truncated
expect: `+$.size+`
actual: `+$._bytesWritten);FP.prototype._finish.call($)}});var Fn=E((ot1,TN0)=>{TN0.exports=S2;var Ln=cJ(),rw1=qZ(),sw1=X1(),aw1=VP(),tw1=J0("fs");sw1(S2,Ln);function S2($){var Y=this;if(!(Y instanceof S2))throw Error("ProxyWriter must be called as constructor.");Y.props=$,Y._needDrain=!1,Ln.call(Y,$)}S2.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";tw1[z](Y.path,function(U,I){var Q;if(U||!I)Q="File";else Q=rw1(I);Y[Q]=!0,Y.type=$.type=Q,$._old=I,$._addProxy(Ln(Y,I))})};S2.prototype._addProxy=function($){var Y=this;if(Y._proxy)return Y.error("proxy already set");Y._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$);var z=Y._buffer;if(z.forEach(function(U){$[U[0]].apply($,U[1])}),Y._buffer.length=0,Y._needsDrain)Y.emit("drain")};S2.prototype.add=function($){if(aw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};S2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};S2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var cJ=E((rt1,gN0)=>{gN0.exports=f$;var x$=l8(),ew1=X1(),$M1=Qn(),YM1=Wn(),OZ=J0("path"),EN0=process.platform==="win32"?0:process.umask(),CN0=qZ(),RN0=UP();ew1(f$,RN0);f$.dirmode=parseInt("0777",8)&~EN0;f$.filemode=parseInt("0666",8)&~EN0;var zM1=Zn(),UM1=qn(),IM1=Vn(),QM1=Fn();function f$($,Y){var z=this;if(typeof $==="string")$={path:$};var U=CN0($),I=f$;switch(U){case"Directory":I=zM1;break;case"File":I=IM1;break;case"Link":case"SymbolicLink":I=UM1;break;case null:default:I=QM1;break}if(!(z instanceof I))return new I($);if(RN0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=OZ.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=OZ.basename($.path),z.dirname=OZ.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(Y)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(Y){if(Y)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat",I=Y._proxy||Y;if($)Q(null,$);else x$[U](Y._path,Q);function Q(J,K){if(Y.filter&&!Y.filter.call(I,I,K)){Y._aborted=!0,Y.emit("end"),Y.emit("close");return}if(J||!K)return wn(Y);Y._old=K;var G=CN0(K);if(G!==Y.type||Y.type==="File"&&K.nlink>1)return $M1(Y._path,function(H){if(H)return Y.error(H);Y._old=null,wn(Y)});wn(Y)}};function wn($){YM1(OZ.dirname($._path),f$.dirmode,function(Y,z){if(Y)return $.error(Y);return $._madeDir=z,$._create()})}function _N0($,Y,z,U,I){var Q=Y.mode,J=Y.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[J])return I();if(typeof Q!=="number")return I();var K=z.mode&parseInt("0777",8);if(Q=Q&parseInt("0777",8),Q===K)return I();x$[J](U,Q,I)}function vN0($,Y,z,U,I){if(process.platform==="win32")return I();if(!process.getuid||process.getuid()!==0)return I();if(typeof Y.uid!=="number"&&typeof Y.gid!=="number")return I();if(z.uid===Y.uid&&z.gid===Y.gid)return I();var Q=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[Q])return I();if(typeof Y.uid!=="number")Y.uid=z.uid;if(typeof Y.gid!=="number")Y.gid=z.gid;x$[Q](U,Y.uid,Y.gid,I)}function hN0($,Y,z,U,I){if(!x$.utimes||process.platform==="win32")return I();var Q=Y.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(Q==="lutimes"&&!x$[Q])Q="utimes";if(!x$[Q])return I();var{atime:J,mtime:K}=z,G=Y.atime,H=Y.mtime;if(G===void 0)G=J;if(H===void 0)H=K;if(!jN0(G))G=new Date(G);if(!jN0(H))G=new Date(H);if(G.getTime()===J.getTime()&&H.getTime()===K.getTime())return I();x$[Q](U,G,H,I)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var Y=0,z=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),Q($._old);else{var I=$.props.follow?"stat":"lstat";x$[I]($._path,function(K,G){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);Q($._old=G)})}return;function Q(K){Y+=3,_N0($,$.props,K,$._path,J("chmod")),vN0($,$.props,K,$._path,J("chown")),hN0($,$.props,K,$._path,J("utimes"))}function J(K){return function(G){if(z)return;if(G)return G.fstream_finish_call=K,$.error(z=G);if(--Y>0)return;if(U)return;if(U=!0,!$._madeDir)return H();else SN0($,$._path,H);function H(W){if(W)return W.fstream_finish_call="setupMadeDir",$.error(W);$.emit("end"),$.emit("close")}}}};function SN0($,Y,z){var U=$._madeDir,I=OZ.dirname(Y);JM1($,I,function(Q){if(Q)return z(Q);if(I===U)return z();SN0($,I,z)})}function JM1($,Y,z){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var I=3,Q=null;x$.stat(Y,function(K,G){if(K)return z(Q=K);_N0($,U,G,Y,J),vN0($,U,G,Y,J),hN0($,U,G,Y,J)});function J(K){if(Q)return;if(K)return z(Q=K);if(--I===0)return z()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function KM1($){return Object.prototype.toString.call($)}function jN0($){return typeof $==="object"&&KM1($)==="[object Date]"}});var An=E((GM1)=>{GM1.Abstract=UP();GM1.Reader=YU();GM1.Writer=cJ();GM1.File={Reader:ac(),Writer:Vn()};GM1.Dir={Reader:sc(),Writer:Zn()};GM1.Link={Reader:oc(),Writer:qn()};GM1.Proxy={Reader:ec(),Writer:Fn()};GM1.Reader.Dir=GM1.DirReader=GM1.Dir.Reader;GM1.Reader.File=GM1.FileReader=GM1.File.Reader;GM1.Reader.Link=GM1.LinkReader=GM1.Link.Reader;GM1.Reader.Proxy=GM1.ProxyReader=GM1.Proxy.Reader;GM1.Writer.Dir=GM1.DirWriter=GM1.Dir.Writer;GM1.Writer.File=GM1.FileWriter=GM1.File.Writer;GM1.Writer.Link=GM1.LinkWriter=GM1.Link.Writer;GM1.Writer.Proxy=GM1.ProxyWriter=GM1.Proxy.Writer;GM1.collect=VP()});var kN0=E((Qe1,yN0)=>{yN0.exports=FM1;var XM1=oA(),ZM1=An().Writer,Pn=J0("path"),qM1=J0("stream"),VM1=dc(),LM1=j2();function FM1($){$.path=Pn.resolve(Pn.normalize($.path));var Y=new XM1($),z=new qM1.Writable({objectMode:!0});z._write=function(I,Q,J){if(I.type=="Directory")return J();var K=Pn.join($.path,I.path);if(K.indexOf($.path)!=0)return J();let G=$.getWriter?$.getWriter({path:K}):ZM1({path:K});I.pipe(G).on("error",J).on("close",J)};var U=VM1(Y,z);return Y.once("crx-header",function(I){U.crxHeader=I}),Y.pipe(z).on("finish",function(){U.emit("close")}),U.promise=function(){return new LM1(function(I,Q){U.on("close",I),U.on("error",Q)})},U}});var xN0=E((Je1,wP)=>{var j6=function($){var Y=1e7,z=7,U=9007199254740992,I=Z(U),Q="0123456789abcdefghijklmnopqrstuvwxyz",J=typeof BigInt==="function";function K(P,v,u,r){if(typeof P>"u")return K[0];if(typeof v<"u")return+v===10&&!u?A0(P):f0(P,v,u,r);return A0(P)}function G(P,v){this.value=P,this.sign=v,this.isSmall=!1}G.prototype=Object.create(K.prototype);function H(P){this.value=P,this.sign=P<0,this.isSmall=!0}H.prototype=Object.create(K.prototype);function W(P){ Line truncated
actual: `+$._bytesWritten);FP.prototype._finish.call($)}});var Fn=E((rt1,TN0)=>{TN0.exports=S2;var Ln=cI(),rw1=qZ(),sw1=X1(),aw1=VP(),tw1=I0("fs");sw1(S2,Ln);function S2($){var U=this;if(!(U instanceof S2))throw Error("ProxyWriter must be called as constructor.");U.props=$,U._needDrain=!1,Ln.call(U,$)}S2.prototype._stat=function(){var $=this,U=$.props,Y=U.follow?"stat":"lstat";tw1[Y](U.path,function(z,Q){var J;if(z||!Q)J="File";else J=rw1(Q);U[J]=!0,U.type=$.type=J,$._old=Q,$._addProxy(Ln(U,Q))})};S2.prototype._addProxy=function($){var U=this;if(U._proxy)return U.error("proxy already set");U._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(z){$.on(z,U.emit.bind(U,z))}),U.emit("proxy",$);var Y=U._buffer;if(Y.forEach(function(z){$[z[0]].apply($,z[1])}),U._buffer.length=0,U._needsDrain)U.emit("drain")};S2.prototype.add=function($){if(aw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};S2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};S2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var cI=E((st1,gN0)=>{gN0.exports=f$;var x$=l8(),ew1=X1(),$O1=Jn(),UO1=Wn(),MZ=I0("path"),EN0=process.platform==="win32"?0:process.umask(),CN0=qZ(),RN0=zP();ew1(f$,RN0);f$.dirmode=parseInt("0777",8)&~EN0;f$.filemode=parseInt("0666",8)&~EN0;var YO1=Zn(),zO1=qn(),QO1=Vn(),JO1=Fn();function f$($,U){var Y=this;if(typeof $==="string")$={path:$};var z=CN0($),Q=f$;switch(z){case"Directory":Q=YO1;break;case"File":Q=QO1;break;case"Link":case"SymbolicLink":Q=zO1;break;case null:default:Q=JO1;break}if(!(Y instanceof Q))return new Q($);if(RN0.call(Y),!$.path)Y.error("Must provide a path",null,!0);if(Y.type=$.type,Y.props=$,Y.depth=$.depth||0,Y.clobber=$.clobber===!1?$.clobber:!0,Y.parent=$.parent||null,Y.root=$.root||$.parent&&$.parent.root||Y,Y._path=Y.path=MZ.resolve($.path),process.platform==="win32"){if(Y.path=Y._path=Y.path.replace(/\?/g,"_"),Y._path.length>=260)Y._swallowErrors=!0,Y._path="\\\\?\\"+Y.path.replace(/\//g,"\\")}if(Y.basename=MZ.basename($.path),Y.dirname=MZ.dirname($.path),Y.linkpath=$.linkpath||null,$.parent=$.root=null,Y.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);Y.readable=!1,Y.writable=!0,Y._buffer=[],Y.ready=!1,Y.filter=typeof $.filter==="function"?$.filter:null,Y._stat(U)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(U){if(U)return $.warn("Cannot create "+$._path+`
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var U=this,Y=U.props,z=Y.follow?"stat":"lstat",Q=U._proxy||U;if($)J(null,$);else x$[z](U._path,J);function J(I,K){if(U.filter&&!U.filter.call(Q,Q,K)){U._aborted=!0,U.emit("end"),U.emit("close");return}if(I||!K)return wn(U);U._old=K;var G=CN0(K);if(G!==U.type||U.type==="File"&&K.nlink>1)return $O1(U._path,function(H){if(H)return U.error(H);U._old=null,wn(U)});wn(U)}};function wn($){UO1(MZ.dirname($._path),f$.dirmode,function(U,Y){if(U)return $.error(U);return $._madeDir=Y,$._create()})}function _N0($,U,Y,z,Q){var J=U.mode,I=U.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[I])return Q();if(typeof J!=="number")return Q();var K=Y.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===K)return Q();x$[I](z,J,Q)}function vN0($,U,Y,z,Q){if(process.platform==="win32")return Q();if(!process.getuid||process.getuid()!==0)return Q();if(typeof U.uid!=="number"&&typeof U.gid!=="number")return Q();if(Y.uid===U.uid&&Y.gid===U.gid)return Q();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[J])return Q();if(typeof U.uid!=="number")U.uid=Y.uid;if(typeof U.gid!=="number")U.gid=Y.gid;x$[J](z,U.uid,U.gid,Q)}function hN0($,U,Y,z,Q){if(!x$.utimes||process.platform==="win32")return Q();var J=U.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!x$[J])J="utimes";if(!x$[J])return Q();var{atime:I,mtime:K}=Y,G=U.atime,H=U.mtime;if(G===void 0)G=I;if(H===void 0)H=K;if(!jN0(G))G=new Date(G);if(!jN0(H))G=new Date(H);if(G.getTime()===I.getTime()&&H.getTime()===K.getTime())return Q();x$[J](z,G,H,Q)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var U=0,Y=null,z=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Q=$.props.follow?"stat":"lstat";x$[Q]($._path,function(K,G){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);J($._old=G)})}return;function J(K){U+=3,_N0($,$.props,K,$._path,I("chmod")),vN0($,$.props,K,$._path,I("chown")),hN0($,$.props,K,$._path,I("utimes"))}function I(K){return function(G){if(Y)return;if(G)return G.fstream_finish_call=K,$.error(Y=G);if(--U>0)return;if(z)return;if(z=!0,!$._madeDir)return H();else SN0($,$._path,H);function H(W){if(W)return W.fstream_finish_call="setupMadeDir",$.error(W);$.emit("end"),$.emit("close")}}}};function SN0($,U,Y){var z=$._madeDir,Q=MZ.dirname(U);IO1($,Q,function(J){if(J)return Y(J);if(Q===z)return Y();SN0($,Q,Y)})}function IO1($,U,Y){var z={};Object.keys($.props).forEach(function(K){if(z[K]=$.props[K],K==="mode"&&$.type!=="Directory")z[K]=z[K]|parseInt("0111",8)});var Q=3,J=null;x$.stat(U,function(K,G){if(K)return Y(J=K);_N0($,z,G,U,I),vN0($,z,G,U,I),hN0($,z,G,U,I)});function I(K){if(J)return;if(K)return Y(J=K);if(--Q===0)return Y()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function KO1($){return Object.prototype.toString.call($)}function jN0($){return typeof $==="object"&&KO1($)==="[object Date]"}});var An=E((GO1)=>{GO1.Abstract=zP();GO1.Reader=Uz();GO1.Writer=cI();GO1.File={Reader:ac(),Writer:Vn()};GO1.Dir={Reader:sc(),Writer:Zn()};GO1.Link={Reader:oc(),Writer:qn()};GO1.Proxy={Reader:ec(),Writer:Fn()};GO1.Reader.Dir=GO1.DirReader=GO1.Dir.Reader;GO1.Reader.File=GO1.FileReader=GO1.File.Reader;GO1.Reader.Link=GO1.LinkReader=GO1.Link.Reader;GO1.Reader.Proxy=GO1.ProxyReader=GO1.Proxy.Reader;GO1.Writer.Dir=GO1.DirWriter=GO1.Dir.Writer;GO1.Writer.File=GO1.FileWriter=GO1.File.Writer;GO1.Writer.Link=GO1.LinkWriter=GO1.Link.Writer;GO1.Writer.Proxy=GO1.ProxyWriter=GO1.Proxy.Writer;GO1.collect=VP()});var kN0=E((Ie1,yN0)=>{yN0.exports=FO1;var XO1=oA(),ZO1=An().Writer,Pn=I0("path"),qO1=I0("stream"),VO1=dc(),LO1=j2();function FO1($){$.path=Pn.resolve(Pn.normalize($.path));var U=new XO1($),Y=new qO1.Writable({objectMode:!0});Y._write=function(Q,J,I){if(Q.type=="Directory")return I();var K=Pn.join($.path,Q.path);if(K.indexOf($.path)!=0)return I();let G=$.getWriter?$.getWriter({path:K}):ZO1({path:K});Q.pipe(G).on("error",I).on("close",I)};var z=VO1(U,Y);return U.once("crx-header",function(Q){z.crxHeader=Q}),U.pipe(Y).on("finish",function(){z.emit("close")}),z.promise=function(){return new LO1(function(Q,J){z.on("close",Q),z.on("error",J)})},z}});var xN0=E((Ke1,wP)=>{var j6=function($){var U=1e7,Y=7,z=9007199254740992,Q=Z(z),J="0123456789abcdefghijklmnopqrstuvwxyz",I=typeof BigInt==="function";function K(P,v,u,r){if(typeof P>"u")return K[0];if(typeof v<"u")return+v===10&&!u?A0(P):f0(P,v,u,r);return A0(P)}function G(P,v){this.value=P,this.sign=v,this.isSmall=!1}G.prototype=Object.create(K.prototype);function H(P){this.value=P,this.sign=P<0,this.isSmall=!0}H.prototype=Object.create(K.prototype);function W(P){ Line truncated
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/var V4=J0("fs"),PP=J0("os"),E6=J0("path"),sN0=J0("crypto"),M9={fs:V4.constants,os:PP.constants},$D0=/XXXXXX/,YD0=(M9.O_CREAT||M9.fs.O_CREAT)|(M9.O_EXCL||M9.fs.O_EXCL)|(M9.O_RDWR||M9.fs.O_RDWR),bM1=PP.platform()==="win32",iM1=M9.EBADF||M9.os.errno.EBADF,cM1=M9.ENOENT||M9.os.errno.ENOENT,pJ=[],zD0=V4.rmdirSync.bind(V4),UD0=!1;function nM1($,Y){return V4.rm($,{recursive:!0},Y)}function ID0($){return V4.rmSync($,{recursive:!0})}function Cn($,Y){let z=dJ($,Y),U=z[0],I=z[1];eM1(U,function(Q,J){if(Q)return I(Q);let K=J.tries;(function G(){try{let H=JD0(J);V4.stat(H,function(W){if(!W){if(K-- >0)return G();return I(Error("Could not get a unique tmp filename, max tries reached "+H))}I(null,H)})}catch(H){I(H)}})()})}function Rn($){let Y=dJ($),z=Y[0],U=$O1(z),I=U.tries;do{let Q=JD0(U);try{V4.statSync(Q)}catch(J){return Q}}while(I-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function pM1($,Y){let z=dJ($,Y),U=z[0],I=z[1];Cn(U,function(J,K){if(J)return I(J);V4.open(K,YD0,U.mode||384,function(H,W){if(H)return I(H);if(U.discardDescriptor)return V4.close(W,function(Z){return I(Z,K,void 0,jn(K,-1,U,!1))});else{let X=U.discardDescriptor||U.detachDescriptor;I(null,K,W,jn(K,X?-1:W,U,!1))}})})}function dM1($){let Y=dJ($),z=Y[0],U=z.discardDescriptor||z.detachDescriptor,I=Rn(z),Q=V4.openSync(I,YD0,z.mode||384);if(z.discardDescriptor)V4.closeSync(Q),Q=void 0;return{name:I,fd:Q,removeCallback:jn(I,U?-1:Q,z,!0)}}function mM1($,Y){let z=dJ($,Y),U=z[0],I=z[1];Cn(U,function(J,K){if(J)return I(J);V4.mkdir(K,U.mode||448,function(H){if(H)return I(H);I(null,K,QD0(K,U,!1))})})}function lM1($){let Y=dJ($),z=Y[0],U=Rn(z);return V4.mkdirSync(U,z.mode||448),{name:U,removeCallback:QD0(U,z,!0)}}function oM1($,Y){let z=function(U){if(U&&!En(U))return Y(U);Y()};if(0<=$[0])V4.close($[0],function(){V4.unlink($[1],z)});else V4.unlink($[1],z)}function rM1($){let Y=null;try{if(0<=$[0])V4.closeSync($[0])}catch(z){if(!YO1(z)&&!En(z))throw z}finally{try{V4.unlinkSync($[1])}catch(z){if(!En(z))Y=z}}if(Y!==null)throw Y}function jn($,Y,z,U){let I=AP(rM1,[Y,$],U),Q=AP(oM1,[Y,$],U,I);if(!z.keep)pJ.unshift(I);return U?I:Q}function QD0($,Y,z){let U=Y.unsafeCleanup?nM1:V4.rmdir.bind(V4),I=Y.unsafeCleanup?ID0:zD0,Q=AP(I,$,z),J=AP(U,$,z,Q);if(!Y.keep)pJ.unshift(Q);return z?Q:J}function AP($,Y,z,U){let I=!1;return function Q(J){if(!I){let K=U||Q,G=pJ.indexOf(K);if(G>=0)pJ.splice(G,1);if(I=!0,z||$===zD0||$===ID0)return $(Y);else return $(Y,J||function(){})}}}function sM1(){if(!UD0)return;while(pJ.length)try{pJ[0]()}catch($){}}function aN0($){let Y=[],z=null;try{z=sN0.randomBytes($)}catch(U){z=sN0.pseudoRandomBytes($)}for(let U=0;U<$;U++)Y.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[U]%62]);return Y.join("")}function r8($){return typeof $>"u"}function dJ($,Y){if(typeof $==="function")return[{},$];if(r8($))return[{},Y];let z={};for(let U of Object.getOwnPropertyNames($))z[U]=$[U];return[z,Y]}function aM1($,Y,z){let U=E6.isAbsolute($)?$:E6.join(Y,$);V4.stat(U,function(I){if(I)V4.realpath(E6.dirname(U),function(Q,J){if(Q)return z(Q);z(null,E6.join(J,E6.basename(U)))});else V4.realpath(U,z)})}function tM1($,Y){let z=E6.isAbsolute($)?$:E6.join(Y,$);try{return V4.statSync(z),V4.realpathSync(z)}catch(U){let I=V4.realpathSync(E6.dirname(z));return E6.join(I,E6.basename(z))}}function JD0($){let Y=$.tmpdir;if(!r8($.name))return E6.join(Y,$.dir,$.name);if(!r8($.template))return E6.join(Y,$.dir,$.template).replace($D0,aN0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",aN0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(Y,$.dir,z)}function Tn($,Y){if(typeof Y!=="string")throw Error(`${$} option must be a string, got "${typeof Y}".`);if(Y.includes(".."))throw Error("Relative value not allowed");return Y}function KD0($){if(!r8($.name)){let Y=$.name;if(E6.isAbsolute(Y))throw Error(`name option must not contain an absolute path, found "${Y}".`);let z=E6.basename(Y);if(z===".."||z==="."||z!==Y)throw Error(`name option must not contain a path, found "${Y}".`)}if(!r8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match($D0))throw Error(`Invalid template, found "${$.template}".`)}if(!r8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r8($.prefix)?"":Tn("prefix",$.prefix),$.postfix=r8($.postfix)?"":Tn("postfix",$.postfix),$.template=r8($.template)?void 0:Tn("template",$.template)}function tN0($,Y,z,U){if(r8(Y))return U(null);aM1(Y,z,function(I,Q){if(I)return U(I);let J=E6.relative(z,Q);if(J.startsWith("..")||E6.isAbsolute(J))return U(Error(`${$} option must be relative to "${z}", found "${J}".`));U(null,J)})}function eN0($,Y,z){if(r8(Y))return;let U=tM1(Y,z),I=E6.relative(z,U);if(I.startsWith("..")||E6.isAbsolute(I))thrLine truncated
`)}let U=[];Y.forEach((I,Q)=>{let J=$.length+Q+1,K=Q===0?"⏳ ":"";U.push(`${K}${J}. ${I}`)});for(let I=$.length-1;I>=0;I--){let Q=I+1;U.push(`${Q}. ${$[I]}`)}return U.join(`
`)}function bn($,Y,z,U,I){let Q=$?.operator||Y?.operator||z?.operator,J=Q?.name||Q?.id||z?.operatorName||"",K=($?.nodeName||Y?.fromNodeName||Y?.nodeName||z?.nodeName||"").trim();if(K==="合思审批节点"||K==="外部审批节点"||K.includes("合思审批")||K.includes("外部审批"))K="";if((!K||K==="提交人"||K==="审批节点")&&J&&U){let M=U.find((w)=>w.operator?.name===J&&w.nodeName&&w.nodeName.trim()!=="提交人"&&!w.isEbot&&w.rawAction!=="freeflow.reject");if(M?.nodeName)K=M.nodeName.trim()}let H=$?.comment||Y?.reason||z?.rejectComment||"修改";if(H.includes(":")){let M=H.split(":");if(M.length>1)H=M.slice(1).join(":").trim()}let W=H;if(K&&J)W=`${K}(${J}) ❌: ${H}`;else if(J)W=`${J} ❌: ${H}`;else if(K)W=`${K} ❌: ${H}`;else W=H;let X=$?.rejectTargetNodeName||Y?.targetNodeName||"提交人",Z=$?.rejectTargetOperator?.name||Y?.targetOperator?.name||I?.submitter?.name,q=Z?`${X}(${Z})`:X,V=$?.resubmitRuleText||Y?.resubmitRuleText||(J?`重新提交后由${J}继续审批`:"重新提交后继续审批");return{comment:`${W}
*/var V4=I0("fs"),PP=I0("os"),E6=I0("path"),sN0=I0("crypto"),O9={fs:V4.constants,os:PP.constants},$D0=/XXXXXX/,UD0=(O9.O_CREAT||O9.fs.O_CREAT)|(O9.O_EXCL||O9.fs.O_EXCL)|(O9.O_RDWR||O9.fs.O_RDWR),bO1=PP.platform()==="win32",iO1=O9.EBADF||O9.os.errno.EBADF,cO1=O9.ENOENT||O9.os.errno.ENOENT,pI=[],YD0=V4.rmdirSync.bind(V4),zD0=!1;function nO1($,U){return V4.rm($,{recursive:!0},U)}function QD0($){return V4.rmSync($,{recursive:!0})}function Cn($,U){let Y=dI($,U),z=Y[0],Q=Y[1];eO1(z,function(J,I){if(J)return Q(J);let K=I.tries;(function G(){try{let H=ID0(I);V4.stat(H,function(W){if(!W){if(K-- >0)return G();return Q(Error("Could not get a unique tmp filename, max tries reached "+H))}Q(null,H)})}catch(H){Q(H)}})()})}function Rn($){let U=dI($),Y=U[0],z=$M1(Y),Q=z.tries;do{let J=ID0(z);try{V4.statSync(J)}catch(I){return J}}while(Q-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function pO1($,U){let Y=dI($,U),z=Y[0],Q=Y[1];Cn(z,function(I,K){if(I)return Q(I);V4.open(K,UD0,z.mode||384,function(H,W){if(H)return Q(H);if(z.discardDescriptor)return V4.close(W,function(Z){return Q(Z,K,void 0,jn(K,-1,z,!1))});else{let X=z.discardDescriptor||z.detachDescriptor;Q(null,K,W,jn(K,X?-1:W,z,!1))}})})}function dO1($){let U=dI($),Y=U[0],z=Y.discardDescriptor||Y.detachDescriptor,Q=Rn(Y),J=V4.openSync(Q,UD0,Y.mode||384);if(Y.discardDescriptor)V4.closeSync(J),J=void 0;return{name:Q,fd:J,removeCallback:jn(Q,z?-1:J,Y,!0)}}function mO1($,U){let Y=dI($,U),z=Y[0],Q=Y[1];Cn(z,function(I,K){if(I)return Q(I);V4.mkdir(K,z.mode||448,function(H){if(H)return Q(H);Q(null,K,JD0(K,z,!1))})})}function lO1($){let U=dI($),Y=U[0],z=Rn(Y);return V4.mkdirSync(z,Y.mode||448),{name:z,removeCallback:JD0(z,Y,!0)}}function oO1($,U){let Y=function(z){if(z&&!En(z))return U(z);U()};if(0<=$[0])V4.close($[0],function(){V4.unlink($[1],Y)});else V4.unlink($[1],Y)}function rO1($){let U=null;try{if(0<=$[0])V4.closeSync($[0])}catch(Y){if(!UM1(Y)&&!En(Y))throw Y}finally{try{V4.unlinkSync($[1])}catch(Y){if(!En(Y))U=Y}}if(U!==null)throw U}function jn($,U,Y,z){let Q=AP(rO1,[U,$],z),J=AP(oO1,[U,$],z,Q);if(!Y.keep)pI.unshift(Q);return z?Q:J}function JD0($,U,Y){let z=U.unsafeCleanup?nO1:V4.rmdir.bind(V4),Q=U.unsafeCleanup?QD0:YD0,J=AP(Q,$,Y),I=AP(z,$,Y,J);if(!U.keep)pI.unshift(J);return Y?J:I}function AP($,U,Y,z){let Q=!1;return function J(I){if(!Q){let K=z||J,G=pI.indexOf(K);if(G>=0)pI.splice(G,1);if(Q=!0,Y||$===YD0||$===QD0)return $(U);else return $(U,I||function(){})}}}function sO1(){if(!zD0)return;while(pI.length)try{pI[0]()}catch($){}}function aN0($){let U=[],Y=null;try{Y=sN0.randomBytes($)}catch(z){Y=sN0.pseudoRandomBytes($)}for(let z=0;z<$;z++)U.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[Y[z]%62]);return U.join("")}function r8($){return typeof $>"u"}function dI($,U){if(typeof $==="function")return[{},$];if(r8($))return[{},U];let Y={};for(let z of Object.getOwnPropertyNames($))Y[z]=$[z];return[Y,U]}function aO1($,U,Y){let z=E6.isAbsolute($)?$:E6.join(U,$);V4.stat(z,function(Q){if(Q)V4.realpath(E6.dirname(z),function(J,I){if(J)return Y(J);Y(null,E6.join(I,E6.basename(z)))});else V4.realpath(z,Y)})}function tO1($,U){let Y=E6.isAbsolute($)?$:E6.join(U,$);try{return V4.statSync(Y),V4.realpathSync(Y)}catch(z){let Q=V4.realpathSync(E6.dirname(Y));return E6.join(Q,E6.basename(Y))}}function ID0($){let U=$.tmpdir;if(!r8($.name))return E6.join(U,$.dir,$.name);if(!r8($.template))return E6.join(U,$.dir,$.template).replace($D0,aN0(6));let Y=[$.prefix?$.prefix:"tmp","-",process.pid,"-",aN0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(U,$.dir,Y)}function Tn($,U){if(typeof U!=="string")throw Error(`${$} option must be a string, got "${typeof U}".`);if(U.includes(".."))throw Error("Relative value not allowed");return U}function KD0($){if(!r8($.name)){let U=$.name;if(E6.isAbsolute(U))throw Error(`name option must not contain an absolute path, found "${U}".`);let Y=E6.basename(U);if(Y===".."||Y==="."||Y!==U)throw Error(`name option must not contain a path, found "${U}".`)}if(!r8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match($D0))throw Error(`Invalid template, found "${$.template}".`)}if(!r8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r8($.prefix)?"":Tn("prefix",$.prefix),$.postfix=r8($.postfix)?"":Tn("postfix",$.postfix),$.template=r8($.template)?void 0:Tn("template",$.template)}function tN0($,U,Y,z){if(r8(U))return z(null);aO1(U,Y,function(Q,J){if(Q)return z(Q);let I=E6.relative(Y,J);if(I.startsWith("..")||E6.isAbsolute(I))return z(Error(`${$} option must be relative to "${Y}", found "${I}".`));z(null,I)})}function eN0($,U,Y){if(r8(U))return;let z=tO1(U,Y),Q=E6.relative(Y,z);if(Q.startsWith("..")||E6.isAbsolute(Q))thrLine truncated
`)}let z=[];U.forEach((Q,J)=>{let I=$.length+J+1,K=J===0?"⏳ ":"";z.push(`${K}${I}. ${Q}`)});for(let Q=$.length-1;Q>=0;Q--){let J=Q+1;z.push(`${J}. ${$[Q]}`)}return z.join(`
`)}function bn($,U,Y,z,Q){let J=$?.operator||U?.operator||Y?.operator,I=J?.name||J?.id||Y?.operatorName||"",K=($?.nodeName||U?.fromNodeName||U?.nodeName||Y?.nodeName||"").trim();if(K==="合思审批节点"||K==="外部审批节点"||K.includes("合思审批")||K.includes("外部审批"))K="";if((!K||K==="提交人"||K==="审批节点")&&I&&z){let O=z.find((w)=>w.operator?.name===I&&w.nodeName&&w.nodeName.trim()!=="提交人"&&!w.isEbot&&w.rawAction!=="freeflow.reject");if(O?.nodeName)K=O.nodeName.trim()}let H=$?.comment||U?.reason||Y?.rejectComment||"修改";if(H.includes(":")){let O=H.split(":");if(O.length>1)H=O.slice(1).join(":").trim()}let W=H;if(K&&I)W=`${K}(${I}) ❌: ${H}`;else if(I)W=`${I} ❌: ${H}`;else if(K)W=`${K} ❌: ${H}`;else W=H;let X=$?.rejectTargetNodeName||U?.targetNodeName||"提交人",Z=$?.rejectTargetOperator?.name||U?.targetOperator?.name||Q?.submitter?.name,q=Z?`${X}(${Z})`:X,V=$?.resubmitRuleText||U?.resubmitRuleText||(I?`重新提交后由${I}继续审批`:"重新提交后继续审批");return{comment:`${W}
↳ 驳回至: ${q}
↳ ${V}`,operator:Q}}function pD0($){if(!$)return[];let Y=$.pending||[],z=String($.rawState||"").toUpperCase(),U=String($.state||"").toUpperCase(),I=[];if(Y.length>0)for(let Q of Y){let J=Q.approver?.name||Q.approver?.id||"待定",K=(Q.name||$.currentNode||"").trim(),G=K?`${K}(${J})`:J,W=Q.type?.toUpperCase()==="PAYING"||K.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";I.push(`${G}: ${W}`)}else if($.currentNode?.trim()){let J=$.currentNode.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";I.push(`${$.currentNode.trim()}: ${J}`)}return I}function JU($,Y){let z=new Map;if(!$||$.length===0)return z;if(!Y){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";z.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:nD0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return z}let U=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),I=Y.history||[],Q=String(Y.rawState||"").toUpperCase(),J=String(Y.state||"").toUpperCase(),K=Q==="DRAFT"||Q==="REVOKED"||Q==="CANCELED"||Q==="CANCELLED"||J==="草稿"||J==="已撤回"||J==="已取消",G=Q==="REJECTED"||Q==="TERMINATED"||J==="审批驳回"||J==="已驳回",H=!K&&!G&&(Q==="PAID"||J==="已支付"||I.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),W=!K&&!G&&!H&&(Q==="PAYING"||J==="支付中"||(Y.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||Y.currentNode?.includes("支付")===!0),Z=H||!K&&!G&&!W&&(Q==="COMPLETED"||Q==="APPROVED"||J==="已完成"||J==="审批通过");for(let q=0;q<U.length;q++){let V=U[q];if(!V)continue;let F=Number(V.createdAt)||0,M=V.document||{},w=V.manualApprovalRecord||V.result?.manualApprovalRecord||M.manualApprovalRecord||{},O=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,D=typeof w.nodeId==="string"?String(w.nodeId):void 0,N=D?decodeURIComponent(D).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,B=O||N,T=B?I.find((A0)=>A0.nodeId&&(A0.nodeId===B||B.includes(A0.nodeId))):void 0,A=T?.time??F,j=U[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===U.length-1,k=I.find((A0)=>(A0.time??0)>A+5000&&A0.isEbot&&(A0.nodeName?.includes("智能")||A0.nodeName?.includes("AI")||A0.action?.includes("智能")||A0.comment?.includes("AI")||A0.comment?.includes("approval-result"))&&!A0.nodeName?.includes("费用标准检查")&&!A0.nodeName?.includes("标准检查")&&!A0.nodeName?.includes("预算"));if(k){if(b=!1,(k.time??1/0)<C)C=k.time}let h=V.result||{},i=h.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",U0=c.toUpperCase(),x=U0==="REJECT"||U0==="驳回",d=U0==="APPROVE"||U0==="通过",t=U0==="EXEMPT_APPROVE"||U0==="免审通过"||U0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(x)e=p?"驳回":"添加评论";else if(U0==="REVIEW"||U0==="转交复核")e="转交复核";let y=typeof w.status==="object"&&w.status!==null?String(w.status.type||w.status.label||"").toUpperCase():"",s=typeof w.status==="object"&&w.status!==null?String(w.status.sourceStatus||""):"",Y0=M.manualApprovalStatus||h.manualApprovalStatus||V.manualApprovalStatus,M0=typeof Y0==="string"?Y0.toUpperCase():"",E0=M0==="CANCELLED"||M0==="CANCELED"||M0==="已取消"||M0==="已撤回"||M0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=M0==="APPROVED"||M0==="已支付/审批完成"||M0==="已通过"||M0==="已完成"||M0==="已支付"||y==="APPROVED",b0=!(s.includes("补偿")||s.includes("已支付"))&&(M0==="TERMINATED"||M0==="REJECTED"||M0==="REJECT"||M0==="已驳回"||M0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),Y1=T?1000:60000,a=I.filter((A0)=>{let I0=A0.time??0;return I0>=A-Y1&&I0<C}),W0="-",F0="-",f0=!1,u0,i0,D1=d||t,k1=I.filter((A0)=>(A0.time??0)>A+5000),u1=k1.some((A0)=>A0.rawAction==="freeflow.retract"||A0.action==="单据撤回"),b1=k1.some((A0)=>A0.rawAction==="freeflow.submit"||A0.action==="提交送审");if(D1&&b&&(u1||b1))f0=!0,u0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&x)W0="无操作",F0="-";else{let A0=a.filter((v)=>(v.time??0)>=A-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),I0=A0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),P=A0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(P||!Y&&b0){W0="审批驳回",f0=!1,u0=void 0;let v=bn(P,void 0,w,I,Y);F0=v.commen Line truncated
`,{mode:384}),Y}function Yp($){let Y=HA0();for(let z of Y){if(!V$(z))continue;for(let U of kP(z).filter((I)=>I.endsWith(".json")).filter((I)=>!I.startsWith("example."))){let I=N9(z,U);try{let Q=fP(I,"utf-8"),J=JSON.parse(Q);if(J&&typeof J==="object"&&J.id===$)return I}catch{}}}return}function x2($,Y){let z=Yp($);if(!z)throw Error(`Enterprise config not found: ${$}`);let I={...JSON.parse(fP(z,"utf-8")),...Y};for(let J of Object.keys(Y))if(Y[J]===void 0)delete I[J];let Q=an.parse(I);return UA0(z,`${JSON.stringify(Q,null,2)}
`,"utf-8"),Q}var en="SEAL_USE_ENTERPRISES_DIR",IA0="SEAL_HOME_ENTERPRISES_DIR",QA0="SEAL_USE_USER_ENTERPRISES_DIR",JA0="SEAL_HOME_USER_ENTERPRISES_DIR",KA0="SEAL_USE_CONFIG_FILE",GA0="SEAL_HOME_CONFIG_FILE",rJ,xP,yP,YA0;var S3=o(()=>{tn();rJ=N9(uP(),".config","seal-use","enterprises"),xP=N9(uP(),".config","seal-home","enterprises"),yP=N9(uP(),".config","seal-use","config.json"),YA0=N9(uP(),".config","seal-home","config.json")});function f2($,Y,z=[]){let U=Y.corpId?.trim()||void 0,I=Y.stateful?Y.defaultCorpId?.trim()||void 0:void 0,Q=U??I;if(Q){let K=$.find((W)=>W.id===Q);if(K)return K;let G=$.find((W)=>W.id.toLowerCase()===Q.toLowerCase());if(G)return G;let H=$.find((W)=>W.name.toLowerCase()===Q.toLowerCase());if(H)return H;throw Error(`No enterprise config found for ${Q}`)}if(!Y.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let J=$[0];if(J)return J;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{existsSync as zp,mkdirSync as gN1,readFileSync as yN1,renameSync as kN1,unlinkSync as xN1,writeFileSync as fN1}from"node:fs";import{homedir as uN1}from"node:os";import{dirname as bN1,join as iN1}from"node:path";function _Z(){let $=process.env[cN1]?.trim();if($)return $;return nN1}function WA0($=new Date){return $.toISOString().slice(0,10)}function XA0($=Up,Y=new Date){let z=Y.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function ZA0($=_Z()){if(!zp($))return{};try{let Y=yN1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function pN1($,Y){let z={};for(let[U,I]of Object.entries($)){if(!I||typeof I!=="object")continue;let Q={},J=!1;for(let[K,G]of Object.entries(I))if(typeof G==="number"&&G>0&&K>=Y)Q[K]=G,J=!0;if(J)z[U]=Q}return z}function dN1($,Y=_Z()){let z=bN1(Y);if(!zp(z))gN1(z,{recursive:!0,mode:448});let U=`${Y}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{fN1(U,JSON.stringify($,null,2),{encoding:"utf-8",mode:384}),kN1(U,Y)}catch(I){try{if(zp(U))xN1(U)}catch{}throw I}}function qA0($,Y=new Date){if(!$||typeof $!=="string")return;try{let z=_Z(),U=ZA0(z),I=WA0(Y),Q=XA0(Up,Y),J=pN1(U,Q);J[$]=J[$]||{},J[$][I]=(J[$][I]??0)+1,dN1(J,z)}catch{}}function mN1($,Y=Up,z=new Date){let U=new Map;try{let I=ZA0(),Q=XA0(Y,z),J=WA0(z),K=$??Object.keys(I);for(let G of K){let H=I[G];if(!H){U.set(G,0);continue}let W=0;for(let[X,Z]of Object.entries(H))if(X>=Q&&X<=J&&typeof Z==="number")W+=Z;U.set(G,W)}}catch{if($)for(let I of $)U.set(I,0)}return U}function VA0($,Y,z){let U=z??mN1($.map((I)=>I.id));return[...$].sort((I,Q)=>{if(Y){if(I.id===Y&&Q.id!==Y)return-1;if(Q.id===Y&&I.id!==Y)return 1}let J=U.get(I.id)??0,K=U.get(Q.id)??0;if(J!==K)return K-J;let G=I.name??I.id,H=Q.name??Q.id,W=G.localeCompare(H,"zh-CN");if(W!==0)return W;return I.id.localeCompare(Q.id)})}var cN1="SEAL_USE_USAGE_FILE",nN1,Up=7;var bP=o(()=>{nN1=iN1(uN1(),".config","seal-use","usage.json")});function lN1($,Y){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>Y?z:z.toLowerCase())}function oN1($,Y){return Y?$:$.toLowerCase()}function rN1($,Y,z,U){let I=oN1($,U),Q=Y.filter((J)=>I.includes(J));if(z==="all"&&Q.length!==Y.length)return[];return Q}function sN1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function aN1($,Y){if(Y.fields&&!Y.fields.has($.field))return[];let z=sN1($.value),U=[];return z.forEach((I,Q)=>{let J=rN1(I,Y.keywords,Y.matchMode,Y.caseSensitive);if(J.length===0)return;let K=Math.max(0,Q-Y.contextLines),G=Math.min(z.length,Q+Y.contextLines+1),H={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:Q+1,matchedKeywords:J,matchedText:iP(I,Y.maxChars),context:{before:Y.snippetOnly?[]:z.slice(K,Q).map((W)=>iP(W,Y.maxChars)),line:iP(I,Y.maxChars),after:Y.snippetOnly?[]:z.slice(Q+1,G).map((W)=>iP(W,Y.maxChars))},metadata:$.metadata};if(Y.snippetOnly)H.context={before:[],line:H.context.line,after:[]};U.push(H)}),U}function iP($,Y){if(!Y||$.length<=Y)return $;return`${$.slice(0,Math.max(0,Y))}...`}function tN1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function FA0($){return $.rules.flatMap((Y,z)=>{let U=`${$.id}:${Y.description.slice(0,32)}`,I={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:Y.scope,strictness:Y.strictness,code:"code"in Y?Y.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:U,title:`${$.versionName} / ${Y.scope}`,field:"h Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==U.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:U}}async function Jp($,Y,z){let U=Y.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",I=await Q$($,U);if(z||I.length>0)return DA0(I,z,Y.id);if(Y.environment==="test"||Y.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${Y.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let Q=(Y.seal.url??Y.source?.sealUrl??`https://${Y.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await LM($,Q,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${Q}/api/v1/integrations/webhook/replay-mock-callback`},Y.seal.endpoints.approvalStylePreferences)}throw new w4(`当前租户「${Y.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`)}async function sJ($){let{query:Y,sourceClient:z,targetClient:U,sourceCorp:I,targetCorp:Q,webhookSelector:J,snPrefix:K,snSuffix:G,docIdPrefix:H,docIdSuffix:W,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(Y.recordId){let B=await H4(z,Y.recordId);q.push(B)}else if(Y.recordIds&&Y.recordIds.length>0)for(let B of Y.recordIds)q.push(await H4(z,B));else if(Y.sn){let B=await b4(z,{sourceDocumentSN:Y.sn,limit:1});if(!B.records.length)throw Error(`在企业「${I.name}」中未找到单据编号为「${Y.sn}」的审批记录。`);q.push(B.records[0])}else if(Y.sns&&Y.sns.length>0)for(let B of Y.sns){let T=await b4(z,{sourceDocumentSN:B,limit:1});if(!T.records.length)throw Error(`在企业「${I.name}」中未找到单据编号为「${B}」的审批记录。`);q.push(T.records[0])}else if(Y.limit!==void 0){let B=await b4(z,{limit:Y.limit,status:Y.status,startDate:Y.startDate,endDate:Y.endDate});if(!B.records.length)throw Error(`在企业「${I.name}」中未检索到符合条件的审批记录。`);q=B.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((B)=>({run:B,doc:Ip(B,{snPrefix:K,snSuffix:G,docIdPrefix:H,docIdSuffix:W})}));if(X){let B={id:"preview-webhook",name:J??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${Q.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await Q$(U,Q.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=DA0(j,J,Q.id);B={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),A=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:I.id,name:I.name,environment:I.environment},targetCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetWebhook:B,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:A?T[0].originalRecord:void 0,document:A?T[0].document:void 0,records:T}}let F=await Jp(U,Q,J),M={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},w=[],O=0,D=0;for(let{run:B,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let A=await Qp(F.incomingDocumentWebhook.url,F.secret,T,Z,A6(Q.seal));w.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:A,success:!0}),O+=1}catch(A){let j=A instanceof Error?A.message:String(A);w.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),D+=1}}let N=w.length===1;return{success:D===0,dryRun:!1,sourceCorp:{id:I.id,name:I.name,environment:I.environment},targetCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetWebhook:M,totalCount:w.length,successCount:O,failureCount:D,originalRecord:N?w[0].originalRecord:void 0,replayedDocument:N?w[0].replayedDocument:void 0,pushResult:N?w[0].pushResult:void 0,records:w}}var GD1;var SZ=o(()=>{cP();L$();X6();GD1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var AA0,l04,WD1,o04;var PA0=o(()=>{A$();AA0=L.object({level:L.enum(["error","warning","info"]),code:L.string(),message:L.string(),snippet:L.string().optional(),suggestion:L.string().optional()}),l04=L.object({score:L.number().min(0).max(100),passed:L.boolean(),issues:L.array(AA0)}),WD1=L.object({ruleId:L.string Line truncated
↳ ${V}`,operator:J}}function pD0($){if(!$)return[];let U=$.pending||[],Y=String($.rawState||"").toUpperCase(),z=String($.state||"").toUpperCase(),Q=[];if(U.length>0)for(let J of U){let I=J.approver?.name||J.approver?.id||"待定",K=(J.name||$.currentNode||"").trim(),G=K?`${K}(${I})`:I,W=J.type?.toUpperCase()==="PAYING"||K.includes("支付")||Y==="PAYING"||z==="支付中"?"待支付":"待审批";Q.push(`${G}: ${W}`)}else if($.currentNode?.trim()){let I=$.currentNode.includes("支付")||Y==="PAYING"||z==="支付中"?"待支付":"待审批";Q.push(`${$.currentNode.trim()}: ${I}`)}return Q}function Iz($,U){let Y=new Map;if(!$||$.length===0)return Y;if(!U){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";Y.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:nD0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return Y}let z=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),Q=U.history||[],J=String(U.rawState||"").toUpperCase(),I=String(U.state||"").toUpperCase(),K=J==="DRAFT"||J==="REVOKED"||J==="CANCELED"||J==="CANCELLED"||I==="草稿"||I==="已撤回"||I==="已取消",G=J==="REJECTED"||J==="TERMINATED"||I==="审批驳回"||I==="已驳回",H=!K&&!G&&(J==="PAID"||I==="已支付"||Q.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),W=!K&&!G&&!H&&(J==="PAYING"||I==="支付中"||(U.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||U.currentNode?.includes("支付")===!0),Z=H||!K&&!G&&!W&&(J==="COMPLETED"||J==="APPROVED"||I==="已完成"||I==="审批通过");for(let q=0;q<z.length;q++){let V=z[q];if(!V)continue;let F=Number(V.createdAt)||0,O=V.document||{},w=V.manualApprovalRecord||V.result?.manualApprovalRecord||O.manualApprovalRecord||{},M=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,N=typeof w.nodeId==="string"?String(w.nodeId):void 0,D=N?decodeURIComponent(N).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,B=M||D,T=B?Q.find((A0)=>A0.nodeId&&(A0.nodeId===B||B.includes(A0.nodeId))):void 0,A=T?.time??F,j=z[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===z.length-1,x=Q.find((A0)=>(A0.time??0)>A+5000&&A0.isEbot&&(A0.nodeName?.includes("智能")||A0.nodeName?.includes("AI")||A0.action?.includes("智能")||A0.comment?.includes("AI")||A0.comment?.includes("approval-result"))&&!A0.nodeName?.includes("费用标准检查")&&!A0.nodeName?.includes("标准检查")&&!A0.nodeName?.includes("预算"));if(x){if(b=!1,(x.time??1/0)<C)C=x.time}let h=V.result||{},i=h.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",z0=c.toUpperCase(),k=z0==="REJECT"||z0==="驳回",d=z0==="APPROVE"||z0==="通过",t=z0==="EXEMPT_APPROVE"||z0==="免审通过"||z0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(k)e=p?"驳回":"添加评论";else if(z0==="REVIEW"||z0==="转交复核")e="转交复核";let y=typeof w.status==="object"&&w.status!==null?String(w.status.type||w.status.label||"").toUpperCase():"",s=typeof w.status==="object"&&w.status!==null?String(w.status.sourceStatus||""):"",U0=O.manualApprovalStatus||h.manualApprovalStatus||V.manualApprovalStatus,O0=typeof U0==="string"?U0.toUpperCase():"",E0=O0==="CANCELLED"||O0==="CANCELED"||O0==="已取消"||O0==="已撤回"||O0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=O0==="APPROVED"||O0==="已支付/审批完成"||O0==="已通过"||O0==="已完成"||O0==="已支付"||y==="APPROVED",b0=!(s.includes("补偿")||s.includes("已支付"))&&(O0==="TERMINATED"||O0==="REJECTED"||O0==="REJECT"||O0==="已驳回"||O0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),U1=T?1000:60000,a=Q.filter((A0)=>{let Q0=A0.time??0;return Q0>=A-U1&&Q0<C}),W0="-",F0="-",f0=!1,u0,i0,D1=d||t,k1=Q.filter((A0)=>(A0.time??0)>A+5000),u1=k1.some((A0)=>A0.rawAction==="freeflow.retract"||A0.action==="单据撤回"),b1=k1.some((A0)=>A0.rawAction==="freeflow.submit"||A0.action==="提交送审");if(D1&&b&&(u1||b1))f0=!0,u0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&k)W0="无操作",F0="-";else{let A0=a.filter((v)=>(v.time??0)>=A-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),Q0=A0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),P=A0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(P||!U&&b0){W0="审批驳回",f0=!1,u0=void 0;let v=bn(P,void 0,w,Q,U);F0=v.commen Line truncated
`,{mode:384}),U}function Up($){let U=HA0();for(let Y of U){if(!V$(Y))continue;for(let z of kP(Y).filter((Q)=>Q.endsWith(".json")).filter((Q)=>!Q.startsWith("example."))){let Q=N9(Y,z);try{let J=fP(Q,"utf-8"),I=JSON.parse(J);if(I&&typeof I==="object"&&I.id===$)return Q}catch{}}}return}function x2($,U){let Y=Up($);if(!Y)throw Error(`Enterprise config not found: ${$}`);let Q={...JSON.parse(fP(Y,"utf-8")),...U};for(let I of Object.keys(U))if(U[I]===void 0)delete Q[I];let J=an.parse(Q);return zA0(Y,`${JSON.stringify(J,null,2)}
`,"utf-8"),J}var en="SEAL_USE_ENTERPRISES_DIR",QA0="SEAL_HOME_ENTERPRISES_DIR",JA0="SEAL_USE_USER_ENTERPRISES_DIR",IA0="SEAL_HOME_USER_ENTERPRISES_DIR",KA0="SEAL_USE_CONFIG_FILE",GA0="SEAL_HOME_CONFIG_FILE",rI,xP,yP,UA0;var S3=o(()=>{tn();rI=N9(uP(),".config","seal-use","enterprises"),xP=N9(uP(),".config","seal-home","enterprises"),yP=N9(uP(),".config","seal-use","config.json"),UA0=N9(uP(),".config","seal-home","config.json")});function f2($,U,Y=[]){let z=U.corpId?.trim()||void 0,Q=U.stateful?U.defaultCorpId?.trim()||void 0:void 0,J=z??Q;if(J){let K=$.find((W)=>W.id===J);if(K)return K;let G=$.find((W)=>W.id.toLowerCase()===J.toLowerCase());if(G)return G;let H=$.find((W)=>W.name.toLowerCase()===J.toLowerCase());if(H)return H;throw Error(`No enterprise config found for ${J}`)}if(!U.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let I=$[0];if(I)return I;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(Y.length?Y.join(", "):"the configured enterprise directories"))}import{existsSync as Yp,mkdirSync as gN1,readFileSync as yN1,renameSync as kN1,unlinkSync as xN1,writeFileSync as fN1}from"node:fs";import{homedir as uN1}from"node:os";import{dirname as bN1,join as iN1}from"node:path";function _Z(){let $=process.env[cN1]?.trim();if($)return $;return nN1}function WA0($=new Date){return $.toISOString().slice(0,10)}function XA0($=zp,U=new Date){let Y=U.getTime()-Math.max(0,$-1)*86400000;return new Date(Y).toISOString().slice(0,10)}function ZA0($=_Z()){if(!Yp($))return{};try{let U=yN1($,"utf-8"),Y=JSON.parse(U);if(Y&&typeof Y==="object"&&!Array.isArray(Y))return Y;return{}}catch{return{}}}function pN1($,U){let Y={};for(let[z,Q]of Object.entries($)){if(!Q||typeof Q!=="object")continue;let J={},I=!1;for(let[K,G]of Object.entries(Q))if(typeof G==="number"&&G>0&&K>=U)J[K]=G,I=!0;if(I)Y[z]=J}return Y}function dN1($,U=_Z()){let Y=bN1(U);if(!Yp(Y))gN1(Y,{recursive:!0,mode:448});let z=`${U}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{fN1(z,JSON.stringify($,null,2),{encoding:"utf-8",mode:384}),kN1(z,U)}catch(Q){try{if(Yp(z))xN1(z)}catch{}throw Q}}function qA0($,U=new Date){if(!$||typeof $!=="string")return;try{let Y=_Z(),z=ZA0(Y),Q=WA0(U),J=XA0(zp,U),I=pN1(z,J);I[$]=I[$]||{},I[$][Q]=(I[$][Q]??0)+1,dN1(I,Y)}catch{}}function mN1($,U=zp,Y=new Date){let z=new Map;try{let Q=ZA0(),J=XA0(U,Y),I=WA0(Y),K=$??Object.keys(Q);for(let G of K){let H=Q[G];if(!H){z.set(G,0);continue}let W=0;for(let[X,Z]of Object.entries(H))if(X>=J&&X<=I&&typeof Z==="number")W+=Z;z.set(G,W)}}catch{if($)for(let Q of $)z.set(Q,0)}return z}function VA0($,U,Y){let z=Y??mN1($.map((Q)=>Q.id));return[...$].sort((Q,J)=>{if(U){if(Q.id===U&&J.id!==U)return-1;if(J.id===U&&Q.id!==U)return 1}let I=z.get(Q.id)??0,K=z.get(J.id)??0;if(I!==K)return K-I;let G=Q.name??Q.id,H=J.name??J.id,W=G.localeCompare(H,"zh-CN");if(W!==0)return W;return Q.id.localeCompare(J.id)})}var cN1="SEAL_USE_USAGE_FILE",nN1,zp=7;var bP=o(()=>{nN1=iN1(uN1(),".config","seal-use","usage.json")});function lN1($,U){return $.map((Y)=>Y.trim()).filter(Boolean).map((Y)=>U?Y:Y.toLowerCase())}function oN1($,U){return U?$:$.toLowerCase()}function rN1($,U,Y,z){let Q=oN1($,z),J=U.filter((I)=>Q.includes(I));if(Y==="all"&&J.length!==U.length)return[];return J}function sN1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function aN1($,U){if(U.fields&&!U.fields.has($.field))return[];let Y=sN1($.value),z=[];return Y.forEach((Q,J)=>{let I=rN1(Q,U.keywords,U.matchMode,U.caseSensitive);if(I.length===0)return;let K=Math.max(0,J-U.contextLines),G=Math.min(Y.length,J+U.contextLines+1),H={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:J+1,matchedKeywords:I,matchedText:iP(Q,U.maxChars),context:{before:U.snippetOnly?[]:Y.slice(K,J).map((W)=>iP(W,U.maxChars)),line:iP(Q,U.maxChars),after:U.snippetOnly?[]:Y.slice(J+1,G).map((W)=>iP(W,U.maxChars))},metadata:$.metadata};if(U.snippetOnly)H.context={before:[],line:H.context.line,after:[]};z.push(H)}),z}function iP($,U){if(!U||$.length<=U)return $;return`${$.slice(0,Math.max(0,U))}...`}function tN1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function FA0($){return $.rules.flatMap((U,Y)=>{let z=`${$.id}:${U.description.slice(0,32)}`,Q={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:U.scope,strictness:U.strictness,code:"code"in U?U.code:void 0,index:Y};return[{area:"rules",entityType:"rule",entityId:z,title:`${$.versionName} / ${U.scope}`,field:"h Line truncated
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${Y.id!==z.id?` --source-corp ${Y.id}`:""}`);return{sourceCorp:Y,targetCorp:z}}async function Ip($,U,Y){let z=U.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",Q=await J$($,z);if(Y||Q.length>0)return DA0(Q,Y,U.id);if(U.environment==="test"||U.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${U.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let J=(U.seal.url??U.source?.sealUrl??`https://${U.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await LO($,J,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${J}/api/v1/integrations/webhook/replay-mock-callback`},U.seal.endpoints.approvalStylePreferences)}throw new w4(`当前租户「${U.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${U.id}`)}async function sI($){let{query:U,sourceClient:Y,targetClient:z,sourceCorp:Q,targetCorp:J,webhookSelector:I,snPrefix:K,snSuffix:G,docIdPrefix:H,docIdSuffix:W,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(U.recordId){let B=await H4(Y,U.recordId);q.push(B)}else if(U.recordIds&&U.recordIds.length>0)for(let B of U.recordIds)q.push(await H4(Y,B));else if(U.sn){let B=await b4(Y,{sourceDocumentSN:U.sn,limit:1});if(!B.records.length)throw Error(`在企业「${Q.name}」中未找到单据编号为「${U.sn}」的审批记录。`);q.push(B.records[0])}else if(U.sns&&U.sns.length>0)for(let B of U.sns){let T=await b4(Y,{sourceDocumentSN:B,limit:1});if(!T.records.length)throw Error(`在企业「${Q.name}」中未找到单据编号为「${B}」的审批记录。`);q.push(T.records[0])}else if(U.limit!==void 0){let B=await b4(Y,{limit:U.limit,status:U.status,startDate:U.startDate,endDate:U.endDate});if(!B.records.length)throw Error(`在企业「${Q.name}」中未检索到符合条件的审批记录。`);q=B.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((B)=>({run:B,doc:Qp(B,{snPrefix:K,snSuffix:G,docIdPrefix:H,docIdSuffix:W})}));if(X){let B={id:"preview-webhook",name:I??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${J.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await J$(z,J.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=DA0(j,I,J.id);B={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),A=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:B,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:A?T[0].originalRecord:void 0,document:A?T[0].document:void 0,records:T}}let F=await Ip(z,J,I),O={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},w=[],M=0,N=0;for(let{run:B,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let A=await Jp(F.incomingDocumentWebhook.url,F.secret,T,Z,A6(J.seal));w.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:A,success:!0}),M+=1}catch(A){let j=A instanceof Error?A.message:String(A);w.push({originalRecord:{id:B.id,sourceSystem:B.sourceSystem,sourceDocumentSN:B.sourceDocumentSN,sourceDocumentId:B.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),N+=1}}let D=w.length===1;return{success:N===0,dryRun:!1,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:O,totalCount:w.length,successCount:M,failureCount:N,originalRecord:D?w[0].originalRecord:void 0,replayedDocument:D?w[0].replayedDocument:void 0,pushResult:D?w[0].pushResult:void 0,records:w}}var GD1;var SZ=o(()=>{cP();L$();X6();GD1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var AA0,o04,WD1,r04;var PA0=o(()=>{A$();AA0=L.object({level:L.enum(["error","warning","info"]),code:L.string(),message:L.string(),snippet:L.string().optional(),suggestion:L.string().optional()}),o04=L.object({score:L.number().min(0).max(100),passed:L.boolean(),issues:L.array(AA0)}),WD1=L.object({ruleId:L.string Line truncated
* ==============================================================================
* Seal 官方标准规则校验器 (Official Standard Rule Linter)
* ==============================================================================
@@ -876,62 +876,67 @@ export function lintRule(rule: RuleLintTarget): RuleLintResult {
}
export default lintRule;
`}});import{existsSync as HU,mkdirSync as BD1,readFileSync as TD1,readdirSync as CA0,rmSync as jD1,unlinkSync as ED1,writeFileSync as CD1}from"node:fs";import{homedir as RD1}from"node:os";import{isAbsolute as _D1,join as f6,resolve as vD1}from"node:path";import{pathToFileURL as jA0}from"node:url";function RA0($=i$){let Y=[],z=[];try{if(!HU($))BD1($,{recursive:!0});let U=Object.keys(Wp);for(let[Q,J]of Object.entries(Wp)){let K=f6($,Q),G=!0;if(HU(K))try{if(TD1(K,"utf8")===J)G=!1}catch{G=!0}if(G)CD1(K,J,"utf8");Y.push(Q)}let I=CA0($,{withFileTypes:!0});for(let Q of I)if(!U.includes(Q.name)){let J=f6($,Q.name);try{if(Q.isDirectory())jD1(J,{recursive:!0,force:!0});else ED1(J);z.push(Q.name)}catch{}}}catch{}return{synced:Y,pruned:z}}function _A0($={syncOfficial:!0}){if($.syncOfficial!==!1)RA0();let Y=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[b$,dP];for(let U of z)if(HU(U))try{let I=CA0(U,{withFileTypes:!0});for(let Q of I){if(Q.isDirectory())continue;let J=Q.name;if(J.endsWith(".ts")||J.endsWith(".js")||J.endsWith(".mjs")){let K=J.replace(/\.(ts|js|mjs)$/,"");if(!Y.some((G)=>G.name===K))Y.push({name:K,type:"custom",path:f6(U,J),description:`用户自定义规则校验器 (${J})`})}}}catch{}return Y}function SD1($){let Y=($||"").trim();if(!Y||Y==="builtin"||Y==="default"||Y==="official/builtin"||Y==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(Y==="strict"||Y==="official/strict"||Y==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(Y==="hlab"||Y==="hlab-sop"||Y==="hlab-rules"||Y==="hlab-standard"||Y==="official/hlab"||Y==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(_D1(Y)||Y.startsWith("./")||Y.startsWith("../")){let U=vD1(Y);if(HU(U))return{path:U};for(let I of[".ts",".js",".mjs"])if(HU(`${U}${I}`))return{path:`${U}${I}`}}let z=[f6(b$,`${Y}.ts`),f6(b$,`${Y}.js`),f6(b$,`${Y}.mjs`),f6(dP,`${Y}.ts`),f6(dP,`${Y}.js`),f6(dP,`${Y}.mjs`)];for(let U of z)if(HU(U))return{path:U};return{}}async function Zp($){RA0();let Y=SD1($??"builtin");if(Y.isOfficial){let U=Y.officialKind==="strict"?BA0:Y.officialKind==="hlab"?TA0:aJ,I=Y.officialKind==="builtin"?"builtin":"official",Q=Y.path;if(Q&&HU(Q))try{let K=await import(jA0(Q).href),G=K.default??K.lintRule??K.linter??K.lint;if(typeof G==="function")return{name:Y.officialKind??"builtin",type:I,filePath:Q,linter:EA0(G,U)}}catch{}return{name:Y.officialKind??"builtin",type:I,filePath:Q,linter:U}}let z=Y.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aJ};try{let I=await import(jA0(z).href),Q=I.default??I.lintRule??I.linter??I.lint;if(typeof Q!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aJ};return{name:$??"custom",type:"custom",filePath:z,linter:EA0(Q,aJ)}}catch(U){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${U?.message??U}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aJ}}}function EA0($,Y){return async(z,U)=>{try{let I=await $(z,U);if(I&&typeof I==="object"&&typeof I.score==="number"&&Array.isArray(I.issues))return I;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),Y(z,U)}catch(I){return console.error("⚠️ [linter] 自定义校验器执行异常:",I),Y(z,U)}}}var b$,hD1="official",i$,dP;var qp=o(()=>{Kp();Hp();Xp();Gp();b$=f6(RD1(),".config","seal-use","linters"),i$=f6(b$,hD1),dP=f6(process.cwd(),"linters")});async function Vp($,Y,z){let U=await Y.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:U.score,passed:U.passed,issues:U.issues,description:$.description}}async function vA0($,Y,z,U){let I=U?.minScore??0,Q=U?.level??"all",J=[],K=0;for(let q of $){let V=await Vp(q,Y,z);K+=V.score;let F=V.issues;if(Q==="error")F=V.issues.filter((w)=>w.level==="error");else if(Q==="warning")F=V.issues.filter((w)=>w.level==="warning"||w.level==="error");let M=F.every((w)=>w.level!=="error");if(U?.summary){if(F.length>0)J.push({...V,passed:M,issues:F})}else J.push({...V,passed:M,issues:F})}let G=$.length,H=G===0?100:Math.round(K/G),W=J.filter((q)=>q.issues.length>0).length,X=G-Line truncated
`,"utf8"),z}function yA0($){return $.map((Y,z)=>{let U;if(typeof Y.code==="number")U=`#${String(Y.code).padStart(4,"0")}`;else if(typeof Y.code==="string")U=Y.code.startsWith("#")?Y.code:`#${Y.code}`;else U=`#${String(z+1).padStart(4,"0")}`;return{id:Y.id,code:U,name:Y.name,description:Y.description,scope:Y.scope,strictness:Y.strictness}})}var kA0=()=>{};var xA0,D5;var tJ=o(()=>{xA0=class xA0 extends Error{errors;warnings;constructor($,Y=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
`));this.errors=$;this.warnings=Y;this.name="ResourcePackValidationError"}};D5=xA0});var iA0=E((A14,bA0)=>{bA0.exports=mP;function mP(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}mP.prototype.go=function($){if(this.pending<this.max)uA0(this,$);else this.waiting.push($)};mP.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};mP.prototype.hold=function(){return fA0(this)};function fA0($){$.pending+=1;var Y=!1;return z;function z(I){if(Y)throw Error("callback called twice");if(Y=!0,$.error=$.error||I,$.pending-=1,$.waiting.length>0&&$.pending<$.max)uA0($,$.waiting.shift());else if($.pending===0){var Q=$.listeners;$.listeners=[],Q.forEach(U)}}function U(I){I($.error)}}function uA0($,Y){Y(fA0($))}});var pA0=E((cD1)=>{var wp=J0("fs"),Mp=J0("util"),cA0=J0("stream"),nA0=cA0.Readable,bD1=cA0.PassThrough,iD1=iA0(),lP=J0("events").EventEmitter;cD1.BufferSlicer=$K;cD1.FdSlicer=eJ;Mp.inherits(eJ,lP);function eJ($){lP.call(this),this.fd=$,this.pend=new iD1,this.pend.max=1,this.refCount=0}eJ.prototype.read=function($,Y,z,U,I){var Q=this;Q.pend.go(function(J){wp.read(Q.fd,$,Y,z,U,function(K,G,H){J(),I(K,G,H)})})};eJ.prototype.createReadStream=function($){return new gZ(this,$)};eJ.prototype.ref=function(){this.refCount+=1};eJ.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;wp.close($.fd,Y);function Y(z){if(z)$.emit("error",z);else $.emit("close")}};Mp.inherits(gZ,nA0);function gZ($,Y){Y=Y||{},nA0.call(this,Y),this.context=$,this.context.ref(),this.start=Y.start||0,this.endOffset=Y.end,this.pos=this.start}gZ.prototype._read=function($){var Y=this,z=Math.min(Y._readableState.highWaterMark,$);if(Y.endOffset!=null)z=Math.min(z,Y.endOffset-Y.pos);if(z<=0){Y.push(null),this._cleanup();return}Y.context.pend.go(function(U){var I=Buffer.allocUnsafe(z);wp.read(Y.context.fd,I,0,z,Y.pos,function(Q,J){if(Q)Y.destroy(Q);else if(J===0)Y.push(null),Y._cleanup();else Y.pos+=J,Y.push(I.slice(0,J));U()})})};gZ.prototype._destroy=function($,Y){this._cleanup(),Y($)};gZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};Mp.inherits($K,lP);function $K($){lP.call(this),this.refCount=0,this.buffer=$}$K.prototype.read=function($,Y,z,U,I){if(!(0<=Y&&Y<=$.length))throw RangeError("offset outside buffer: 0 <= "+Y+" <= "+$.length);if(U<0)throw RangeError("position is negative: "+U);if(Y+z>$.length)z=$.length-Y;if(U+z>this.buffer.length)z=this.buffer.length-U;if(z<=0){setImmediate(function(){I(null,0)});return}this.buffer.copy($,Y,U,U+z),setImmediate(function(){I(null,z)})};$K.prototype.createReadStream=function($){$=$||{};var Y=new bD1($);Y.start=$.start||0,Y.endOffset=$.end,Y.pos=Y.endOffset||this.buffer.length;var z=this.buffer.slice(Y.start,Y.pos),U=65536,I=0;while(!0){var Q=I+U;if(Q>=z.length){if(I<z.length)Y.write(z.slice(I,z.length));break}Y.write(z.slice(I,Q)),I=Q}return Y.end(),Y};$K.prototype.ref=function(){this.refCount+=1};$K.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var mA0=E((B14,dA0)=>{var dD1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462, Line truncated
`}});import{existsSync as Hz,mkdirSync as BD1,readFileSync as TD1,readdirSync as CA0,rmSync as jD1,unlinkSync as ED1,writeFileSync as CD1}from"node:fs";import{homedir as RD1}from"node:os";import{isAbsolute as _D1,join as f6,resolve as vD1}from"node:path";import{pathToFileURL as jA0}from"node:url";function RA0($=i$){let U=[],Y=[];try{if(!Hz($))BD1($,{recursive:!0});let z=Object.keys(Wp);for(let[J,I]of Object.entries(Wp)){let K=f6($,J),G=!0;if(Hz(K))try{if(TD1(K,"utf8")===I)G=!1}catch{G=!0}if(G)CD1(K,I,"utf8");U.push(J)}let Q=CA0($,{withFileTypes:!0});for(let J of Q)if(!z.includes(J.name)){let I=f6($,J.name);try{if(J.isDirectory())jD1(I,{recursive:!0,force:!0});else ED1(I);Y.push(J.name)}catch{}}}catch{}return{synced:U,pruned:Y}}function _A0($={syncOfficial:!0}){if($.syncOfficial!==!1)RA0();let U=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],Y=[b$,dP];for(let z of Y)if(Hz(z))try{let Q=CA0(z,{withFileTypes:!0});for(let J of Q){if(J.isDirectory())continue;let I=J.name;if(I.endsWith(".ts")||I.endsWith(".js")||I.endsWith(".mjs")){let K=I.replace(/\.(ts|js|mjs)$/,"");if(!U.some((G)=>G.name===K))U.push({name:K,type:"custom",path:f6(z,I),description:`用户自定义规则校验器 (${I})`})}}}catch{}return U}function SD1($){let U=($||"").trim();if(!U||U==="builtin"||U==="default"||U==="official/builtin"||U==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(U==="strict"||U==="official/strict"||U==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(U==="hlab"||U==="hlab-sop"||U==="hlab-rules"||U==="hlab-standard"||U==="official/hlab"||U==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(_D1(U)||U.startsWith("./")||U.startsWith("../")){let z=vD1(U);if(Hz(z))return{path:z};for(let Q of[".ts",".js",".mjs"])if(Hz(`${z}${Q}`))return{path:`${z}${Q}`}}let Y=[f6(b$,`${U}.ts`),f6(b$,`${U}.js`),f6(b$,`${U}.mjs`),f6(dP,`${U}.ts`),f6(dP,`${U}.js`),f6(dP,`${U}.mjs`)];for(let z of Y)if(Hz(z))return{path:z};return{}}async function Zp($){RA0();let U=SD1($??"builtin");if(U.isOfficial){let z=U.officialKind==="strict"?BA0:U.officialKind==="hlab"?TA0:aI,Q=U.officialKind==="builtin"?"builtin":"official",J=U.path;if(J&&Hz(J))try{let K=await import(jA0(J).href),G=K.default??K.lintRule??K.linter??K.lint;if(typeof G==="function")return{name:U.officialKind??"builtin",type:Q,filePath:J,linter:EA0(G,z)}}catch{}return{name:U.officialKind??"builtin",type:Q,filePath:J,linter:z}}let Y=U.path;if(!Y)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI};try{let Q=await import(jA0(Y).href),J=Q.default??Q.lintRule??Q.linter??Q.lint;if(typeof J!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${Y}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI};return{name:$??"custom",type:"custom",filePath:Y,linter:EA0(J,aI)}}catch(z){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${Y}" 失败(语法错误或依赖缺失: ${z?.message??z}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI}}}function EA0($,U){return async(Y,z)=>{try{let Q=await $(Y,z);if(Q&&typeof Q==="object"&&typeof Q.score==="number"&&Array.isArray(Q.issues))return Q;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),U(Y,z)}catch(Q){return console.error("⚠️ [linter] 自定义校验器执行异常:",Q),U(Y,z)}}}var b$,hD1="official",i$,dP;var qp=o(()=>{Kp();Hp();Xp();Gp();b$=f6(RD1(),".config","seal-use","linters"),i$=f6(b$,hD1),dP=f6(process.cwd(),"linters")});async function Vp($,U,Y){let z=await U.linter($,Y);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:z.score,passed:z.passed,issues:z.issues,description:$.description}}async function vA0($,U,Y,z){let Q=z?.minScore??0,J=z?.level??"all",I=[],K=0;for(let q of $){let V=await Vp(q,U,Y);K+=V.score;let F=V.issues;if(J==="error")F=V.issues.filter((w)=>w.level==="error");else if(J==="warning")F=V.issues.filter((w)=>w.level==="warning"||w.level==="error");let O=F.every((w)=>w.level!=="error");if(z?.summary){if(F.length>0)I.push({...V,passed:O,issues:F})}else I.push({...V,passed:O,issues:F})}let G=$.length,H=G===0?100:Math.round(K/G),W=I.filter((q)=>q.issues.length>0).length,X=G-Line truncated
`,"utf8"),Y}function yA0($){return $.map((U,Y)=>{let z;if(typeof U.code==="number")z=`#${String(U.code).padStart(4,"0")}`;else if(typeof U.code==="string")z=U.code.startsWith("#")?U.code:`#${U.code}`;else z=`#${String(Y+1).padStart(4,"0")}`;return{id:U.id,code:z,name:U.name,description:U.description,scope:U.scope,strictness:U.strictness}})}var kA0=()=>{};var xA0,D5;var tI=o(()=>{xA0=class xA0 extends Error{errors;warnings;constructor($,U=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((Y)=>`- ${Y}`)].join(`
`));this.errors=$;this.warnings=U;this.name="ResourcePackValidationError"}};D5=xA0});var iA0=E((P14,bA0)=>{bA0.exports=mP;function mP(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}mP.prototype.go=function($){if(this.pending<this.max)uA0(this,$);else this.waiting.push($)};mP.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};mP.prototype.hold=function(){return fA0(this)};function fA0($){$.pending+=1;var U=!1;return Y;function Y(Q){if(U)throw Error("callback called twice");if(U=!0,$.error=$.error||Q,$.pending-=1,$.waiting.length>0&&$.pending<$.max)uA0($,$.waiting.shift());else if($.pending===0){var J=$.listeners;$.listeners=[],J.forEach(z)}}function z(Q){Q($.error)}}function uA0($,U){U(fA0($))}});var pA0=E((cD1)=>{var wp=I0("fs"),Op=I0("util"),cA0=I0("stream"),nA0=cA0.Readable,bD1=cA0.PassThrough,iD1=iA0(),lP=I0("events").EventEmitter;cD1.BufferSlicer=$K;cD1.FdSlicer=eI;Op.inherits(eI,lP);function eI($){lP.call(this),this.fd=$,this.pend=new iD1,this.pend.max=1,this.refCount=0}eI.prototype.read=function($,U,Y,z,Q){var J=this;J.pend.go(function(I){wp.read(J.fd,$,U,Y,z,function(K,G,H){I(),Q(K,G,H)})})};eI.prototype.createReadStream=function($){return new gZ(this,$)};eI.prototype.ref=function(){this.refCount+=1};eI.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;wp.close($.fd,U);function U(Y){if(Y)$.emit("error",Y);else $.emit("close")}};Op.inherits(gZ,nA0);function gZ($,U){U=U||{},nA0.call(this,U),this.context=$,this.context.ref(),this.start=U.start||0,this.endOffset=U.end,this.pos=this.start}gZ.prototype._read=function($){var U=this,Y=Math.min(U._readableState.highWaterMark,$);if(U.endOffset!=null)Y=Math.min(Y,U.endOffset-U.pos);if(Y<=0){U.push(null),this._cleanup();return}U.context.pend.go(function(z){var Q=Buffer.allocUnsafe(Y);wp.read(U.context.fd,Q,0,Y,U.pos,function(J,I){if(J)U.destroy(J);else if(I===0)U.push(null),U._cleanup();else U.pos+=I,U.push(Q.slice(0,I));z()})})};gZ.prototype._destroy=function($,U){this._cleanup(),U($)};gZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};Op.inherits($K,lP);function $K($){lP.call(this),this.refCount=0,this.buffer=$}$K.prototype.read=function($,U,Y,z,Q){if(!(0<=U&&U<=$.length))throw RangeError("offset outside buffer: 0 <= "+U+" <= "+$.length);if(z<0)throw RangeError("position is negative: "+z);if(U+Y>$.length)Y=$.length-U;if(z+Y>this.buffer.length)Y=this.buffer.length-z;if(Y<=0){setImmediate(function(){Q(null,0)});return}this.buffer.copy($,U,z,z+Y),setImmediate(function(){Q(null,Y)})};$K.prototype.createReadStream=function($){$=$||{};var U=new bD1($);U.start=$.start||0,U.endOffset=$.end,U.pos=U.endOffset||this.buffer.length;var Y=this.buffer.slice(U.start,U.pos),z=65536,Q=0;while(!0){var J=Q+z;if(J>=Y.length){if(Q<Y.length)U.write(Y.slice(Q,Y.length));break}U.write(Y.slice(Q,J)),Q=J}return U.end(),U};$K.prototype.ref=function(){this.refCount+=1};$K.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var mA0=E((T14,dA0)=>{var dD1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462, Line truncated
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csiLine truncated
\v\f\r\x0E\x0F\x10ỨỰỲỶỸÝỴ\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:`\x00\x01Ẳ\x03\x04ẴẪ\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13Ỷ\x15\x16\x17\x18Ỹ\x1A\x1B\x1C\x1DỴ\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ`},iso646cn:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},iso646jp:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var BP0=E((nA1)=>{var $d=y3().Buffer;nA1._dbcs=x3;var z8=-1,PP0=-2,p$=-10,h8=-1000,KK=Array(256),xZ=-1;for(kZ=0;kZ<256;kZ++)KK[kZ]=z8;var kZ;function x3($,Y){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=KK.slice(0),this.decodeTableSeq=[];for(var U=0;U<z.length;U++)this._addDecodeChunk(z[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var I=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var Q=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var J=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[h8-J[U]];for(var G=48;G<=57;G++){if(K[G]===z8)K[G]=h8-I;else if(K[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var H=this.decodeTables[h8-K[G]];for(var W=129;W<=254;W++){if(H[W]===z8)H[W]=h8-Q;else if(H[W]===h8-Q)continue;else if(H[W]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-H[W]];for(var Z=48;Z<=57;Z++)if(X[Z]===z8)X[Z]=PP0}}}}this.defaultCharUnicode=Y.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var V=$.encodeSkipVals[U];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][Y.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===z8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===z8)this.defCharSB=63}x3.prototype.encoder=JB;x3.prototype.decoder=Yd;x3.prototype._getDecodeTrieNode=function($){var Y=[];for(;$>0;$>>>=8)Y.push($&255);if(Y.length==0)Y.push(0);var z=this.decodeTables[0];for(var U=Y.length-1;U>0;U--){var I=z[Y[U]];if(I==z8)z[Y[U]]=h8-this.decodeTables.length,this.decodeTables.push(z=KK.slice(0));else if(I<=h8)z=this.decodeTables[h8-I];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};x3.prototype._addDecodeChunk=function($){var Y=parseInt($[0],16),z=this._getDecodeTrieNode(Y);Y=Y&255;for(var U=1;U<$.length;U++){var I=$[U];if(typeof I==="string")for(var Q=0;Q<I.length;){var J=I.charCodeAt(Q++);if(J>=55296&&J<56320){var K=I.charCodeAt(Q++);if(K>=56320&&K<57344)z[Y++]=65536+(J-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(J>4080&&J<=4095){var G=4095-J+2,H=[];for(var W=0;W<G;W++)H.push(I.charCodeAt(Q++));z[Y++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(H)}else z[Y++]=J}else if(typeof I==="number"){var X=z[Y-1]+1;for(var Q=0;Q<I;Q++)z[Y++]=X++}else throw Error("Incorrect type '"+typeof I+"' given in "+this.encodingName+" at chunk "+$[0])}if(Y>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`;super(Y);this.name="AggregateError",this.errors=$}}SB0.exports={AggregateError:hB0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,Y){return $.includes(Y)},ArrayPrototypeIndexOf($,Y){return $.indexOf(Y)},ArrayPrototypeJoin($,Y){return $.join(Y)},ArrayPrototypeMap($,Y){return $.map(Y)},ArrayPrototypePop($,Y){return $.pop(Y)},ArrayPrototypePush($,Y){return $.push(Y)},ArrayPrototypeSlice($,Y,z){return $.slice(Y,z)},Error,FunctionPrototypeCall($,Y,...z){return $.call(Y,...z)},FunctionPrototypeSymbolHasInstance($,Y){return Function.prototype[Symbol.hasInstance].call($,Y)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,Y){return Object.defineProperties($,Y)},ObjectDefineProperty($,Y,z){return Object.defineProperty($,Y,z)},ObjectGetOwnPropertyDescriptor($,Y){return Object.getOwnPropertyDescriptor($,Y)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,Y){return Object.setPrototypeOf($,Y)},Promise,PromisePrototypeCatch($,Y){return $.catch(Y)},PromisePrototypeThen($,Y,z){return $.then(Y,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,Y){return $.test(Y)},SafeSet:Set,String,StringPrototypeSlice($,Y,z){return $.slice(Y,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,Y,z){return $.set(Y,z)},Boolean,Uint8Array}});var Bd=E((C44,gB0)=>{gB0.exports={format($,...Y){return $.replace(/%([sdifj])/g,function(...[z,U]){let I=Y.shift();if(U==="f")return I.toFixed(6);else if(U==="j")return JSON.stringify(I);else if(U==="s"&&typeof I==="object")return`${I.constructor!==Object?I.constructor.name:""} {}`.trim();else return I.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var M8=E((R44,fB0)=>{var{format:kB1,inspect:ZB}=Bd(),{AggregateError:xB1}=x4(),fB1=globalThis.AggregateError||xB1,uB1=Symbol("kIsNodeError"),bB1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],iB1=/^([A-Z][a-z0-9]*)+$/,qB={};function ZU($,Y){if(!$)throw new qB.ERR_INTERNAL_ASSERTION(Y)}function yB0($){let Y="",z=$.length,U=$[0]==="-"?1:0;for(;z>=U+4;z-=3)Y=`_${$.slice(z-3,z)}${Y}`;return`${$.slice(0,z)}${Y}`}function cB1($,Y,z){if(typeof Y==="function")return ZU(Y.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${Y.length}).`),Y(...z);let U=(Y.match(/%[dfijoOs]/g)||[]).length;if(ZU(U===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${U}).`),z.length===0)return Y;return kB1(Y,...z)}function U8($,Y,z){if(!z)z=Error;class U extends z{constructor(...I){super(cB1($,Y,I))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(U.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),U.prototype.code=$,U.prototype[uB1]=!0,qB[$]=U}function kB0($){let Y="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:Y}),$}function nB1($,Y){if($&&Y&&$!==Y){if(Array.isArray(Y.errors))return Y.errors.push($),Y;let z=new fB1([Y,$],Y.message);return z.code=Y.code,z}return $||Y}class xB0 extends Error{constructor($="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw new qB.ERR_INVALID_ARG_TYPE("options","Object",Y);super($,Y);this.code="ABORT_ERR",this.name="AbortError"}}U8("ERR_ASSERTION","%s",Error);U8("ERR_INVALID_ARG_TYPE",($,Y,z)=>{if(ZU(typeof $==="string","'name' must be a string"),!Array.isArray(Y))Y=[Y];let U="The ";if($.endsWith(" argument"))U+=`${$} `;else U+=`"${$}" ${$.includes(".")?"property":"argument"} `;U+="must be ";let I=[],Q=[],J=[];for(let G of Y)if(ZU(typeof G==="string","All expected entries have to be of type string"),bB1.includes(G))I.push(G.toLowerCase());else if(iB1.test(G))Q.push(G);else ZU(G!=="object",'The value "object" should be written as "Object"'),J.push(G);if(Q.length>0){let G=I.indexOf("object");if(G!==-1)I.splice(I,G,1),Q.push("Object")}if(I.length>0){switch(I.length){case 1:U+=`of type ${I[Line truncated
`);if(Y.linkname)z+=$l(" linkpath="+Y.linkname+`
`);let U=Y.pax;if(U)for(let I in U)z+=$l(" "+I+"="+U[I]+`
`);return n1.from(z)};bv1.decodePax=function(Y){let z={};while(Y.length){let U=0;while(U<Y.length&&Y[U]!==32)U++;let I=parseInt(n1.toString(Y.subarray(0,U)),10);if(!I)return z;let Q=n1.toString(Y.subarray(U+1,I-1)),J=Q.indexOf("=");if(J===-1)return z;z[Q.slice(0,J)]=Q.slice(J+1),Y=Y.subarray(I)}return z};bv1.encode=function(Y){let z=n1.alloc(512),U=Y.name,I="";if(Y.typeflag===5&&U[U.length-1]!=="/")U+="/";if(n1.byteLength(U)!==U.length)return null;while(n1.byteLength(U)>100){let Q=U.indexOf("/");if(Q===-1)return null;I+=I?"/"+U.slice(0,Q):U.slice(0,Q),U=U.slice(Q+1)}if(n1.byteLength(U)>100||n1.byteLength(I)>155)return null;if(Y.linkname&&n1.byteLength(Y.linkname)>100)return null;if(n1.write(z,U),n1.write(z,m2(Y.mode&4095,6),100),n1.write(z,m2(Y.uid,6),108),n1.write(z,m2(Y.gid,6),116),fv1(Y.size,z,124),n1.write(z,m2(Y.mtime.getTime()/1000|0,11),136),z[156]=48+kv1(Y.type),Y.linkname)n1.write(z,Y.linkname,157);if(n1.copy(GR0,z,257),n1.copy(Rv1,z,263),Y.uname)n1.write(z,Y.uname,265);if(Y.gname)n1.write(z,Y.gname,297);if(n1.write(z,m2(Y.devmajor||0,6),329),n1.write(z,m2(Y.devminor||0,6),337),I)n1.write(z,I,345);return n1.write(z,m2(WR0(z),6),148),z};bv1.decode=function(Y,z,U){let I=Y[156]===0?0:Y[156]-48,Q=EK(Y,0,100,z),J=d2(Y,100,8),K=d2(Y,108,8),G=d2(Y,116,8),H=d2(Y,124,12),W=d2(Y,136,12),X=yv1(I),Z=Y[157]===0?null:EK(Y,157,100,z),q=EK(Y,265,32),V=EK(Y,297,32),F=d2(Y,329,8),M=d2(Y,337,8),w=WR0(Y);if(w===256)return null;if(w!==d2(Y,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(hv1(Y)){if(Y[345])Q=EK(Y,345,155,z)+"/"+Q}else if(Sv1(Y));else if(!U)throw Error("Invalid tar header: unknown format.");if(I===0&&Q&&Q[Q.length-1]==="/")I=5;return{name:Q,mode:J,uid:K,gid:G,size:H,byteOffset:0,mtime:new Date(1000*W),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:M,pax:null}};function hv1($){return n1.equals(GR0,$.subarray(257,263))}function Sv1($){return n1.equals(_v1,$.subarray(257,263))&&n1.equals(vv1,$.subarray(263,265))}function gv1($,Y,z){if(typeof $!=="number")return z;if($=~~$,$>=Y)return Y;if($>=0)return $;if($+=Y,$>=0)return $;return 0}function yv1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function kv1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function HR0($,Y,z,U){for(;z<U;z++)if($[z]===Y)return z;return U}function WR0($){let Y=256;for(let z=0;z<148;z++)Y+=$[z];for(let z=156;z<512;z++)Y+=$[z];return Y}function m2($,Y){if($=$.toString(8),$.length>Y)return"7777777777777777777".slice(0,Y)+" ";return"0000000000000000000".slice(0,Y-$.length)+$+" "}function xv1($,Y,z){Y[z]=128;for(let U=11;U>0;U--)Y[z+U]=$&255,$=Math.floor($/256)}function fv1($,Y,z){if($.toString(8).length>11)xv1($,Y,z);else n1.write(Y,m2($,11),z)}function uv1($){let Y;if($[0]===128)Y=!0;else if($[0]===255)Y=!1;else return null;let z=[],U;for(U=$.length-1;U>0;U--){let J=$[U];if(Y)z.push(J);else z.push(255-J)}let I=0,Q=z.length;for(U=0;U<Q;U++)I+=z[U]*Math.pow(256,U);return Y?I:-1*I}function d2($,Y,z){if($=$.subarray(Y,Y+z),Y=0,$[Y]&128)return uv1($);else{while(Y<$.length&&$[Y]===32)Y++;let U=gv1(HR0($,32,Y,$.length),$.length,$.length);while(Y<U&&$[Y]===0)Y++;if(U===Y)return 0;return parseInt(n1.toString($.subarray(Y,U)),8)}}function EK($,Y,z,U){return n1.toString($.subarray(Y,HR0($,0,Y,Y+z)),U)}function $l($){let Y=n1.byteLength($),z=Math.floor(Math.log(Y)/Math.log(10))+1;if(Y+z>=Math.pow(10,z))z++;return Y+z+$}});var MR0=E((O84,wR0)=>{var{Writable:mv1,Readable:lv1,getStreamError:XR0}=em(),ov1=dm(),ZR0=jK(),CK=Yl(),rv1=ZR0.alloc(0);class qR0{constructor(){this.buffered=0,this.shifted=0,this.queue=new ov1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return rv1;let Y=this._next($);if($===Y.byteLength)return Y;let z=[Y];while(($-=Y.byteLength)>0)Y=this._next($),z.push(Y);return ZR0.concat(z)}_next($){let Y=this.queue.peek(),z=Y.byteLength-this._offset;if($>=z){let U=this._offset?Y.subarray(this._offset,Y.byteLength):Y;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,U}return this.buffered-=$,this.shifted+=$,Y.subarray(this._offset,this._offset+=$)}}class VR0 extends lv1{constructor($,Y,z){super();this.header=Y,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(XR0(this))}_detach(){if(this._parent._stream= Line truncated
`),U=[await H4($,z.recordId)];else if(z.recordIds&&z.recordIds.length>0)process.stderr.write(`\uD83D\uDD0D 批量查询 ${z.recordIds.length} 条单据记录...
`),U=await Promise.all(z.recordIds.map((w)=>H4($,w)));else{let w=z.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${Y.name}」(${Y.id}) 的线上审核记录 (限制 ${w} 条)...
`);let D=(await b4($,{limit:w,status:z.status,startDate:z.startDate!==void 0?String(z.startDate):void 0,endDate:z.endDate!==void 0?String(z.endDate):void 0})).records??[];if(D.length===0)throw Error("未检索到符合条件的线上审核记录,无法导出 webhook 资源包。");process.stderr.write(`\uD83D\uDCE5 正在拉取 ${D.length} 条审核记录完整详情...
`),U=await Promise.all(D.map((N)=>H4($,N.id)))}let I=new Map,Q=0;for(let w of U){let O=w.document,D=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,N=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,B=[];if(z.includeAttachments!==!1){let A=k2(w,{summary:!1}).attachments,j=new Set;for(let C of A){let b=C.ossSignedUrl??C.url;if(!b)continue;let k=C.fileName??C.fileId??"attachment",h=on(k),i=h,c=h.lastIndexOf("."),U0=c>0?h.slice(0,c):h,x=c>0?h.slice(c):"",d=1;while(j.has(i.toLowerCase()))i=`${U0}_${d}${x}`,d++;j.add(i.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${N}」附件: ${k}...
`);let t=await fetch(b);if(t.ok){let $0=await t.arrayBuffer(),g=Buffer.from($0);B.push({fileName:i,zipPath:`${N}/${i}`,buffer:g,sourceField:C.sourceField??"附件"}),Q++}}catch(t){process.stderr.write(`⚠️ [跳过附件] 下载失败 ${k}: ${t}
`)}}}I.set(N,B)}let J=new kR0.default.Workbook;J.creator="seal-use",J.created=new Date;let K=new Set;for(let w of I.values())for(let O of w)K.add(O.sourceField);if(K.size===0)K.add("附件");let G=new Set;for(let w of U){let O=w.document,D=Array.isArray(O?.fields)?O.fields:[];for(let N of D)if(N&&typeof N==="object"){let B=N,T=typeof B.label==="string"?B.label.trim():typeof B.key==="string"?B.key.trim():"",A=typeof B.type==="string"?B.type.toUpperCase():"";if(T&&A!=="ATTACHMENT"&&A!=="LIST")G.add(T)}}let H=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],W=Array.from(G).filter((w)=>!H.includes(w)&&w!=="单据编号"&&w!=="单号"),X=Array.from(K).map((w)=>`[附件]${w}`),Z=[...H,...W,...X],q=J.addWorksheet("主表");q.addRow(Z),q.getRow(1).font={bold:!0};for(let w of U){let O=w.document,D=w.sourceDocumentSN??(typeof O?.sn==="string"?O.sn:void 0)??(typeof O?.sourceDocumentSN==="string"?O.sourceDocumentSN:void 0)??w.id,N=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,B=`${z.docIdPrefix??""}${N}${z.docIdSuffix??""}`,T=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,A=(typeof O?.title==="string"?O.title:void 0)??(typeof O?.name==="string"?O.name:void 0)??T,j="";if(typeof O?.sourceStartTime==="number")j=new Date(O.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="number")j=new Date(w.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="string")j=w.createdAt.slice(0,10);let C=new Map,b=Array.isArray(O?.fields)?O.fields:[];for(let U0 of b)if(U0&&typeof U0==="object"){let x=U0,d=typeof x.label==="string"?x.label.trim():typeof x.key==="string"?x.key.trim():"";if(d)C.set(d,x.value)}let k,h=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof h==="number")k=h;else if(h&&typeof h==="object"&&"amount"in h&&typeof h.amount==="number")k=h.amount;let i=[];i.push(B),i.push(A),i.push(w.status??"已审批"),i.push(k??""),i.push(C.get("报销事由")??C.get("事由")??A),i.push(j);for(let U0 of W){let x=C.get(U0);if(x===void 0||x===null)i.push("");else if(typeof x==="object")if("amount"in x)i.push(x.amount);else i.push(JSON.stringify(x));else i.push(x)}let c=I.get(B)??[];for(let U0 of K){let x=c.filter((d)=>d.sourceField===U0||K.size===1);if(x.length>0)i.push(x.map((d)=>d.zipPath).join(`
`));else i.push("")}q.addRow(i)}let V=Vh1(z,Y);Hh1(Zh1(V),{recursive:!0});let F=await J.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
`),await new Promise((w,O)=>{let D=Gh1(V),N=new Jl({zlib:{level:9}});D.on("close",()=>w()),N.on("error",(B)=>O(B)),N.pipe(D),N.append(Buffer.from(F),{name:"信息表.xlsx"});for(let B of I.values())for(let T of B)N.append(T.buffer,{name:T.zipPath});N.finalize()});let M=Wh1(V);return{filePath:V,corpId:Y.id,corpName:Y.name,recordCount:U.length,attachmentCount:Q,fileSizeBytes:M.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var kR0;var Kl=o(()=>{gR0();X6();SP();kR0=Q6(EZ(),1)});import{readFileSync as Lh1}from"node:fs";function Fh1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${Y.protocol}//${Y.host}`,webhookId:z[1]}}function wh1($,Y){return Y.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!Y.toLowerCase().endsWith(".xlsx")}function Mh1($,Y){if(!$.length)return;let z=new Set($.map((Q)=>{let J=Q.fileName.split("/")[0],K=J.indexOf("@");return K>=0?J.slice(0,K):J}).filter((Q)=>Q!=="信息表.xlsx")),U=[];for(let Q of Y){let J=Q.document.documentId;if((Q.documentAttachments.length>0||Object.values(Q.expenseAttachments).some((G)=>G.length>0)||Object.values(Q.personAttachments).some((G)=>G.length>0))&&!z.has(J))U.push(`Excel 会议编号「${J}」声明了附件,但在 ZIP 中找不到对应的根目录「${J}/」或「${J}@.../」。`)}let I=new Set(Y.map((Q)=>Q.document.documentId));for(let Q of z)if(!I.has(Q))U.push(`ZIP 根目录对应的编号「${Q}」在信息表中找不到对应的会议编号。`);if(U.length)throw new D5(U)}async function xR0($,Y,z){let U=[],I=$;if(wh1($,Y)){U=await lP0($),rP0(U,z);let G=U.find((H)=>H.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");I=await Kd($,G)}let Q=await zB0(I);Mh1(U,Q);let J=UB0(U,Q),K=Q.map((G)=>G.document);return{entries:U,parsed:Q,plans:J,documents:K,fileBuffer:$}}async function _U($,Y,z){let U=await xR0($,Y,z),I=U.parsed.map((Q,J)=>qd(Q.document,U.plans[J],new Map));return{warnings:[],documents:I,attachmentPlan:U.plans}}async function zT($,Y,z){let U=await xR0($,Y,z.materialPackFilePolicy),{baseUrl:I,webhookId:Q}=Fh1(z.webhookUrl),J=[];for(let K=0;K<U.parsed.length;K+=1){let G=U.parsed[K],H=U.plans[K],W=new Map,X=[...H.categoryFields,...Object.values(H.personAttachments).flat(),...Object.values(H.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(W.has(F))continue;let M=U.entries.find((T)=>T.fileName===F);if(!M)continue;process.stderr.write(`⬆ 上传附件: ${F}
`);let w=new FormData,O=await Kd(U.fileBuffer,M),D=F.split("/").pop()??F;w.append("files",new File([new Uint8Array(O)],D));let N=await fetch(`${I}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...vZ({},z.secret)},body:w});if(!N.ok)throw Error(`附件上传失败 ${N.status}: ${await N.text()}`);let B=await N.json();W.set(F,B.attachments?.map((T)=>T.data)??(B.data===void 0?[]:[B.data])),process.stderr.write(`✓ 附件上传成功: ${F}
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var BP0=E((nA1)=>{var $d=y3().Buffer;nA1._dbcs=x3;var Y8=-1,PP0=-2,p$=-10,h8=-1000,KK=Array(256),xZ=-1;for(kZ=0;kZ<256;kZ++)KK[kZ]=Y8;var kZ;function x3($,U){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var Y=$.table();this.decodeTables=[],this.decodeTables[0]=KK.slice(0),this.decodeTableSeq=[];for(var z=0;z<Y.length;z++)this._addDecodeChunk(Y[z]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Q=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var J=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var I=this.decodeTables[0];for(var z=129;z<=254;z++){var K=this.decodeTables[h8-I[z]];for(var G=48;G<=57;G++){if(K[G]===Y8)K[G]=h8-Q;else if(K[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var H=this.decodeTables[h8-K[G]];for(var W=129;W<=254;W++){if(H[W]===Y8)H[W]=h8-J;else if(H[W]===h8-J)continue;else if(H[W]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-H[W]];for(var Z=48;Z<=57;Z++)if(X[Z]===Y8)X[Z]=PP0}}}}this.defaultCharUnicode=U.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var z=0;z<$.encodeSkipVals.length;z++){var V=$.encodeSkipVals[z];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][U.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===Y8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===Y8)this.defCharSB=63}x3.prototype.encoder=IB;x3.prototype.decoder=Ud;x3.prototype._getDecodeTrieNode=function($){var U=[];for(;$>0;$>>>=8)U.push($&255);if(U.length==0)U.push(0);var Y=this.decodeTables[0];for(var z=U.length-1;z>0;z--){var Q=Y[U[z]];if(Q==Y8)Y[U[z]]=h8-this.decodeTables.length,this.decodeTables.push(Y=KK.slice(0));else if(Q<=h8)Y=this.decodeTables[h8-Q];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return Y};x3.prototype._addDecodeChunk=function($){var U=parseInt($[0],16),Y=this._getDecodeTrieNode(U);U=U&255;for(var z=1;z<$.length;z++){var Q=$[z];if(typeof Q==="string")for(var J=0;J<Q.length;){var I=Q.charCodeAt(J++);if(I>=55296&&I<56320){var K=Q.charCodeAt(J++);if(K>=56320&&K<57344)Y[U++]=65536+(I-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(I>4080&&I<=4095){var G=4095-I+2,H=[];for(var W=0;W<G;W++)H.push(Q.charCodeAt(J++));Y[U++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(H)}else Y[U++]=I}else if(typeof Q==="number"){var X=Y[U-1]+1;for(var J=0;J<Q;J++)Y[U++]=X++}else throw Error("Incorrect type '"+typeof Q+"' given in "+this.encodingName+" at chunk "+$[0])}if(U>255)throw Error("Incorrect chunk in "+this.encoLine truncated
`;super(U);this.name="AggregateError",this.errors=$}}SB0.exports={AggregateError:hB0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,U){return $.includes(U)},ArrayPrototypeIndexOf($,U){return $.indexOf(U)},ArrayPrototypeJoin($,U){return $.join(U)},ArrayPrototypeMap($,U){return $.map(U)},ArrayPrototypePop($,U){return $.pop(U)},ArrayPrototypePush($,U){return $.push(U)},ArrayPrototypeSlice($,U,Y){return $.slice(U,Y)},Error,FunctionPrototypeCall($,U,...Y){return $.call(U,...Y)},FunctionPrototypeSymbolHasInstance($,U){return Function.prototype[Symbol.hasInstance].call($,U)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,U){return Object.defineProperties($,U)},ObjectDefineProperty($,U,Y){return Object.defineProperty($,U,Y)},ObjectGetOwnPropertyDescriptor($,U){return Object.getOwnPropertyDescriptor($,U)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,U){return Object.setPrototypeOf($,U)},Promise,PromisePrototypeCatch($,U){return $.catch(U)},PromisePrototypeThen($,U,Y){return $.then(U,Y)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,U){return $.test(U)},SafeSet:Set,String,StringPrototypeSlice($,U,Y){return $.slice(U,Y)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,U,Y){return $.set(U,Y)},Boolean,Uint8Array}});var Bd=E((R44,gB0)=>{gB0.exports={format($,...U){return $.replace(/%([sdifj])/g,function(...[Y,z]){let Q=U.shift();if(z==="f")return Q.toFixed(6);else if(z==="j")return JSON.stringify(Q);else if(z==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var O8=E((_44,fB0)=>{var{format:kB1,inspect:ZB}=Bd(),{AggregateError:xB1}=x4(),fB1=globalThis.AggregateError||xB1,uB1=Symbol("kIsNodeError"),bB1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],iB1=/^([A-Z][a-z0-9]*)+$/,qB={};function Zz($,U){if(!$)throw new qB.ERR_INTERNAL_ASSERTION(U)}function yB0($){let U="",Y=$.length,z=$[0]==="-"?1:0;for(;Y>=z+4;Y-=3)U=`_${$.slice(Y-3,Y)}${U}`;return`${$.slice(0,Y)}${U}`}function cB1($,U,Y){if(typeof U==="function")return Zz(U.length<=Y.length,`Code: ${$}; The provided arguments length (${Y.length}) does not match the required ones (${U.length}).`),U(...Y);let z=(U.match(/%[dfijoOs]/g)||[]).length;if(Zz(z===Y.length,`Code: ${$}; The provided arguments length (${Y.length}) does not match the required ones (${z}).`),Y.length===0)return U;return kB1(U,...Y)}function z8($,U,Y){if(!Y)Y=Error;class z extends Y{constructor(...Q){super(cB1($,U,Q))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(z.prototype,{name:{value:Y.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),z.prototype.code=$,z.prototype[uB1]=!0,qB[$]=z}function kB0($){let U="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:U}),$}function nB1($,U){if($&&U&&$!==U){if(Array.isArray(U.errors))return U.errors.push($),U;let Y=new fB1([U,$],U.message);return Y.code=U.code,Y}return $||U}class xB0 extends Error{constructor($="The operation was aborted",U=void 0){if(U!==void 0&&typeof U!=="object")throw new qB.ERR_INVALID_ARG_TYPE("options","Object",U);super($,U);this.code="ABORT_ERR",this.name="AbortError"}}z8("ERR_ASSERTION","%s",Error);z8("ERR_INVALID_ARG_TYPE",($,U,Y)=>{if(Zz(typeof $==="string","'name' must be a string"),!Array.isArray(U))U=[U];let z="The ";if($.endsWith(" argument"))z+=`${$} `;else z+=`"${$}" ${$.includes(".")?"property":"argument"} `;z+="must be ";let Q=[],J=[],I=[];for(let G of U)if(Zz(typeof G==="string","All expected entries have to be of type string"),bB1.includes(G))Q.push(G.toLowerCase());else if(iB1.test(G))J.push(G);else Zz(G!=="object",'The value "object" should be written as "Object"'),I.push(G);if(J.length>0){let G=Q.indexOf("object");if(G!==-1)Q.splice(Q,G,1),J.push("Object")}if(Q.length>0){switch(Q.length){case 1:z+=`of type ${Q[Line truncated
`);if(U.linkname)Y+=$l(" linkpath="+U.linkname+`
`);let z=U.pax;if(z)for(let Q in z)Y+=$l(" "+Q+"="+z[Q]+`
`);return n1.from(Y)};bv1.decodePax=function(U){let Y={};while(U.length){let z=0;while(z<U.length&&U[z]!==32)z++;let Q=parseInt(n1.toString(U.subarray(0,z)),10);if(!Q)return Y;let J=n1.toString(U.subarray(z+1,Q-1)),I=J.indexOf("=");if(I===-1)return Y;Y[J.slice(0,I)]=J.slice(I+1),U=U.subarray(Q)}return Y};bv1.encode=function(U){let Y=n1.alloc(512),z=U.name,Q="";if(U.typeflag===5&&z[z.length-1]!=="/")z+="/";if(n1.byteLength(z)!==z.length)return null;while(n1.byteLength(z)>100){let J=z.indexOf("/");if(J===-1)return null;Q+=Q?"/"+z.slice(0,J):z.slice(0,J),z=z.slice(J+1)}if(n1.byteLength(z)>100||n1.byteLength(Q)>155)return null;if(U.linkname&&n1.byteLength(U.linkname)>100)return null;if(n1.write(Y,z),n1.write(Y,m2(U.mode&4095,6),100),n1.write(Y,m2(U.uid,6),108),n1.write(Y,m2(U.gid,6),116),fv1(U.size,Y,124),n1.write(Y,m2(U.mtime.getTime()/1000|0,11),136),Y[156]=48+kv1(U.type),U.linkname)n1.write(Y,U.linkname,157);if(n1.copy(GR0,Y,257),n1.copy(Rv1,Y,263),U.uname)n1.write(Y,U.uname,265);if(U.gname)n1.write(Y,U.gname,297);if(n1.write(Y,m2(U.devmajor||0,6),329),n1.write(Y,m2(U.devminor||0,6),337),Q)n1.write(Y,Q,345);return n1.write(Y,m2(WR0(Y),6),148),Y};bv1.decode=function(U,Y,z){let Q=U[156]===0?0:U[156]-48,J=EK(U,0,100,Y),I=d2(U,100,8),K=d2(U,108,8),G=d2(U,116,8),H=d2(U,124,12),W=d2(U,136,12),X=yv1(Q),Z=U[157]===0?null:EK(U,157,100,Y),q=EK(U,265,32),V=EK(U,297,32),F=d2(U,329,8),O=d2(U,337,8),w=WR0(U);if(w===256)return null;if(w!==d2(U,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(hv1(U)){if(U[345])J=EK(U,345,155,Y)+"/"+J}else if(Sv1(U));else if(!z)throw Error("Invalid tar header: unknown format.");if(Q===0&&J&&J[J.length-1]==="/")Q=5;return{name:J,mode:I,uid:K,gid:G,size:H,byteOffset:0,mtime:new Date(1000*W),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:O,pax:null}};function hv1($){return n1.equals(GR0,$.subarray(257,263))}function Sv1($){return n1.equals(_v1,$.subarray(257,263))&&n1.equals(vv1,$.subarray(263,265))}function gv1($,U,Y){if(typeof $!=="number")return Y;if($=~~$,$>=U)return U;if($>=0)return $;if($+=U,$>=0)return $;return 0}function yv1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function kv1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function HR0($,U,Y,z){for(;Y<z;Y++)if($[Y]===U)return Y;return z}function WR0($){let U=256;for(let Y=0;Y<148;Y++)U+=$[Y];for(let Y=156;Y<512;Y++)U+=$[Y];return U}function m2($,U){if($=$.toString(8),$.length>U)return"7777777777777777777".slice(0,U)+" ";return"0000000000000000000".slice(0,U-$.length)+$+" "}function xv1($,U,Y){U[Y]=128;for(let z=11;z>0;z--)U[Y+z]=$&255,$=Math.floor($/256)}function fv1($,U,Y){if($.toString(8).length>11)xv1($,U,Y);else n1.write(U,m2($,11),Y)}function uv1($){let U;if($[0]===128)U=!0;else if($[0]===255)U=!1;else return null;let Y=[],z;for(z=$.length-1;z>0;z--){let I=$[z];if(U)Y.push(I);else Y.push(255-I)}let Q=0,J=Y.length;for(z=0;z<J;z++)Q+=Y[z]*Math.pow(256,z);return U?Q:-1*Q}function d2($,U,Y){if($=$.subarray(U,U+Y),U=0,$[U]&128)return uv1($);else{while(U<$.length&&$[U]===32)U++;let z=gv1(HR0($,32,U,$.length),$.length,$.length);while(U<z&&$[U]===0)U++;if(z===U)return 0;return parseInt(n1.toString($.subarray(U,z)),8)}}function EK($,U,Y,z){return n1.toString($.subarray(U,HR0($,0,U,U+Y)),z)}function $l($){let U=n1.byteLength($),Y=Math.floor(Math.log(U)/Math.log(10))+1;if(U+Y>=Math.pow(10,Y))Y++;return U+Y+$}});var OR0=E((N84,wR0)=>{var{Writable:mv1,Readable:lv1,getStreamError:XR0}=em(),ov1=dm(),ZR0=jK(),CK=Ul(),rv1=ZR0.alloc(0);class qR0{constructor(){this.buffered=0,this.shifted=0,this.queue=new ov1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return rv1;let U=this._next($);if($===U.byteLength)return U;let Y=[U];while(($-=U.byteLength)>0)U=this._next($),Y.push(U);return ZR0.concat(Y)}_next($){let U=this.queue.peek(),Y=U.byteLength-this._offset;if($>=Y){let z=this._offset?U.subarray(this._offset,U.byteLength):U;return this.queue.shift(),this._offset=0,this.buffered-=Y,this.shifted+=Y,z}return this.buffered-=$,this.shifted+=$,U.subarray(this._offset,this._offset+=$)}}class VR0 extends lv1{constructor($,U,Y){super();this.header=U,this.offset=Y,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(XR0(this))}_detach(){if(this._parent._stream= Line truncated
`),z=[await H4($,Y.recordId)];else if(Y.recordIds&&Y.recordIds.length>0)process.stderr.write(`\uD83D\uDD0D 批量查询 ${Y.recordIds.length} 条单据记录...
`),z=await Promise.all(Y.recordIds.map((w)=>H4($,w)));else{let w=Y.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${U.name}」(${U.id}) 的线上审核记录 (限制 ${w} 条)...
`);let N=(await b4($,{limit:w,status:Y.status,startDate:Y.startDate!==void 0?String(Y.startDate):void 0,endDate:Y.endDate!==void 0?String(Y.endDate):void 0})).records??[];if(N.length===0)throw Error("未检索到符合条件的线上审核记录,无法导出 webhook 资源包。");process.stderr.write(`\uD83D\uDCE5 正在拉取 ${N.length} 条审核记录完整详情...
`),z=await Promise.all(N.map((D)=>H4($,D.id)))}let Q=new Map,J=0;for(let w of z){let M=w.document,N=w.sourceDocumentId??(typeof M?.id==="string"?M.id:void 0)??(typeof M?.sourceDocumentId==="string"?M.sourceDocumentId:void 0)??w.documentId??w.id,D=`${Y.docIdPrefix??""}${N}${Y.docIdSuffix??""}`,B=[];if(Y.includeAttachments!==!1){let A=k2(w,{summary:!1}).attachments,j=new Set;for(let C of A){let b=C.ossSignedUrl??C.url;if(!b)continue;let x=C.fileName??C.fileId??"attachment",h=on(x),i=h,c=h.lastIndexOf("."),z0=c>0?h.slice(0,c):h,k=c>0?h.slice(c):"",d=1;while(j.has(i.toLowerCase()))i=`${z0}_${d}${k}`,d++;j.add(i.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${D}」附件: ${x}...
`);let t=await fetch(b);if(t.ok){let $0=await t.arrayBuffer(),g=Buffer.from($0);B.push({fileName:i,zipPath:`${D}/${i}`,buffer:g,sourceField:C.sourceField??"附件"}),J++}}catch(t){process.stderr.write(`⚠️ [跳过附件] 下载失败 ${x}: ${t}
`)}}}Q.set(D,B)}let I=new kR0.default.Workbook;I.creator="seal-use",I.created=new Date;let K=new Set;for(let w of Q.values())for(let M of w)K.add(M.sourceField);if(K.size===0)K.add("附件");let G=new Set;for(let w of z){let M=w.document,N=Array.isArray(M?.fields)?M.fields:[];for(let D of N)if(D&&typeof D==="object"){let B=D,T=typeof B.label==="string"?B.label.trim():typeof B.key==="string"?B.key.trim():"",A=typeof B.type==="string"?B.type.toUpperCase():"";if(T&&A!=="ATTACHMENT"&&A!=="LIST")G.add(T)}}let H=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],W=Array.from(G).filter((w)=>!H.includes(w)&&w!=="单据编号"&&w!=="单号"),X=Array.from(K).map((w)=>`[附件]${w}`),Z=[...H,...W,...X],q=I.addWorksheet("主表");q.addRow(Z),q.getRow(1).font={bold:!0};for(let w of z){let M=w.document,N=w.sourceDocumentSN??(typeof M?.sn==="string"?M.sn:void 0)??(typeof M?.sourceDocumentSN==="string"?M.sourceDocumentSN:void 0)??w.id,D=w.sourceDocumentId??(typeof M?.id==="string"?M.id:void 0)??(typeof M?.sourceDocumentId==="string"?M.sourceDocumentId:void 0)??w.documentId??w.id,B=`${Y.docIdPrefix??""}${D}${Y.docIdSuffix??""}`,T=`${Y.docIdPrefix??""}${N}${Y.docIdSuffix??""}`,A=(typeof M?.title==="string"?M.title:void 0)??(typeof M?.name==="string"?M.name:void 0)??T,j="";if(typeof M?.sourceStartTime==="number")j=new Date(M.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="number")j=new Date(w.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="string")j=w.createdAt.slice(0,10);let C=new Map,b=Array.isArray(M?.fields)?M.fields:[];for(let z0 of b)if(z0&&typeof z0==="object"){let k=z0,d=typeof k.label==="string"?k.label.trim():typeof k.key==="string"?k.key.trim():"";if(d)C.set(d,k.value)}let x,h=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof h==="number")x=h;else if(h&&typeof h==="object"&&"amount"in h&&typeof h.amount==="number")x=h.amount;let i=[];i.push(B),i.push(A),i.push(w.status??"已审批"),i.push(x??""),i.push(C.get("报销事由")??C.get("事由")??A),i.push(j);for(let z0 of W){let k=C.get(z0);if(k===void 0||k===null)i.push("");else if(typeof k==="object")if("amount"in k)i.push(k.amount);else i.push(JSON.stringify(k));else i.push(k)}let c=Q.get(B)??[];for(let z0 of K){let k=c.filter((d)=>d.sourceField===z0||K.size===1);if(k.length>0)i.push(k.map((d)=>d.zipPath).join(`
`));else i.push("")}q.addRow(i)}let V=Vh1(Y,U);Hh1(Zh1(V),{recursive:!0});let F=await I.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
`),await new Promise((w,M)=>{let N=Gh1(V),D=new Il({zlib:{level:9}});N.on("close",()=>w()),D.on("error",(B)=>M(B)),D.pipe(N),D.append(Buffer.from(F),{name:"信息表.xlsx"});for(let B of Q.values())for(let T of B)D.append(T.buffer,{name:T.zipPath});D.finalize()});let O=Wh1(V);return{filePath:V,corpId:U.id,corpName:U.name,recordCount:z.length,attachmentCount:J,fileSizeBytes:O.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var kR0;var Kl=o(()=>{gR0();X6();SP();kR0=J6(EZ(),1)});import{readFileSync as Lh1}from"node:fs";function Fh1($){let U=new URL($),Y=U.pathname.match(/\/webhook\/([^/]+)/);if(!Y)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${U.protocol}//${U.host}`,webhookId:Y[1]}}function wh1($,U){return U.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!U.toLowerCase().endsWith(".xlsx")}function Oh1($,U){if(!$.length)return;let Y=new Set($.map((J)=>{let I=J.fileName.split("/")[0],K=I.indexOf("@");return K>=0?I.slice(0,K):I}).filter((J)=>J!=="信息表.xlsx")),z=[];for(let J of U){let I=J.document.documentId;if((J.documentAttachments.length>0||Object.values(J.expenseAttachments).some((G)=>G.length>0)||Object.values(J.personAttachments).some((G)=>G.length>0))&&!Y.has(I))z.push(`Excel 会议编号「${I}」声明了附件,但在 ZIP 中找不到对应的根目录「${I}/」或「${I}@.../」。`)}let Q=new Set(U.map((J)=>J.document.documentId));for(let J of Y)if(!Q.has(J))z.push(`ZIP 根目录对应的编号「${J}」在信息表中找不到对应的会议编号。`);if(z.length)throw new D5(z)}async function xR0($,U,Y){let z=[],Q=$;if(wh1($,U)){z=await lP0($),rP0(z,Y);let G=z.find((H)=>H.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");Q=await Kd($,G)}let J=await YB0(Q);Oh1(z,J);let I=zB0(z,J),K=J.map((G)=>G.document);return{entries:z,parsed:J,plans:I,documents:K,fileBuffer:$}}async function _z($,U,Y){let z=await xR0($,U,Y),Q=z.parsed.map((J,I)=>qd(J.document,z.plans[I],new Map));return{warnings:[],documents:Q,attachmentPlan:z.plans}}async function YT($,U,Y){let z=await xR0($,U,Y.materialPackFilePolicy),{baseUrl:Q,webhookId:J}=Fh1(Y.webhookUrl),I=[];for(let K=0;K<z.parsed.length;K+=1){let G=z.parsed[K],H=z.plans[K],W=new Map,X=[...H.categoryFields,...Object.values(H.personAttachments).flat(),...Object.values(H.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(W.has(F))continue;let O=z.entries.find((T)=>T.fileName===F);if(!O)continue;process.stderr.write(`⬆ 上传附件: ${F}
`);let w=new FormData,M=await Kd(z.fileBuffer,O),N=F.split("/").pop()??F;w.append("files",new File([new Uint8Array(M)],N));let D=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/attachments`,{method:"POST",headers:{...Y.customHeaders??{},...vZ({},Y.secret)},body:w});if(!D.ok)throw Error(`附件上传失败 ${D.status}: ${await D.text()}`);let B=await D.json();W.set(F,B.attachments?.map((T)=>T.data)??(B.data===void 0?[]:[B.data])),process.stderr.write(`✓ 附件上传成功: ${F}
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${G.document.documentId}
`);let Z=qd(G.document,H,W),q=await fetch(`${I}/api/v1/integrations/webhook/${encodeURIComponent(Q)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...vZ({webhookId:Q,...Z},z.secret)},body:JSON.stringify(Z)});if(!q.ok)throw Error(`Webhook 单据推送失败 ${q.status}: ${await q.text()}`);J.push({documentId:Z.documentId,document:Z,pushResult:await q.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
`)}return{warnings:[],results:J}}function vU($){return{fileBuffer:Lh1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Gl=o(()=>{cP();Vd();Zd();Gd();tJ();Kl()});import{existsSync as Oh1}from"node:fs";async function UT($,Y,z={}){let I=_4().stateful?"stateful":"stateless",Q="ok",J,K,G;try{let N=await W8($);G={id:N.user.id,name:N.user.name,isAdmin:N.user.isAdmin},K={id:N.tenant.id,name:N.tenant.name,tenantSlug:N.tenant.tenantSlug,corporationName:N.tenant.hoseCorpConfig?.corporationName}}catch(N){Q="error",J=N instanceof Error?N.message:String(N)}let H=[];if(Q==="ok")try{H=await Q$($,Y.seal.endpoints.approvalStylePreferences)}catch(N){Q="error",J=`读取 Webhook 配置失败: ${N instanceof Error?N.message:String(N)}`}let W=H.length===1,X=H.map((N)=>({id:N.id,name:N.name,mode:N.mode,incomingDocumentWebhookUrl:N.incomingDocumentWebhook.url,outgoingResultWebhookUrl:N.outgoingResultWebhook,autoApprovalRate:N.autoApprovalRate,...W?{isDefault:!0}:{}})),Z=W?{id:H[0].id,name:H[0].name,mode:H[0].mode}:null,q=z.webhook?v7(H,z.webhook):W?H[0]:void 0,V;if(z.filePath)if(!Oh1(z.filePath))V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let N=vU(z.filePath),B=await _U(N.fileBuffer,N.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:z.filePath,fileName:N.fileName,documentCount:B.documents.length,warnings:B.warnings}}catch(N){V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[N instanceof Error?N.message:String(N)]}}let F=V?V.valid:!0,M=Q==="ok"&&X.length>0&&F,w=I==="stateful"?"":` --corp ${Y.id}`,O="",D="";if(Q!=="ok")D=`凭证鉴权异常: ${J}`,O=`seal-use auth diagnose${w}`;else if(X.length===0)D="当前企业尚未配置任何 Webhook 集成通道",O=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${w}`;else if(V&&!V.valid)D=`资源包预检失败: ${V.errors?.join("; ")}`,O=`seal-use webhook resource-pack preview ${V.filePath}${w}`;else{D=W?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let N=V?.filePath??"<资源包.zip>",B=W?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;O=`seal-use webhook resource-pack push ${N}${B}${w}`}return{ready:M,corp:{id:Y.id,name:Y.name,sourceType:Y.source.type,tenant:K,user:G},stateMode:I,authStatus:Q,authError:J,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:D,nextAction:O}}var fR0=o(()=>{S3();X6();Gl()});var Hl=o(()=>{tJ();pI();cP();Gd();Zd();Vd();Gl();fR0();Kl()});import{existsSync as uR0,mkdirSync as bR0,statSync as Nh1}from"node:fs";import{homedir as Dh1}from"node:os";import{dirname as Ah1,resolve as IT}from"node:path";function Ph1($){if($.outputFile){let J=IT($.outputFile),K=Ah1(J);if(!uR0(K))bR0(K,{recursive:!0});return J}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",U=$.dateTag||new Date().toISOString().slice(0,10),I=`${z}_智能洞察报告_${U}.xlsx`,Q;if($.toDownloads)Q=IT(Dh1(),"Downloads");else Q=IT(process.cwd(),"exports");if(!uR0(Q))bR0(Q,{recursive:!0});return IT(Q,I)}async function QT($,Y,z={}){let U=Y.name||Y.id,I=dn({startDate:z.startDate,endDate:z.endDate,force:z.force}),Q=new Date().toISOString(),[J,K]=await Promise.all([NM($,{startDate:I.startDateStr,endDate:I.endDateStr,limit:z.limit??100}),AM($,{startDate:I.startDateStr,endDate:I.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=J.tagStats||[],H=[],W=Math.min(G.length,z.limit??50);for(let C=0;C<W;C++){let b=G[C];if(!b?.tagId)continue;try{let k=await DM($,{tagId:b.tagId,startDate:I.startDateStr,endDate:I.endDateStr});for(let h of k.risks||[])H.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:h.documentSN||"-",documentType:h.documentType||"-",riskLevel:h.riskLevel||"warning",confidence:h.confidence??0,riskDetails:h.riskDetails||"-",reasoning:h.reasoning||"-",sourceDocumentURL:h.sourceDocumentURL,createdAt:h.createdAt})}catch{}}let X=new iR0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let M=K.metrics||{},w=[{c Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:_K({id:Y?.id,sn:Y?.sn??Y?.sourceDocumentSN??$.sourceDocumentSN,title:Y?.title??Y?.name,template:XT(Y,["template.name","templateName","form.name","formName","formTitle"]),amount:KT(z,["金额","报销金额","付款金额","合计","价税合计"])??XT(Y,["amount","totalAmount","expenseAmount"]),expenseType:KT(z,["费用类型","费用类别","报销类型"]),costCompany:KT(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:KT(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:ih1($),attachments:k2($,{summary:!0}).attachments,aiResult:qT($),manualResult:SU($)?.value,hints:_K({amountMentions:dR0(U,["金额","合计","税率"],8),partyMentions:dR0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function xh1($){let Y=[["result.citedRules",n3($,"result.citedRules")],["result.matchedRules",n3($,"result.matchedRules")],["result.ruleResults",n3($,"result.ruleResults")],["result.rules",n3($,"result.rules")],["pipelineData.citedRules",n3($,"pipelineData.citedRules")],["pipelineData.matchedRules",n3($,"pipelineData.matchedRules")]],z=[],U=new Set;for(let[I,Q]of Y)(Array.isArray(Q)?Q:Q&&typeof Q==="object"?Object.values(Q):[]).forEach((K,G)=>{let H=Lq(K);if(!H)return;let W=S4(H.runtimeRuleId)??S4(H.runtimeId)??S4(H.id)??S4(H.ruleId),X=S4(H.ruleCode)??S4(H.code)??(W?ph1(W):void 0),Z=_K({runtimeRuleId:W,ruleCode:X,versionNumber:uh1(H.versionNumber)??$.ruleSetVersionNumber,scope:S4(H.scope),strictness:S4(H.strictness),appliedAnalysis:H.appliedAnalysis??H.analysis??H.reasoning,checkResult:H.checkResult??H.result??H.decision,findings:H.findings??H.riskPoints??H.evidence,sourcePath:`${I}.${G}`}),q=JSON.stringify(Z);if(!U.has(q))U.add(q),z.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function XT($,Y){if(!$)return;for(let z of Y){let U=n3($,z);if(U!==void 0)return U}return}function pR0($,Y){if(!$)return 0;for(let z of Y){let U=n3($,z);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function n3($,Y){return Y.split(".").reduce((z,U)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let I=Number(U);return Number.isInteger(I)?z[I]:void 0}if(typeof z==="object")return z[U];return},$)}function fh1($,Y,z){let U=Y.split("."),I=$;for(let Q of U.slice(0,-1)){let J=I[Q];if(!J||typeof J!=="object"||Array.isArray(J))I[Q]={};I=I[Q]}I[U[U.length-1]??Y]=z}function _K($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}function Lq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function uh1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function bh1($){let Y=[];return ql($,"document",Y),Y}function ql($,Y,z){if(Array.isArray($)){$.forEach((J,K)=>ql(J,`${Y}.${K}`,z));return}let U=Lq($);if(!U)return;let I=S4(U.label)??S4(U.name)??S4(U.title)??S4(U.fieldName),Q=U.value??U.displayValue??U.text??U.content;if(I&&Q!==void 0&&typeof Q!=="object")z.push(_K({path:Y,label:I,value:Q,type:S4(U.type)??S4(U.fieldType)}));for(let[J,K]of Object.entries(U)){if(J==="attachments")continue;ql(K,`${Y}.${J}`,z)}}function KT($,Y){return $.find((U)=>{let I=S4(U.label)??"";return Y.some((Q)=>I.includes(Q))})?.value}function ih1($){let Y=[];return ZT($.result,"result",Y),ZT($.document,"document",Y),Y.slice(0,20)}function ZT($,Y,z){if(Array.isArray($)){$.forEach((I,Q)=>ZT(I,`${Y}.${Q}`,z));return}let U=Lq($);if(!U)return;if(/invoice|发票/i.test(Y))z.push(_K({path:Y,fileName:S4(U.fileName)??S4(U.filename)??S4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[I,Q]of Object.entries(U))ZT(Q,`${Y}.${I}`,z)}function dR0($,Y,z){return $.split(/\r?\n/).filter((U)=>Y.some((I)=>U.includes(I))).slice(0,z)}function GT($){return $.map((Y)=>{let z=hU(Y);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Xl($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function ch1($,Y){if(Y.recordId&&!Y.versionId&&!Y.versionNumber&&!Y.latest){let z=await H4($,Y.recordId);if(!z.ruleSetVersionNumber)throw Er Line truncated
`+`• 身份主体:${w}${O}
`);let Z=qd(G.document,H,W),q=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/document`,{method:"POST",headers:{...Y.customHeaders??{},"Content-Type":"application/json",...vZ({webhookId:J,...Z},Y.secret)},body:JSON.stringify(Z)});if(!q.ok)throw Error(`Webhook 单据推送失败 ${q.status}: ${await q.text()}`);I.push({documentId:Z.documentId,document:Z,pushResult:await q.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
`)}return{warnings:[],results:I}}function vz($){return{fileBuffer:Lh1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Gl=o(()=>{cP();Vd();Zd();Gd();tI();Kl()});import{existsSync as Mh1}from"node:fs";async function zT($,U,Y={}){let Q=_4().stateful?"stateful":"stateless",J="ok",I,K,G;try{let D=await W8($);G={id:D.user.id,name:D.user.name,isAdmin:D.user.isAdmin},K={id:D.tenant.id,name:D.tenant.name,tenantSlug:D.tenant.tenantSlug,corporationName:D.tenant.hoseCorpConfig?.corporationName}}catch(D){J="error",I=D instanceof Error?D.message:String(D)}let H=[];if(J==="ok")try{H=await J$($,U.seal.endpoints.approvalStylePreferences)}catch(D){J="error",I=`读取 Webhook 配置失败: ${D instanceof Error?D.message:String(D)}`}let W=H.length===1,X=H.map((D)=>({id:D.id,name:D.name,mode:D.mode,incomingDocumentWebhookUrl:D.incomingDocumentWebhook.url,outgoingResultWebhookUrl:D.outgoingResultWebhook,autoApprovalRate:D.autoApprovalRate,...W?{isDefault:!0}:{}})),Z=W?{id:H[0].id,name:H[0].name,mode:H[0].mode}:null,q=Y.webhook?v7(H,Y.webhook):W?H[0]:void 0,V;if(Y.filePath)if(!Mh1(Y.filePath))V={valid:!1,filePath:Y.filePath,fileName:Y.filePath.split(/[\\/]/).pop()??Y.filePath,documentCount:0,errors:[`文件不存在: ${Y.filePath}`]};else try{let D=vz(Y.filePath),B=await _z(D.fileBuffer,D.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:Y.filePath,fileName:D.fileName,documentCount:B.documents.length,warnings:B.warnings}}catch(D){V={valid:!1,filePath:Y.filePath,fileName:Y.filePath.split(/[\\/]/).pop()??Y.filePath,documentCount:0,errors:[D instanceof Error?D.message:String(D)]}}let F=V?V.valid:!0,O=J==="ok"&&X.length>0&&F,w=Q==="stateful"?"":` --corp ${U.id}`,M="",N="";if(J!=="ok")N=`凭证鉴权异常: ${I}`,M=`seal-use auth diagnose${w}`;else if(X.length===0)N="当前企业尚未配置任何 Webhook 集成通道",M=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${w}`;else if(V&&!V.valid)N=`资源包预检失败: ${V.errors?.join("; ")}`,M=`seal-use webhook resource-pack preview ${V.filePath}${w}`;else{N=W?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let D=V?.filePath??"<资源包.zip>",B=W?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;M=`seal-use webhook resource-pack push ${D}${B}${w}`}return{ready:O,corp:{id:U.id,name:U.name,sourceType:U.source.type,tenant:K,user:G},stateMode:Q,authStatus:J,authError:I,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:N,nextAction:M}}var fR0=o(()=>{S3();X6();Gl()});var Hl=o(()=>{tI();pQ();cP();Gd();Zd();Vd();Gl();fR0();Kl()});import{existsSync as uR0,mkdirSync as bR0,statSync as Nh1}from"node:fs";import{homedir as Dh1}from"node:os";import{dirname as Ah1,resolve as QT}from"node:path";function Ph1($){if($.outputFile){let I=QT($.outputFile),K=Ah1(I);if(!uR0(K))bR0(K,{recursive:!0});return I}let Y=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",z=$.dateTag||new Date().toISOString().slice(0,10),Q=`${Y}_智能洞察报告_${z}.xlsx`,J;if($.toDownloads)J=QT(Dh1(),"Downloads");else J=QT(process.cwd(),"exports");if(!uR0(J))bR0(J,{recursive:!0});return QT(J,Q)}async function JT($,U,Y={}){let z=U.name||U.id,Q=dn({startDate:Y.startDate,endDate:Y.endDate,force:Y.force}),J=new Date().toISOString(),[I,K]=await Promise.all([NO($,{startDate:Q.startDateStr,endDate:Q.endDateStr,limit:Y.limit??100}),AO($,{startDate:Q.startDateStr,endDate:Q.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=I.tagStats||[],H=[],W=Math.min(G.length,Y.limit??50);for(let C=0;C<W;C++){let b=G[C];if(!b?.tagId)continue;try{let x=await DO($,{tagId:b.tagId,startDate:Q.startDateStr,endDate:Q.endDateStr});for(let h of x.risks||[])H.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:h.documentSN||"-",documentType:h.documentType||"-",riskLevel:h.riskLevel||"warning",confidence:h.confidence??0,riskDetails:h.riskDetails||"-",reasoning:h.reasoning||"-",sourceDocumentURL:h.sourceDocumentURL,createdAt:h.createdAt})}catch{}}let X=new iR0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let O=K.metrics||{},w=[{c Line truncated
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:_K({id:U?.id,sn:U?.sn??U?.sourceDocumentSN??$.sourceDocumentSN,title:U?.title??U?.name,template:XT(U,["template.name","templateName","form.name","formName","formTitle"]),amount:KT(Y,["金额","报销金额","付款金额","合计","价税合计"])??XT(U,["amount","totalAmount","expenseAmount"]),expenseType:KT(Y,["费用类型","费用类别","报销类型"]),costCompany:KT(Y,["费用承担公司","承担公司","成本中心","费用归属"]),payee:KT(Y,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:Y.slice(0,30)}),invoices:ih1($),attachments:k2($,{summary:!0}).attachments,aiResult:qT($),manualResult:Sz($)?.value,hints:_K({amountMentions:dR0(z,["金额","合计","税率"],8),partyMentions:dR0(z,["买方","卖方","甲方","乙方","收款"],8)})}}function xh1($){let U=[["result.citedRules",n3($,"result.citedRules")],["result.matchedRules",n3($,"result.matchedRules")],["result.ruleResults",n3($,"result.ruleResults")],["result.rules",n3($,"result.rules")],["pipelineData.citedRules",n3($,"pipelineData.citedRules")],["pipelineData.matchedRules",n3($,"pipelineData.matchedRules")]],Y=[],z=new Set;for(let[Q,J]of U)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((K,G)=>{let H=Lq(K);if(!H)return;let W=S4(H.runtimeRuleId)??S4(H.runtimeId)??S4(H.id)??S4(H.ruleId),X=S4(H.ruleCode)??S4(H.code)??(W?ph1(W):void 0),Z=_K({runtimeRuleId:W,ruleCode:X,versionNumber:uh1(H.versionNumber)??$.ruleSetVersionNumber,scope:S4(H.scope),strictness:S4(H.strictness),appliedAnalysis:H.appliedAnalysis??H.analysis??H.reasoning,checkResult:H.checkResult??H.result??H.decision,findings:H.findings??H.riskPoints??H.evidence,sourcePath:`${Q}.${G}`}),q=JSON.stringify(Z);if(!z.has(q))z.add(q),Y.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:Y.length,rules:Y}}function XT($,U){if(!$)return;for(let Y of U){let z=n3($,Y);if(z!==void 0)return z}return}function pR0($,U){if(!$)return 0;for(let Y of U){let z=n3($,Y);if(Array.isArray(z))return z.length;if(z&&typeof z==="object")return Object.keys(z).length;if(typeof z==="number")return z}return 0}function n3($,U){return U.split(".").reduce((Y,z)=>{if(Y===void 0||Y===null)return;if(Array.isArray(Y)){let Q=Number(z);return Number.isInteger(Q)?Y[Q]:void 0}if(typeof Y==="object")return Y[z];return},$)}function fh1($,U,Y){let z=U.split("."),Q=$;for(let J of z.slice(0,-1)){let I=Q[J];if(!I||typeof I!=="object"||Array.isArray(I))Q[J]={};Q=Q[J]}Q[z[z.length-1]??U]=Y}function _K($){return Object.fromEntries(Object.entries($).filter(([,U])=>U!==void 0))}function Lq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function uh1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function bh1($){let U=[];return ql($,"document",U),U}function ql($,U,Y){if(Array.isArray($)){$.forEach((I,K)=>ql(I,`${U}.${K}`,Y));return}let z=Lq($);if(!z)return;let Q=S4(z.label)??S4(z.name)??S4(z.title)??S4(z.fieldName),J=z.value??z.displayValue??z.text??z.content;if(Q&&J!==void 0&&typeof J!=="object")Y.push(_K({path:U,label:Q,value:J,type:S4(z.type)??S4(z.fieldType)}));for(let[I,K]of Object.entries(z)){if(I==="attachments")continue;ql(K,`${U}.${I}`,Y)}}function KT($,U){return $.find((z)=>{let Q=S4(z.label)??"";return U.some((J)=>Q.includes(J))})?.value}function ih1($){let U=[];return ZT($.result,"result",U),ZT($.document,"document",U),U.slice(0,20)}function ZT($,U,Y){if(Array.isArray($)){$.forEach((Q,J)=>ZT(Q,`${U}.${J}`,Y));return}let z=Lq($);if(!z)return;if(/invoice|发票/i.test(U))Y.push(_K({path:U,fileName:S4(z.fileName)??S4(z.filename)??S4(z.name),buyer:z.buyer??z.buyerName??z.purchaserName,seller:z.seller??z.sellerName,amount:z.amount??z.totalAmount??z.total,taxRate:z.taxRate,category:z.category??z.type}));for(let[Q,J]of Object.entries(z))ZT(J,`${U}.${Q}`,Y)}function dR0($,U,Y){return $.split(/\r?\n/).filter((z)=>U.some((Q)=>z.includes(Q))).slice(0,Y)}function GT($){return $.map((U)=>{let Y=hz(U);return{recordId:Y.id,tenantId:Y.tenantId,agentId:Y.agentId,sourceDocumentSN:Y.sourceDocumentSN,sourceDocumentId:Y.sourceDocumentId,simulationBatchId:Y.simulationBatchId,langfuseTraceId:Y.langfuseTraceId,langfuseSessionFallback:Y.langfuseSessionFallback,ruleSetVersionNumber:Y.ruleSetVersionNumber,ruleSetPublishedAt:Y.ruleSetPublishedAt,ruleSetPublishedByName:Y.ruleSetPublishedByName,resolution:Y.langfuseTraceId?"trace":Y.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Xl($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function ch1($,U){if(U.recordId&&!U.versionId&&!U.versionNumber&&!U.latest){let Y=await H4($,U.recordId);if(!Y.ruleSetVersionNumber)throw Er Line truncated
`+`• 身份主体:${w}${M}
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
`+`• 时效性:换票凭证有效时间 ${q} 秒(${Math.round(q/60)} 分钟),在浏览器打开后将保留 30 天会话
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:Y.sso?W:H,sealResultUrl:H,ssoUrl:W,type:Y.sso?"sso_link":"deep_link",expiresIn:Y.sso?q:void 0,identity:X,warning:Z,enterpriseAssistUrl:J,enterpriseUrl:J,hoseDomain:Q.type==="hose"?oh1(Q.domain):void 0,documentUrl:K,recordId:I?.id,sourceDocumentSN:I?.sourceDocumentSN,sourceDocumentId:I?.sourceDocumentId,sourceSystem:I?.sourceSystem,missing:{enterpriseAssistUrl:J?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:U&&!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,Y)=>{let z=Y.sn??Y.query;if(!z)throw Error("query or sn is required");let U=await rh1($,{query:z,sn:Y.sn,batchId:Y.batchId,latest:Y.latest,limit:Y.latest?1:Y.limit??20,maxScan:Y.maxScan??1000}),I=await Promise.all(U.records.map((K)=>H4($,K.id))),Q=nR0(Y.fields),J=I.map((K)=>dh1(K,Q));return{query:z,sourceDocumentSN:Y.sn,simulationBatchId:Y.batchId,latest:Y.latest??!1,total:U.total,scanned:U.scanned,matched:J.length,records:J,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...Y.includeBridge?{bridge:GT(I)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,Y)=>{let z=Ol(await aS($,Y.batchId),Y.query);return{batchId:Y.batchId,count:z.length,records:z.map(hU),bridge:GT(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,Y)=>{let z=Y.mode??"hosecloud",U=Y.signKey;if(z==="hosecloud"&&!U){if(U=(await eS($)).find((K)=>K.signKey)?.signKey,!U)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`)}function QS1($){let Y=[];if(Y.push(`seal-use ${$.area} - ${$.title}`),$.description)Y.push($.description);Y.push(""),Y.push("Usage:");for(let z of $.commands)for(let U of z.usage)Y.push(` ${U}`);if($.commands.some((z)=>z.name))Y.push(""),Y.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return Y.join(`
`)}function H_0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let Y of W_0)for(let z of Y.commands)for(let U of z.usage)$.push(` ${U}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var W_0;var Tl=o(()=>{L$();W_0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",description:"Production enterprise ID (default: active enterprise)"},{flag:"--record-id <id>",description:"Replay a specific approval run ID"},{flag:"--sn <sn>",description:"Replay a specific document SN"},{flag:"--limit <n>",description:"Batch replay latest N records from production (default: 1)"},{flag:"--status <status>",descripti Line truncated
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:U.sso?W:H,sealResultUrl:H,ssoUrl:W,type:U.sso?"sso_link":"deep_link",expiresIn:U.sso?q:void 0,identity:X,warning:Z,enterpriseAssistUrl:I,enterpriseUrl:I,hoseDomain:J.type==="hose"?oh1(J.domain):void 0,documentUrl:K,recordId:Q?.id,sourceDocumentSN:Q?.sourceDocumentSN,sourceDocumentId:Q?.sourceDocumentId,sourceSystem:Q?.sourceSystem,missing:{enterpriseAssistUrl:I?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:z&&!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,U)=>{let Y=U.sn??U.query;if(!Y)throw Error("query or sn is required");let z=await rh1($,{query:Y,sn:U.sn,batchId:U.batchId,latest:U.latest,limit:U.latest?1:U.limit??20,maxScan:U.maxScan??1000}),Q=await Promise.all(z.records.map((K)=>H4($,K.id))),J=nR0(U.fields),I=Q.map((K)=>dh1(K,J));return{query:Y,sourceDocumentSN:U.sn,simulationBatchId:U.batchId,latest:U.latest??!1,total:z.total,scanned:z.scanned,matched:I.length,records:I,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...U.includeBridge?{bridge:GT(Q)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,U)=>{let Y=Ml(await aS($,U.batchId),U.query);return{batchId:U.batchId,count:Y.length,records:Y.map(hz),bridge:GT(Y)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,U)=>{let Y=U.mode??"hosecloud",z=U.signKey;if(Y==="hosecloud"&&!z){if(z=(await eS($)).find((K)=>K.signKey)?.signKey,!z)throw Error("未找到合思集成 signKey, 请通过 signKey Line truncated
`)}function JS1($){let U=[];if(U.push(`seal-use ${$.area} - ${$.title}`),$.description)U.push($.description);U.push(""),U.push("Usage:");for(let Y of $.commands)for(let z of Y.usage)U.push(` ${z}`);if($.commands.some((Y)=>Y.name))U.push(""),U.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return U.join(`
`)}function H_0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let U of W_0)for(let Y of U.commands)for(let z of Y.usage)$.push(` ${z}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
`)}var W_0;var Tl=o(()=>{L$();W_0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",description:"Production enterprise ID (default: active enterprise)"},{flag:"--record-id <id>",description:"Replay a specific approval run ID"},{flag:"--sn <sn>",description:"Replay a specific document SN"},{flag:"--limit <n>",description:"Batch replay latest N records from production (default: 1)"},{flag:"--status <status>",descripti Line truncated
`)}
`}function Oq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function c0($,Y={}){WS1($,Y);let z=`${JSON.stringify($,null,2)}
`;if(Y.outputFile){JS1(Y.outputFile,z),console.log(JSON.stringify({outputFile:Y.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function WS1($,Y={}){if(Y.allowFull||Y.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>HS1)throw new nP(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function V_0($,Y){if(Y)return;let z=$&&typeof $==="object"?$:{},U=typeof z.count==="number"?z.count:void 0,I=Array.isArray(z.rules)?z.rules.length:void 0,Q=Buffer.byteLength(JSON.stringify($),"utf-8"),J=U??I??0;if(J>KS1||Q>GS1)throw new nP(`Rule list is large (${J} rules, ${Q} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:V0($.full)===!0,outputFile:S($.outputFile)??S($["output-file"])}}function L_0($=[]){console.log(Z_0($))}var KS1=100,GS1=120000,q_0,HS1=200000;var Q4=o(()=>{D4();L$();Tl();q_0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var F_0={};x8(F_0,{selectCorp:()=>E1,runToolResult:()=>o2,runTool:()=>k0,globalConfigSummary:()=>l2});function E1($){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},h3());return qA0(U.id),U}function l2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:KU()}}async function k0($,Y,z,U,I={}){c0(await o2($,Y,z,U),I)}async function o2($,Y,z,U){let I=Vq.find((K)=>K.name===$);if(!I)throw Error(`Unknown Seal tool: ${$}`);let Q=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),J=I.handler;return J(Y,Q,{corp:z})}var o4=o(()=>{S3();bP();Fq();Q4()});import{existsSync as w_0}from"node:fs";async function M_0($,Y){if(!w_0($))throw Error(`File not found: ${$}`);let z=vU($);console.log(JSON.stringify(await _U(z.fileBuffer,z.fileName,Y),null,2))}async function MT($,Y,z,U,I){if($==="ready"||$==="status"){let Q=Y??S(I.options.file)??S(I.options.input),J=await UT(z,U,{filePath:Q,webhook:S(I.options.webhook)??S(I.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${J.corp.name} (${J.corp.id}) [${J.stateMode}]`),J.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${J.corp.tenant.name} (${J.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${J.authStatus==="ok"?"OK":`异常 (${J.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${J.activeWebhooks.length} 个可用`);for(let K of J.activeWebhooks){let G=K.isDefault?" [默认通道]":"";console.error(` - ${K.name} (${K.id}) mode=${K.mode}${G}`)}if(J.materialPack)console.error(`[webhook-ready] 材料包预检: ${J.materialPack.valid?`通过 (${J.materialPack.documentCount} 单)`:`失败 (${J.materialPack.errors?.join("; ")})`}`);if(J.ready)console.error(`\uD83D\uDFE2 ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${J.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${J.nextAction}`);console.log(JSON.stringify(J,null,2));return}if($==="replay"){let Q=Y??S(I.options.recordId)??S(I.options["record-id"])??S(I.options.id),J=S(I.options.recordIds)??S(I.options["record-ids"]),K=J?J.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=S(I.options.sn)??S(I.options.documentSn)??S(I.options["document-sn"]),H=S(I.options.sns)??S(I.options["document-sns"]),W=H?H.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(I.options.limit),Z=S(I.options.status),q=S(I.options.startDate)??S(I.options["start-date"]),V=S(I.options.endDate)??S(I.options["end-date"]);if(!Q&&!K&&!G&&!W&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=S(I.options.sourceCorp)??S(I.options["source-corp"])??S(I.options.prodCorp)??S(I.options["prod-corp"]),M=S(I.options.targetCorp)??S(I.options["target-corp"])??S(I.options.testCorp)??S(I.options["test-corp"]),w=V0(I.options.force)===!0,{sourceCorp:O,targetCorp:D}=pP({sourceCorpId:F,targetCorpId:M,activeCorp:U,force:w},E1),N=O.id===U.id?z:await j1(O),B=D.id===U.id?z:await j1(D),T=S(I.options.webhook)??S(I.options.selector),A=S(I.options.snSuffix)??S(I.options["sn-suffix"]),j=S(I.options.snPrefix)??S(I.options["sn-prefix"]),C=S(I.options.docIdSuffix)??S(I.options["doc-id-suffix"]),b=S(I.options.docIdPrefix)??S(I.options["doc-id-prefix"]),k=V0(I.options.dryRun)??V0(I.options["dry-run"]),i=await sJ({query:{recordId:Q,recordIds:K,sn:G,sns:W,limit:X,status:Z,startDate:q,endDate:V},sourceClient:N,targetClient:B,sourceCorp:O,targetCorp:D,webhookSelector:T,snPrefix:j,snSuffix:A,docIdPrefix:b,docIdSuffix:C Line truncated
`}function Mq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function c0($,U={}){WS1($,U);let Y=`${JSON.stringify($,null,2)}
`;if(U.outputFile){IS1(U.outputFile,Y),console.log(JSON.stringify({outputFile:U.outputFile,bytes:Buffer.byteLength(Y,"utf-8")},null,2));return}console.log(Y.trimEnd())}function WS1($,U={}){if(U.allowFull||U.outputFile)return;let Y=Buffer.byteLength(JSON.stringify($),"utf-8");if(Y>HS1)throw new nP(`Output is large (${Y} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function V_0($,U){if(U)return;let Y=$&&typeof $==="object"?$:{},z=typeof Y.count==="number"?Y.count:void 0,Q=Array.isArray(Y.rules)?Y.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),I=z??Q??0;if(I>KS1||J>GS1)throw new nP(`Rule list is large (${I} rules, ${J} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:V0($.full)===!0,outputFile:S($.outputFile)??S($["output-file"])}}function L_0($=[]){console.log(Z_0($))}var KS1=100,GS1=120000,q_0,HS1=200000;var J4=o(()=>{D4();L$();Tl();q_0=["code","status","strictness","scope","updatedAt"]});var F_0={};x8(F_0,{selectCorp:()=>E1,runToolResult:()=>o2,runTool:()=>k0,globalConfigSummary:()=>l2});function E1($){let U=s8(),Y=_4(),z=f2(U,{stateful:Y.stateful,defaultCorpId:Y.defaultCorpId,corpId:$},h3());return qA0(z.id),z}function l2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:Kz()}}async function k0($,U,Y,z,Q={}){c0(await o2($,U,Y,z),Q)}async function o2($,U,Y,z){let Q=Vq.find((K)=>K.name===$);if(!Q)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(z).filter(([,K])=>K!==void 0)),I=Q.handler;return I(U,J,{corp:Y})}var o4=o(()=>{S3();bP();Fq();J4()});import{existsSync as w_0}from"node:fs";async function O_0($,U){if(!w_0($))throw Error(`File not found: ${$}`);let Y=vz($);console.log(JSON.stringify(await _z(Y.fileBuffer,Y.fileName,U),null,2))}async function OT($,U,Y,z,Q){if($==="ready"||$==="status"){let J=U??S(Q.options.file)??S(Q.options.input),I=await zT(Y,z,{filePath:J,webhook:S(Q.options.webhook)??S(Q.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${I.corp.name} (${I.corp.id}) [${I.stateMode}]`),I.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${I.corp.tenant.name} (${I.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${I.authStatus==="ok"?"OK":`异常 (${I.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${I.activeWebhooks.length} 个可用`);for(let K of I.activeWebhooks){let G=K.isDefault?" [默认通道]":"";console.error(` - ${K.name} (${K.id}) mode=${K.mode}${G}`)}if(I.materialPack)console.error(`[webhook-ready] 材料包预检: ${I.materialPack.valid?`通过 (${I.materialPack.documentCount} 单)`:`失败 (${I.materialPack.errors?.join("; ")})`}`);if(I.ready)console.error(`\uD83D\uDFE2 ${I.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${I.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${I.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${I.nextAction}`);console.log(JSON.stringify(I,null,2));return}if($==="replay"){let J=U??S(Q.options.recordId)??S(Q.options["record-id"])??S(Q.options.id),I=S(Q.options.recordIds)??S(Q.options["record-ids"]),K=I?I.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=S(Q.options.sn)??S(Q.options.documentSn)??S(Q.options["document-sn"]),H=S(Q.options.sns)??S(Q.options["document-sns"]),W=H?H.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(Q.options.limit),Z=S(Q.options.status),q=S(Q.options.startDate)??S(Q.options["start-date"]),V=S(Q.options.endDate)??S(Q.options["end-date"]);if(!J&&!K&&!G&&!W&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=S(Q.options.sourceCorp)??S(Q.options["source-corp"])??S(Q.options.prodCorp)??S(Q.options["prod-corp"]),O=S(Q.options.targetCorp)??S(Q.options["target-corp"])??S(Q.options.testCorp)??S(Q.options["test-corp"]),w=V0(Q.options.force)===!0,{sourceCorp:M,targetCorp:N}=pP({sourceCorpId:F,targetCorpId:O,activeCorp:z,force:w},E1),D=M.id===z.id?Y:await j1(M),B=N.id===z.id?Y:await j1(N),T=S(Q.options.webhook)??S(Q.options.selector),A=S(Q.options.snSuffix)??S(Q.options["sn-suffix"]),j=S(Q.options.snPrefix)??S(Q.options["sn-prefix"]),C=S(Q.options.docIdSuffix)??S(Q.options["doc-id-suffix"]),b=S(Q.options.docIdPrefix)??S(Q.options["doc-id-prefix"]),x=V0(Q.options.dryRun)??V0(Q.options["dry-run"]),i=await sI({query:{recordId:J,recordIds:K,sn:G,sns:W,limit:X,status:Z,startDate:q,endDate:V},sourceClient:D,targetClient:B,sourceCorp:M,targetCorp:N,webhookSelector:T,snPrefix:j,snSuffix:A,docIdPrefix:b,docIdSuffix:C,dryRun:x});if(x) Line truncated
`+`\uD83D\uDC49 查看全部请添加: seal-use corps list --all
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}c0(w.map((O)=>({id:O.id,name:O.name,environment:O.environment??"production",sourceType:O.source.type,provider:O.source.provider??O.source.type,staffId:O.source.staffId,testCorpId:O.testCorpId,prodCorpId:O.prodCorpId,current:O.id===H})));return}if($==="get"||$==="show"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps get <corpId>");let I=E1(U),Q=Yp(I.id),J=fS1(I);c0({id:I.id,name:I.name,environment:I.environment??"production",configFile:Q,seal:{url:J,tenantSlug:I.seal.tenantSlug??I.source.tenantSlug,customHeaderNames:I.seal.headers?Object.keys(I.seal.headers):[],customCookieNames:I.seal.cookies?Object.keys(I.seal.cookies):[],endpoints:I.seal.endpoints},source:uS1(I.source),relations:{testCorpId:I.testCorpId,prodCorpId:I.prodCorpId},auth:{refreshTtl:I.auth.refreshTtl}});return}if($==="current"){let U=E1(S(z.options.corp));c0({id:U.id,name:U.name,environment:U.environment??"production",sourceType:U.source.type,provider:U.source.provider??U.source.type,staffId:U.source.staffId,testCorpId:U.testCorpId,prodCorpId:U.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let I=E1(U),Q=$==="mark-test"?"test":$==="mark-prod"?"production":S(z.options.env)??S(z.options.environment);if(Q!=="production"&&Q!=="test")throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw D9(`Refusing to change environment tag of enterprise '${I.name}' (${I.id}) to '${Q}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${I.id} --env ${Q} --confirm`);let K=x2(I.id,{environment:Q});c0({id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId,prodCorpId:K.prodCorpId});return}if($==="bind-test"){let U,I;if(Y&&z.command[3])U=Y,I=z.command[3];else if(Y){let X=S(z.options.corp),Z=S(z.options["test-corp"])??S(z.options.testCorp);if(X)U=X,I=Y;else if(Z)U=Y,I=Z}if(!U||!I)throw d4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let Q=E1(U),J=E1(I);if(Q.id===J.id)throw d4(`Cannot bind enterprise '${Q.id}' to itself.`);if(Q.prodCorpId&&Q.prodCorpId!==J.id)throw d4(`Cannot use '${Q.id}' as a production enterprise because it is already registered as a test enterprise for '${Q.prodCorpId}'. Multi-tier chaining is not permitted.`);if(J.testCorpId&&J.testCorpId!==Q.id)throw d4(`Cannot bind '${J.id}' as a test enterprise because it already has a bound test enterprise '${J.testCorpId}'. Multi-tier chaining is not permitted.`);let K=V0(z.options.force)===!0;if(Q.testCorpId&&Q.testCorpId!==J.id||J.prodCorpId&&J.prodCorpId!==Q.id){if(!K)throw D9(`Enterprise binding conflict: production enterprise '${Q.id}' is bound to '${Q.testCorpId??"none"}', and test enterprise '${J.id}' is bound to '${J.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${Q.id} ${J.id} --confirm --force`)}if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0)){let X=K?" --force":"";throw D9(`Refusing to bind test enterprise '${J.name}' (${J.id}) to production enterprise '${Q.name}' (${Q.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${J.id}' as a test environment.`,`seal-use corps bind-test ${Q.id} ${J.id} --confirm${X}`)}if(Q.testCorpId&&Q.testCorpId!==J.id)try{x2(Q.testCorpId,{prodCorpId:void 0})}catch{}if(J.prodCorpId&&J.prodCorpId!==Q.id)try{x2(J.prodCorpId,{testCorpId:void 0})}catch{}let H=x2(Q.id,{environment:"production",testCorpId:J.id}),W=x2(J.id,{environment:"test",prodCorpId:Q.id});c0({success:!0,productionEnterprise:{id:H.id,name:H.name,environment:H.environment,testCorpId:H.testCorpId},testEnterprise:{id:W.id,name:W.name,environment:W.environment,prodCorpId:W.prodCorpId}});return}if($==="unbind-test"){let U=Y??S(z.options.corp),I=E1(U);if(!I.testCorpId&&!I.prodCorpId){c0({unbound:!1,message:`Enterprise '${I.name}' (${I.id}) does not have an active test enterprise binding.`});return}let Q=I.testCorpId?I.id:I.prodCorpId,J=I.testCorpId?I.testCorpId:I.id;if(!(V0(z.options.confirm)===!0||V0(z.options.yes)===!0))throw D9(`Refusing to unbind production enterprise '${Q}' and test enterprise '${J}' without --confirm.`,`seal-use corps unbind-test ${I.id} --confirm`);x2(Q,{testCorpId:void 0});try{x2(J,{prodCorpId:void 0})}catch{}c0({success:!0,unboundProduction:Q,unboundTest:J});return}if($==="sync-test"){let U=Y??S(z.options.corp),I=E1(U);if(!I.testCorpId)throw d4(`Production enterprise '${I.name}' (${I.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${I.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let Q=E1(I.testCorpId);if(Q.environment!=="test")throw Error(`Target enterprise '${Q.name}' (${Q.id}) is marked as '${Q.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let J=await j1(I),K=await j1(Q),[G,H,W,X,Z,q,V,F]=await Promise.all([o1(J,I.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(K,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),p6(J),p6(K),B$(J).catch(()=>[]),B$(K).catch(()=>[]),_7(J,{limit:100}).catch(()=>({articles:[]})),_7(K,{limit:100}).catch(()=>({articles:[]}))]),M=(V.articles||[]).filter((G0)=>!G0.isDeleted),w=(F.articles||[]).filter((G0)=>!G0.isDeleted),O=new Map(w.map((G0)=>[G0.title.trim(),G0])),D=[],N=[],B=new Set(M.map((G0)=>G0.title.trim()));for(let G0 of M){let T0=G0.title.trim(),b0=O.get(T0);if(!b0)D.push(G0);else{let Y1=b0.content!==G0.content,a=(b0.purpose??"")!==(G0.purpose??""),W0=b0.enabled!==G0.enabled,F0=b0.contentType!==G0.contentType,f0=(b0.status??"")!==(G0.status??""),u0=JSON.stringify([...b0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),i0=JSON.stringify([...b0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(Y1||a||W0||F0||f0||u0||i0)N.push({testId:b0.id,prodDoc:G0,reasons:[...Y1?["content"]:[],...a?["purpose"]:[],...W0?["enabled"]:[],...F0?["contentType"]:[],...f0?["status"]:[],...u0?["scenarios"]:[],...i0?["tags"]:[]]})}}let T=w.filter((G0)=>!B.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,k=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,h=pv0(I.name,C,q),c=S(z.options["version-name"])??S(z.options.versionName)??dv0(I.name,C,h,k),U0={...H,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(V0(z.options["dry-run"])===!0||V0(z.options.dryRun)===!0){c0({dryRun:!0,source:{id:I.id,name:I.name,environment:I.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:M.length},target:{id:Q.id,name:Q.name,environment:Q.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:k,targetTestPublishVersionName:c,iteration:h},preferencesDiff:{decisionPreferences:{before:H.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:H.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:W.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:W.rules.length,rulesToSync:W.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:M.length,targetExistingDocumentCount:w.length,toCreateCount:D.length,toCreate:D.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:N.length,toUpdate:N.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:Q.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(I.source.type!=="hose")return{sourceType:I.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((Y1)=>Y1.type==="hosecloud"),T0=new Set,b0=G0.filter((Y1)=>{let a=Y1.corporationId??I.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:av0(I.name),targetMode:"assisted",integrationsCount:b0.length,integrations:b0.map((Y1)=>({corporationId:Y1.corporationId,apiOrigin:Y1.apiOrigin,customApiUrl:Y1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(V0(z.options.yes)===!0||V0(z.options.confirm)===!0))throw D9(`Refusing to overwrite test enterprise '${Q.name}' (${Q.id}) with preferences, ${W.rules.length} draft rules, and ${M.length} knowledge documents from production enterprise '${I.name}' (${I.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${I.id} --yes`);await m5(K,U0,Q.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await VM(K,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of N)await qM(K,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled, Line truncated
Run 'seal-use corps bind-test ${I.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association,
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);J=I}else if(J=E1(I.testCorpId),J.environment!=="test"&&!Q)throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let K=S(z.options.recordId)??S(z.options["record-id"])??S(z.options.id),G=S(z.options.recordIds)??S(z.options["record-ids"]),H=G?G.split(",").map((k)=>k.trim()).filter(Boolean):void 0,W=S(z.options.sn)??S(z.options.documentSn)??S(z.options["document-sn"]),X=S(z.options.sns)??S(z.options["document-sns"]),Z=X?X.split(",").map((k)=>k.trim()).filter(Boolean):void 0,q=s0(z.options.limit)??(!K&&!H&&!W&&!Z?1:void 0),V=S(z.options.status),F=S(z.options.startDate)??S(z.options["start-date"]),M=S(z.options.endDate)??S(z.options["end-date"]),w=await j1(I),O=I.id===J.id?w:await j1(J),D=S(z.options.webhook)??S(z.options.selector),N=S(z.options.snSuffix)??S(z.options["sn-suffix"]),B=S(z.options.snPrefix)??S(z.options["sn-prefix"]),T=S(z.options.docIdSuffix)??S(z.options["doc-id-suffix"]),A=S(z.options.docIdPrefix)??S(z.options["doc-id-prefix"]),j=V0(z.options.dryRun)??V0(z.options["dry-run"]),C={recordId:K,recordIds:H,sn:W,sns:Z,limit:q,status:V,startDate:F,endDate:M};console.error(`[corps-replay-test] 正式企业「${I.name}」(${I.id}) -> 测试企业「${J.name}」(${J.id})`);let b=await sJ({query:C,sourceClient:w,targetClient:O,sourceCorp:I,targetCorp:J,webhookSelector:D,snPrefix:B,snSuffix:N,docIdPrefix:A,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${I.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${J.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${I.name}」)至「${J.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${J.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${J.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let U=Y;if(!U)throw Error("Usage: seal-use corps switch <corpId>");let I=_4();if(!I.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let Q=E1(U);GU({...I,stateful:!0,defaultCorpId:Q.id}),c0({current:!0,id:Q.id,name:Q.name});return}if($==="probe-hose"){await iS1(y8(z.json));return}if($==="hose-staffs"){await cS1(y8(z.json));return}if($==="add-hose"){await il(y8(z.json));return}if($==="add-seal"){await nS1(y8(z.json));return}if($==="add-link"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(V0(z.options["as-hose"])===!0||V0(z.options.hose)===!0){await dS1(U,S(z.options.name),V0(z.options.overwrite)===!0,V0(z.options.force)===!0,{appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await pS1(U,S(z.options.name),V0(z.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]");let I=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0,Q=V0(z.options.save)===!0||V0(z.options.add)===!0;await CT(U,{reveal:I,save:Q,name:S(z.options.name),overwrite:V0(z.options.overwrite)===!0,force:V0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}if($==="keys"){let U=Y??S(z.options.link)??S(z.options.url)??S(z.options.corp),I=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0;if(U&&(U.startsWith("http://")||U.startsWith("https://"))){let Q=V0(z.options.save)===!0||V0(z.options.add)===!0;await CT(U,{reveal:I,save:Q,name:S(z.options.name),overwrite:V0(z.options.overwrite)===!0,force:V0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await cl(U,{reveal:I});return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function av0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function bS1($,Y,z,U){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud creden Line truncated
- `);throw Error(`Missing required parameter: staffId. Found ${C.length} candidate administrators:
- ${b}
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!F)if(!W&&Q)F=Q;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let M=X4($,"id")??Z,w=q??Z,O=X4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,D={id:M,name:w,environment:"production",seal:{url:O,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:z,appSecurity:U,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(W)aw(M),await yK(D);let N=$p();lv0(N,{recursive:!0,mode:448});let B=rv0(N,`${VT(M)}.json`);if(mv0(B)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${B}. Pass "overwrite": true to replace it.`);ov0(B,`${JSON.stringify(D,null,2)}
`,{mode:384}),c0({id:M,name:w,corpId:Z,domain:X,staffId:F,verified:W,path:B})}async function nS1($){let Y=p3($,"token"),z=(X4($,"sealUrl")??X4($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let U=Nl($,"expiresIn")??2592000,I=$.force===!0||$.verify===!1?!1:!0,Q=tv0($),J=I?await mS1(z,Y,A6(Q)):void 0;$h0($,{token:Y,sealUrl:z,expiresIn:U,verify:I,remote:J,custom:Q})}function tv0($){return{headers:rn.parse($.headers),cookies:sn.parse($.cookies)}}async function pS1($,Y,z){let U=await tw($),I=T8(U.sealUrl,U.token),Q=await W8(I),J={user:Q.user,tenant:Q.tenant};ew(U.corpId,J.tenant),$h0({id:U.corpId,corpId:U.corpId,name:Y,provider:"hosecloud",overwrite:z},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:J})}function ev0($,Y,z,U){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${Y}] 的 OpenAPI 密钥凭据。
`+"\uD83D\uDCA1 说明:此能力专属于合思 (Hose) 子域,用于将临时会话提权为标准 OpenAPI 开发者接入。需要企业管理员已在合思开放平台创建应用并生成 appKey/appSecurity。");if(z.keyId||z.appKey){let I=$.find((Q)=>z.keyId&&Q.id===z.keyId||z.appKey&&Q.appKey===z.appKey);if(!I){console.error(`
❌ 未找到指定的合思 OpenAPI 密钥 (${z.appKey??z.keyId})。`),console.error(`ℹ️ 该合思企业当前存在以下 ${$.length} 套候选密钥:`);for(let Q of $){let J=Q.active?"\uD83D\uDFE2 启用":"⚪ 停用";console.error(` • "${Q.name||"未命名应用"}" (appKey: ${Q.appKey}, keyId: ${Q.id}, 状态: ${J})`)}throw new w4("指定的合思密钥不存在,请从上述候选列表中选择正确的 appKey 或 keyId。",2,`${U} --app-key ${$[0].appKey}`)}return I}if($.length===1)return $[0];console.error(`
ℹ️ [合思子域提权] 合思企业 [${Y}] 存在多套 (${$.length} 套) OpenAPI 应用密钥凭据:`);for(let I=0;I<$.length;I++){let Q=$[I],J=Q.active?"\uD83D\uDFE2 启用":"⚪ 停用",K=Q.name||"未命名应用";console.error(` [${I+1}] "${K}" (appKey: ${Q.appKey}, keyId: ${Q.id}, 状态: ${J})`)}throw console.error(`
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}c0(w.map((M)=>({id:M.id,name:M.name,environment:M.environment??"production",sourceType:M.source.type,provider:M.source.provider??M.source.type,staffId:M.source.staffId,testCorpId:M.testCorpId,prodCorpId:M.prodCorpId,current:M.id===H})));return}if($==="get"||$==="show"){let z=U??S(Y.options.corp);if(!z)throw d4("Usage: seal-use corps get <corpId>");let Q=E1(z),J=Up(Q.id),I=fS1(Q);c0({id:Q.id,name:Q.name,environment:Q.environment??"production",configFile:J,seal:{url:I,tenantSlug:Q.seal.tenantSlug??Q.source.tenantSlug,customHeaderNames:Q.seal.headers?Object.keys(Q.seal.headers):[],customCookieNames:Q.seal.cookies?Object.keys(Q.seal.cookies):[],endpoints:Q.seal.endpoints},source:uS1(Q.source),relations:{testCorpId:Q.testCorpId,prodCorpId:Q.prodCorpId},auth:{refreshTtl:Q.auth.refreshTtl}});return}if($==="current"){let z=E1(S(Y.options.corp));c0({id:z.id,name:z.name,environment:z.environment??"production",sourceType:z.source.type,provider:z.source.provider??z.source.type,staffId:z.source.staffId,testCorpId:z.testCorpId,prodCorpId:z.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let z=U??S(Y.options.corp);if(!z)throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let Q=E1(z),J=$==="mark-test"?"test":$==="mark-prod"?"production":S(Y.options.env)??S(Y.options.environment);if(J!=="production"&&J!=="test")throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(V0(Y.options.confirm)===!0||V0(Y.options.yes)===!0))throw D9(`Refusing to change environment tag of enterprise '${Q.name}' (${Q.id}) to '${J}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${Q.id} --env ${J} --confirm`);let K=x2(Q.id,{environment:J});c0({id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId,prodCorpId:K.prodCorpId});return}if($==="bind-test"){let z,Q;if(U&&Y.command[3])z=U,Q=Y.command[3];else if(U){let X=S(Y.options.corp),Z=S(Y.options["test-corp"])??S(Y.options.testCorp);if(X)z=X,Q=U;else if(Z)z=U,Q=Z}if(!z||!Q)throw d4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let J=E1(z),I=E1(Q);if(J.id===I.id)throw d4(`Cannot bind enterprise '${J.id}' to itself.`);if(J.prodCorpId&&J.prodCorpId!==I.id)throw d4(`Cannot use '${J.id}' as a production enterprise because it is already registered as a test enterprise for '${J.prodCorpId}'. Multi-tier chaining is not permitted.`);if(I.testCorpId&&I.testCorpId!==J.id)throw d4(`Cannot bind '${I.id}' as a test enterprise because it already has a bound test enterprise '${I.testCorpId}'. Multi-tier chaining is not permitted.`);let K=V0(Y.options.force)===!0;if(J.testCorpId&&J.testCorpId!==I.id||I.prodCorpId&&I.prodCorpId!==J.id){if(!K)throw D9(`Enterprise binding conflict: production enterprise '${J.id}' is bound to '${J.testCorpId??"none"}', and test enterprise '${I.id}' is bound to '${I.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${J.id} ${I.id} --confirm --force`)}if(!(V0(Y.options.confirm)===!0||V0(Y.options.yes)===!0)){let X=K?" --force":"";throw D9(`Refusing to bind test enterprise '${I.name}' (${I.id}) to production enterprise '${J.name}' (${J.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${I.id}' as a test environment.`,`seal-use corps bind-test ${J.id} ${I.id} --confirm${X}`)}if(J.testCorpId&&J.testCorpId!==I.id)try{x2(J.testCorpId,{prodCorpId:void 0})}catch{}if(I.prodCorpId&&I.prodCorpId!==J.id)try{x2(I.prodCorpId,{testCorpId:void 0})}catch{}let H=x2(J.id,{environment:"production",testCorpId:I.id}),W=x2(I.id,{environment:"test",prodCorpId:J.id});c0({success:!0,productionEnterprise:{id:H.id,name:H.name,environment:H.environment,testCorpId:H.testCorpId},testEnterprise:{id:W.id,name:W.name,environment:W.environment,prodCorpId:W.prodCorpId}});return}if($==="unbind-test"){let z=U??S(Y.options.corp),Q=E1(z);if(!Q.testCorpId&&!Q.prodCorpId){c0({unbound:!1,message:`Enterprise '${Q.name}' (${Q.id}) does not have an active test enterprise binding.`});return}let J=Q.testCorpId?Q.id:Q.prodCorpId,I=Q.testCorpId?Q.testCorpId:Q.id;if(!(V0(Y.options.confirm)===!0||V0(Y.options.yes)===!0))throw D9(`Refusing to unbind production enterprise '${J}' and test enterprise '${I}' without --confirm.`,`seal-use corps unbind-test ${Q.id} --confirm`);x2(J,{testCorpId:void 0});try{x2(I,{prodCorpId:void 0})}catch{}c0({success:!0,unboundProduction:J,unboundTest:I});return}if($==="sync-test"){let z=U??S(Y.options.corp),Q=E1(z);if(!Q.testCorpId)throw d4(`Production enterprise '${Q.name}' (${Q.id}) has no bound test enterprise.
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let J=E1(Q.testCorpId);if(J.environment!=="test")throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let I=await j1(Q),K=await j1(J),[G,H,W,X,Z,q,V,F]=await Promise.all([o1(I,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(K,J.seal.endpoints.approvalStylePreferences).catch(()=>({})),p6(I),p6(K),B$(I).catch(()=>[]),B$(K).catch(()=>[]),_7(I,{limit:100}).catch(()=>({articles:[]})),_7(K,{limit:100}).catch(()=>({articles:[]}))]),O=(V.articles||[]).filter((G0)=>!G0.isDeleted),w=(F.articles||[]).filter((G0)=>!G0.isDeleted),M=new Map(w.map((G0)=>[G0.title.trim(),G0])),N=[],D=[],B=new Set(O.map((G0)=>G0.title.trim()));for(let G0 of O){let T0=G0.title.trim(),b0=M.get(T0);if(!b0)N.push(G0);else{let U1=b0.content!==G0.content,a=(b0.purpose??"")!==(G0.purpose??""),W0=b0.enabled!==G0.enabled,F0=b0.contentType!==G0.contentType,f0=(b0.status??"")!==(G0.status??""),u0=JSON.stringify([...b0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),i0=JSON.stringify([...b0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(U1||a||W0||F0||f0||u0||i0)D.push({testId:b0.id,prodDoc:G0,reasons:[...U1?["content"]:[],...a?["purpose"]:[],...W0?["enabled"]:[],...F0?["contentType"]:[],...f0?["status"]:[],...u0?["scenarios"]:[],...i0?["tags"]:[]]})}}let T=w.filter((G0)=>!B.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,x=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,h=pv0(Q.name,C,q),c=S(Y.options["version-name"])??S(Y.options.versionName)??dv0(Q.name,C,h,x),z0={...H,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(V0(Y.options["dry-run"])===!0||V0(Y.options.dryRun)===!0){c0({dryRun:!0,source:{id:Q.id,name:Q.name,environment:Q.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:O.length},target:{id:J.id,name:J.name,environment:J.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:x,targetTestPublishVersionName:c,iteration:h},preferencesDiff:{decisionPreferences:{before:H.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:H.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:W.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:W.rules.length,rulesToSync:W.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:O.length,targetExistingDocumentCount:w.length,toCreateCount:N.length,toCreate:N.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:D.length,toUpdate:D.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:J.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(Q.source.type!=="hose")return{sourceType:Q.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((U1)=>U1.type==="hosecloud"),T0=new Set,b0=G0.filter((U1)=>{let a=U1.corporationId??Q.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:av0(Q.name),targetMode:"assisted",integrationsCount:b0.length,integrations:b0.map((U1)=>({corporationId:U1.corporationId,apiOrigin:U1.apiOrigin,customApiUrl:U1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(V0(Y.options.yes)===!0||V0(Y.options.confirm)===!0))throw D9(`Refusing to overwrite test enterprise '${J.name}' (${J.id}) with preferences, ${W.rules.length} draft rules, and ${O.length} knowledge documents from production enterprise '${Q.name}' (${Q.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${Q.id} --yes`);await m5(K,z0,J.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await VO(K,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of D)await qO(K,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled, Line truncated
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association,
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);I=Q}else if(I=E1(Q.testCorpId),I.environment!=="test"&&!J)throw Error(`Target enterprise '${I.name}' (${I.id}) is marked as '${I.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let K=S(Y.options.recordId)??S(Y.options["record-id"])??S(Y.options.id),G=S(Y.options.recordIds)??S(Y.options["record-ids"]),H=G?G.split(",").map((x)=>x.trim()).filter(Boolean):void 0,W=S(Y.options.sn)??S(Y.options.documentSn)??S(Y.options["document-sn"]),X=S(Y.options.sns)??S(Y.options["document-sns"]),Z=X?X.split(",").map((x)=>x.trim()).filter(Boolean):void 0,q=s0(Y.options.limit)??(!K&&!H&&!W&&!Z?1:void 0),V=S(Y.options.status),F=S(Y.options.startDate)??S(Y.options["start-date"]),O=S(Y.options.endDate)??S(Y.options["end-date"]),w=await j1(Q),M=Q.id===I.id?w:await j1(I),N=S(Y.options.webhook)??S(Y.options.selector),D=S(Y.options.snSuffix)??S(Y.options["sn-suffix"]),B=S(Y.options.snPrefix)??S(Y.options["sn-prefix"]),T=S(Y.options.docIdSuffix)??S(Y.options["doc-id-suffix"]),A=S(Y.options.docIdPrefix)??S(Y.options["doc-id-prefix"]),j=V0(Y.options.dryRun)??V0(Y.options["dry-run"]),C={recordId:K,recordIds:H,sn:W,sns:Z,limit:q,status:V,startDate:F,endDate:O};console.error(`[corps-replay-test] 正式企业「${Q.name}」(${Q.id}) -> 测试企业「${I.name}」(${I.id})`);let b=await sI({query:C,sourceClient:w,targetClient:M,sourceCorp:Q,targetCorp:I,webhookSelector:N,snPrefix:B,snSuffix:D,docIdPrefix:A,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${Q.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${I.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${Q.name}」)至「${I.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${I.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${I.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let z=U;if(!z)throw Error("Usage: seal-use corps switch <corpId>");let Q=_4();if(!Q.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let J=E1(z);Gz({...Q,stateful:!0,defaultCorpId:J.id}),c0({current:!0,id:J.id,name:J.name});return}if($==="probe-hose"){await cS1(y8(Y.json));return}if($==="hose-staffs"){await nS1(y8(Y.json));return}if($==="add-hose"){await il(y8(Y.json));return}if($==="add-seal"){await pS1(y8(Y.json));return}if($==="add-link"){let z=U??S(Y.options.link)??S(Y.options.url);if(!z)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(V0(Y.options["as-hose"])===!0||V0(Y.options.hose)===!0){await mS1(z,S(Y.options.name),V0(Y.options.overwrite)===!0,V0(Y.options.force)===!0,{appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)});return}await dS1(z,S(Y.options.name),V0(Y.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let z=U??S(Y.options.link)??S(Y.options.url);if(!z)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]");let Q=V0(Y.options.reveal)===!0||V0(Y.options.r)===!0||V0(Y.options.plain)===!0,J=V0(Y.options.save)===!0||V0(Y.options.add)===!0;await CT(z,{reveal:Q,save:J,name:S(Y.options.name),overwrite:V0(Y.options.overwrite)===!0,force:V0(Y.options.force)===!0,appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)});return}if($==="keys"){let z=U??S(Y.options.link)??S(Y.options.url)??S(Y.options.corp),Q=V0(Y.options.reveal)===!0||V0(Y.options.r)===!0||V0(Y.options.plain)===!0;if(z&&(z.startsWith("http://")||z.startsWith("https://"))){let J=V0(Y.options.save)===!0||V0(Y.options.add)===!0;await CT(z,{reveal:Q,save:J,name:S(Y.options.name),overwrite:V0(Y.options.overwrite)===!0,force:V0(Y.options.force)===!0,appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)});return}await cl(z,{reveal:Q});return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function bS1($){if(!$)return"未绑定手机";let U=$.trim();if(U.length===11)return`${U.slice(0,3)}****${U.slice(7)}`;if(U.length>=7)return`${U.slice(0,3)}****${U.slice(-4)}`;if(U.leng Line truncated
`);throw Error(`Missing required parameter: staffId. 当前企业共配置了 ${C.length} 位管理员账号(手机号已脱敏):
`+`${b}
`+`\uD83D\uDC49 请指定要作为审计身份绑定的管理员:
`+` • 按姓名选择:追加 --staffName <姓名>(支持关键字,如: --staffName 谢子豪)
`+` • 按手机选择:追加 --staffPhone <手机号>(支持手机后4位,如: --staffPhone 5678)
`+" • 或传 force:true / --force 自动使用默认首位管理员。")}}}if(!F)if(!W&&J)F=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let O=X4($,"id")??Z,w=U??q??Z,M=X4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,N={id:O,name:w,environment:"production",seal:{url:M,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:Y,appSecurity:z,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(W){aw(O);let T=await yK(N);if((!U||U===Z)&&T.tenantName&&T.tenantName!==Z)w=T.tenantName,N.name=T.tenantName}let D=$p();lv0(D,{recursive:!0,mode:448});let B=rv0(D,`${VT(O)}.json`);if(mv0(B)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${B}. Pass "overwrite": true to replace it.`);ov0(B,`${JSON.stringify(N,null,2)}
`,{mode:384}),c0({id:O,name:w,corpId:Z,domain:X,staffId:F,verified:W,path:B})}async function pS1($){let U=p3($,"token"),Y=(X4($,"sealUrl")??X4($,"url")??"").replace(/\/+$/,"");if(!Y)throw Error("Missing required JSON field: sealUrl");let z=Nl($,"expiresIn")??2592000,Q=$.force===!0||$.verify===!1?!1:!0,J=tv0($),I=Q?await lS1(Y,U,A6(J)):void 0;$h0($,{token:U,sealUrl:Y,expiresIn:z,verify:Q,remote:I,custom:J})}function tv0($){return{headers:rn.parse($.headers),cookies:sn.parse($.cookies)}}async function dS1($,U,Y){let z=await tw($),Q=T8(z.sealUrl,z.token),J=await W8(Q),I={user:J.user,tenant:J.tenant};ew(z.corpId,I.tenant),$h0({id:z.corpId,corpId:z.corpId,name:U,provider:"hosecloud",overwrite:Y},{token:z.token,sealUrl:z.sealUrl,expiresIn:z.expiresIn,verify:!0,remote:I})}function ev0($,U,Y,z){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${U}] 的 OpenAPI 密钥凭据。
`+"\uD83D\uDCA1 说明:此能力专属于合思 (Hose) 子域,用于将临时会话提权为标准 OpenAPI 开发者接入。需要企业管理员已在合思开放平台创建应用并生成 appKey/appSecurity。");if(Y.keyId||Y.appKey){let Q=$.find((J)=>Y.keyId&&J.id===Y.keyId||Y.appKey&&J.appKey===Y.appKey);if(!Q){console.error(`
❌ 未找到指定的合思 OpenAPI 密钥 (${Y.appKey??Y.keyId})。`),console.error(`ℹ️ 该合思企业当前存在以下 ${$.length} 套候选密钥:`);for(let J of $){let I=J.active?"\uD83D\uDFE2 启用":"⚪ 停用";console.error(` • "${J.name||"未命名应用"}" (appKey: ${J.appKey}, keyId: ${J.id}, 状态: ${I})`)}throw new w4("指定的合思密钥不存在,请从上述候选列表中选择正确的 appKey 或 keyId。",2,`${z} --app-key ${$[0].appKey}`)}return Q}if($.length===1)return $[0];console.error(`
ℹ️ [合思子域提权] 合思企业 [${U}] 存在多套 (${$.length} 套) OpenAPI 应用密钥凭据:`);for(let Q=0;Q<$.length;Q++){let J=$[Q],I=J.active?"\uD83D\uDFE2 启用":"⚪ 停用",K=J.name||"未命名应用";console.error(` [${Q+1}] "${K}" (appKey: ${J.appKey}, keyId: ${J.id}, 状态: ${I})`)}throw console.error(`
\uD83D\uDC49 为确保权限提权绑定正确的业务应用,请显式指定要使用的密钥套件:`),console.error(` 在命令后追加 --app-key <key> 或 --key-id <id> 参数。
`),new w4(`合思企业 [${Y}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${U} --app-key ${$[0].appKey}`)}async function dS1($,Y,z,U=!1,I){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let Q=await gS($),J=ev0(Q.keys,Q.corpId,I??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${J.appKey}, 应用: "${J.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await il({domain:Q.baseUrl,appKey:J.appKey,appSecurity:J.appSecurity,corpId:Q.corpId,name:Y??Q.corpName??Q.corpId,staffId:Q.staffId,overwrite:z,force:U})}async function CT($,Y){let z=await gS($),U=Y.reveal===!0;if(Y.save){let I=ev0(z.keys,z.corpId,{appKey:Y.appKey,keyId:Y.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${I.appKey}, 应用: "${I.name||"未命名应用"}") 保存为标准合思企业配置...`),await il({domain:z.baseUrl,appKey:I.appKey,appSecurity:I.appSecurity,corpId:z.corpId,name:Y.name??z.corpName??z.corpId,staffId:z.staffId,overwrite:Y.overwrite,force:Y.force});return}if(!U)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
`),new w4(`合思企业 [${U}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${z} --app-key ${$[0].appKey}`)}async function mS1($,U,Y,z=!1,Q){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let J=await gS($),I=ev0(J.keys,J.corpId,Q??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${I.appKey}, 应用: "${I.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await il({domain:J.baseUrl,appKey:I.appKey,appSecurity:I.appSecurity,corpId:J.corpId,name:U??J.corpName,staffId:J.staffId,overwrite:Y,force:z})}async function CT($,U){let Y=await gS($),z=U.reveal===!0;if(U.save){let Q=ev0(Y.keys,Y.corpId,{appKey:U.appKey,keyId:U.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${Q.appKey}, 应用: "${Q.name||"未命名应用"}") 保存为标准合思企业配置...`),await il({domain:Y.baseUrl,appKey:Q.appKey,appSecurity:Q.appSecurity,corpId:Y.corpId,name:U.name??Y.corpName,staffId:Y.staffId,overwrite:U.overwrite,force:U.force});return}if(!z)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
`);else console.error(`⚠️ [合思子域提权] 正在以明文展示合思 (Hose) appSecurity 接入密码,请妥善保管敏感凭据。
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.corpId,corpName:z.corpName??z.corpId,baseUrl:z.baseUrl,staffId:z.staffId,keyCount:z.keys.length,keys:z.keys.map((I)=>({id:I.id,name:I.name||"-",appKey:I.appKey,appSecurity:U?I.appSecurity:SS(I.appSecurity),active:I.active,createTime:I.createTime,updateTime:I.updateTime}))})}async function cl($,Y){let z=E1($),U=Y.reveal===!0;if(z.source.type!=="hose")throw new w4(`【合思子域专享能力】当前企业「${z.name}」(id: ${z.id}) 为原生 Seal (${z.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。
`+"OpenAPI 密钥查询与提权能力专属于合思生态租户(用于从合思协助链接或合思凭据中提取开发者密钥提升权限等级),非合思渠道企业不支持此能力。",2);let I=z.source.appKey??z.source.key,Q=z.source.appSecurity??z.source.password;if(!U)console.error(`\uD83D\uDCA1 [合思子域] 接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文。
`);c0({provider:"hose",capability:"privilege-elevation",corpId:Y.corpId,corpName:Y.corpName??Y.corpId,baseUrl:Y.baseUrl,staffId:Y.staffId,keyCount:Y.keys.length,keys:Y.keys.map((Q)=>({id:Q.id,name:Q.name||"-",appKey:Q.appKey,appSecurity:z?Q.appSecurity:SS(Q.appSecurity),active:Q.active,createTime:Q.createTime,updateTime:Q.updateTime}))})}async function cl($,U){let Y=E1($),z=U.reveal===!0;if(Y.source.type!=="hose")throw new w4(`【合思子域专享能力】当前企业「${Y.name}」(id: ${Y.id}) 为原生 Seal (${Y.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。
`+"OpenAPI 密钥查询与提权能力专属于合思生态租户(用于从合思协助链接或合思凭据中提取开发者密钥提升权限等级),非合思渠道企业不支持此能力。",2);let Q=Y.source.appKey??Y.source.key,J=Y.source.appSecurity??Y.source.password;if(!z)console.error(`\uD83D\uDCA1 [合思子域] 接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文。
`);else console.error(`⚠️ [合思子域] 正在以明文展示合思 appSecurity 接入密码,请妥善保管敏感凭据。
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.id,corpName:z.name,domain:z.source.domain,staffId:z.source.staffId,appKey:I??"-",appSecurity:Q?U?Q:SS(Q):"-",active:!0})}function $h0($,Y){let{token:z,sealUrl:U,expiresIn:I,verify:Q,remote:J}=Y,K=Y.custom??tv0($),G=J?.user,H=J?.tenant,W=X4($,"tenantSlug")??s2(H?.tenantSlug),X=X4($,"tenantId")??s2(H?.id),Z=X4($,"tenantName")??s2(H?.name),q=X4($,"id")??W??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=X4($,"staffId")??s2(G?.providerUserId)??s2(G?.id)??"seal",F=X4($,"provider")??s2(G?.provider)??s2(H?.providerConfig?.provider),M=X4($,"corpId")??W??X??q,w={id:q,name:X4($,"name")??Z??q,environment:"production",seal:{url:U,tenantSlug:W,headers:K.headers,cookies:K.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:U,expiresIn:I,staffId:V,corpId:M,tenantId:X,tenantSlug:W,tenantName:Z,providerUserId:s2(G?.providerUserId),provider:F},auth:{refreshTtl:300}},O=$p();lv0(O,{recursive:!0,mode:448});let D=rv0(O,`${VT(q)}.json`);if(mv0(D)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${D}. Pass "overwrite": true to replace it.`);ov0(D,`${JSON.stringify(w,null,2)}
`,{mode:384}),c0({id:q,name:w.name,tenantId:X,tenantSlug:W,verified:Q,path:D})}async function mS1($,Y,z={}){let U=T8($,Y,z),I=await W8(U);return{user:I.user??{},tenant:I.tenant??{}}}function s2($){return typeof $==="string"&&$?$:void 0}var nl=o(()=>{a9();BH();i8();S3();fv0();bP();tn();X6();X6();ul();SZ();ET();o4();L$();D4();Q4()});async function zh0($,Y){let z=$??S(Y.options.link)??S(Y.options.url);if(!z)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let U=V0(Y.options.reveal)===!0||V0(Y.options.r)===!0||V0(Y.options.plain)===!0,I=V0(Y.options.save)===!0||V0(Y.options.add)===!0;await CT(z,{reveal:U,save:I,name:S(Y.options.name),overwrite:V0(Y.options.overwrite)===!0,force:V0(Y.options.force)===!0,appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)})}async function Uh0($,Y,z){if($==="diagnose"){c0(await lS1(Y));return}if($==="hose-link"){let U=z.options.expire,I=U!==void 0?s0(U):7200;if(I===void 0||I<=0)throw Error(`Invalid --expire: ${String(U)}. Must be a positive number of seconds (e.g. --expire 7200 or --expire 86400).`);let Q=V0(z.options.force)===!0||V0(z.options.refresh)===!0||V0(z.options.f)===!0;c0(await P00(Y,I,{force:Q}));return}if($==="keys"){let U=V0(z.options.reveal)===!0||V0(z.options.r)===!0||V0(z.options.plain)===!0;await cl(Y.id,{reveal:U});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function lS1($){if($.source.type!=="hose"){let F=await j1($),M=await W8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:M.user,tenant:M.tenant}]}}aw($.id);let Y=$.source,z=Y.appKey??Y.key,U=Y.appSecurity??Y.password,I=($.seal.url??Y.sealUrl??`https://${Y.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),Q=Y.staffId.includes(":")?Y.staffId:`${Y.corpId}:${Y.staffId}`,J=[];if(!z||!U)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let K=await RT("hose.openapi",async()=>{let F=await Yh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:z,appSecurity:U}),M=d3(F.value),w=b6(M.accessToken)??b6(F.accessToken)??b6(F.token);if(!w)throw Error("Hose login did not return an access token");return{token:w,public:{corporationId:b6(M.corporationId)??b6(d3(M.corporation).id),expireTime:Bq(M.expireTime)}}});J.push(K.public);let G=K.private?.token,H=G?await RT("hose.provisional",async()=>{let F=await Yh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:Q,pageType:"home",expireDate:7200}),M=b6(d3(F.value).message);if(!M)throw Error("Hose CloseAPI did not return a provisional auth URL");let w=new URL(M).searchParams.get("accessToken");if(!w)throw Error("Hose provisional auth URL did not include accessToken");return{token:w,public:{uid:Q,enterpriseUrl:Oq(M)}}}):pl("hose.provisional");J.push(H.public);let W=A6($.seal),X=H.private?.token,Z=X?await RT("seal.sso",async()=>{let M=await T8(I,void 0,W).get(`api/auth/oauth2/session/oem-hosecloud?token=${encodeURIComponent(X)}&returnToken=1`).json(),w=d3(M.data),O=b6(M.token)??b6(M.accessToken)??b6(w.token)??b6(w.accessToken);if(!O)throw Error("Seal SSO did not return a bearer token");return{token:O,public:{sealUrl:I,expiresIn:Bq(M.expiresIn)??Bq(M.expires_in)??Bq(w.expiresIn)??Bq(w.expires_in)}}}):pl("seal.sso");J.push(Z.public);let q=Z.private?.token,V=q?await RT("seal.whoami",async()=>{let M=await T8(I,q,W).get("api/v1/auth/me").json(),w=d3(M.data),O=d3(w.user??M.user),D=d3(w.tenant??M.tenant);return{public:{user:{id:b6(O.id),name:b6(O.name),isAdmin:rS1(O.isAdmin),providerUserId:b6(O.providerUserId)},tenant:{id:b6(D.id),name:b6(D.name),tenantSlug:b6(D.tenantSlug),hoseCorpConfig:sS1(D.hoseCorpConfig)}}}}):pl("seal.whoami");return J.push(V.public),{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:J.every((F)=>F.ok===!0),stages:J}}async function RT($,Y){try{let z=await Y();return{public:{name:$,ok:!0,...Ih0(z.public)},private:z.token?{token:z.token}:void 0}}catch(z){return{public:{name:$,ok:!1,error:Oq(z instanceof Error?z.message:String(z))}}}}function pl($){return{public:{name:$,ok:!1,skipped:!0}}}async function Yh0($,Y){let z=await fetch($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Y)});return oS1(z)}async function oS1($){let Y=await $.text();if(!$.ok)throw Error(`${$.status} ${Y}`);let z=JSON.parse(Y);return d3(z)}function d3($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function b6($){return typeof $==="string"&&$?$:void 0}function Bq($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function rS1($){return typeof $==="boolean"?$:void 0}function sS1($){let Y=d3($);return Ih0({corporationId:b6(Y.corporationId),corporationName:b6(Y.corporationName)})}f Line truncated
`);c0({provider:"hose",capability:"privilege-elevation",corpId:Y.id,corpName:Y.name,domain:Y.source.domain,staffId:Y.source.staffId,appKey:Q??"-",appSecurity:J?z?J:SS(J):"-",active:!0})}function $h0($,U){let{token:Y,sealUrl:z,expiresIn:Q,verify:J,remote:I}=U,K=U.custom??tv0($),G=I?.user,H=I?.tenant,W=X4($,"tenantSlug")??s2(H?.tenantSlug),X=X4($,"tenantId")??s2(H?.id),Z=X4($,"tenantName")??s2(H?.name),q=X4($,"id")??W??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=X4($,"staffId")??s2(G?.providerUserId)??s2(G?.id)??"seal",F=X4($,"provider")??s2(G?.provider)??s2(H?.providerConfig?.provider),O=X4($,"corpId")??W??X??q,w={id:q,name:X4($,"name")??Z??q,environment:"production",seal:{url:z,tenantSlug:W,headers:K.headers,cookies:K.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:Y,sealUrl:z,expiresIn:Q,staffId:V,corpId:O,tenantId:X,tenantSlug:W,tenantName:Z,providerUserId:s2(G?.providerUserId),provider:F},auth:{refreshTtl:300}},M=$p();lv0(M,{recursive:!0,mode:448});let N=rv0(M,`${VT(q)}.json`);if(mv0(N)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${N}. Pass "overwrite": true to replace it.`);ov0(N,`${JSON.stringify(w,null,2)}
`,{mode:384}),c0({id:q,name:w.name,tenantId:X,tenantSlug:W,verified:J,path:N})}async function lS1($,U,Y={}){let z=T8($,U,Y),Q=await W8(z);return{user:Q.user??{},tenant:Q.tenant??{}}}function s2($){return typeof $==="string"&&$?$:void 0}var nl=o(()=>{a9();BH();i8();S3();fv0();bP();tn();X6();X6();ul();SZ();ET();o4();L$();D4();J4()});async function Yh0($,U){let Y=$??S(U.options.link)??S(U.options.url);if(!Y)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let z=V0(U.options.reveal)===!0||V0(U.options.r)===!0||V0(U.options.plain)===!0,Q=V0(U.options.save)===!0||V0(U.options.add)===!0;await CT(Y,{reveal:z,save:Q,name:S(U.options.name),overwrite:V0(U.options.overwrite)===!0,force:V0(U.options.force)===!0,appKey:S(U.options["app-key"])??S(U.options.appKey),keyId:S(U.options["key-id"])??S(U.options.keyId)})}async function zh0($,U,Y){if($==="diagnose"){c0(await oS1(U));return}if($==="hose-link"){let z=Y.options.expire,Q=z!==void 0?s0(z):7200;if(Q===void 0||Q<=0)throw Error(`Invalid --expire: ${String(z)}. Must be a positive number of seconds (e.g. --expire 7200 or --expire 86400).`);let J=V0(Y.options.force)===!0||V0(Y.options.refresh)===!0||V0(Y.options.f)===!0;c0(await P00(U,Q,{force:J}));return}if($==="keys"){let z=V0(Y.options.reveal)===!0||V0(Y.options.r)===!0||V0(Y.options.plain)===!0;await cl(U.id,{reveal:z});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function oS1($){if($.source.type!=="hose"){let F=await j1($),O=await W8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:O.user,tenant:O.tenant}]}}aw($.id);let U=$.source,Y=U.appKey??U.key,z=U.appSecurity??U.password,Q=($.seal.url??U.sealUrl??`https://${U.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),J=U.staffId.includes(":")?U.staffId:`${U.corpId}:${U.staffId}`,I=[];if(!Y||!z)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let K=await RT("hose.openapi",async()=>{let F=await Uh0(`${U.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:Y,appSecurity:z}),O=d3(F.value),w=b6(O.accessToken)??b6(F.accessToken)??b6(F.token);if(!w)throw Error("Hose login did not return an access token");return{token:w,public:{corporationId:b6(O.corporationId)??b6(d3(O.corporation).id),expireTime:Bq(O.expireTime)}}});I.push(K.public);let G=K.private?.token,H=G?await RT("hose.provisional",async()=>{let F=await Uh0(`${U.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:J,pageType:"home",expireDate:7200}),O=b6(d3(F.value).message);if(!O)throw Error("Hose CloseAPI did not return a provisional auth URL");let w=new URL(O).searchParams.get("accessToken");if(!w)throw Error("Hose provisional auth URL did not include accessToken");return{token:w,public:{uid:J,enterpriseUrl:Mq(O)}}}):pl("hose.provisional");I.push(H.public);let W=A6($.seal),X=H.private?.token,Z=X?await RT("seal.sso",async()=>{let O=await T8(Q,void 0,W).get(`api/auth/oauth2/session/oem-hosecloud?token=${encodeURIComponent(X)}&returnToken=1`).json(),w=d3(O.data),M=b6(O.token)??b6(O.accessToken)??b6(w.token)??b6(w.accessToken);if(!M)throw Error("Seal SSO did not return a bearer token");return{token:M,public:{sealUrl:Q,expiresIn:Bq(O.expiresIn)??Bq(O.expires_in)??Bq(w.expiresIn)??Bq(w.expires_in)}}}):pl("seal.sso");I.push(Z.public);let q=Z.private?.token,V=q?await RT("seal.whoami",async()=>{let O=await T8(Q,q,W).get("api/v1/auth/me").json(),w=d3(O.data),M=d3(w.user??O.user),N=d3(w.tenant??O.tenant);return{public:{user:{id:b6(M.id),name:b6(M.name),isAdmin:sS1(M.isAdmin),providerUserId:b6(M.providerUserId)},tenant:{id:b6(N.id),name:b6(N.name),tenantSlug:b6(N.tenantSlug),hoseCorpConfig:aS1(N.hoseCorpConfig)}}}}):pl("seal.whoami");return I.push(V.public),{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:I.every((F)=>F.ok===!0),stages:I}}async function RT($,U){try{let Y=await U();return{public:{name:$,ok:!0,...Qh0(Y.public)},private:Y.token?{token:Y.token}:void 0}}catch(Y){return{public:{name:$,ok:!1,error:Mq(Y instanceof Error?Y.message:String(Y))}}}}function pl($){return{public:{name:$,ok:!1,skipped:!0}}}async function Uh0($,U){let Y=await fetch($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(U)});return rS1(Y)}async function rS1($){let U=await $.text();if(!$.ok)throw Error(`${$.status} ${U}`);let Y=JSON.parse(U);return d3(Y)}function d3($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function b6($){return typeof $==="string"&&$?$:void 0}function Bq($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function sS1($){return typeof $==="boolean"?$:void 0}function aS1($){let U=d3($);return Qh0({corporationId:b6(U.corporationId),corporationName:b6(U.corporationName)})}f Line truncated
`+`支持的审批系统与发布目标:
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
@@ -939,14 +944,14 @@ Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an a
`+` • feishu (飞书审批): 建议使用 Webhook 模式对接
`+` • weaver (泛微 OA): 建议使用 Webhook 模式对接
`+` • helios (汇联易): 建议使用 Webhook 模式对接
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let H=$==="maycur"?"每刻报销":"汇联易";throw Error(`${H}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${H}' --result-url <url> --corp <corpId>`)}let J=$==="hosecloud",K=$==="hosecloud"?Y:$,G=$==="hosecloud"?z:Y;if(!J)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await k0("seal_deploy_hosecloud_requirements",U,I,{},C0(Q.options));return}if(K==="list"){await k0("seal_deploy_hosecloud_list",U,I,{},C0(Q.options));return}if(K==="get"){let H=G??S(Q.options.signKey)??S(Q.options["sign-key"]);if(!H){let X=((await o1(U)).integrations??[]).filter((Z)=>Z.type==="hosecloud");if(X.length===0)throw Error(`当前企业 (${I.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${I.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${I.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let Z of X){let q=Z.outboundName??"SealAI 审批",V=Z.signKey,F=Z.apiOrigin??"production";console.error(` • "${q}" (signKey: ${V}, 环境: ${F})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${V} --corp ${I.id}
`)}throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${I.id}`:void 0)}await k0("seal_deploy_hosecloud_get",U,I,{signKey:H},C0(Q.options));return}if(K==="status"){await k0("seal_deploy_hosecloud_status",U,I,{},C0(Q.options));return}if(K==="configure"){let H=S(Q.options.input),W=H?JSON.parse(aS1(H,"utf8")):y8(Q.json);if(!W||Object.keys(W).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",U,I,{...W,dryRun:V0(Q.options.dryRun)??V0(Q.options["dry-run"])},C0(Q.options));return}if(K==="sync"){let H=G??S(Q.options.signKey)??S(Q.options["sign-key"]),W=V0(Q.options.auto)??V0(Q.options.yes);if(!H){let Z=((await o1(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${I.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${I.id}`);let q=Z[0];if(q&&Z.length===1&&W){let V=q.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${V})`),await k0("seal_deploy_hosecloud_sync",U,I,{signKey:V},C0(Q.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${I.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of Z){let F=V.outboundName??"SealAI 审批",M=V.signKey,w=V.apiOrigin??"production";console.error(` • "${F}" (signKey: ${M}, 环境: ${w})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${M} --corp ${I.id}
`)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${I.id}
`);throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${I.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,I,{signKey:H},C0(Q.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var Nh0=o(()=>{o4();D4();Q4();X6();L$()});var Ah0=`interface:
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let H=$==="maycur"?"每刻报销":"汇联易";throw Error(`${H}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${H}' --result-url <url> --corp <corpId>`)}let I=$==="hosecloud",K=$==="hosecloud"?U:$,G=$==="hosecloud"?Y:U;if(!I)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await k0("seal_deploy_hosecloud_requirements",z,Q,{},C0(J.options));return}if(K==="list"){await k0("seal_deploy_hosecloud_list",z,Q,{},C0(J.options));return}if(K==="get"){let H=G??S(J.options.signKey)??S(J.options["sign-key"]);if(!H){let X=((await o1(z)).integrations??[]).filter((Z)=>Z.type==="hosecloud");if(X.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Q.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${Q.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let Z of X){let q=Z.outboundName??"SealAI 审批",V=Z.signKey,F=Z.apiOrigin??"production";console.error(` • "${q}" (signKey: ${V}, 环境: ${F})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${V} --corp ${Q.id}
`)}throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_get",z,Q,{signKey:H},C0(J.options));return}if(K==="status"){await k0("seal_deploy_hosecloud_status",z,Q,{},C0(J.options));return}if(K==="configure"){let H=S(J.options.input),W=H?JSON.parse(tS1(H,"utf8")):y8(J.json);if(!W||Object.keys(W).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",z,Q,{...W,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}if(K==="sync"){let H=G??S(J.options.signKey)??S(J.options["sign-key"]),W=V0(J.options.auto)??V0(J.options.yes);if(!H){let Z=((await o1(z)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Q.id}`);let q=Z[0];if(q&&Z.length===1&&W){let V=q.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${V})`),await k0("seal_deploy_hosecloud_sync",z,Q,{signKey:V},C0(J.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${Q.id}]
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of Z){let F=V.outboundName??"SealAI 审批",O=V.signKey,w=V.apiOrigin??"production";console.error(` • "${F}" (signKey: ${O}, 环境: ${w})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${O} --corp ${Q.id}
`)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${Q.id}
`);throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",z,Q,{signKey:H},C0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var Nh0=o(()=>{o4();D4();J4();X6();L$()});var Ah0=`interface:
display_name: "Seal Use"
short_description: "Diagnose approval feedback and publish minimal rule fixes"
default_prompt: "Use $seal-use to resolve a customer feedback package to the correct tenant, diagnose the approval run, propose a minimal rule diff, and publish only after explicit confirmation."
@@ -1496,7 +1501,9 @@ Do not automatically rerun or resubmit the customer's production document. Run a
- **规则一致性校验**:确认目标规则文本与确认内容 100% 逐字吻合
`;var vh0=()=>{};var gh0=`# Enterprise Onboarding
Read this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.
> 💡 **新手接入指引分工**:
> - 若是引导无技术背景的用户找凭证材料、找按钮,**必须直接使用 \`references/first-time-user.md\` 并渲染其中的指引截图**;
> - 本文档用于 Agent 理解企业身份源划分、标准凭证/协助链接/cURL 的后台凭据生命周期、合思子域 OpenAPI 提权机制与参数自动发现。
## Start With Discovery
@@ -1684,30 +1691,31 @@ Report the human enterprise name, identity provider, credential method, and whet
If a temporary assistance-link or browser session expires, explain that it must be renewed or recaptured. Recommend standard Hose app credentials when the user needs durable unattended access.
`;var Sh0=()=>{};var kh0=`# 第一次接入:看图找到材料
> **【Agent 呈现铁律(Mandatory Image Rule)】**:
> 当向用户提供接入指引或引导用户获取材料时,**Agent 必须将本文档中对应的截图主动按顺序渲染到 Markdown 对话中**(使用图片语法 \`![说明](路径)\`),**绝不允许只讲纯文字步骤!** 真实业务用户必须对照图片界面才能准确找到按钮。
这份说明给第一次使用 Seal Use、还不熟悉“合思”“Seal”“appKey”“cURL”等词的用户。
用户不需要先知道 \`corpId\`、\`staffId\`、域名或内部命令。只要能进入企业网页,助手会负责识别企业和接入方式。
## 路径一:从合思开放接口取得接入账号和接入密码
## 路径一:从合思开放接口取得接入账号和接入密码(推荐·永久配置)
这条路径适用于有合思开放平台或应用管理权限的用户。
在合思网页中依次完成:
1. 打开「应用中心」或「应用商店」。
2. 搜索“接口”。
3. 进入「开放接口(新)」。
4. 点击「商品配置」。
5. 在配置面板中找到:
1. 打开「应用中心」或「应用商店」,搜索“接口”,进入「开放接口(新)」:
![在应用中心搜索并进入开放接口](../assets/hose-open-platform-app-center.png)
2. 点击「商品配置」:
![进入开放接口后点击商品配置](../assets/hose-open-platform-product-config.png)
3. 在配置面板中找到:
- **接入账号**:这就是 \`appKey\`。
- **接入密码**:这就是 \`appSecurity\`。需要先点击「显示」再复制。
6. 将这两项只交给当前本地助手,不要发到群聊、工单、公共文档或代码仓库。
![在商品配置中找到接入账号和接入密码](../assets/hose-open-platform-credentials.png)
![在应用中心搜索并进入开放接口](../assets/hose-open-platform-app-center.png)
![进入开放接口后点击商品配置](../assets/hose-open-platform-product-config.png)
![在商品配置中找到接入账号和接入密码](../assets/hose-open-platform-credentials.png)
4. 将这两项直接发送给当前本地助手,不要发到外部群聊、工单、公共文档或代码仓库。
助手拿到这两项后,会自动探测合思环境、识别企业、发现管理员绑定,并验证 Seal 会话。用户不需要填写 \`corpId\`、\`staffId\` 或域名。
@@ -2354,219 +2362,138 @@ flowchart TD
发布后核实版本状态,完成业务安全闭环。
`;var lh0=()=>{};var sh0=`---
name: seal-use
description: "v0.10.30: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
description: "v0.10.31: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
metadata:
version: 0.10.30
short-description: Seal tenant and Hose approval automation (v0.10.30)
version: 0.10.31
short-description: Seal tenant and Hose approval automation (v0.10.31)
---
# Seal Use (v0.10.30)
# Seal Use (v0.10.31)
**The CLI is the primary path; the MCP server is an optional extra that is off by default.** Prefer the global \`seal-use\` CLI, and only use MCP when it is actually available in the current session. If no \`seal_cli*\` tool is present, that is the normal default — do not try to enable it or treat it as a fault; just use the CLI. Enabling it is the user's choice in the plugin settings (插件配置中的「启用 MCP 服务」,默认关闭,打开后需重连该插件的 MCP 服务).
> CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (\`stdout\`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 \`stderr\`。
When MCP *is* available, two tools are exposed:
---
- \`seal_cli\` — **read-only only.** Reads tenant state without changing it. It is annotated \`readOnlyHint: true\`, so clients may auto-approve it.
- \`seal_cli_write\` — everything that mutates tenant state, publishes configuration, mints credentials, self-updates or starts a server. Annotated \`destructiveHint: true\`; **confirm the exact command with the user before calling it.**
## 0. 全局业务术语与对外输出契约(Mandatory Vocabulary Contract)⚠️ 核心红线
The boundary is enforced, not merely advertised: \`seal_cli\` refuses any command that is not on its read-only allow-list, and unclassified commands fail closed. A refusal names \`seal_cli_write\` as the follow-up. \`seal-use tool <name>\` is allowed through \`seal_cli\` only for tools the registry classifies as read-only (\`SEAL_READ_ONLY_TOOLS\`); the rest need \`seal_cli_write\`.
**所有场景强制生效**(包括规则列表、规则详情、规则修补与 Diff、单据核对、体检诊断、客诉排查及所有日常对话):
This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
### 1.1 业务术语强制映射与违禁词红线
| 系统字段 / 英文枚举 | 强制使用的业务术语 | 严禁自创 / 违禁词(红线) |
| :--- | :--- | :--- |
| \`scope\` | **适用场景** | ❌ 适用范围、适用模版、触发条件、触发范围 |
| \`strictness\` | **遵守程度** | ❌ 严格度、执行力度、严重性、级别 |
| \`MUST_FOLLOW\` | **必须遵守** | ❌ 必须执行、强阻断、必须遵守(系统) |
| \`SHOULD_FOLLOW\`| **建议遵守** | ❌ 建议执行、弱提示、建议参考 |
| \`SUGGESTION\` | **提示参考** | ❌ 参考、建议、提示 |
| \`code\` | **规则编号** (如 \`#0038\`) | ❌ 规则代码、code、系统code |
| \`status\` | **启用状态** (\`已启用\` / \`已停用\` / \`草稿\`) | ❌ active/inactive、生效状态 |
| \`description\` | **规则内容 / 审核要求** | ❌ 规则描述、说明文案 |
## Bootstrap & Installation (环境安装与自愈)
### 1.2 隐藏内部机器标识与脱敏原则
- **严禁向用户直接暴露系统底层存储 UUID**(如 \`01a00f34...\`、\`cly...\` 等机器哈希),对外交流与呈现统一使用用户与管理后台唯一认知的业务编号:\`规则编号: #xxxx\`。
- **严禁暴露内部技术参数名**:严禁向用户直接输出 \`boundCorpRole: testTarget\`、\`tenantSlug\`、\`permissions: ["*"]\` 等生硬技术字段,一律转化为业务中文表述(如“测试靶场环境”、“具备全部超级管理员权限”)。
- **手机号脱敏**:凡涉及员工或管理员手机号,必须脱敏中间 4 位(\`138****5678\`),严防信息泄露。
Agent 必须确保使用最新版本的 \`seal-use\` CLI、Skill 与 Agent 插件。在执行任何配置或业务任务前,优先核验版本状态:
---
\`\`\`bash
seal-use version
seal-use corps list
\`\`\`
## 1. 首次接入图文引导(Newbie 3-Step & Mandatory Image Rule)
如果 CLI 或 Skill 尚未安装或落后于发布版本,通过以下命令一键安装或升级:
> **【强制执行契约】**:当用户首次使用、询问如何接入、或需要用户提供凭证材料时,**Agent 必须主动使用 Markdown 图片语法将对应步骤的截图呈现给用户,绝对禁止只发干瘪文字!**
\`\`\`bash
# 方式 1:CLI 自更新(已安装时推荐)
seal-use update
### 新手接入 3 步走:
1. **确认材料类型**:向用户自然询问拥有的材料(合思开放平台凭据、协助链接、或网页 cURL)。
2. **图文指导获取(必须贴图)**:
- **路径一:合思开放平台(推荐·永久开发者凭据)**
1. 进入「应用中心」搜索“接口”,进入「开放接口(新)」:
![进入开放接口](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-open-platform-app-center.png)
2. 点击「商品配置」:
![点击商品配置](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-open-platform-product-config.png)
3. 复制「接入账号」(\`appKey\`) 与「接入密码」(\`appSecurity\`):
![找到接入账号和密码](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-open-platform-credentials.png)
- **路径二:从已登录网页复制 cURL(零门槛·会话快照或自动提权)**
1. 在企业网页右键选择「检查」打开开发者工具:
![打开检查](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-curl-open-page-check.png)
2. 切换到「网络」-「Fetch/XHR」,刷新或点击任一列表:
![网络Fetch/XHR](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-curl-network-fetch-xhr.png)
3. 找到任一正常业务请求,右键「复制」-「以 cURL 格式复制」:
![以cURL格式复制](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-curl-copy-as-curl.png)
3. **无感接入**:Agent 接收材料后自动执行 \`corps add-hose\`、\`corps add-link\` 或 \`corps extract-keys --save\`,系统自动反查拉取真实企业中文名,自动绑定管理员,完成接入。无需用户手动查找 \`corpId\` 或 \`staffId\`。详阅 \`references/first-time-user.md\` 与 \`references/enterprise-onboarding.md\`。
# 方式 2:国内高速一键安装与自愈(Gitea 镜像源,免代理、秒级完成)
curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash
---
# 方式 3:Global / GitHub Direct
curl -fsSL https://raw.githubusercontent.com/yunyingk/seal-use/main/scripts/install.sh | bash
\`\`\`
## 2. 80% 日常业务运维场景(Daily High-Frequency Operations)
安装或升级后,验证系统连通性:
\`\`\`bash
seal-use version
seal-use corps list
\`\`\`
日常 80% 的工作聚焦在企业切换、规则查验、单据定位与运行大盘:
## First Rules
### 2.1 企业定位与切换
- 关键字智能搜索(支持同音字/拼音/简拼/容错):\`seal-use corps search <keyword>\`
- 常用企业列表(默认展示 7 天使用频次最高的 10 家):\`seal-use corps list\`
- 查看企业详情(富属性安全脱敏查看):\`seal-use corps get <corpId>\`
- Treat CLI/MCP as the Agent's execution channel, not the user's interface. Translate natural-language intent into commands yourself; never ask the user to compose CLI syntax, JSON payloads, placeholder values, or internal IDs.
- Before asking for enterprise parameters, resolve the target enterprise: when an enterprise is named, hinted, or keyword-identifiable, ALWAYS run \`seal-use corps search <keyword>\` (or \`seal-use corps get <corpId>\` if an exact ID is known) — DO NOT dump the entire enterprise catalog with \`seal-use corps list\` when the target is already known. Only run \`seal-use corps list\` (or \`corps list --env <test|production>\`) for initial discovery when zero enterprise context is known. Resolve its human name to the returned \`id\` and pass that value as \`--corp\`; do not ask the user to know \`corpId\`. Use \`seal-use corps get <corpId>\` to inspect rich enterprise attributes (URLs, tenant slugs, staff IDs, environment relations, and config file locations) with sensitive secrets safely redacted.
- If no enterprise is configured, the user is installing for the first time, or the user provides credentials, an assistance link, or a browser-copied cURL, read \`references/first-time-user.md\` for the plain-language, screenshot-based path first, then read \`references/enterprise-onboarding.md\` before asking questions or running setup commands.
- When the user provides a Hose/合思 \`thirdparty.html\` assistance link, use \`seal-use corps add-link <url> [--name ...]\` for temporary session access, or elevate privileges to permanent developer credentials using \`seal-use corps extract-keys <url> --save\` (or \`seal-use corps add-link <url> --as-hose\`). This Hose-exclusive capability extracts \`appKey\`/\`appSecurity\`. If the enterprise has multiple keys, specify \`--app-key <key>\` or \`--key-id <id>\`.
- **同等凭据原则(Equal Credential Scope Principle)**: A Hose assistance link and a cURL copied from an authenticated **Hose admin** page are both Hose web frontend sessions — structurally different in format only, carrying the same \`accesstoken\`/\`corpid\` web session credentials. **When a Hose administrator provides a browser cURL, do NOT silently downgrade it to a plain short-lived session import.** Attempt privilege elevation first by extracting \`accesstoken\`+\`corpid\`+\`baseUrl\` from the cURL and invoking the Hose key interface (\`/api/innerapi/v1/key\`) to retrieve permanent \`appKey\`/\`appSecurity\`. Only fall back to temporary session import if the user is not a Hose administrator or the key interface returns no keys.
- Keep enterprise identity origin separate from credential acquisition. A Hose/合思-sourced Seal tenant can be accessed with standard Hose app credentials, an assistance link, or a captured web session; receiving a Seal Bearer token does not by itself prove the tenant is Seal-native. Calling key extraction or \`keys\` on native Seal enterprises is strictly blocked.
- Never ask a normal user for \`corpId\`, \`staffId\`, \`proxyStaffBizId\`, \`tenantId\`, or another discoverable internal ID. Discover it first. If discovery fails, explain what the field means, why it could not be discovered, and exactly where the user can find it.
- Prefer compact commands first: \`pick\`, \`--summary\`, \`--fields\`, \`attachments --summary\`, \`rules count\`, and \`rules list --summary\`.
- Parse JSON stdout. Do not scrape human text.
- Do not hand-edit enterprise configs for normal setup. Use \`seal-use corps ...\`.
- Before write operations on rules, documents, style preferences, or publishing, fetch current state and confirm the intended mutation with the user. For supported configuration writes, prefer the universal \`--dry-run\` preview first (rules clear/push, \`corps sync-test\`, preference updates, thinking-depth policies, HoseCloud configure, and Webhook add/update/delete), then use \`--yes\` only after reviewing its redacted \`changesDiff\`.
- Knowledge document creation and deletion are now supported. Validate \`contentType\` and \`scenarios\` before creating; use \`enabled: false\` when the document should be withdrawn without deletion. For an explicit deletion, re-read the document and obtain confirmation before using the low-level \`seal_approval_delete_document\` tool.
- For customer-feedback rule remediation, show an exact field-level diff and obtain explicit approval before updating. Default to changing only the narrowest necessary part of \`description\`; preserve \`scope\`, \`strictness\`, and unrelated clauses unless the user explicitly approves otherwise. Always follow the Presentation & Report Contract in \`references/customer-feedback-rule-remediation.md\`: hide internal UUIDs, use standard business terms (适用场景, 遵守程度), present unmodified fields cleanly without colloquial fluff, format description changes as standard Git Diff, and avoid repeating full report text in chat context once structured HTML/PDF artifacts are delivered (guide users to external browsers/viewers instead).
- Resolve and lock the target enterprise \`corpId\` before diagnosis or mutation. Never assume the current tenant is the customer tenant. Re-fetch the target rule immediately before updating, then verify the draft and newly published version after writing.
- For date questions, use explicit dates and \`--timezone Asia/Shanghai\`.
- If output may be large, use \`--summary\`, \`--fields\`, \`--count\`, or \`--output-file\`; use \`--full\` only when the user really needs full payloads.
- When returning ANY authorization, login, or delegation links (e.g. 合思授权链接, Seal授权链接/委托链接), ALWAYS provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
- For delegation links, always prefer \`seal-use delegation create\` over \`users delegation\` for link generation to ensure persistent token tracking.
- Never treat “Seal 协助/Seal 授权/委托” as a 合思授权入口. They are different links and must use different commands.
- For approval run links (\`seal-use approval-runs url <recordId> [--corp <corpId>]\`):
- Always default to returning the clean deep link (\`type: 'deep_link'\`), which contains no credentials and requires no sensitive access. Users in their authorized browsers open it directly with zero token leakage risk.
- ONLY provide an SSO link (\`--sso\`) when the user explicitly requests an unauthenticated/cross-browser/no-login/免密 link and acknowledges risks.
- When returning an \`--sso\` link, the Agent MUST:
1. Declare the 4 mandatory security disclosures:
- 身份主体(Identity attribution: name and admin status)
- 权限范围(Full Seal AI operation permissions under this user)
- 时效性(2-hour provisional ticket TTL, 30-day session after opening)
- 安全与防扩散边界(No Hose main system access, strictly internal, never share to public/external groups)
2. Provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) and a clickable hyperlink.
- In the default stateless mode, every enterprise command requires \`--corp <corpId>\`. In stateful mode, omitting \`--corp\` uses the configured default enterprise and is unsafe for an explicitly named enterprise.
- For an explicitly named enterprise, resolve it directly with \`seal-use corps search <name>\` (or \`seal-use corps get <corpId>\` if given an exact ID) rather than dumping all enterprises with \`seal-use corps list\`. Then pass its exact \`corpId\` to every command. After creation, verify the returned URL host matches that enterprise's Seal tenant; if the host is the current/default tenant or cannot be verified, do not present the link as the target enterprise's link.
- 生产规则变更建议优先遵循“生产改草稿 -> 同步测试企业 -> 自动化回归测试矩阵/真实单据模拟验证 -> 生产发布投产”安全闭环;Agent 应主动提示并建议在测试环境中验证,但最终操作权与决策权在用户手中,绝不代替用户做决定。若用户明确要求直接在生产环境发布,尊重用户意图并严格执行。
- 在对企业执行高风险操作、批量审批或发布前,优先运行 \`seal-use doctor tenant --corp <corpId>\` 校验租户健康契约:验证身份管理权限、AI 审核扣费点数余量(\`balance\` 与 \`deductionAmount\`)、活跃规则与未发布草稿箱、Webhook 通道以及测试环境绑定。
- 在测试企业完成规则同步后,强烈推荐运行 \`seal-use test regression --corp <corpId> [--samples 10]\` 执行自动化回归测试矩阵:自动采样生产历史单据并在测试靶场重放对比决策,核验决策翻转率(Flips)与一致率,确保 \`safeToPublish: true\` 后再行投产。硬性红线:回归测试严禁直接在纯生产企业运行(必须下挂测试靶场),且测试环境点数余额必须充足。
- 单据 Webhook 重放安全与用户自主权策略:单据重放建议优先在绑定的测试企业中验证(CLI 与 MCP 默认拦截向生产环境重放以防污染真实审批流或产生实际外发回调)。Agent 应主动向用户解释风险并优先建议在测试环境模拟;但工具绝不反客为主,最终决策权在用户手中。若用户未绑定测试企业,或明确要求直接向生产环境重放,Agent 应向用户客观说明可能污染生产审批流或触发真实外部回调的风险;在确认用户明确意图后,通过追加 \`--force\`(或 MCP \`force: true\`)严格执行,绝不擅自拒绝用户要求。
- 测试环境合思模拟安全隔离:\`corps sync-test\` 自动将生产企业合思凭证以 \`assisted\` 模式注入测试企业,名称格式为 \`{企业名前缀}(Seal测)\`。该配置仅保存在测试 Seal 侧,绝对不执行 \`deploy hosecloud sync\`,杜绝向生产合思费控推送 EBot 节点或创建外发 webhook。
### 2.2 规则查验(遵循术语契约,使用规则编号 #xxxx)
- 规则总数快速感知:\`seal-use rules count --corp <corpId>\`
- 规则精简列表(聚焦业务字段,不漏底层 UUID):\`seal-use rules list --corp <corpId> --summary\`
- 查看单条规则详情:\`seal-use rules get --corp <corpId> --code '#0038'\`
## Route By Intent
### 2.3 单据定位与审核追踪
- 单号秒级定位:\`seal-use approval-runs pick --corp <corpId> --sn <单据编号> --latest\`
- 单据摘要与审核结论:\`seal-use approval-runs get <recordId> --corp <corpId> --summary\`
- 单据引用规则速查:\`seal-use approval-runs cited-rules <recordId> --corp <corpId>\`
- 生成业务审批单深链接(安全直达,无需凭据):\`seal-use approval-runs url <recordId> --corp <corpId>\`
- 生产规则安全演进、搭配配置与测试模拟闭环: read \`references/staging-simulation-workflow.md\`. 适用于:用户提出规则变更需求/客诉修复、生产与测试企业搭配接入与 1 对 1 绑定、生产环境仅改草稿隔离风险、\`seal-use corps sync-test\` 一键同步测试环境(含合思集成免配同步)、测试靶场运行自动化规则回归测试矩阵(\`test regression\`)或真实单据模拟验证、验证通过后才在生产正式发布的完整安全生命周期。
- First install / zero configuration / “how do I connect my enterprise?” / user supplies app credentials, an assistance link, or F12/Network cURL: read \`references/first-time-user.md\` and \`references/enterprise-onboarding.md\`. Ask what material the user already has in plain language, then discover all remaining identifiers automatically.
- User-facing Seal tenant assistance link (Seal 协助/Seal 授权/委托): resolve the named enterprise first, then run \`seal-use delegation create --corp <corpId> --note '<enterprise>'\`; verify the returned hostname is that tenant's Seal hostname. Always provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) AND a hyperlink.
- Packaged customer feedback → approval-rule remediation: read \`references/customer-feedback-rule-remediation.md\`. Use this route for WeChat messages, screenshots, rejection notifications, document numbers, customer complaints, expected approval behavior, rule-only mitigation, exact diffs, or requests to update and publish a rule version.
- 自动化规则回归测试矩阵 (Automated Rule Regression Test Matrix): \`seal-use test regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips] [--prod-corp <id>] [--test-corp <id>]\` (快捷别名 \`seal-use corps regression\`)。采样生产企业历史已完成单据,通过出站 HTTPS 轮询重放到配对测试靶场执行 AI 审核并对比双端决策,计算一致率(Concordance Rate),识别决策翻转(Decision Flips),给出 \`safeToPublish\` 综合判定。硬性红线:目标环境必须为测试企业且测试点数余额充足,严禁在纯生产环境发起。
- 模拟测试发布闭环: \`seal-use simulation create --mode hosecloud --flow-ids ... --no-wait --corp <corpId>\` (合思指定单号) 或 \`--mode material_pack --package-ids ... --schema-config file.json\` (材料包导入), 支持多源系统 \`--source-system <hosecloud|feishu|weaver|helios|maycur|material_pack>\`, \`simulation status <batchId>\` 单次查询状态, \`simulation wait <batchId>\` 轮询等待完成, \`simulation clean <batchId>\` 清理数据, \`simulation specifications\` 列出单据模板, \`simulation approval-definitions\` 查询飞书审批定义, \`simulation list\`/\`get\`/\`batch-records\` 查看批次与记录。创建前确认目标环境为测试环境。
- 企业检索、详情查看、环境标记、关联与配置规则同步: \`seal-use corps list [query] [--env <production|test>] [--limit <n>] [--all] [--sort <usage|name|id>] [--strict]\` (列表与轻量检索,默认展示 7 天使用频次最高的 10 个租户;\`--all\` 展示全量;\`--sort usage|name|id\` 切换排序), \`seal-use corps search <query> [--env <production|test>] [--strict]\` (跨字段智能软搜索:默认支持同音字、前后鼻音、平翘舌音、拼音与简拼、拼音或字母缺漏容错;\`--strict\` 切换为严格子串匹配), \`seal-use corps get <corpId>\` (富属性安全查看,敏感信息脱敏), \`seal-use corps mark <corpId> --env <production|test> --confirm\` (严格标记环境), \`seal-use corps bind-test <prodCorpId> <testCorpId> --confirm\` (严格1对1下挂,禁止多层级串联), \`seal-use corps unbind-test <corpId> --confirm\`, \`seal-use corps sync-test <prodCorpId> [--dry-run|--yes] [--version-name <name>]\` (将正式企业的偏好、草稿规则和知识文档覆盖同步到测试企业并自动发布语义版本 \`[Prod vN · #M -> Test vM]\`,输出并本地缓存 \`versionMapping\`/\`ruleMapping\`,正式企业规则保持草稿态不发布), \`seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]\` (将绑定的生产企业历史审批记录批量或单条重放到测试企业 Webhook 并做环境隔离与自动通道补齐;若未绑定测试企业可加 \`--force\` 直接重放), \`seal-use rules map [--corp <corpId>] [--version <v|latest>] [--code <code>]\` (离线毫秒级速查测试与生产规则对照映射)。
- 规则本地工作流: \`seal-use rules pull\` 导出草稿规则,\`rules lint\` 做质量检查,\`rules push --dry-run\` 预览增量更新,确认后用 \`--yes\` 写入;\`rules map\` 查询 \`corps sync-test\` 生成的跨企业规则映射。规则版本与草稿/发布 code 空间的区别详见 \`references/rule-lightweight.md\` 和 \`references/cli.md\`。
- Seal AI 智能审核发布到合思费控: \`seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>\`; read \`references/hose-enterprise-deploy.md\`.
- 审核决策偏好与思考深度: \`seal-use preference get --corp <corpId>\`, \`preference decision update --json '...' --corp <corpId>\`, \`preference thinking-depth set --default <medium|high> --corp <corpId>\`, \`preference thinking-depth policies <list|upsert|remove> --corp <corpId>\`.
- 审核大盘统计与去重分析: \`seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp <corpId>\`, \`approval-runs count\`, \`analytics insight|risks|performance|analyze\`, 以及 \`approval-runs export\`(Excel 报表,文件名强制追加精确到分钟的 \`_YYYYMMDD_HHmm\` 时间戳后缀防止覆盖;支持 \`--sn <SN1,SN2>\` 定向筛选极速导出并跳过全量分页;追加 \`--with-flow\` 可额外输出 **E人工行为** / **E人工意见** 两列——基于合思原生审批流对齐,含样式 2-B 三行展开式驳回目标与重审规则、中途修改置顶事实且保留时序、动作 Emoji,200 条以上单据约增加 30 秒);需要追踪单据时再使用 \`url\` 或 \`bridge\`。
- User-facing 合思 authorization link (合思/易快报授权): \`seal-use auth hose-link --corp <corpId> [--expire <seconds>] [--force]\`; read \`references/hose-enterprise-auth.md\`. Never use this route when the user says Seal 协助. 凭证独立生成且不污染本地会话。Always provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) AND a hyperlink.
- Delegation links management (【Seal 审核后台】委托授权链接): \`seal-use delegation list --corp <corpId>\`, \`create [--note ...] --corp <corpId>\`, \`create --from-link <url> [--note ...]\`, \`revoke <tokenId> --corp <corpId>\`. 注意:此处管理 Seal AI 智能审核后台的委托令牌,不包含合思主站免密链接(后者走 \`auth hose-link\`,不可在 \`delegation list\` 中查询)。
- User & Contacts Management (用户搜索、激活与一键代生成授权): \`seal-use users search [keyword] --corp <corpId>\`, \`users delegation <userIdOrPhone> --corp <corpId>\` (仅适用于 Seal 本地创建的账号 \`provider: local\`;对合思同步账号系统拒绝重置密码,需改用 \`auth hose-link\`), \`users activate <userId> --corp <corpId>\`, \`users create --name ... --phone ... --corp <corpId>\`, \`users reset-password <userId> --corp <corpId>\`, \`users get <userId> --corp <corpId>\`, \`users delete <userId> --corp <corpId>\`.
- 只读业务数据与组织发现: \`seal-use contacts departments|children|users|sync-time --corp <corpId>\`, \`seal-use data expenses|invoices --corp <corpId>\`, \`seal-use analytics insight|risks|performance --corp <corpId>\`, \`seal-use context --corp <corpId>\`, \`seal-use source config --corp <corpId>\`;这些查询优先用于定位企业结构、原始费用/发票和当前审核知识,不要把结果误当成写操作。
- LLM Model Config & Providers: \`seal-use llm config --corp <corpId>\`, \`seal-use llm providers --corp <corpId>\`.
- System Permissions Config: \`seal-use permissions available --corp <corpId>\`, \`seal-use permissions configs --corp <corpId>\`.
- Billing & Feature Quotas: \`seal-use billing status --corp <corpId>\`, \`seal-use billing plans --corp <corpId>\`, \`seal-use billing features --corp <corpId>\`.
- Webhook 准备看板与审批回调管理: \`seal-use webhook ready [<资源包.zip>] [--webhook <idOrName>] --corp <corpId>\` 检查企业环境、租户连通性、已激活通道与资源包预检;\`seal-use webhook <list|get|add|update|delete> --corp <corpId>\`.
- Webhook 资源包管理 (Webhook Resource Pack): \`seal-use webhook resource-pack export [--limit <n>] [--status <status>] [--output <file.zip>] [--to-downloads] --corp <corpId>\` 从线上审核记录直接打包导出为标准 Webhook 资源包(包含根目录 \`信息表.xlsx\` 与下载好的单据附件),便于通过邮件/微信等第三方渠道离线分发;\`seal-use webhook resource-pack preview <资源包.zip> --corp <corpId>\` 本地预检单据与附件;\`seal-use webhook resource-pack push <资源包.zip> [--webhook <idOrName>] --corp <corpId>\` 上传附件并通过入站 Webhook 触发 AI 审批(租户仅有 1 个通道时自动锁定无需指定 \`--webhook\`)。CLI 简写别名 \`pack\`,旧名 \`material-pack\` 完整向下兼容保留。每个 Webhook 可配置资源包附件的最小字节数、可选最大字节数和文件后缀白名单;这是可修改的持久化策略,不是不可绕过的硬编码。校验不通过时不会上传附件或推送单据。资源包格式:ZIP 根目录名 = \`documentId\`(或 \`documentId@annotation\`),Excel 附件列以 \`[附件]\` 为前缀(如 \`[附件]合同协议\`),单元格值为 ZIP 相对路径(支持多行/逗号/分号分隔);系统执行严格双向验证(Excel 声明附件的单据必须有对应根目录,ZIP 中的文件必须在某个 \`[附件]\` 列中声明)。详见 \`references/cli.md\` 中 "Webhook Resource Pack Workflow" 一节。它与 Seal 官方在模拟测试中使用的 \`simulation material_pack\` 流程相互独立,避免混淆。
- 审批记录转 Webhook 重放 (Universal Record Replay): \`seal-use webhook replay [<recordId>] [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--sn-suffix <str>] [--dry-run] [--force] [--corp <corpId>]\` 以及生产测专用快捷命令 \`seal-use corps replay-test [<prodCorpId>] [--force]\`。通用支持从历史审批记录(Webhook 来源、Hose 来源等)汲取结构化表单与明细字段,自动清洗规范化字段类型,支持按状态/数量批量重放到目标企业 Webhook 触发审批。默认推荐并导向测试企业(测试企业无 Webhook 时自动开通辅助模式通道并锁定环境隔离);若用户未绑定测试企业或明确要求向生产企业重放,支持通过 \`--force\` 显式执行,方便环境回归验证与 Bad Case 靶向调试。
### 2.4 审核大盘与健康体检
- 审核大盘统计(按单据去重):\`seal-use approval-runs stats --corp <corpId> --dedupe-by sourceDocumentSN\`
- 企业健康契约体检(点数余额、管理员身份、规则状态):\`seal-use doctor tenant --corp <corpId>\`
- HTTP REST API & Docs Server: \`seal-use http [--port 8787] [--host 127.0.0.1]\` (提供 \`/docs\` 交互文档、\`/openapi.json\`、\`POST /api/cli\` 与 \`/v1/*\` REST API)。
- 审批规则质量校验 (Linter): \`seal-use rules lint [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary] --corp <corpId>\`; read \`references/rule-lint.md\`. 全局配置默认关闭 (\`config lint <enable|disable>\`),状态由 \`seal-use doctor\` 实时感知并自检;规则修改与治理时,Agent 应主动询问用户是否开启。
- 系统自检、租户健康契约与内嵌架构规范白皮书: \`seal-use doctor\` (整机环境、目录状态、企业资产统计与健康自检,零磁盘写入), \`seal-use doctor tenant [--corp <corpId>] [--quiet]\` (企业租户级健康契约探针:身份/管理员角色、AI 审批点数余额与单次扣费、活跃规则数、草稿安全性、Webhook 通道与环境配对), \`seal-use doctor guide\` (纯内存只读输出内嵌白皮书与目录规范), \`seal-use doctor paths\` (紧凑型核心目录健康检查)。
- Full CLI inventory: read \`references/cli.md\`.
---
## Material-pack Webhook policy and recovery
## 3. 生产规则变更安全闭环(Rule Remediation & Change Cycle)
材料包附件策略保存在目标入站 Webhook 的 \`materialPackFilePolicy\` 下,按 Webhook 生效。新建 Webhook 的默认策略是:最小文件大小 \`500\` 字节、最大文件大小不限制、后缀白名单为常见 PDF/Office/文本/邮件/图片格式。\`信息表.xlsx\` 是材料包根清单,不属于普通附件,不受这三个附件策略限制。完整默认后缀和边界规则见 \`references/cli.md\`。
生产环境规则修改必须遵守安全演进闭环:
\`生产改草稿 -> 同步测试企业 -> 靶场模拟/回归矩阵验证 -> 生产确认发布\`
这套策略允许人工或助手修改。错误处理有两条通道:先通过错误通道明确告诉助手是哪一个文件、哪一条规则失败;再通过配置或文件处置通道完成恢复。遇到附件被拦截时按以下闭环处理:
1. **草稿修改与规范 Diff 呈现**:
- 规则客诉修复与修改详阅 \`references/customer-feedback-rule-remediation.md\`;
- 必须向用户呈现统一 Git Diff,展示业务字段(适用场景、遵守程度、规则编号),隐藏内部 UUID;
- 生产修改时默认仅保存为**草稿态**,绝不直接线上生效。
2. **一键同步测试环境**:
- 运行 \`seal-use corps sync-test <prodCorpId>\`,自动将草稿规则发布到绑定的测试靶场 \`[Prod vN · #M -> Test vM]\`,同时自动同步免配的合思测试通道。
3. **测试靶场自动化验证**:
- 运行 \`seal-use test regression --corp <testCorpId> --samples 10\` 执行自动化规则回归测试矩阵;
- 重放生产历史单据,检验决策一致率(Concordance Rate)与决策翻转(Flips),确保 \`safeToPublish: true\`。
4. **用户授权确认与生产发布**:
- 严禁代替用户决策,只有在用户明确确认批准后,方可在生产环境正式发布。
1. 从错误中识别被拦截的文件、实际大小、失败规则和目标 Webhook。
2. 向用户说明可选处置:替换/压缩文件,或在确认允许该格式/大小后修改 Webhook 策略。
3. 用户或业务负责人明确确认放宽策略后,读取目标 Webhook 当前配置:\`seal-use webhook get\`/\`webhook list\`,或等价的 \`seal-use tool seal_webhook_get\`/\`seal_webhook_list\`(MCP 下经 \`seal_cli\` 执行)。
4. 修改最小值、最大值或完整后缀白名单:\`seal-use webhook update\`,或等价的 \`seal-use tool seal_webhook_update\`(MCP 下经 \`seal_cli_write\` 执行,需用户确认)。写入后重新读取核对,再重试原来的材料包 push。
---
push 会重新读取最新 Webhook 配置;校验通过后才会开始上传附件。CLI 以非零退出码和 \`stderr\` 返回可恢复的业务错误,MCP 以工具错误返回。没有用户授权或没有修改权限时,不能擅自放宽策略,也不能绕过校验。
## 4. 进阶能力路由(Advanced Capabilities & References)
注意:直接执行本地 \`material-pack preview\` 只使用默认策略或命令行临时覆盖,不会自动读取某个 Webhook 的持久化策略;\`webhook ready --file\`(指定 Webhook 时)和 \`material-pack push\` 才使用保存的 Webhook 策略。需要验证实际入站通道策略时,优先使用 \`ready --file --webhook ...\`,或直接重试 push。
需要执行进阶或专项目标时,按需查阅对应子文档:
- **新手首次接入图文说明**:详阅 \`references/first-time-user.md\`(面向小白用户的看图指南)
- **企业认证凭证模型与提权机制**:详阅 \`references/enterprise-onboarding.md\`(同等凭据原则、OpenAPI 开发者密钥提取)
- **生产与测试环境搭配与模拟全流程**:详阅 \`references/staging-simulation-workflow.md\`(生产改草稿、测试验证闭环)
- **客诉定界排查与最小规则 Patch 规范**:详阅 \`references/customer-feedback-rule-remediation.md\`(差旅、费用争议的标准报告闭环)
- **合思 EBot 审核节点发布与部署**:详阅 \`references/hose-enterprise-deploy.md\`
- **合思企业配置、认证诊断与授权链接**:详阅 \`references/hose-enterprise-auth.md\`
- **单据附件与发票争议 Langfuse 追踪**:详阅 \`references/approval-attachment-trace.md\`
- **规则质量校验器 (Linter)**:详阅 \`references/rule-lint.md\`(builtin / strict / hlab 规则质检规范)
- **Webhook 资源包导出与离线重放**:详阅 \`references/cli.md\` (Webhook Resource Pack 章节)
- **完整 CLI 命令全景**:详阅 \`references/cli.md\`
## High-Value Commands
---
\`\`\`bash
seal-use doctor
seal-use doctor tenant --corp <corpId>
seal-use doctor guide
seal-use test regression --corp <corpId> --dry-run
seal-use test regression --corp <corpId> --samples 10 --fail-on-flips
seal-use corps list [query] [--env production|test] [--limit 10] [--all] [--sort usage|name|id]
seal-use corps search <keyword> [--env production|test] [--strict]
seal-use corps get <corpId>
seal-use approval-runs url <recordId> --corp <corpId>
seal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest
seal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --batch <batchId> --latest --fields recordId,status,aiDecision,aiSummary
seal-use approval-runs get <recordId> --corp <corpId> --summary
seal-use approval-runs get <recordId> --corp <corpId> --fields metadata,document.fields,result.summary
seal-use approval-runs document-summary <recordId> --corp <corpId>
seal-use approval-runs cited-rules <recordId> --corp <corpId>
seal-use approval-runs attachments <recordId> --corp <corpId> --summary
seal-use approval-runs result <recordId> --corp <corpId> --summary
seal-use rules count --corp <corpId>
seal-use rules list --corp <corpId> --summary
seal-use rules lint --corp <corpId> --summary
seal-use rules pull --corp <corpId> --out ./rules.local.json
seal-use rules push --corp <corpId> --file ./rules.local.json --dry-run
seal-use rules map --corp <corpId> --version latest
seal-use rules clear --corp <corpId> --dry-run
seal-use rules clear --corp <corpId> --yes
seal-use rules get --corp <corpId> --version 16 --code '#0038'
seal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205
seal-use simulation create --corp <corpId> --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high]
seal-use simulation create --corp <corpId> --mode material_pack --package-ids <materialPackageId> [--schema-config file.json]
seal-use simulation package-upload <材料包.zip> --corp <corpId>
seal-use simulation list --corp <corpId>
seal-use simulation get <batchId> --corp <corpId>
seal-use simulation batch-records <batchId> --corp <corpId>
seal-use simulation status <batchId> --corp <corpId>
seal-use simulation approval-definitions --corp <corpId>
seal-use approval-runs export --corp <corpId> --downloads --completed-only
# Add --with-flow to also populate E人工行为 / E人工意见 columns (Hose Open API, adds ~30s):
seal-use approval-runs export --corp <corpId> --downloads --with-flow
# Target specific document SNs for instant export without full pagination:
seal-use approval-runs export --corp <corpId> --sn B26002307,B26002144 --with-flow --downloads
seal-use analytics insight --corp <corpId>
seal-use contacts departments --corp <corpId>
seal-use data invoices --corp <corpId> --limit 20
seal-use tool seal_approval_search --corp <corpId> --json '{"keywords":["差旅","发票"],"areas":["rules"],"snippetOnly":true,"maxChars":500,"fields":["id","title","snippet"]}'
\`\`\`
## 5. 安全守则与参数责任(Safety Guardrails & Parameter Ownership)
## Important Fields
- \`sourceDocumentSN\`: external document number, often the easiest 合思/易快报 lookup key.
- \`sourceDocumentId\`: external source document ID.
- \`recordId\`: Seal approval run record ID.
- \`simulationBatchId\`: simulation batch identifier.
- \`status\`: run status.
- \`taskMode\` / \`finalExecutionMode\`: execution mode information.
- \`ruleSetVersionNumber\`: approval rule version used by a run.
- \`langfuseTraceId\`: direct Langfuse trace lookup key.
- \`langfuseSessionFallback\`: fallback session key, usually \`hosecloud-{sourceDocumentSN}\`.
## References
- \`references/first-time-user.md\`: 面向完全新手的首次接入图文说明,包含合思开放接口密钥和浏览器 cURL 两条路径;配套图片在同级 \`assets/\` 目录。
- \`references/enterprise-onboarding.md\`: 首次安装、零配置、合思来源与 Seal 原生来源的区分、标准密钥/协助链接/F12 cURL 接入、参数责任与安全边界。
- \`references/approval-run-lightweight.md\`: 单号定位、字段裁剪、摘要、引用规则、单据摘要、附件摘要。
- \`references/rule-lightweight.md\`: 规则 count/list summary、按版本/编号取单条规则、规则搜索裁剪。
- \`references/rule-lint.md\`: 规则质量检查器(Linter,含 builtin / strict / hlab 官方规范)、模糊词拦截、悬空例外闭环、多 TS 校验器切换与发布门禁。
- \`references/customer-feedback-rule-remediation.md\`: 微信/截图反馈包到企业定位、审批追踪、根因分类、最小规则 diff、确认、发布与验收的固定闭环。
- \`references/hose-enterprise-auth.md\`: Hose 企业配置、认证诊断、授权链接。
- \`references/hose-enterprise-init.md\`: 合思标准密钥的域名、企业与管理员自动发现,以及多候选管理员的安全选择。
- \`references/hose-enterprise-deploy.md\`: Seal AI 智能审核发布到合思费控(添加/编辑配置、平台自动探测、一键同步与 EBot 节点发布)。
- \`references/approval-attachment-trace.md\`: 附件/发票/OCR/图片争议的 Langfuse 追踪工作流。
- \`references/staging-simulation-workflow.md\`: 生产与测试环境搭配配置、合思集成免配自动同步、单据模拟测试验证与生产规则安全演进闭环指南。
- \`references/cli.md\`: 完整 CLI 命令清单。
## Safety
Rule, document, style preference, and publish actions mutate Seal configuration. Make the target enterprise explicit, show the intended payload, and verify after the write. Never send real \`enterprises/*.json\` files, tokens, signed URLs, or full raw documents to GitHub, tickets, logs, or chat unless the user explicitly requests a safe export.
`;var rh0=()=>{};var qg1="iVBORw0KGgoAAAANSUhEUgAADVgAAAdwCAYAAACUWcTmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAANWKADAAQAAAABAAAHcAAAAAD4n9OGAABAAElEQVR4AeydB4AdVfX/z246pNAD0hK6dOki0rsU+dMJJVIFRYoUFUFAQUCqgHSkxx8gTRCpFkB6CU06SQi9BEhC+u7/fu7b83J3dt7bt33f5nuStzNz5947M583c+fOvPO9p6Y+mMlEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4kUDsHHrMOWQREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQigd7jxo8TChEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYIwkogtUc+bXroEVABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCBQUx9MKERABERABERABERABERABERABERABERABERABERABERABERABESgqwiMHz/eBgwY0FWb13ZFQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQATmcAKKYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwn0npMPXscuAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAj2RwP8+n26vfjbd3vpyho2fPN0+mjLTJs+qs/qaOhvYp8YWGtDLFh/U25YZ3NdWnr+/rTDvgJ6IQcckAhURqKkPVlFOZRIBERABERABERABERABERABERABERABERABERABERABERABERCBDiAwfvx4GzBAP9p2AFpVKQIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiMIcR+GhSnT347lT713tT7eOpM4OYqj5+LEzNEFdZ+MyKU5Zr4jLp9fat/r1ss28NtM0WG2KLzN1nDiOnw53TCUhgNaefATp+ERABERABERABERABERABERABERABERABERABERABERABEehiAhJYdfEXoM2LgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAhUPYFJ08z+7+Updsc7U8OxFARURKqyIKAqCKnqbVYQUdU2CK7iOiuIr4oirLBcgxArfHZZcrDttcwCNnefXlXPRgcgApUQkMCqEkrKIwIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0GEEJLDqMLSqWAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4g8MR7M+2Cp6fY5JmFSFQhRlUQStUVBVUsF0VUCKiSSFZEsKqLkawa5yH/oN5mP195qK0/dPAcQFGHOKcTkMBqTj8DdPwiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0MUEJLDq4i+gCzY/ZcqUuNUBAwZ0wda1SREQAREQAREQAREQAREQAREQAREQAREQAREQARHoHAKd8S501AszbNT/psXIUwWhVDi2IK6qj5GriGRVEE4RlSoVWlUayYry+w2fx0Yst1DnQNNWRKCLCAQ9oUwEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKCaCFz035n20JgZ1stqQowqs9qaWmJVBR1VbRBZkdLLakN0qiCzCtMGgVXMURfW1YQsTHsFEdasMC0UCSWjOIvcbte++6V9MX2mHb7ytzypS6e/+93v7H//+1/uPuy888727W9/O35yMyhRBEoQ4NyXiYAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiECPIXDbbbfZiBEjGh0PP7aSxif90dXzks68G3k8P2VTYznNm67TvAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BoGLHp1lD74zM6qh6kK4qprwqW+YMl9TR1pYHcRWtUFHhZaqLi6TFsJbhflCOYRVtbG818H6+KGOhnr+9v4ku/DlDzrj0Mpug/fz6Xv+bOa//vWvxkcmAi0loAhWLSWm/CIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAt2WAD+sdvQPp/xwy0cjYHbb00A7JgIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAI9msCo5+rt4XdDVKoaIlfVxChVHHCMPtXoyIO4KuSoy0ayqifOFeWJUxVqSCJZfW/hwfbox1/FuqiKHF4zIqt5+39qey+zYEztij/pbwC8p0/NhVc+TddpXgSaIyCBVXOEtF4EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKBqCLz66qudtq/8iPvrX/+607aX3VBniMluvPHG7Ga1LAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiUIJAzT+vi2vqN9m3RA4li0DbCTw5xuyWl+qMIFQWIk8Rpqo+Cq1YDlKokL7m4v2D7IrFOgurwvqwoiaEsIpyKebNHv9wki+FdERaSKlq7fytlrEj73vLHvvoq7gNUkM4q1BPKBTque7tCbbUoH62/tDBrOkyQ1yVfUf/u9/9rmx0qy7b2VZu2H8H4FhXXHFF+3//7/+1siYVq4RATX2wSjIqjwiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BIHx48fbgAEDOqLqHlun/6ja0QfYUQKrKVOmxF3X997R36DqFwEREAEREAEREAEREAEREAEREAEREAER6EwCs074btxcr9Me78zNalvdmEB7vwudNM3ssFvNJs2oi0KqWUE0FQVUUUiF6KreLtx5QVtt0X5lqYz+cIodevfYkKcg1KpHfBXKHvadobbvdxay0R9NsgPveyOsD3KTWiQniLjCNHyYDgqhfq7bcCmbu0+vsttpy0rEUlgqLErfje+8885NBEepwMrXE83Ko16ldbVl3zqjbHqsvj0EZdmoXb5O07YTUASrtjNUDSIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiLQqQQ6M1JXpx5YD96Yj3sZR3ntwcdZyaHNmDHDPv74Y1t00UULo95WUqiL8syaNct69eo4J5EuOqwu3Szff58+fZrsg66RJkiU0MkEGJ4YhzSZCHQmAdpEjHtNbW0Ydb4djHvX9OnTNYBBA0ucWfv169dufNvhK+oxVUydOtXq6upsrrnm6jHHpAMRAREQAREQgbYS8OhV1FN/1VFWc8B5ba2yWJ6+45gxY+ytt96y/v3729JLL22LLbZYbj+H9y4u6ilWUGJm7rnntgUXXDCu/frrr+2LL74okbNxMv3XJZZYonFia5fGjLaad0e3tnSx3JwSNezmZ2ts8vQQTSr8C9KoOA2Sp8ChJvyttQPXG9SsuMqh1VEslIviqTBdf5G5o7iK1NUWHmg/XW1Ru/iF960+aK8QVbE1j2SFwOumtz6zg749lOztbqlQygVSCIuYL2cIqDwPoirepfsy5ZgnLRv5qlydXbUu73cAjqka9h1mCMSw1kbdamv5uPEW/pHAqoXAlF0EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEuppA+oNwR0WZ6upj7Enbf+ONN+yUU06Jh3Tsscfa6quv3pMOLx7Lhx9+aMcff3yc33vvvW3LLbfMPcZbbrnF7rjjjrjuF7/4ha2yyiq5+dLEyZMn24QJE2zhhRe23r1720svvWTnn39+zPLLX/7SlllmmTR77jyORb/61a/iuv3339++973v5eZLE99++2076aSTbNlll7UtttiiojJp+WqZHz16dBQ84XziNnPmTPv00099sUVTHLMGDx6cW2bcuHHRAWSzzTazHXfc0eaZZ56Y7/HHH7eLLroozh933HG21FJL2Zlnnmm77LJLm6+Xb775xr766qvc/ckmzjvvvNFJLZveluWzzz7b3nrzTVty2DDjfG2JTZs2ze677z7bZpttGonSvvzyy4od5bLb4zqqJqHnxxNmWcHZK3skLV/u16fG5huUL2B5cPRUO Line truncated
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"created"};let I={};try{I=JSON.parse(eh0(z,"utf8"))}catch{I={entries:[]}}if(!Array.isArray(I.entries))I.entries=[];if(I.entries.findIndex((K)=>K&&typeof K.path==="string"&&K.path===Y)!==-1)return{detected:U,configured:!0,configPath:z,targetDir:Y,action:"already_present"};let J=I.entries.findIndex((K)=>K&&typeof K.path==="string"&&(K.path==="~/.agents/skills"||K.path==="~/.agents/skills/"));if(J!==-1)return I.entries[J]={...I.entries[J],path:Y},ml(z,JSON.stringify(I,null,2)+`
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"updated_tilde"};return I.entries.unshift({path:Y}),ml(z,JSON.stringify(I,null,2)+`
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"prepended"}}function rl($){let Y=$?.targetSkillsDir??$S0(),z=$?.configFile??YS0(),U=zS0(),I=!1;if(Tq(z))try{let Q=JSON.parse(eh0(z,"utf8"));if(Array.isArray(Q?.entries))I=Q.entries.some((J)=>J?.path===Y)}catch{}return{detected:U,configured:I,configPath:z,targetDir:Y}}var sl=()=>{};import{cpSync as Dg1,existsSync as kK,lstatSync as IS0,mkdirSync as Ag1,realpathSync as a2,rmSync as Pg1,symlinkSync as Bg1,unlinkSync as US0}from"node:fs";import{homedir as QS0}from"node:os";import{dirname as JS0,join as t2}from"node:path";function Tg1($,Y){let z=Y?.baseHomeDir??QS0(),U=t2(z,$.rootDirName),I=Y?.sourceSkillDir??t2(z,".agents","skills","seal-use"),Q=JS0(I),J=t2(U,"skills"),K=t2(J,"seal-use");if(!kK(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"skipped_not_detected"};if(kK(J)&&kK(Q))try{if(a2(J)===a2(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:J}}catch{}Ag1(J,{recursive:!0});let G;try{G=IS0(K)}catch{G=void 0}let H=!1;if(G)if(G.isSymbolicLink()){try{if(a2(K)===a2(I))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"already_linked",targetPath:K}}catch{}try{US0(K)}catch{}}else if(G.isDirectory())Pg1(K,{recursive:!0,force:!0}),H=!0;else US0(K);let W=process.platform==="win32"?"junction":"dir";try{return Bg1(I,K,W),{id:$.id,name:$.name,detected:!0,configured:!0,mode:H?"replaced_real_dir":"linked",targetPath:K}}catch{try{return Dg1(I,K,{recursive:!0}),{id:$.id,name:$.name,detected:!0,configured:!0,mode:"fallback_copied",targetPath:K}}catch(X){return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"error",targetPath:K,error:X?.message||String(X)}}}}function jg1($,Y){let z=Y?.baseHomeDir??QS0(),U=t2(z,$.rootDirName),I=Y?.sourceSkillDir??t2(z,".agents","skills","seal-use"),Q=JS0(I),J=t2(U,"skills"),K=t2(J,"seal-use");if(!kK(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"not_detected"};if(kK(J)&&kK(Q))try{if(a2(J)===a2(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:J}}catch{}let G;try{G=IS0(K)}catch{G=void 0}if(G){if(G.isSymbolicLink())try{if(a2(K)===a2(I))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"single_symlinked",targetPath:K}}catch{}else if(G.isDirectory())return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"real_directory",targetPath:K}}return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"not_configured",targetPath:K}}function al($){return KS0.map((Y)=>Tg1(Y,$))}function tl($){return KS0.map((Y)=>jg1(Y,$))}var KS0;var el=o(()=>{KS0=[{id:"workbuddy",name:"WorkBuddy",rootDirName:".workbuddy"},{id:"claude",name:"Claude",rootDirName:".claude"},{id:"qoder",name:"Qoder",rootDirName:".qoder"}]});var $o=o(()=>{sl();el();sl();el()});import{existsSync as Eg1,mkdirSync as Yo,readFileSync as Cg1,rmSync as Rg1,writeFileSync as GS0}from"node:fs";import{homedir as WS0}from"node:os";import{dirname as HS0,join as Eq}from"node:path";function zo(){return XS0["SKILL.md"]||""}function ZS0($){return $.match(/^\s*version:\s*(\S+)\s*$/m)?.[1]}function qS0($=Eq(gU(),"SKILL.md")){try{return ZS0(Cg1($,"utf8"))}catch{return}}function gU(){return Eq(WS0(),".agents","skills","seal-use")}function vg1(){return Eq(WS0(),".agents","skills","seal-home")}function hg1(){let $=vg1();if(Eg1($))try{return Rg1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function VS0($=gU()){hg1(),Yo($,{recursive:!0});let Y=[];for(let[z,U]of Object.entries(XS0)){let I=Eq($,z);Yo(HS0(I),{recursive:!0}),GS0(I,U,"utf8"),Y.push(z)}for(let[z,U]of Object.entries(_g1)){let I=Eq($,z);Yo(HS0(I),{recursive:!0}),GS0(I,U),Y.push(z)}return{targetDir:$,files:Y}}var XS0,_g1,D24;var Cq=o(()=>{dl();dl();$o();XS0=ah0,_g1=Object.fromEntries(Object.entries(th0).map(([$,Y])=>[$,Buffer.from(Y,"base64")]));D24=ZS0(zo())});function LS0(){return`# Seal Use 系统架构与运行规范白皮书
- **参数责任原则**:绝不向普通用户索要 \`corpId\`、\`staffId\`、\`proxyStaffBizId\`、\`tenantId\` 等底层机器 ID。所有参数必须由 Agent 自动发现与解析。若有多位管理员,展示脱敏手机号与姓名让用户抉择。
- **链接安全规范**:
- 返回授权、协助或委托链接时,必须同时提供代码块(便于复制)与可点击链接;
- 审批单链接默认提供只读 Deep Link(\`type: 'deep_link'\`);仅在用户明确需要免密时才使用 \`--sso\` 并声明四项安全告知。
- **高危写操作防线**:规则推送(\`rules push\`)、清空(\`rules clear\`)、发布(\`rules publish\`)等破坏性写操作必须先通过 \`--dry-run\` 预览 diff 并获得用户明确批准后方可执行。
`;var rh0=()=>{};var Vg1="iVBORw0KGgoAAAANSUhEUgAADVgAAAdwCAYAAACUWcTmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAANWKADAAQAAAABAAAHcAAAAAD4n9OGAABAAElEQVR4AeydB4AdVfX/z246pNAD0hK6dOki0rsU+dMJJVIFRYoUFUFAQUCqgHSkxx8gTRCpFkB6CU06SQi9BEhC+u7/fu7b83J3dt7bt33f5nuStzNz5947M583c+fOvPO9p6Y+mMlEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4kUDsHHrMOWQREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQigd7jxo8TChEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYIwkogtUc+bXroEVABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCBQUx9MKERABERABERABERABERABERABERABERABERABERABERABERABESgqwiMHz/eBgwY0FWb13ZFQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQATmcAKKYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwn0npMPXscuAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAj2RwP8+n26vfjbd3vpyho2fPN0+mjLTJs+qs/qaOhvYp8YWGtDLFh/U25YZ3NdWnr+/rTDvgJ6IQcckAhURqKkPVlFOZRIBERABERABERABERABERABERABERABERABERABERABERABERCBDiAwfvx4GzBAP9p2AFpVKQIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiMIcR+GhSnT347lT713tT7eOpM4OYqj5+LEzNEFdZ+MyKU5Zr4jLp9fat/r1ss28NtM0WG2KLzN1nDiOnw53TCUhgNaefATp+ERABERABERABERABERABERABERABERABERABERABERABEehiAhJYdfEXoM2LgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAhUPYFJ08z+7+Updsc7U8OxFARURKqyIKAqCKnqbVYQUdU2CK7iOiuIr4oirLBcgxArfHZZcrDttcwCNnefXlXPRgcgApUQkMCqEkrKIwIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0GEEJLDqMLSqWAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4g8MR7M+2Cp6fY5JmFSFQhRlUQStUVBVUsF0VUCKiSSFZEsKqLkawa5yH/oN5mP195qK0/dPAcQFGHOKcTkMBqTj8DdPwiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0MUEJLDq4i+gCzY/ZcqUuNUBAwZ0wda1SREQAREQAREQAREQAREQAREQAREQAREQAREQARHoHAKd8S501AszbNT/psXIUwWhVDi2IK6qj5GriGRVEE4RlSoVWlUayYry+w2fx0Yst1DnQNNWRKCLCAQ9oUwEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKCaCFz035n20JgZ1stqQowqs9qaWmJVBR1VbRBZkdLLakN0qiCzCtMGgVXMURfW1YQsTHsFEdasMC0UCSWjOIvcbte++6V9MX2mHb7ytzypS6e/+93v7H//+1/uPuy888727W9/O35yMyhRBEoQ4NyXiYAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiECPIXDbbbfZiBEjGh0PP7aSxif90dXzks68G3k8P2VTYznNm67TvAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BoGLHp1lD74zM6qh6kK4qprwqW+YMl9TR1pYHcRWtUFHhZaqLi6TFsJbhflCOYRVtbG818H6+KGOhnr+9v4ku/DlDzrj0Mpug/fz6Xv+bOa//vWvxkcmAi0loAhWLSWm/CIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAt2WAD+sdvQPp/xwy0cjYHbb00A7JgIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAI9msCo5+rt4XdDVKoaIlfVxChVHHCMPtXoyIO4KuSoy0ayqifOFeWJUxVqSCJZfW/hwfbox1/FuqiKHF4zIqt5+39qey+zYEztij/pbwC8p0/NhVc+TddpXgSaIyCBVXOEtF4EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKBqCLz66qudtq/8iPvrX/+607aX3VBniMluvPHG7Ga1LAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiUIJAzT+vi2vqN9m3RA4li0DbCTw5xuyWl+qMIFQWIk8Rpqo+Cq1YDlKokL7m4v2D7IrFOgurwvqwoiaEsIpyKebNHv9wki+FdERaSKlq7fytlrEj73vLHvvoq7gNUkM4q1BPKBTque7tCbbUoH62/tDBrOkyQ1yVfUf/u9/9rmx0qy7b2VZu2H8H4FhXXHFF+3//7/+1siYVq4RATX2wSjIqjwiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BIHx48fbgAEDOqLqHlun/6ja0QfYUQKrKVOmxF3X997R36DqFwEREAEREAEREAEREAEREAEREAEREAER6EwCs074btxcr9Me78zNalvdmEB7vwudNM3ssFvNJs2oi0KqWUE0FQVUUUiF6KreLtx5QVtt0X5lqYz+cIodevfYkKcg1KpHfBXKHvadobbvdxay0R9NsgPveyOsD3KTWiQniLjCNHyYDgqhfq7bcCmbu0+vsttpy0rEUlgqLErfje+8885NBEepwMrXE83Ko16ldbVl3zqjbHqsvj0EZdmoXb5O07YTUASrtjNUDSIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiLQqQQ6M1JXpx5YD96Yj3sZR3ntwcdZyaHNmDHDPv74Y1t00UULo95WUqiL8syaNct69eo4J5EuOqwu3Szff58+fZrsg66RJkiU0MkEGJ4YhzSZCHQmAdpEjHtNbW0Ydb4djHvX9OnTNYBBA0ucWfv169dufNvhK+oxVUydOtXq6upsrrnm6jHHpAMRAREQAREQgbYS8OhV1FN/1VFWc8B5ba2yWJ6+45gxY+ytt96y/v3729JLL22LLbZYbj+H9y4u6ilWUGJm7rnntgUXXDCu/frrr+2LL74okbNxMv3XJZZYonFia5fGjLaad0e3tnSx3JwSNezmZ2ts8vQQTSr8C9KoOA2Sp8ChJvyttQPXG9SsuMqh1VEslIviqTBdf5G5o7iK1NUWHmg/XW1Ru/iF960+aK8QVbE1j2SFwOumtz6zg749lOztbqlQygVSCIuYL2cIqDwPoirepfsy5ZgnLRv5qlydXbUu73cAjqka9h1mCMSw1kbdamv5uPEW/pHAqoXAlF0EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEuppA+oNwR0WZ6upj7Enbf+ONN+yUU06Jh3Tsscfa6quv3pMOLx7Lhx9+aMcff3yc33vvvW3LLbfMPcZbbrnF7rjjjrjuF7/4ha2yyiq5+dLEyZMn24QJE2zhhRe23r1720svvWTnn39+zPLLX/7SlllmmTR77jyORb/61a/iuv3339++973v5eZLE99++2076aSTbNlll7UtttiiojJp+WqZHz16dBQ84XziNnPmTPv00099sUVTHLMGDx6cW2bcuHHRAWSzzTazHXfc0eaZZ56Y7/HHH7eLLroozh933HG21FJL2Zlnnmm77LJLm6+Xb775xr766qvc/ckmzjvvvNFJLZveluWzzz7b3nrzTVty2DDjfG2JTZs2ze677z7bZpttGonSvvzyy4od5bLb4zqqJqHnxxNmWcHZK3skLV/u16fG5huUL2B5cPRUO Line truncated
`,"utf8"),{detected:z,configured:!0,configPath:Y,targetDir:U,action:"created"};let Q={};try{Q=JSON.parse(eh0(Y,"utf8"))}catch{Q={entries:[]}}if(!Array.isArray(Q.entries))Q.entries=[];if(Q.entries.findIndex((K)=>K&&typeof K.path==="string"&&K.path===U)!==-1)return{detected:z,configured:!0,configPath:Y,targetDir:U,action:"already_present"};let I=Q.entries.findIndex((K)=>K&&typeof K.path==="string"&&(K.path==="~/.agents/skills"||K.path==="~/.agents/skills/"));if(I!==-1)return Q.entries[I]={...Q.entries[I],path:U},ml(Y,JSON.stringify(Q,null,2)+`
`,"utf8"),{detected:z,configured:!0,configPath:Y,targetDir:U,action:"updated_tilde"};return Q.entries.unshift({path:U}),ml(Y,JSON.stringify(Q,null,2)+`
`,"utf8"),{detected:z,configured:!0,configPath:Y,targetDir:U,action:"prepended"}}function rl($){let U=$?.targetSkillsDir??$S0(),Y=$?.configFile??US0(),z=YS0(),Q=!1;if(Tq(Y))try{let J=JSON.parse(eh0(Y,"utf8"));if(Array.isArray(J?.entries))Q=J.entries.some((I)=>I?.path===U)}catch{}return{detected:z,configured:Q,configPath:Y,targetDir:U}}var sl=()=>{};import{cpSync as Ag1,existsSync as kK,lstatSync as QS0,mkdirSync as Pg1,realpathSync as a2,rmSync as Bg1,symlinkSync as Tg1,unlinkSync as zS0}from"node:fs";import{homedir as JS0}from"node:os";import{dirname as IS0,join as t2}from"node:path";function jg1($,U){let Y=U?.baseHomeDir??JS0(),z=t2(Y,$.rootDirName),Q=U?.sourceSkillDir??t2(Y,".agents","skills","seal-use"),J=IS0(Q),I=t2(z,"skills"),K=t2(I,"seal-use");if(!kK(z))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"skipped_not_detected"};if(kK(I)&&kK(J))try{if(a2(I)===a2(J))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:I}}catch{}Pg1(I,{recursive:!0});let G;try{G=QS0(K)}catch{G=void 0}let H=!1;if(G)if(G.isSymbolicLink()){try{if(a2(K)===a2(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"already_linked",targetPath:K}}catch{}try{zS0(K)}catch{}}else if(G.isDirectory())Bg1(K,{recursive:!0,force:!0}),H=!0;else zS0(K);let W=process.platform==="win32"?"junction":"dir";try{return Tg1(Q,K,W),{id:$.id,name:$.name,detected:!0,configured:!0,mode:H?"replaced_real_dir":"linked",targetPath:K}}catch{try{return Ag1(Q,K,{recursive:!0}),{id:$.id,name:$.name,detected:!0,configured:!0,mode:"fallback_copied",targetPath:K}}catch(X){return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"error",targetPath:K,error:X?.message||String(X)}}}}function Eg1($,U){let Y=U?.baseHomeDir??JS0(),z=t2(Y,$.rootDirName),Q=U?.sourceSkillDir??t2(Y,".agents","skills","seal-use"),J=IS0(Q),I=t2(z,"skills"),K=t2(I,"seal-use");if(!kK(z))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"not_detected"};if(kK(I)&&kK(J))try{if(a2(I)===a2(J))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:I}}catch{}let G;try{G=QS0(K)}catch{G=void 0}if(G){if(G.isSymbolicLink())try{if(a2(K)===a2(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"single_symlinked",targetPath:K}}catch{}else if(G.isDirectory())return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"real_directory",targetPath:K}}return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"not_configured",targetPath:K}}function al($){return KS0.map((U)=>jg1(U,$))}function tl($){return KS0.map((U)=>Eg1(U,$))}var KS0;var el=o(()=>{KS0=[{id:"workbuddy",name:"WorkBuddy",rootDirName:".workbuddy"},{id:"claude",name:"Claude",rootDirName:".claude"},{id:"qoder",name:"Qoder",rootDirName:".qoder"}]});var $o=o(()=>{sl();el();sl();el()});import{existsSync as Cg1,mkdirSync as Uo,readFileSync as Rg1,rmSync as _g1,writeFileSync as GS0}from"node:fs";import{homedir as WS0}from"node:os";import{dirname as HS0,join as Eq}from"node:path";function Yo(){return XS0["SKILL.md"]||""}function ZS0($){return $.match(/^\s*version:\s*(\S+)\s*$/m)?.[1]}function qS0($=Eq(gz(),"SKILL.md")){try{return ZS0(Rg1($,"utf8"))}catch{return}}function gz(){return Eq(WS0(),".agents","skills","seal-use")}function hg1(){return Eq(WS0(),".agents","skills","seal-home")}function Sg1(){let $=hg1();if(Cg1($))try{return _g1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function VS0($=gz()){Sg1(),Uo($,{recursive:!0});let U=[];for(let[Y,z]of Object.entries(XS0)){let Q=Eq($,Y);Uo(HS0(Q),{recursive:!0}),GS0(Q,z,"utf8"),U.push(Y)}for(let[Y,z]of Object.entries(vg1)){let Q=Eq($,Y);Uo(HS0(Q),{recursive:!0}),GS0(Q,z),U.push(Y)}return{targetDir:$,files:U}}var XS0,vg1,A24;var Cq=o(()=>{dl();dl();$o();XS0=ah0,vg1=Object.fromEntries(Object.entries(th0).map(([$,U])=>[$,Buffer.from(U,"base64")]));A24=ZS0(Yo())});function LS0(){return`# Seal Use 系统架构与运行规范白皮书
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
@@ -2589,14 +2516,14 @@ Rule, document, style preference, and publish actions mutate Seal configuration.
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
| :--- | :--- | :--- | :--- |
${Uo.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
${zo.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
`)}
---
## 3. 安全与数据隐私保证
${Io.map(($,Y)=>`### 3.${Y+1} ${$.topic}
${Qo.map(($,U)=>`### 3.${U+1} ${$.topic}
- **安全承诺**:${$.guarantee}
- **实现约束**:${$.enforcement}
`).join(`
@@ -2606,9 +2533,9 @@ ${Io.map(($,Y)=>`### 3.${Y+1} ${$.topic}
## 4. 业务域能力图谱
${Qo.map(($)=>`### \`seal-use ${$.domain}\`
${Jo.map(($)=>`### \`seal-use ${$.domain}\`
* **能力定位**:${$.summary}
* **核心命令**:${$.primaryCommands.map((Y)=>`\`seal-use ${Y}\``).join("、")}
* **核心命令**:${$.primaryCommands.map((U)=>`\`seal-use ${U}\``).join("、")}
`).join(`
`)}
@@ -2619,14 +2546,14 @@ ${Qo.map(($)=>`### \`seal-use ${$.domain}\`
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
`}var Uo,Io,Qo;var Jo=o(()=>{Uo=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Io=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],Qo=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs url"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材 Line truncated
`)}var NS0=o(()=>{qp();t9();S3();Cq();bP();Jo()});var DS0={};x8(DS0,{formatTenantDoctorDashboard:()=>ug1,diagnoseTenantContract:()=>fg1});async function fg1($,Y){let z=[],U=Y.environment==="test"?"test":"production",I=U==="test"?Y.prodCorpId:Y.testCorpId,Q=U==="test"?"prodParent":"testTarget",J=null,K=null;try{let M=await W8($);if(J=M.user,K=M.tenant,Boolean(J?.isAdmin||J?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${J.name??"未知"}」(${J.id??""}),具备完整操作权限`,details:{userId:J.id,userName:J.name,isAdmin:!0,tenantSlug:K?.tenantSlug,permissions:J.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${J.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:J.id,userName:J.name,isAdmin:!1,permissions:J.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(M){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let G={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},H={used:0,remaining:0};try{let M=await cY($),w=Array.isArray(M.features)?M.features:[],O=w.find((N)=>N?.code==="ai-approval");if(O){let N=typeof O.balance==="number"?O.balance:0,B=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,T=Math.floor(N/B);if(G.balance=N,G.deductionAmount=B,G.estimatedRuns=T,N<=0)G.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:N,deductionAmount:B,estimatedRuns:T},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(T<10)G.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${N} 点 (单笔扣除 ${B} 点),仅可支持约 ${T} 笔审核`,details:{balance:N,deductionAmount:B,estimatedRuns:T},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else G.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${N} 点,预估可支持 ${T} 笔审核单据`,details:{balance:N,deductionAmount:B,estimatedRuns:T}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:w.map((N)=>N?.code)}});let D=w.find((N)=>N?.code==="approval-rules");if(D)H.used=typeof D.used==="number"?D.used:0,H.remaining=typeof D.remaining==="number"?D.remaining:0}catch(M){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let W={totalCount:0,activeCount:0,quotaUsed:H.used,quotaRemaining:H.remaining};try{let M=await p6($),w=Array.isArray(M.rules)?M.rules:[];if(W.totalCount=w.length,W.activeCount=w.filter((O)=>O.status==="ACTIVE").length,w.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&I?`可运行 seal-use corps sync-test --corp ${I} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${W.totalCount} 条规则,其中生效活跃 ${W.activeCount} 条`,details:{totalCount:W.totalCount,activeCount:W.activeCount,quotaUsed:H.used,quotaRemaining:H.remaining}})}catch(M){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let X={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let M=await Q$($);X.integrationCount=M.length;let w=M.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(X.hasReplayChannel=Boolean(w),X.activeWebhookId=w?.id??M[0]?.id,M.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook add --name (回放通道) 手动注册专属通道"});else z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${M.length} 个通道${w?` (含专属回放通道「${w.name}」)`:""}`,details:{integrationCount:M.length Line truncated
`)}var AS0=o(()=>{X6()});async function PS0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(LS0());return}if(U==="paths"||U==="dirs"||U==="directories"){let J=Ko();c0(J.directories);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:J}=await Promise.resolve().then(() => (o4(),F_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),R00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),G_0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (AS0(),DS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=J(X),q=await K(Z),V=await H(q,Z);if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(W(V));c0(V);return}let I=Ko();if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(OS0(I));c0(I)}var BS0=o(()=>{NS0();Jo();D4();Q4()});var jS0;var TS0=o(()=>{jS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.30",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local Line truncated
`}var zo,Qo,Jo;var Io=o(()=>{zo=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Qo=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],Jo=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs url"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材 Line truncated
`)}var NS0=o(()=>{qp();t9();S3();Cq();bP();Io()});var DS0={};x8(DS0,{formatTenantDoctorDashboard:()=>bg1,diagnoseTenantContract:()=>ug1});async function ug1($,U){let Y=[],z=U.environment==="test"?"test":"production",Q=z==="test"?U.prodCorpId:U.testCorpId,J=z==="test"?"prodParent":"testTarget",I=Q?z==="test"?"已绑定生产母企业 (上游配置与样本源)":"已绑定测试靶场 (下游隔离演练环境)":void 0,K=null,G=null;try{let w=await W8($);if(K=w.user,G=w.tenant,Boolean(K?.isAdmin||K?.permissions?.includes("*")))Y.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${K.name??"未知"}」(${K.id??""}),具备完整操作权限`,details:{userId:K.id,userName:K.name,isAdmin:!0,permissionLevel:"超级管理员(具备完整操作权限)",tenantName:G?.name,tenantSlug:G?.tenantSlug,permissions:K.permissions}});else Y.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${K.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:K.id,userName:K.name,isAdmin:!1,permissionLevel:"普通用户(部分管理配置受限)",tenantName:G?.name,permissions:K.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(w){Y.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)},recommendation:`请执行 seal-use auth login --corp ${U.id} 重新登录或更新 Token`})}let H={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},W={used:0,remaining:0};try{let w=await cU($),M=Array.isArray(w.features)?w.features:[],N=M.find((B)=>B?.code==="ai-approval");if(N){let B=typeof N.balance==="number"?N.balance:0,T=typeof N.deductionAmount==="number"&&N.deductionAmount>0?N.deductionAmount:120,A=Math.floor(B/T);if(H.balance=B,H.deductionAmount=T,H.estimatedRuns=A,B<=0)H.status="exhausted",Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:B,deductionAmount:T,estimatedRuns:A},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(A<10)H.status="low",Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${B} 点 (单笔扣除 ${T} 点),仅可支持约 ${A} 笔审核`,details:{balance:B,deductionAmount:T,estimatedRuns:A},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else H.status="sufficient",Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${B} 点,预估可支持 ${A} 笔审核单据`,details:{balance:B,deductionAmount:T,estimatedRuns:A}})}else Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:M.map((B)=>B?.code)}});let D=M.find((B)=>B?.code==="approval-rules");if(D)W.used=typeof D.used==="number"?D.used:0,W.remaining=typeof D.remaining==="number"?D.remaining:0}catch(w){Y.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let X={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let w=await p6($),M=Array.isArray(w.rules)?w.rules:[];if(X.totalCount=M.length,X.activeCount=M.filter((N)=>N.status==="ACTIVE").length,M.length===0)Y.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:z==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else Y.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${X.totalCount} 条规则,其中生效活跃 ${X.activeCount} 条`,details:{totalCount:X.totalCount,activeCount:X.activeCount,quotaUsed:W.used,quotaRemaining:W.remaining}})}catch(w){Y.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let Z={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let w=await J$($);Z.integrationCount=w.length;let M=w.find((N)=>N.name.includes("回放")||N.name.toLowerCase().includes("replay"));if(Z.hasReplayChannel=Boolean(M),Z.activeWebhookId=M?.id??w[0]?.id,w.length===0)Y.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook Line truncated
`)}var AS0=o(()=>{X6()});async function PS0($,U,Y){let z=($??U??"").toLowerCase();if(z==="guide"||z==="doc"||z==="knowledge"||z==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
`),console.log(LS0());return}if(z==="paths"||z==="dirs"||z==="directories"){let I=Ko();c0(I.directories);return}if(z==="tenant"||z==="corp"||z==="enterprise"){let{selectCorp:I}=await Promise.resolve().then(() => (o4(),F_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),R00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),G_0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (AS0(),DS0)),X=G(Y.options.corp)??(U&&U!==z?U:void 0)??(Y.command[2]&&Y.command[2]!==z?Y.command[2]:void 0),Z=I(X),q=await K(Z),V=await H(q,Z);if(!(V0(Y.options.quiet)||V0(Y.options.silent)))console.error(W(V));c0(V);return}let Q=Ko();if(!(V0(Y.options.quiet)||V0(Y.options.silent)))console.error(MS0(Q));c0(Q)}var BS0=o(()=>{NS0();Io();D4();J4()});var jS0;var TS0=o(()=>{jS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.31",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local Line truncated
the credentials already stored on this machine for the selected enterprise. Keep it bound
to loopback (\`--host 127.0.0.1\`) and do not expose the port to a network or an origin you
do not control.
`}},parameters:{CorpId:{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},Offset:{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},Limit:{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},RuleId:{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."},VersionId:{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."},DocumentId:{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."},RecordId:{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."},BatchId:{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}},responses:{BadRequest:{description:"Invalid request.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},Unauthorized:{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},NotFound:{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}},schemas:{ErrorResponse:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}},CorpSummary:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}},SwitchCorpRequest:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}},SwitchCorpResponse:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}},SourceConfig:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."},AuthStage:{type:"object",additionalProperties:!0,required:["name","ok"],properties:{name:{type:"string",examples:["hose.openapi","hose.provisional","seal.sso","seal.whoami"]},ok:{type:"boolean"},error:{type:"string"}}},AuthDiagnosis:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}},SealUser:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},tenantId:{type:"string"},name:{type:"string"},isAdmin:{type:"boolean"},permissions:{type:"array",items:{type:"string"}}}},SealTenant:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},name:{type:"string"},tenantSlug:{type:"string"}}},WhoamiResponse:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}},SessionResponse:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}},ApprovalRule:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}},ApprovalRuleInput:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulePatch:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulesResponse:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}},RuleSetVersion:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}},PublishRuleVersionRequest:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}},ApprovalDocument:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},t Line truncated
`}},parameters:{CorpId:{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},Offset:{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},Limit:{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},RuleId:{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."},VersionId:{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."},DocumentId:{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."},RecordId:{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."},BatchId:{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}},responses:{BadRequest:{description:"Invalid request.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},Unauthorized:{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},NotFound:{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}},schemas:{ErrorResponse:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}},CorpSummary:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}},SwitchCorpRequest:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}},SwitchCorpResponse:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}},SourceConfig:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."},AuthStage:{type:"object",additionalProperties:!0,required:["name","ok"],properties:{name:{type:"string",examples:["hose.openapi","hose.provisional","seal.sso","seal.whoami"]},ok:{type:"boolean"},error:{type:"string"}}},AuthDiagnosis:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}},SealUser:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},tenantId:{type:"string"},name:{type:"string"},isAdmin:{type:"boolean"},permissions:{type:"array",items:{type:"string"}}}},SealTenant:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},name:{type:"string"},tenantSlug:{type:"string"}}},WhoamiResponse:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}},SessionResponse:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}},ApprovalRule:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}},ApprovalRuleInput:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulePatch:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulesResponse:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}},RuleSetVersion:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}},PublishRuleVersionRequest:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}},ApprovalDocument:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},t Line truncated
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
@@ -2650,22 +2577,22 @@ do not control.
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
></script>
</body>
</html>`}var RS0=o(()=>{t9()});import{URL as ig1}from"node:url";async function _6($,Y,z,U){let I=$.handler;return I(Y,z,{corp:U})}async function _S0($,Y){if(Y.setHeader("Access-Control-Allow-Origin","*"),Y.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),Y.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){Y.writeHead(204),Y.end();return}let z=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",I=new ig1($.url||"/",`${U}://${z}`),Q=I.pathname.replace(/\/+$/,"")||"/",J=($.method||"GET").toUpperCase();try{if(J==="GET"&&Q==="/"){A4(Y,200,{name:"seal-use",version:P1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(J==="GET"&&Q==="/docs"){ng1(Y,200,CS0());return}if(J==="GET"&&Q==="/openapi.json"){A4(Y,200,vT());return}if(J==="GET"&&Q==="/health"){A4(Y,200,{status:"ok",version:P1,name:"seal-use",timestamp:new Date().toISOString()});return}if(J==="POST"&&(Q==="/shutdown"||Q==="/api/shutdown")){A4(Y,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(J==="POST"&&Q==="/api/cli"){let K=await ST($),G=(typeof K?.command==="string"?K.command:"").trim();if(!G){hT(Y,400,"Missing 'command' property in request body");return}let H=Rq(G),W=H[0]==="seal-use"||H[0]==="seal-home"||H[0]?.endsWith("/seal-use")||H[0]?.endsWith("/seal-home")?H.slice(1):H,X=await _q(W),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}A4(Y,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(J==="POST"&&Q.startsWith("/api/tool/")){let K=Q.slice(10).trim(),G=M6(K);if(!G){hT(Y,404,`Tool not found: '${K}'`);return}let H=await ST($)||{},W=k8($,I,H),X=E1(W),Z=await j1(X),q={...H};delete q.corp;let V=await _6(G,Z,q,X);A4(Y,200,V);return}if(Q.startsWith("/v1/")){if(await cg1($,Y,J,Q,I))return}hT(Y,404,`Cannot ${J} ${Q}. Visit /docs for available endpoints.`)}catch(K){let G=K instanceof Error?K.message:String(K);hT(Y,500,G)}}async function cg1($,Y,z,U,I){let Q=Object.fromEntries(I.searchParams.entries());if(z==="GET"&&U==="/v1/corps"){let J=s8(),K=_4();return A4(Y,200,{count:J.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:J.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(z==="GET"&&U==="/v1/whoami"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_whoami"),W=await _6(H,G,{},K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/session"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_session_get"),W=await _6(H,G,{},K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/summary"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_runs_summary"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/stats"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_runs_stats"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/pick"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_run_pick"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval-runs/url"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_run_url_get"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(U.startsWith("/v1/approval-runs/")){let J=U.slice(18).split("/"),K=J[0],G=J[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let H=k8($,I,Q),W=E1(H),X=await j1(W);if(!G){let Z=M6("seal_approval_run_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="attachments"){let Z=M6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="cited-rules"){let Z=M6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="document-summary"){let Z=M6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}if(G==="result"){let Z=M6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:K,...Q},W);return A4(Y,200,q),!0}}}if(z==="GET"&&U==="/v1/approval-runs"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_runs_search"),W=await _6(H,G,{...Q,limit:Q.limit?Number(Q.limit):void 0,offset:Q.offset?Number(Q.offset):void 0,includeBridge:Q.includeBridge==="true"},K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/approval/rules"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_approval_rules_list"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="GET"&&U==="/v1/simulation/batches"){let J=k8($,I,Q),K=E1(J),G=await j1(K),H=M6("seal_simulation_batches_list"),W=await _6(H,G,Q,K);return A4(Y,200,W),!0}if(z==="POST"&&U==="/v1/simulation/create-batchLine truncated
\uD83D\uDE80 seal-use HTTP Server (v${P1}) started`),console.error(` URL: http://${z}:${Y}`),console.error(` Docs: http://${z}:${Y}/docs`),console.error(` OpenAPI: http://${z}:${Y}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${Y}/api/cli`),console.error(` REST API: http://${z}:${Y}/v1/...
`);I(U)})})}var gT=8787,yT="127.0.0.1";var Wo=o(()=>{vS0();t9()});async function hS0($){let Y=s0($.options.port)??s0($.options.p),z=S($.options.host)??S($.options.h),U=await kT({port:Y,host:z}),I=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",I),process.on("SIGTERM",I),await new Promise(()=>{})}var SS0=o(()=>{D4();Wo()});async function gS0($,Y,z,U){if($==="config"||$==="get"){await k0("seal_llm_config_get",Y,z,{},C0(U.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",Y,z,{},C0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var yS0=o(()=>{o4();Q4()});async function kS0($,Y){if($==="config"||$==="json"){Xo();return}let{startServer:z}=await uS0().then(() => fS0);z()}function Xo(){c0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var xS0=o(()=>{Q4()});function bS0($){let Y=vT();c0(Y,{...C0($.options),allowFull:!0})}var iS0=o(()=>{Go();Q4()});async function cS0($,Y,z,U){if($==="available"){await k0("seal_permissions_available_list",Y,z,{},C0(U.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",Y,z,{},C0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var nS0=o(()=>{o4();Q4()});import{readFileSync as pS0}from"node:fs";async function dS0($,Y,z,U,I,Q,J){if(!$||$==="get"){await k0("seal_preference_get",I,Q,{},C0(J.options));return}if($==="decision"){if(Y==="update"||!Y){let K=S(J.options.input),G=K?JSON.parse(pS0(K,"utf8")):y8(J.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",I,Q,{...G,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(Y==="set"){let K=S(J.options.default)??S(J.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",I,Q,{defaultLevel:K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}if(Y==="policies"){if(z==="list"||!z){await k0("seal_preference_thinking_depth_policies_list",I,Q,{},C0(J.options));return}if(z==="upsert"){let K=S(J.options.input),G=K?JSON.parse(pS0(K,"utf8")):y8(J.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",I,Q,{...G,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}if(z==="remove"||z==="delete"){let K=U??S(J.options.id)??S(J.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",I,Q,{policyId:K,dryRun:V0(J.options.dryRun)??V0(J.options["dry-run"])},C0(J.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var mS0=o(()=>{o4();D4();Q4()});async function lS0($={}){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},h3());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let I=await yK(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(I,null,2));let Q=await j1(U),J=await MM(Q,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:J.rules.rules.length,hasPendingRuleDeletes:J.rules.hasPendingDeletes,documents:J.documents.articles.length,documentsTotal:J.documents.total,stylePreferences:J.stylePreferences.ok?"ok":`error: ${J.stylePreferences.error}`},null,2))}var oS0=o(()=>{S3();i8();ET();X6()});async function rS0($,Y,z){let U=Y??S(z.options.corp)??($&&$!=="--corp"?$:void 0);await lS0({corpId:U})}var sS0=o(()=>{oS0();D4()});async function Zo($,Y,z,U,I){if($==="count"){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(I.options));return}if($==="list"){if(V0(I.options.count)){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(I.options));return}let Q=s0(I.options.limit),J=s0(I.options.offset);if(V0(I.options.summary)){await k0("seal_approval_rules_list",z,U,{fields:q_0,limit:Q,offset:J},C0(I.options));return}let K=await o2("seal_approval_rules_list",z,U,{limit:Q,offset:J});V_0(K,V0(I.options.full)===!0),c0(K);return}if($==="clear"){let Q=V0(I.options.yes)===!0,J=V0(I.options.dryRun)??V0(I.options["dry-run"])??!Q;if(!Q&&!J)throw D9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${U.id} --dry-run`);let K=await o2("seal_approval_rules_clear",z,U,{dryRun:J,recode:V0(I.options.recode)});if(!Q&&J&&K&&typeof K==="object"){c0({...K, Line truncated
`).filter(Boolean),Q=I.slice(-Y);return{logFile:z,lines:Q,totalLines:I.length}}async function rg1($){let Y=bT($),z=Lo($),U=vq($);Yg0($.stateDir);let I=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):gT),Q=$.host??(process.env.HOST?process.env.HOST:yT);fT(Y,`${process.pid}
`,{mode:384}),fT(z,JSON.stringify({pid:process.pid,port:I,host:Q,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),xK(U,`service starting on http://${Q}:${I} pid=${process.pid}`);let J=null;try{J=await kT({port:I,host:Q,silent:!0}),xK(U,`service listening pid=${process.pid}`)}catch(G){if(xK(U,`service failed to bind port ${I}: ${G instanceof Error?G.message:String(G)}`),uT(Y)===process.pid)v9(Y,{force:!0}),v9(z,{force:!0});throw G}let K=()=>{if(J)J.close(),J=null;if(uT(Y)===process.pid)v9(Y,{force:!0}),v9(z,{force:!0});xK(U,`stopped pid=${process.pid}`)};await new Promise((G)=>{let H=!1,W=()=>{if(H)return;H=!0,K(),process.off("SIGTERM",W),process.off("SIGINT",W),G()};process.once("SIGTERM",W),process.once("SIGINT",W)})}function tS0($){Yg0($.stateDir);let Y=fK($);if(Y.running)return Y;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...z.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let I=dg1(z.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});I.unref();let Q=bT($);return fT(Q,`${I.pid}
`,{mode:384}),xK(vq($),`started pid=${I.pid}`),{started:!0,...fK($)}}function eS0($,Y={}){let z=bT($),U=Lo($),I=uT(z);if(!I||!$g0(I,$.appRoot))return v9(z,{force:!0}),v9(U,{force:!0}),Y.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(I,"SIGTERM"),v9(z,{force:!0}),v9(U,{force:!0}),xK(vq($),`stop requested pid=${I}`),Y.quiet?void 0:{stopped:!0,pid:I}}function $g0($,Y){if(!sg1($))return!1;try{let z=mg1("ps",["-p",String($),"-o","command="],{encoding:"utf8"}),U=z.trim().split(/\s+/).filter(Boolean),I=U.indexOf("service"),Q=I!==-1&&U[I+1]==="run",J=z.includes(Y)||U.some((K)=>/(^|[\\/])(seal-use|seal-home)(\.exe)?$/.test(K));return Q&&J}catch{return!1}}function sg1($){try{return process.kill($,0),!0}catch{return!1}}function bT($){return Vo($.stateDir,"service.pid")}function Lo($){return Vo($.stateDir,"service.json")}function vq($){return Vo($.stateDir,"service.log")}function uT($){if(!xT($))return;let Y=Number(qo($,"utf8").trim());return Number.isInteger(Y)&&Y>0?Y:void 0}function Yg0($){lg1($,{recursive:!0,mode:448})}function xK($,Y){fT($,`${new Date().toISOString()} ${Y}
`,{flag:"a",mode:384})}var Fo=o(()=>{Wo()});import{homedir as ag1}from"node:os";import{join as tg1}from"node:path";async function Mo($,Y,z){let U=z?s0(z.options.port)??s0(z.options.p):void 0,I=z?S(z.options.host)??S(z.options.h):void 0,Q=z?s0(z.options.lines)??s0(z.options.n):void 0,J=await yU($,{appRoot:Y.appRoot,entryFile:Y.entryFile,stateDir:wo,version:P1,launcher:Y.launcher,port:U,host:I},{maxLines:Q});if(J!==void 0)c0(J)}var wo;var Oo=o(()=>{t9();Fo();Q4();D4();wo=tg1(ag1(),".config","seal-use")});import{existsSync as eg1,readFileSync as zg0}from"node:fs";async function Ug0($,Y,z,U,I){if($==="batch-records"||$==="records"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",z,U,{batchId:Q,query:S(I.options.query)},C0(I.options));return}if($==="create"||$==="run"){let Q=S(I.options.mode)??S(I.options.sourceSystem)??S(I.options["source-system"])??"hosecloud",J=Q==="material-pack"?"material_pack":Q,K=S(I.options.schemaConfig)??S(I.options["schema-config"]),G=K?JSON.parse(zg0(K,"utf8")):void 0,H=S(I.options.input),W=H?JSON.parse(zg0(H,"utf8")):y8(I.json),X=S(I.options.packageId)??S(I.options["package-id"]),Z=u6(I.options.packageIds)??u6(I.options["package-ids"])??(X?[X]:void 0),q=u6(I.options.flowIds)??u6(I.options["flow-ids"])??u6(I.options.documentSn)??u6(I.options["document-sn"]),V=S(I.options.signKey)??S(I.options["sign-key"])??S(I.options.integration),F=V0(I.options.noWait)??V0(I.options["no-wait"]);await k0("seal_simulation_batch_create",z,U,{mode:J,sourceSystem:J,flowIds:q,documentSn:q,rejectNodeName:S(I.options.rejectNode)??S(I.options["reject-node"])??null,thinkingDepthOverride:S(I.options.thinkingDepth)??S(I.options["thinking-depth"]),skipInvoiceGeneration:V0(I.options.skipInvoiceGeneration)??V0(I.options["skip-invoice-generation"]),skipExpenseExtraction:V0(I.options.skipExpenseExtraction)??V0(I.options["skip-expense-extraction"]),disableAttachmentCache:V0(I.options.disableAttachmentCache)??V0(I.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:S(I.options.templateId)??S(I.options["template-id"]),schemaConfig:G,requestIds:u6(I.options.requestIds)??u6(I.options["request-ids"]),workflowTypeId:S(I.options.workflowTypeId)??S(I.options["workflow-type-id"]),flowStatusList:u6(I.options.flowStatusList)?.map(Number)??u6(I.options["flow-status-list"])?.map(Number),businessCodes:u6(I.options.businessCodes)??u6(I.options["business-codes"]),documentType:S(I.options.documentType)??S(I.options["document-type"]),startTime:s0(I.options.startTime)??s0(I.options["start-time"]),endTime:s0(I.options.endTime)??s0(I.options["end-time"]),status:u6(I.options.status),limit:s0(I.options.limit),noWait:F,rawParams:W},C0(I.options));return}if($==="wait"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",z,U,{batchId:Q,timeout:S(I.options.timeout),pollInterval:S(I.options.pollInterval)??S(I.options["poll-interval"])},C0(I.options));return}if($==="status"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",z,U,{batchId:Q},C0(I.options));return}if($==="clean"||$==="delete"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",z,U,{batchId:Q},C0(I.options));return}if($==="specifications"){let Q=Y??S(I.options.integration)??S(I.options.signKey)??S(I.options["sign-key"]);await k0("seal_simulation_specifications_list",z,U,{signKey:Q},C0(I.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",z,U,{},C0(I.options));return}if($==="list"){await k0("seal_simulation_batches_list",z,U,{limit:s0(I.options.limit)},C0(I.options));return}if($==="get"){let Q=Y??S(I.options.batchId)??S(I.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",z,U,{batchId:Q},C0(I.options));return}if($==="templates"){await k0("seal_simulation_templates_get",z,U,{},C0(I.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",z,U,{},C0(I.options));return}if($==="package-upload"){let Q=Y??S(I.options.file);if(!Q)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!eg1(Q))throw Error(`File not found: ${Q}`);await k0("seal_simulation_material_package_upload",z,U,{filePath:Q},C0(I.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var Ig0=o(()=>{o4();D4();Q4()});import{existsSync as Qg0}from"node:fs";import{join as iT}from"node:path";function Jg0($,Y,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${zoLine truncated
`);return}if($==="install"||$==="init"||$==="sync"){let U=V0(z.options.local)||V0(z.options.workspace),I=S(z.options.dir)??S(z.options.target)??Y,Q=I?I:U?iT(process.cwd(),".agents","skills","seal-use"):gU(),J=VS0(Q),K=!U&&!I,G=K?ol():void 0,H=K?al():void 0;c0({installed:!0,targetDir:J.targetDir,fileCount:J.files.length,files:J.files,...G?{antigravity:G}:{},...H?{hosts:H}:{}});return}if($==="status"||$==="get"||!$){let U=gU(),I=iT(process.cwd(),".agents","skills","seal-use"),Q=rl(),J=tl();c0({global:{dir:U,installed:Qg0(iT(U,"SKILL.md"))},local:{dir:I,installed:Qg0(iT(I,"SKILL.md"))},antigravity:Q,hosts:J});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var Kg0=o(()=>{$o();Cq();D4();Q4()});async function Gg0($,Y){if($==="config"){c0(await yK(Y));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var Hg0=o(()=>{ET();Q4()});function No($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let Y=$.toUpperCase().trim();if(Y==="APPROVE"||Y==="PASS")return"APPROVE";if(Y==="REJECT"||Y==="DENIED")return"REJECT";if(Y==="MANUAL"||Y==="ASSISTED")return"MANUAL";if(Y==="ERROR"||Y==="FAILED")return"ERROR";return Y}async function Wg0($){let{sourceCorp:Y,targetCorp:z,sourceClient:U,targetClient:I,samples:Q=10,dryRun:J=!1,pollIntervalMs:K=2000,timeoutMs:G=45000,snPrefix:H="REG_",fetchFn:W=fetch}=$;if(z.environment!=="test")throw new w4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);let X=await cY(I),q=(Array.isArray(X.features)?X.features:[]).find((d)=>d?.code==="ai-approval"),V=typeof q?.balance==="number"?q.balance:0,F=typeof q?.deductionAmount==="number"&&q.deductionAmount>0?q.deductionAmount:120,M=Q*F;if(V<M)throw new w4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${V} 点,本次回归抽样 ${Q} 笔需要约 ${M} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let w=await b4(U,{limit:Q,status:"completed"}),O=Array.isArray(w.records)?w.records:[];if(O.length===0){let d=await b4(U,{limit:Q});O=Array.isArray(d.records)?d.records:[]}if(O.length===0)throw new w4(`在母企业「${Y.name}」(${Y.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(O=O.slice(0,Q),J){let d=O.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=No(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let D=await Jp(I,z),N=[];for(let d of O){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=No(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await H4(U,d.id),y=`${H}${$0}`,s=Ip(e,{snPrefix:H,docIdPrefix:H});await Qp(D.incomingDocumentWebhook.url,D.secret,s,W,A6(z.seal));let Y0=null,M0=Date.now();while(Date.now()-M0<G){await new Promise((W0)=>setTimeout(W0,K));let a=await b4(I,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let W0=a.records[0];if(W0.status==="completed"||W0.status==="failed"){Y0=W0;break}}}if(!Y0){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=No(Y0?.result?.decision??Y0.aiDecision??Y0?.decision??(Y0.status==="completed"?"APPROVE":"ERROR")),G0=Y0?.result?.summary??Y0.aiSummary,T0=g===E0,b0=T0?"MATCHED":"FLIPPED",Y1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:Y0.id,testDecision:E0,testSummary:G0,status:b0,durationMs:Date.now()-t};if(!T0)Y1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};N.push(Y1)}catch(e){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let B=N.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=N.filter((d)=>d.status==="MATCHED"),A=N.filter((d)=>d.status==="FLIPPED"),j=N.filter((d)=>d.status==="FAILED").length,C=T.length,b=A.length,k=C+b,h=k>0?C/k:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",U0=!i&&j===0,x;try{let d=await cY(I),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")x=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:U0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M,balanceAfter:x},metrics:{sampleCount:N.length,successCount:B.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(h.toFixed(4))},flips:A,records:N}}function Xg0($){let{sourceCorp:Y,targetCorp:z,verdict:U,safeToPublish:I,metrics:Q,quota:J,flips:K,records:G}=$,H=U==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":U==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",W=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${Y.name}」-> 测试靶场「${z.name}」`,` 判定: ${H} · 准许发布: ${I?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${Q.sampleCount} | 一致通过: ${Q.matchCount} | 决策翻转: ${Q.flipCount} | 异常失败: ${Q.failureCount}`,` 一致率: ${(Q.concordanceRate*100).toFixed(1)}% | 消耗预估: ${J.estimatedRequired} 点 (余量: ${J.balanceBefore}${J.balanceAfter!==void 0?` -> ${J.balanceAfter}`:""})`," "+"─".repeat(65)];if(K.length>0){W.push(` ⚠️ 决策翻转清单 (${K.length} 笔单据在新规则下结果改变):`);for(let X of K)if(W.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)W.push(` 理由差异: ${X.diff.reasonDiff}`);W.push(" "+"─".repeat(65)),W.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(U==="CLEAN")W.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% 吻合,无任 Line truncated
`)}var Zg0=o(()=>{L$();X6();SZ()});async function Do($,Y,z){let U=($??Y??"regression").toLowerCase();if(U==="regression"||U==="regress"||U==="matrix"){let I=S(z.options.corp)??(Y&&Y!==U?Y:void 0),Q=E1(I),J=Q,K=Q;if(Q.environment==="test"){K=Q;let O=S(z.options["prod-corp"])??S(z.options.prod)??Q.prodCorpId;if(!O)throw new w4(`测试企业「${Q.name}」(${Q.id}) 未绑定生产母企业,无法拉取历史样本。
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${Q.id}`);J=E1(O)}else{J=Q;let O=S(z.options["test-corp"])??S(z.options.test)??Q.testCorpId;if(!O)throw new w4(`生产企业「${Q.name}」(${Q.id}) 未绑定测试靶场企业。
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Q.id} <testCorpId>`);K=E1(O)}let G=await j1(J),H=await j1(K),W=s0(z.options.samples)??s0(z.options.limit)??s0(z.options.n)??10,X=V0(z.options["dry-run"]),Z=V0(z.options["fail-on-flips"]),q=s0(z.options["poll-interval"])??2000,V=s0(z.options.timeout)??45000,F=S(z.options["sn-prefix"])??"REG_",M=await Wg0({sourceCorp:J,targetCorp:K,sourceClient:G,targetClient:H,samples:W,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z});if(!(V0(z.options.quiet)||V0(z.options.silent)))console.error(Xg0(M));if(c0(M),Z&&!M.ok)throw new w4(`回归测试发现 ${M.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new w4(`未知的 test 子命令: "${U}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var qg0=o(()=>{L$();o4();D4();Q4();i8();Zg0()});async function Vg0($,Y,z,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,Y,z,y8(U.json),C0(U.options))}var Lg0=o(()=>{o4();D4();Q4()});function Fg0(){c0(Vq.map(($)=>({name:$.name,description:$.description})))}var wg0=o(()=>{Fq();Q4()});function cT($=process.execPath,Y=import.meta.url){if(Y.includes("/$bunfs/")||Y.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var Mg0=o(()=>{Cq()});import{chmodSync as $y1,mkdirSync as Yy1,readdirSync as zy1,renameSync as Ao,rmSync as Uy1,unlinkSync as Ag0,writeFileSync as Og0}from"node:fs";import{basename as Iy1,dirname as Qy1,join as pT}from"node:path";import{spawnSync as uK}from"node:child_process";async function Bg0($,Y={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:wo,version:P1,launcher:$.launcher},U=Y.repo||process.env[Jy1]?.trim()||process.env[Ky1]?.trim()||Pg0,I=Y.targetVersion?.trim(),Q=I&&I.toLowerCase()!=="latest"?I:void 0;if(Q){let N=Q.replace(/^v/,""),B=Cg0(N,P1);if(B<0)if(!xS&&Y.force);else{c0({updated:!1,currentVersion:P1,targetVersion:N,mode:cT()?"binary":"source",message:!xS?`Cannot downgrade seal-use from dev build v${P1} to release v${N}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${P1} to older version v${N}. Updates must be forward-only.`});return}if(B===0&&!Y.force){c0({updated:!1,currentVersion:P1,targetVersion:N,mode:cT()?"binary":"source",message:`seal-use is already at version v${P1}. Use --force to reinstall.`});return}}if(Y.changelogOnly){let N=await Po(U,Y.limit??10);c0({currentVersion:P1,totalQueried:N.length,releases:N.map((B)=>({version:B.version,tagName:B.tagName,publishedAt:B.publishedAt,author:B.author,releaseNotes:B.notes,releaseUrl:B.htmlUrl,isCurrent:B.version===P1,isNewer:hq(B.version,P1)}))});return}if(!cT()){if(Y.checkOnly){let B=await Po(U,30),T=B[0],A=T?.version??P1,j=B.find((k)=>k.version===P1),C=hq(A,P1),b=B.filter((k)=>hq(k.version,P1));c0({updated:!1,updateAvailable:C,currentVersion:P1,currentVersionPublishedAt:j?.publishedAt,latestVersion:A,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((k)=>({version:k.version,tagName:k.tagName,publishedAt:k.publishedAt,author:k.author,releaseNotes:k.notes,releaseUrl:k.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let N=fK(z).running;if(N)await yU("stop",z);try{Dg0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(B){console.error(`git pull skipped: ${B instanceof Error?B.message:String(B)}`)}if(Dg0("bun",["install"],{cwd:$.appRoot}),N)await yU("start",z);c0({updated:!0,serviceRestarted:N,version:P1,mode:"source"});return}let J=Hy1(),K=Wy1(),G=await Po(U,30),H=Q?G.find((N)=>N.version===Q||N.tagName===Q||N.tagName===`v${Q}`)??await Ng0(U,Q):G[0]??await Ng0(U);if(!H){c0({updated:!1,currentVersion:P1,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let W=H.version,X=G.find((N)=>N.version===P1),Z=hq(W,P1),q=Z||Boolean(Y.force),V=G.filter((N)=>hq(N.version,P1));if(Y.checkOnly){c0({updated:!1,updateAvailable:Z,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,behindCount:V.length,pendingReleases:V.map((N)=>({version:N.version,tagName:N.tagName,publishedAt:N.publishedAt,author:N.author,releaseNotes:N.notes,releaseUrl:N.htmlUrl})),releaseNotes:H.notes,releaseUrl:H.htmlUrl,mode:"binary"});return}if(!q){c0({updated:!1,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,mode:"binary",message:`seal-use is already up to date (v${P1})`});return}let F=Zy1(H.assets,J,K);if(!F)throw Error(`No compatible binary found for ${J}-${K} in release v${W}. Available assets: ${H.assets.map((N)=>N.name).join(", ")}`);let M=fK(z).running;if(M)await yU("stop",z);let w=process.execPath,O=Qy1(w),D=pT(O,`.tmp-update-${Date.now()}`);Yy1(D,{recursive:!0});try{let N=pT(D,F.name);await qy1(F.downloadUrl,N,H.tagName,F.name);let B=N;if(F.name.endsWith(".tar.gz")||F.name.endsWith(".tgz"))B=Vy1(N,D,J);else if(F.name.endsWith(".zip"))B=Ly1(N,D,J);if($y1(B,493),process.platform==="darwin")try{uK("/usr/bin/codesign",["--remove-signature",B],{stdio:"ignore"}),uK("/usr/bin/codesign",["--force","--sign","-",B],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let A=`${w}.old.${Date.now()}`;try{Ao(w,A)}catch{}Ao(B,w)}else Ao(B,w);if(M)await yU("start",z);let T=Gy1(w,W);c0({updated:!0,fromVersion:P1,toVersion:W,serviceRestarted:M,skillSynced:T.targetDir??!1,skillVersion:T.version??!1,mode:"binary"})}finally{try{Uy1(D,{recursive:!0,force:!0})}catch{}}}function Line truncated
`)}catch{}}async function qy1($,Y,z,U){let I=Bo(),Q=[],J=z?z.startsWith("v")?z:`v${z}`:void 0,K=U||$.split("/").pop()||"";if(I!=="github"){if(J&&K)Q.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${J}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${J}/${K}`);if($.startsWith("https://git.ying-qing.cn"))Q.push($)}if(I!=="gitea")if(J&&K){let F=`https://github.com/${Pg0}/releases/download/${J}/${K}`;if(!process.env.CI)Q.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);Q.push(F)}else if($.includes("github.com")){if(!process.env.CI)Q.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Q.push($)}else Q.push($);let G=Array.from(new Set(Q)),H,W=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let M=G[F],w=new AbortController,O="",D=(A)=>{O=A;try{w.abort()}catch{}},N=setTimeout(()=>{D("Connection timed out (no response headers within 6s)")},W),B,T;try{nT(`==> [${F+1}/${G.length}] Downloading via: ${M}`);let A=await fetch(M,{signal:w.signal});if(N)clearTimeout(N),N=void 0;if(!A.ok)throw Error(`HTTP ${A.status} ${A.statusText}`);B=setTimeout(()=>{D("Overall download time exceeded 3 minutes")},V);let j=Number(A.headers.get("content-length"))||0,C=A.body?.getReader();if(!C){let c=Buffer.from(await A.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);Og0(Y,c),nT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],k=0,h=0;T=setTimeout(()=>{if(k<Z){let c=(k/1024).toFixed(1);D(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),U0,x=new Promise((g,p)=>{U0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,x])}finally{if(U0)clearTimeout(U0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),k+=$0.length,T&&k>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-h>200){h=g;let p=j?Math.round(k/j*100):0,e=(k/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);Og0(Y,i),nT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(A){if(N)clearTimeout(N);if(T)clearTimeout(T);if(B)clearTimeout(B);let j=O||(A instanceof Error?A.message:String(A));H=Error(j),nT(`
↳ Mirror failed: ${H.message}`)}finally{if(N)clearTimeout(N);if(T)clearTimeout(T);if(B)clearTimeout(B)}}throw Error(`Failed to download asset from all mirrors: ${H?.message}`)}function jg0($){let Y;try{Y=zy1($,{withFileTypes:!0})}catch{return[]}let z=[];for(let U of Y){let I=pT($,U.name);if(U.isDirectory())z.push(...jg0(I));else if(U.isFile())z.push(I)}return z}function Eg0($,Y,z){let U=Y==="windows"?"seal-use.exe":"seal-use",I=jg0($);return I.find((Q)=>Iy1(Q)===U)??I[0]??z}function Vy1($,Y,z){let U=uK("tar",["-xzf",$,"-C",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);return Ag0($),Eg0(Y,z,$)}function Ly1($,Y,z){let U=uK("unzip",["-q","-o",$,"-d",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);return Ag0($),Eg0(Y,z,$)}function Cg0($,Y){let z=$.replace(/^v/,"").split(".").map((I)=>Number.parseInt(I,10)||0),U=Y.replace(/^v/,"").split(".").map((I)=>Number.parseInt(I,10)||0);for(let I=0;I<Math.max(z.length,U.length);I++){let Q=z[I]??0,J=U[I]??0;if(Q>J)return 1;if(Q<J)return-1}return 0}function hq($,Y){return Cg0($,Y)>0}function Dg0($,Y,z={}){let U=uK($,Y,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${Y.join(" ")} failed with status ${U.status}`)}var Pg0="yunyingk/seal-use",Sq="yunyingk/seal-home",Jy1="SEAL_USE_GITHUB_REPO",Ky1="SEAL_HOME_GITHUB_REPO";var Rg0=o(()=>{Mg0();Cq();t9();Fo();Q4();Oo()});async function _g0($,Y,z,U,I){if($==="create"){let Q=S(I.options.name)??Y,J=S(I.options.phone);if(!Q||!J)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=S(I.options.dept)??S(I.options.departmentId);await k0("seal_user_create",z,U,{name:Q,phone:J,departmentIds:K?[K]:void 0},C0(I.options));return}if($==="reset-password"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",z,U,{userId:Q},C0(I.options));return}if($==="search"||$==="list"){let Q=Y??S(I.options.keyword)??S(I.options.query)??"";await k0("seal_user_search",z,U,{keyword:Q},C0(I.options));return}if($==="get"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",z,U,{userId:Q},C0(I.options));return}if($==="delete"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",z,U,{userId:Q},C0(I.options));return}if($==="activate"){let Q=Y??S(I.options.userId);if(!Q)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",z,U,{userId:Q},C0(I.options));return}if($==="delegation"||$==="impersonate"){let Q=Y??S(I.options.userId)??S(I.options.phone);if(!Q)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let J=S(I.options.note);await k0("seal_user_delegation_create",z,U,{userIdOrPhone:Q,note:J},C0(I.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var vg0=o(()=>{o4();D4();Q4()});import{dirname as To,join as Fy1}from"node:path";import{fileURLToPath as wy1}from"node:url";function Dy1($){if(!$.length)return!1;let Y=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(Y&&Ny1.has(Y))return!0;if((Y==="service"||Y==="daemon")&&z==="run")return!0;return!1}function _q($,Y={}){if(Dy1($))return gg0($,Y);let z=Sg0.then(()=>gg0($,Y));return Sg0=z.then(()=>{return},()=>{return}),z}async function gg0($,Y){let z=[],U=[],I=console.log,Q=console.error,J={appRoot:Y.appRoot??hg0,entryFile:Y.entryFile??Fy1(Y.appRoot??hg0,"src","cli.ts"),launcher:Y.launcher};console.log=(...K)=>{z.push(jl(K))},console.error=(...K)=>{U.push(jl(K))};try{return await Ay1($,J),{stdout:Mq(z),stderr:Mq(U),isError:!1,exitCode:0}}catch(K){let G=Oq(K instanceof Error?K.message:String(K)),H=hZ(K);if(U.push(G),H.nextAction&&!G.includes("Next action:"))U.push(`\uD83D\uDC49 Next action: ${H.nextAction}`);return{stdout:Mq(z),stderr:Mq(U),isError:!0,exitCode:H.exitCode}}finally{console.log=I,console.error=Q}}async function Ay1($,Y){let z=wq($),[U,I,Q]=z.command,J=U?.toLowerCase(),K=J?My1.has(J):!1,G=K?"update":J;if(G==="version"||G==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){c0(EH);return}let H=X_0(z);if(H.isHelp){L_0(H.target);return}if(!G||!Oy1.has(G))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(G==="webhook"&&(I==="resource-pack"||I==="pack"||I==="material-pack")&&Q==="preview"){let Z=z.command[3]??S(z.options.file)??S(z.options.input);if(!Z)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await M_0(Z,hK(z.options));return}if(G==="openapi"){bS0(z);return}if(G==="mcp-config"){Xo();return}if(G==="skill"){Jg0(I,Q,z);return}if(G==="mcp"||G==="server"){await kS0(I,z);return}if(G==="probe"){await rS0(I, Line truncated
</html>`}var RS0=o(()=>{t9()});import{URL as cg1}from"node:url";async function _6($,U,Y,z){let Q=$.handler;return Q(U,Y,{corp:z})}async function _S0($,U){if(U.setHeader("Access-Control-Allow-Origin","*"),U.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),U.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){U.writeHead(204),U.end();return}let Y=$.headers.host||"localhost",z=$.headers["x-forwarded-proto"]||"http",Q=new cg1($.url||"/",`${z}://${Y}`),J=Q.pathname.replace(/\/+$/,"")||"/",I=($.method||"GET").toUpperCase();try{if(I==="GET"&&J==="/"){A4(U,200,{name:"seal-use",version:P1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(I==="GET"&&J==="/docs"){pg1(U,200,CS0());return}if(I==="GET"&&J==="/openapi.json"){A4(U,200,vT());return}if(I==="GET"&&J==="/health"){A4(U,200,{status:"ok",version:P1,name:"seal-use",timestamp:new Date().toISOString()});return}if(I==="POST"&&(J==="/shutdown"||J==="/api/shutdown")){A4(U,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(I==="POST"&&J==="/api/cli"){let K=await ST($),G=(typeof K?.command==="string"?K.command:"").trim();if(!G){hT(U,400,"Missing 'command' property in request body");return}let H=Rq(G),W=H[0]==="seal-use"||H[0]==="seal-home"||H[0]?.endsWith("/seal-use")||H[0]?.endsWith("/seal-home")?H.slice(1):H,X=await _q(W),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}A4(U,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(I==="POST"&&J.startsWith("/api/tool/")){let K=J.slice(10).trim(),G=O6(K);if(!G){hT(U,404,`Tool not found: '${K}'`);return}let H=await ST($)||{},W=k8($,Q,H),X=E1(W),Z=await j1(X),q={...H};delete q.corp;let V=await _6(G,Z,q,X);A4(U,200,V);return}if(J.startsWith("/v1/")){if(await ng1($,U,I,J,Q))return}hT(U,404,`Cannot ${I} ${J}. Visit /docs for available endpoints.`)}catch(K){let G=K instanceof Error?K.message:String(K);hT(U,500,G)}}async function ng1($,U,Y,z,Q){let J=Object.fromEntries(Q.searchParams.entries());if(Y==="GET"&&z==="/v1/corps"){let I=s8(),K=_4();return A4(U,200,{count:I.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:I.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(Y==="GET"&&z==="/v1/whoami"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_whoami"),W=await _6(H,G,{},K);return A4(U,200,W),!0}if(Y==="GET"&&z==="/v1/session"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_session_get"),W=await _6(H,G,{},K);return A4(U,200,W),!0}if(Y==="GET"&&z==="/v1/approval-runs/summary"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_approval_runs_summary"),W=await _6(H,G,J,K);return A4(U,200,W),!0}if(Y==="GET"&&z==="/v1/approval-runs/stats"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_approval_runs_stats"),W=await _6(H,G,J,K);return A4(U,200,W),!0}if(Y==="GET"&&z==="/v1/approval-runs/pick"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_approval_run_pick"),W=await _6(H,G,J,K);return A4(U,200,W),!0}if(Y==="GET"&&z==="/v1/approval-runs/url"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_approval_run_url_get"),W=await _6(H,G,J,K);return A4(U,200,W),!0}if(z.startsWith("/v1/approval-runs/")){let I=z.slice(18).split("/"),K=I[0],G=I[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let H=k8($,Q,J),W=E1(H),X=await j1(W);if(!G){let Z=O6("seal_approval_run_get"),q=await _6(Z,X,{recordId:K,...J},W);return A4(U,200,q),!0}if(G==="attachments"){let Z=O6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:K,...J},W);return A4(U,200,q),!0}if(G==="cited-rules"){let Z=O6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:K,...J},W);return A4(U,200,q),!0}if(G==="document-summary"){let Z=O6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:K,...J},W);return A4(U,200,q),!0}if(G==="result"){let Z=O6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:K,...J},W);return A4(U,200,q),!0}}}if(Y==="GET"&&z==="/v1/approval-runs"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_approval_runs_search"),W=await _6(H,G,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},K);return A4(U,200,W),!0}if(Y==="GET"&&z==="/v1/approval/rules"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_approval_rules_list"),W=await _6(H,G,J,K);return A4(U,200,W),!0}if(Y==="GET"&&z==="/v1/simulation/batches"){let I=k8($,Q,J),K=E1(I),G=await j1(K),H=O6("seal_simulation_batches_list"),W=await _6(H,G,J,K);return A4(U,200,W),!0}if(Y==="POST"&&z==="/v1/simulation/create-batchLine truncated
\uD83D\uDE80 seal-use HTTP Server (v${P1}) started`),console.error(` URL: http://${Y}:${U}`),console.error(` Docs: http://${Y}:${U}/docs`),console.error(` OpenAPI: http://${Y}:${U}/openapi.json`),console.error(` CLI Exec: POST http://${Y}:${U}/api/cli`),console.error(` REST API: http://${Y}:${U}/v1/...
`);Q(z)})})}var gT=8787,yT="127.0.0.1";var Wo=o(()=>{vS0();t9()});async function hS0($){let U=s0($.options.port)??s0($.options.p),Y=S($.options.host)??S($.options.h),z=await kT({port:U,host:Y}),Q=()=>{z.close(()=>{process.exit(0)})};process.on("SIGINT",Q),process.on("SIGTERM",Q),await new Promise(()=>{})}var SS0=o(()=>{D4();Wo()});async function gS0($,U,Y,z){if($==="config"||$==="get"){await k0("seal_llm_config_get",U,Y,{},C0(z.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",U,Y,{},C0(z.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var yS0=o(()=>{o4();J4()});async function kS0($,U){if($==="config"||$==="json"){Xo();return}let{startServer:Y}=await uS0().then(() => fS0);Y()}function Xo(){c0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var xS0=o(()=>{J4()});function bS0($){let U=vT();c0(U,{...C0($.options),allowFull:!0})}var iS0=o(()=>{Go();J4()});async function cS0($,U,Y,z){if($==="available"){await k0("seal_permissions_available_list",U,Y,{},C0(z.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",U,Y,{},C0(z.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var nS0=o(()=>{o4();J4()});import{readFileSync as pS0}from"node:fs";async function dS0($,U,Y,z,Q,J,I){if(!$||$==="get"){await k0("seal_preference_get",Q,J,{},C0(I.options));return}if($==="decision"){if(U==="update"||!U){let K=S(I.options.input),G=K?JSON.parse(pS0(K,"utf8")):y8(I.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",Q,J,{...G,dryRun:V0(I.options.dryRun)??V0(I.options["dry-run"])},C0(I.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(U==="set"){let K=S(I.options.default)??S(I.options.level)??z;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",Q,J,{defaultLevel:K,dryRun:V0(I.options.dryRun)??V0(I.options["dry-run"])},C0(I.options));return}if(U==="policies"){if(Y==="list"||!Y){await k0("seal_preference_thinking_depth_policies_list",Q,J,{},C0(I.options));return}if(Y==="upsert"){let K=S(I.options.input),G=K?JSON.parse(pS0(K,"utf8")):y8(I.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",Q,J,{...G,dryRun:V0(I.options.dryRun)??V0(I.options["dry-run"])},C0(I.options));return}if(Y==="remove"||Y==="delete"){let K=z??S(I.options.id)??S(I.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",Q,J,{policyId:K,dryRun:V0(I.options.dryRun)??V0(I.options["dry-run"])},C0(I.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var mS0=o(()=>{o4();D4();J4()});async function lS0($={}){let U=s8(),Y=_4(),z=f2(U,{stateful:Y.stateful,defaultCorpId:Y.defaultCorpId,corpId:$.corpId},h3());console.log(`[probe] corp=${z.id} source=${z.source.type}`);let Q=await yK(z);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Q,null,2));let J=await j1(z),I=await OO(J,{documentLimit:20,stylePreferencesEndpoint:z.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:I.rules.rules.length,hasPendingRuleDeletes:I.rules.hasPendingDeletes,documents:I.documents.articles.length,documentsTotal:I.documents.total,stylePreferences:I.stylePreferences.ok?"ok":`error: ${I.stylePreferences.error}`},null,2))}var oS0=o(()=>{S3();i8();ET();X6()});async function rS0($,U,Y){let z=U??S(Y.options.corp)??($&&$!=="--corp"?$:void 0);await lS0({corpId:z})}var sS0=o(()=>{oS0();D4()});async function Zo($,U,Y,z,Q){if($==="count"){await k0("seal_approval_rules_list",Y,z,{countOnly:!0},C0(Q.options));return}if($==="list"){if(V0(Q.options.count)){await k0("seal_approval_rules_list",Y,z,{countOnly:!0},C0(Q.options));return}let J=s0(Q.options.limit),I=s0(Q.options.offset);if(V0(Q.options.summary)){await k0("seal_approval_rules_list",Y,z,{fields:q_0,limit:J,offset:I},C0(Q.options));return}let K=await o2("seal_approval_rules_list",Y,z,{limit:J,offset:I});V_0(K,V0(Q.options.full)===!0),c0(K);return}if($==="clear"){let J=V0(Q.options.yes)===!0,I=V0(Q.options.dryRun)??V0(Q.options["dry-run"])??!J;if(!J&&!I)throw D9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${z.id} --dry-run`);let K=await o2("seal_approval_rules_clear",Y,z,{dryRun:I,recode:V0(Q.options.recode)});if(!J&&I&&K&&typeof K==="object"){c0({...K, Line truncated
`).filter(Boolean),J=Q.slice(-U);return{logFile:Y,lines:J,totalLines:Q.length}}async function sg1($){let U=bT($),Y=Lo($),z=vq($);Ug0($.stateDir);let Q=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):gT),J=$.host??(process.env.HOST?process.env.HOST:yT);fT(U,`${process.pid}
`,{mode:384}),fT(Y,JSON.stringify({pid:process.pid,port:Q,host:J,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),xK(z,`service starting on http://${J}:${Q} pid=${process.pid}`);let I=null;try{I=await kT({port:Q,host:J,silent:!0}),xK(z,`service listening pid=${process.pid}`)}catch(G){if(xK(z,`service failed to bind port ${Q}: ${G instanceof Error?G.message:String(G)}`),uT(U)===process.pid)v9(U,{force:!0}),v9(Y,{force:!0});throw G}let K=()=>{if(I)I.close(),I=null;if(uT(U)===process.pid)v9(U,{force:!0}),v9(Y,{force:!0});xK(z,`stopped pid=${process.pid}`)};await new Promise((G)=>{let H=!1,W=()=>{if(H)return;H=!0,K(),process.off("SIGTERM",W),process.off("SIGINT",W),G()};process.once("SIGTERM",W),process.once("SIGINT",W)})}function tS0($){Ug0($.stateDir);let U=fK($);if(U.running)return U;let Y=$.launcher??{command:process.execPath,args:[$.entryFile]},z=[...Y.args??[],"service","run"];if($.port)z.push("--port",String($.port));if($.host)z.push("--host",String($.host));let Q=mg1(Y.command,z,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});Q.unref();let J=bT($);return fT(J,`${Q.pid}
`,{mode:384}),xK(vq($),`started pid=${Q.pid}`),{started:!0,...fK($)}}function eS0($,U={}){let Y=bT($),z=Lo($),Q=uT(Y);if(!Q||!$g0(Q,$.appRoot))return v9(Y,{force:!0}),v9(z,{force:!0}),U.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(Q,"SIGTERM"),v9(Y,{force:!0}),v9(z,{force:!0}),xK(vq($),`stop requested pid=${Q}`),U.quiet?void 0:{stopped:!0,pid:Q}}function $g0($,U){if(!ag1($))return!1;try{let Y=lg1("ps",["-p",String($),"-o","command="],{encoding:"utf8"}),z=Y.trim().split(/\s+/).filter(Boolean),Q=z.indexOf("service"),J=Q!==-1&&z[Q+1]==="run",I=Y.includes(U)||z.some((K)=>/(^|[\\/])(seal-use|seal-home)(\.exe)?$/.test(K));return J&&I}catch{return!1}}function ag1($){try{return process.kill($,0),!0}catch{return!1}}function bT($){return Vo($.stateDir,"service.pid")}function Lo($){return Vo($.stateDir,"service.json")}function vq($){return Vo($.stateDir,"service.log")}function uT($){if(!xT($))return;let U=Number(qo($,"utf8").trim());return Number.isInteger(U)&&U>0?U:void 0}function Ug0($){og1($,{recursive:!0,mode:448})}function xK($,U){fT($,`${new Date().toISOString()} ${U}
`,{flag:"a",mode:384})}var Fo=o(()=>{Wo()});import{homedir as tg1}from"node:os";import{join as eg1}from"node:path";async function Oo($,U,Y){let z=Y?s0(Y.options.port)??s0(Y.options.p):void 0,Q=Y?S(Y.options.host)??S(Y.options.h):void 0,J=Y?s0(Y.options.lines)??s0(Y.options.n):void 0,I=await yz($,{appRoot:U.appRoot,entryFile:U.entryFile,stateDir:wo,version:P1,launcher:U.launcher,port:z,host:Q},{maxLines:J});if(I!==void 0)c0(I)}var wo;var Mo=o(()=>{t9();Fo();J4();D4();wo=eg1(tg1(),".config","seal-use")});import{existsSync as $y1,readFileSync as Yg0}from"node:fs";async function zg0($,U,Y,z,Q){if($==="batch-records"||$==="records"){let J=U??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",Y,z,{batchId:J,query:S(Q.options.query)},C0(Q.options));return}if($==="create"||$==="run"){let J=S(Q.options.mode)??S(Q.options.sourceSystem)??S(Q.options["source-system"])??"hosecloud",I=J==="material-pack"?"material_pack":J,K=S(Q.options.schemaConfig)??S(Q.options["schema-config"]),G=K?JSON.parse(Yg0(K,"utf8")):void 0,H=S(Q.options.input),W=H?JSON.parse(Yg0(H,"utf8")):y8(Q.json),X=S(Q.options.packageId)??S(Q.options["package-id"]),Z=u6(Q.options.packageIds)??u6(Q.options["package-ids"])??(X?[X]:void 0),q=u6(Q.options.flowIds)??u6(Q.options["flow-ids"])??u6(Q.options.documentSn)??u6(Q.options["document-sn"]),V=S(Q.options.signKey)??S(Q.options["sign-key"])??S(Q.options.integration),F=V0(Q.options.noWait)??V0(Q.options["no-wait"]);await k0("seal_simulation_batch_create",Y,z,{mode:I,sourceSystem:I,flowIds:q,documentSn:q,rejectNodeName:S(Q.options.rejectNode)??S(Q.options["reject-node"])??null,thinkingDepthOverride:S(Q.options.thinkingDepth)??S(Q.options["thinking-depth"]),skipInvoiceGeneration:V0(Q.options.skipInvoiceGeneration)??V0(Q.options["skip-invoice-generation"]),skipExpenseExtraction:V0(Q.options.skipExpenseExtraction)??V0(Q.options["skip-expense-extraction"]),disableAttachmentCache:V0(Q.options.disableAttachmentCache)??V0(Q.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:S(Q.options.templateId)??S(Q.options["template-id"]),schemaConfig:G,requestIds:u6(Q.options.requestIds)??u6(Q.options["request-ids"]),workflowTypeId:S(Q.options.workflowTypeId)??S(Q.options["workflow-type-id"]),flowStatusList:u6(Q.options.flowStatusList)?.map(Number)??u6(Q.options["flow-status-list"])?.map(Number),businessCodes:u6(Q.options.businessCodes)??u6(Q.options["business-codes"]),documentType:S(Q.options.documentType)??S(Q.options["document-type"]),startTime:s0(Q.options.startTime)??s0(Q.options["start-time"]),endTime:s0(Q.options.endTime)??s0(Q.options["end-time"]),status:u6(Q.options.status),limit:s0(Q.options.limit),noWait:F,rawParams:W},C0(Q.options));return}if($==="wait"){let J=U??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",Y,z,{batchId:J,timeout:S(Q.options.timeout),pollInterval:S(Q.options.pollInterval)??S(Q.options["poll-interval"])},C0(Q.options));return}if($==="status"){let J=U??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",Y,z,{batchId:J},C0(Q.options));return}if($==="clean"||$==="delete"){let J=U??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",Y,z,{batchId:J},C0(Q.options));return}if($==="specifications"){let J=U??S(Q.options.integration)??S(Q.options.signKey)??S(Q.options["sign-key"]);await k0("seal_simulation_specifications_list",Y,z,{signKey:J},C0(Q.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",Y,z,{},C0(Q.options));return}if($==="list"){await k0("seal_simulation_batches_list",Y,z,{limit:s0(Q.options.limit)},C0(Q.options));return}if($==="get"){let J=U??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",Y,z,{batchId:J},C0(Q.options));return}if($==="templates"){await k0("seal_simulation_templates_get",Y,z,{},C0(Q.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",Y,z,{},C0(Q.options));return}if($==="package-upload"){let J=U??S(Q.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!$y1(J))throw Error(`File not found: ${J}`);await k0("seal_simulation_material_package_upload",Y,z,{filePath:J},C0(Q.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var Qg0=o(()=>{o4();D4();J4()});import{existsSync as Jg0}from"node:fs";import{join as iT}from"node:path";function Ig0($,U,Y){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${YoLine truncated
`);return}if($==="install"||$==="init"||$==="sync"){let z=V0(Y.options.local)||V0(Y.options.workspace),Q=S(Y.options.dir)??S(Y.options.target)??U,J=Q?Q:z?iT(process.cwd(),".agents","skills","seal-use"):gz(),I=VS0(J),K=!z&&!Q,G=K?ol():void 0,H=K?al():void 0;c0({installed:!0,targetDir:I.targetDir,fileCount:I.files.length,files:I.files,...G?{antigravity:G}:{},...H?{hosts:H}:{}});return}if($==="status"||$==="get"||!$){let z=gz(),Q=iT(process.cwd(),".agents","skills","seal-use"),J=rl(),I=tl();c0({global:{dir:z,installed:Jg0(iT(z,"SKILL.md"))},local:{dir:Q,installed:Jg0(iT(Q,"SKILL.md"))},antigravity:J,hosts:I});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var Kg0=o(()=>{$o();Cq();D4();J4()});async function Gg0($,U){if($==="config"){c0(await yK(U));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var Hg0=o(()=>{ET();J4()});function No($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let U=$.toUpperCase().trim();if(U==="APPROVE"||U==="PASS")return"APPROVE";if(U==="REJECT"||U==="DENIED")return"REJECT";if(U==="MANUAL"||U==="ASSISTED")return"MANUAL";if(U==="ERROR"||U==="FAILED")return"ERROR";return U}async function Wg0($){let{sourceCorp:U,targetCorp:Y,sourceClient:z,targetClient:Q,samples:J=10,dryRun:I=!1,pollIntervalMs:K=2000,timeoutMs:G=45000,snPrefix:H="REG_",fetchFn:W=fetch}=$;if(Y.environment!=="test")throw new w4(`重放目标企业「${Y.name}」(${Y.id}) 的环境为「${Y.environment}」,非测试环境!
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${U.id} <testCorpId>`);let X=await cU(Q),q=(Array.isArray(X.features)?X.features:[]).find((d)=>d?.code==="ai-approval"),V=typeof q?.balance==="number"?q.balance:0,F=typeof q?.deductionAmount==="number"&&q.deductionAmount>0?q.deductionAmount:120,O=J*F;if(V<O)throw new w4(`测试企业「${Y.name}」AI 审批额度不足:当前剩余 ${V} 点,本次回归抽样 ${J} 笔需要约 ${O} 点。
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${Y.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let w=await b4(z,{limit:J,status:"completed"}),M=Array.isArray(w.records)?w.records:[];if(M.length===0){let d=await b4(z,{limit:J});M=Array.isArray(d.records)?d.records:[]}if(M.length===0)throw new w4(`在母企业「${U.name}」(${U.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(M=M.slice(0,J),I){let d=M.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=No(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:U.id,name:U.name,environment:U.environment??"production"},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:O},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let N=await Ip(Q,Y),D=[];for(let d of M){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=No(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await H4(z,d.id),y=`${H}${$0}`,s=Qp(e,{snPrefix:H,docIdPrefix:H});await Jp(N.incomingDocumentWebhook.url,N.secret,s,W,A6(Y.seal));let U0=null,O0=Date.now();while(Date.now()-O0<G){await new Promise((W0)=>setTimeout(W0,K));let a=await b4(Q,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let W0=a.records[0];if(W0.status==="completed"||W0.status==="failed"){U0=W0;break}}}if(!U0){D.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=No(U0?.result?.decision??U0.aiDecision??U0?.decision??(U0.status==="completed"?"APPROVE":"ERROR")),G0=U0?.result?.summary??U0.aiSummary,T0=g===E0,b0=T0?"MATCHED":"FLIPPED",U1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:U0.id,testDecision:E0,testSummary:G0,status:b0,durationMs:Date.now()-t};if(!T0)U1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};D.push(U1)}catch(e){D.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let B=D.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=D.filter((d)=>d.status==="MATCHED"),A=D.filter((d)=>d.status==="FLIPPED"),j=D.filter((d)=>d.status==="FAILED").length,C=T.length,b=A.length,x=C+b,h=x>0?C/x:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",z0=!i&&j===0,k;try{let d=await cU(Q),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")k=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:z0,timestamp:new Date().toISOString(),sourceCorp:{id:U.id,name:U.name,environment:U.environment??"production"},targetCorp:{id:Y.id,name:Y.name,environment:Y.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:O,balanceAfter:k},metrics:{sampleCount:D.length,successCount:B.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(h.toFixed(4))},flips:A,records:D}}function Xg0($){let{sourceCorp:U,targetCorp:Y,verdict:z,safeToPublish:Q,metrics:J,quota:I,flips:K,records:G}=$,H=z==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":z==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",W=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${U.name}」-> 测试靶场「${Y.name}」`,` 判定: ${H} · 准许发布: ${Q?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${J.sampleCount} | 一致通过: ${J.matchCount} | 决策翻转: ${J.flipCount} | 异常失败: ${J.failureCount}`,` 一致率: ${(J.concordanceRate*100).toFixed(1)}% | 消耗预估: ${I.estimatedRequired} 点 (余量: ${I.balanceBefore}${I.balanceAfter!==void 0?` -> ${I.balanceAfter}`:""})`," "+"─".repeat(65)];if(K.length>0){W.push(` ⚠️ 决策翻转清单 (${K.length} 笔单据在新规则下结果改变):`);for(let X of K)if(W.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)W.push(` 理由差异: ${X.diff.reasonDiff}`);W.push(" "+"─".repeat(65)),W.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(z==="CLEAN")W.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% 吻合,无任 Line truncated
`)}var Zg0=o(()=>{L$();X6();SZ()});async function Do($,U,Y){let z=($??U??"regression").toLowerCase();if(z==="regression"||z==="regress"||z==="matrix"){let Q=S(Y.options.corp)??(U&&U!==z?U:void 0),J=E1(Q),I=J,K=J;if(J.environment==="test"){K=J;let M=S(Y.options["prod-corp"])??S(Y.options.prod)??J.prodCorpId;if(!M)throw new w4(`测试企业「${J.name}」(${J.id}) 未绑定生产母企业,无法拉取历史样本。
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${J.id}`);I=E1(M)}else{I=J;let M=S(Y.options["test-corp"])??S(Y.options.test)??J.testCorpId;if(!M)throw new w4(`生产企业「${J.name}」(${J.id}) 未绑定测试靶场企业。
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${J.id} <testCorpId>`);K=E1(M)}let G=await j1(I),H=await j1(K),W=s0(Y.options.samples)??s0(Y.options.limit)??s0(Y.options.n)??10,X=V0(Y.options["dry-run"]),Z=V0(Y.options["fail-on-flips"]),q=s0(Y.options["poll-interval"])??2000,V=s0(Y.options.timeout)??45000,F=S(Y.options["sn-prefix"])??"REG_",O=await Wg0({sourceCorp:I,targetCorp:K,sourceClient:G,targetClient:H,samples:W,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z});if(!(V0(Y.options.quiet)||V0(Y.options.silent)))console.error(Xg0(O));if(c0(O),Z&&!O.ok)throw new w4(`回归测试发现 ${O.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new w4(`未知的 test 子命令: "${z}"。
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var qg0=o(()=>{L$();o4();D4();J4();i8();Zg0()});async function Vg0($,U,Y,z){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,U,Y,y8(z.json),C0(z.options))}var Lg0=o(()=>{o4();D4();J4()});function Fg0(){c0(Vq.map(($)=>({name:$.name,description:$.description})))}var wg0=o(()=>{Fq();J4()});function cT($=process.execPath,U=import.meta.url){if(U.includes("/$bunfs/")||U.includes("\\$bunfs\\"))return!0;let Y=$.toLowerCase().replace(/\\/g,"/");return!Y.endsWith("/bun")&&!Y.endsWith("/bun.exe")&&!Y.endsWith("/node")&&!Y.endsWith("/node.exe")}var Og0=o(()=>{Cq()});import{chmodSync as Uy1,mkdirSync as Yy1,readdirSync as zy1,renameSync as Ao,rmSync as Qy1,unlinkSync as Ag0,writeFileSync as Mg0}from"node:fs";import{basename as Jy1,dirname as Iy1,join as pT}from"node:path";import{spawnSync as uK}from"node:child_process";async function Bg0($,U={}){let Y={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:wo,version:P1,launcher:$.launcher},z=U.repo||process.env[Ky1]?.trim()||process.env[Gy1]?.trim()||Pg0,Q=U.targetVersion?.trim(),J=Q&&Q.toLowerCase()!=="latest"?Q:void 0;if(J){let D=J.replace(/^v/,""),B=Cg0(D,P1);if(B<0)if(!xS&&U.force);else{c0({updated:!1,currentVersion:P1,targetVersion:D,mode:cT()?"binary":"source",message:!xS?`Cannot downgrade seal-use from dev build v${P1} to release v${D}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${P1} to older version v${D}. Updates must be forward-only.`});return}if(B===0&&!U.force){c0({updated:!1,currentVersion:P1,targetVersion:D,mode:cT()?"binary":"source",message:`seal-use is already at version v${P1}. Use --force to reinstall.`});return}}if(U.changelogOnly){let D=await Po(z,U.limit??10);c0({currentVersion:P1,totalQueried:D.length,releases:D.map((B)=>({version:B.version,tagName:B.tagName,publishedAt:B.publishedAt,author:B.author,releaseNotes:B.notes,releaseUrl:B.htmlUrl,isCurrent:B.version===P1,isNewer:hq(B.version,P1)}))});return}if(!cT()){if(U.checkOnly){let B=await Po(z,30),T=B[0],A=T?.version??P1,j=B.find((x)=>x.version===P1),C=hq(A,P1),b=B.filter((x)=>hq(x.version,P1));c0({updated:!1,updateAvailable:C,currentVersion:P1,currentVersionPublishedAt:j?.publishedAt,latestVersion:A,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((x)=>({version:x.version,tagName:x.tagName,publishedAt:x.publishedAt,author:x.author,releaseNotes:x.notes,releaseUrl:x.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let D=fK(Y).running;if(D)await yz("stop",Y);try{Dg0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(B){console.error(`git pull skipped: ${B instanceof Error?B.message:String(B)}`)}if(Dg0("bun",["install"],{cwd:$.appRoot}),D)await yz("start",Y);c0({updated:!0,serviceRestarted:D,version:P1,mode:"source"});return}let I=Wy1(),K=Xy1(),G=await Po(z,30),H=J?G.find((D)=>D.version===J||D.tagName===J||D.tagName===`v${J}`)??await Ng0(z,J):G[0]??await Ng0(z);if(!H){c0({updated:!1,currentVersion:P1,mode:"binary",message:`Failed to query releases from repository '${z}'`});return}let W=H.version,X=G.find((D)=>D.version===P1),Z=hq(W,P1),q=Z||Boolean(U.force),V=G.filter((D)=>hq(D.version,P1));if(U.checkOnly){c0({updated:!1,updateAvailable:Z,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,behindCount:V.length,pendingReleases:V.map((D)=>({version:D.version,tagName:D.tagName,publishedAt:D.publishedAt,author:D.author,releaseNotes:D.notes,releaseUrl:D.htmlUrl})),releaseNotes:H.notes,releaseUrl:H.htmlUrl,mode:"binary"});return}if(!q){c0({updated:!1,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,mode:"binary",message:`seal-use is already up to date (v${P1})`});return}let F=qy1(H.assets,I,K);if(!F)throw Error(`No compatible binary found for ${I}-${K} in release v${W}. Available assets: ${H.assets.map((D)=>D.name).join(", ")}`);let O=fK(Y).running;if(O)await yz("stop",Y);let w=process.execPath,M=Iy1(w),N=pT(M,`.tmp-update-${Date.now()}`);Yy1(N,{recursive:!0});try{let D=pT(N,F.name);await Vy1(F.downloadUrl,D,H.tagName,F.name);let B=D;if(F.name.endsWith(".tar.gz")||F.name.endsWith(".tgz"))B=Ly1(D,N,I);else if(F.name.endsWith(".zip"))B=Fy1(D,N,I);if(Uy1(B,493),process.platform==="darwin")try{uK("/usr/bin/codesign",["--remove-signature",B],{stdio:"ignore"}),uK("/usr/bin/codesign",["--force","--sign","-",B],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let A=`${w}.old.${Date.now()}`;try{Ao(w,A)}catch{}Ao(B,w)}else Ao(B,w);if(O)await yz("start",Y);let T=Hy1(w,W);c0({updated:!0,fromVersion:P1,toVersion:W,serviceRestarted:O,skillSynced:T.targetDir??!1,skillVersion:T.version??!1,mode:"binary"})}finally{try{Qy1(N,{recursive:!0,force:!0})}catch{}}}function Line truncated
`)}catch{}}async function Vy1($,U,Y,z){let Q=Bo(),J=[],I=Y?Y.startsWith("v")?Y:`v${Y}`:void 0,K=z||$.split("/").pop()||"";if(Q!=="github"){if(I&&K)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${I}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${I}/${K}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Q!=="gitea")if(I&&K){let F=`https://github.com/${Pg0}/releases/download/${I}/${K}`;if(!process.env.CI)J.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);J.push(F)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let G=Array.from(new Set(J)),H,W=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let O=G[F],w=new AbortController,M="",N=(A)=>{M=A;try{w.abort()}catch{}},D=setTimeout(()=>{N("Connection timed out (no response headers within 6s)")},W),B,T;try{nT(`==> [${F+1}/${G.length}] Downloading via: ${O}`);let A=await fetch(O,{signal:w.signal});if(D)clearTimeout(D),D=void 0;if(!A.ok)throw Error(`HTTP ${A.status} ${A.statusText}`);B=setTimeout(()=>{N("Overall download time exceeded 3 minutes")},V);let j=Number(A.headers.get("content-length"))||0,C=A.body?.getReader();if(!C){let c=Buffer.from(await A.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);Mg0(U,c),nT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],x=0,h=0;T=setTimeout(()=>{if(x<Z){let c=(x/1024).toFixed(1);N(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),z0,k=new Promise((g,p)=>{z0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,k])}finally{if(z0)clearTimeout(z0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),x+=$0.length,T&&x>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-h>200){h=g;let p=j?Math.round(x/j*100):0,e=(x/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);Mg0(U,i),nT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(A){if(D)clearTimeout(D);if(T)clearTimeout(T);if(B)clearTimeout(B);let j=M||(A instanceof Error?A.message:String(A));H=Error(j),nT(`
↳ Mirror failed: ${H.message}`)}finally{if(D)clearTimeout(D);if(T)clearTimeout(T);if(B)clearTimeout(B)}}throw Error(`Failed to download asset from all mirrors: ${H?.message}`)}function jg0($){let U;try{U=zy1($,{withFileTypes:!0})}catch{return[]}let Y=[];for(let z of U){let Q=pT($,z.name);if(z.isDirectory())Y.push(...jg0(Q));else if(z.isFile())Y.push(Q)}return Y}function Eg0($,U,Y){let z=U==="windows"?"seal-use.exe":"seal-use",Q=jg0($);return Q.find((J)=>Jy1(J)===z)??Q[0]??Y}function Ly1($,U,Y){let z=uK("tar",["-xzf",$,"-C",U],{stdio:"pipe"});if(z.status!==0)throw Error(`Failed to extract tar archive: ${z.stderr.toString()}`);return Ag0($),Eg0(U,Y,$)}function Fy1($,U,Y){let z=uK("unzip",["-q","-o",$,"-d",U],{stdio:"pipe"});if(z.status!==0)throw Error(`Failed to extract zip archive: ${z.stderr.toString()}`);return Ag0($),Eg0(U,Y,$)}function Cg0($,U){let Y=$.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0),z=U.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0);for(let Q=0;Q<Math.max(Y.length,z.length);Q++){let J=Y[Q]??0,I=z[Q]??0;if(J>I)return 1;if(J<I)return-1}return 0}function hq($,U){return Cg0($,U)>0}function Dg0($,U,Y={}){let z=uK($,U,{cwd:Y.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(z.stdout)console.error(z.stdout.trimEnd());if(z.stderr)console.error(z.stderr.trimEnd());if(z.status!==0)throw Error(`${$} ${U.join(" ")} failed with status ${z.status}`)}var Pg0="yunyingk/seal-use",Sq="yunyingk/seal-home",Ky1="SEAL_USE_GITHUB_REPO",Gy1="SEAL_HOME_GITHUB_REPO";var Rg0=o(()=>{Og0();Cq();t9();Fo();J4();Mo()});async function _g0($,U,Y,z,Q){if($==="create"){let J=S(Q.options.name)??U,I=S(Q.options.phone);if(!J||!I)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=S(Q.options.dept)??S(Q.options.departmentId);await k0("seal_user_create",Y,z,{name:J,phone:I,departmentIds:K?[K]:void 0},C0(Q.options));return}if($==="reset-password"){let J=U??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",Y,z,{userId:J},C0(Q.options));return}if($==="search"||$==="list"){let J=U??S(Q.options.keyword)??S(Q.options.query)??"";await k0("seal_user_search",Y,z,{keyword:J},C0(Q.options));return}if($==="get"){let J=U??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",Y,z,{userId:J},C0(Q.options));return}if($==="delete"){let J=U??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",Y,z,{userId:J},C0(Q.options));return}if($==="activate"){let J=U??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",Y,z,{userId:J},C0(Q.options));return}if($==="delegation"||$==="impersonate"){let J=U??S(Q.options.userId)??S(Q.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let I=S(Q.options.note);await k0("seal_user_delegation_create",Y,z,{userIdOrPhone:J,note:I},C0(Q.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var vg0=o(()=>{o4();D4();J4()});import{dirname as To,join as wy1}from"node:path";import{fileURLToPath as Oy1}from"node:url";function Ay1($){if(!$.length)return!1;let U=$[0]?.toLowerCase(),Y=$[1]?.toLowerCase();if(U&&Dy1.has(U))return!0;if((U==="service"||U==="daemon")&&Y==="run")return!0;return!1}function _q($,U={}){if(Ay1($))return gg0($,U);let Y=Sg0.then(()=>gg0($,U));return Sg0=Y.then(()=>{return},()=>{return}),Y}async function gg0($,U){let Y=[],z=[],Q=console.log,J=console.error,I={appRoot:U.appRoot??hg0,entryFile:U.entryFile??wy1(U.appRoot??hg0,"src","cli.ts"),launcher:U.launcher};console.log=(...K)=>{Y.push(jl(K))},console.error=(...K)=>{z.push(jl(K))};try{return await Py1($,I),{stdout:Oq(Y),stderr:Oq(z),isError:!1,exitCode:0}}catch(K){let G=Mq(K instanceof Error?K.message:String(K)),H=hZ(K);if(z.push(G),H.nextAction&&!G.includes("Next action:"))z.push(`\uD83D\uDC49 Next action: ${H.nextAction}`);return{stdout:Oq(Y),stderr:Oq(z),isError:!0,exitCode:H.exitCode}}finally{console.log=Q,console.error=J}}async function Py1($,U){let Y=wq($),[z,Q,J]=Y.command,I=z?.toLowerCase(),K=I?My1.has(I):!1,G=K?"update":I;if(G==="version"||G==="v"||Boolean(Y.options.version)||Boolean(Y.options.v)||Boolean(Y.options.V)){c0(EH);return}let H=X_0(Y);if(H.isHelp){L_0(H.target);return}if(!G||!Ny1.has(G))throw Error(`Unknown command: ${Y.command.join(" ")}. Run 'seal-use help' for available commands.`);if(G==="webhook"&&(Q==="resource-pack"||Q==="pack"||Q==="material-pack")&&J==="preview"){let Z=Y.command[3]??S(Y.options.file)??S(Y.options.input);if(!Z)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await O_0(Z,hK(Y.options));return}if(G==="openapi"){bS0(Y);return}if(G==="mcp-config"){Xo();return}if(G==="skill"){Ig0(Q,J,Y);return}if(G==="mcp"||G==="server"){await kS0(Q,Y);return}if(G==="probe"){await rS0(Q, Line truncated
`)?"":`
`}`);process.exitCode=$.exitCode}var m3,ug0,dT="seal_cli",kq="seal_cli_write",bg0="SEAL_USE_MCP_ENABLED",ig0="SEAL_HOME_MCP_ENABLED",Ry1;var uS0=o(async()=>{Be();Ee();A$();Ho();kg0();L$();t9();m3=Ey1(import.meta.url),ug0=m3.includes("/dist/mcp/")||m3.includes("\\dist\\mcp\\")?gq(gq(gq(m3))):gq(gq(m3));Ry1=Boolean(J0.main==J0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&xg0(process.argv[1])===xg0(m3));if(Ry1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await Cy1();else try{pg0()}catch($){console.error($),process.exitCode=1}});await uS0();export{Rq as tokenizeCommand,pg0 as startServer,cg0 as resolveMcpEnabled,ng0 as createServer,bg0 as SEAL_MCP_ENABLED_ENV,kq as SEAL_CLI_WRITE_TOOL_NAME,dT as SEAL_CLI_TOOL_NAME,ig0 as LEGACY_SEAL_MCP_ENABLED_ENV};
`}`);process.exitCode=$.exitCode}var m3,ug0,dT="seal_cli",kq="seal_cli_write",bg0="SEAL_USE_MCP_ENABLED",ig0="SEAL_HOME_MCP_ENABLED",_y1;var uS0=o(async()=>{Be();Ee();A$();Ho();kg0();L$();t9();m3=Cy1(import.meta.url),ug0=m3.includes("/dist/mcp/")||m3.includes("\\dist\\mcp\\")?gq(gq(gq(m3))):gq(gq(m3));_y1=Boolean(I0.main==I0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&xg0(process.argv[1])===xg0(m3));if(_y1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await Ry1();else try{pg0()}catch($){console.error($),process.exitCode=1}});await uS0();export{Rq as tokenizeCommand,pg0 as startServer,cg0 as resolveMcpEnabled,ng0 as createServer,bg0 as SEAL_MCP_ENABLED_ENV,kq as SEAL_CLI_WRITE_TOOL_NAME,dT as SEAL_CLI_TOOL_NAME,ig0 as LEGACY_SEAL_MCP_ENABLED_ENV};
+1 -1
View File
@@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "seal-use Wrapped API",
"version": "0.10.30",
"version": "0.10.31",
"description": "HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"
},
"servers": [
+1 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: seal-use Wrapped API
version: 0.10.30
version: 0.10.31
description: |
HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter
(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "seal-use",
"version": "0.10.30",
"version": "0.10.31",
"private": true,
"description": "Seal tenant operations toolkit: approval-run diagnosis, rule remediation, Hose/合思 auth, plus a CLI and an optional MCP server.",
"license": "MIT",
+98 -179
View File
@@ -1,211 +1,130 @@
---
name: seal-use
description: "v0.10.30: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
description: "v0.10.31: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
metadata:
version: 0.10.30
short-description: Seal tenant and Hose approval automation (v0.10.30)
version: 0.10.31
short-description: Seal tenant and Hose approval automation (v0.10.31)
---
# Seal Use (v0.10.30)
# Seal Use (v0.10.31)
**The CLI is the primary path; the MCP server is an optional extra that is off by default.** Prefer the global `seal-use` CLI, and only use MCP when it is actually available in the current session. If no `seal_cli*` tool is present, that is the normal default — do not try to enable it or treat it as a fault; just use the CLI. Enabling it is the user's choice in the plugin settings (插件配置中的「启用 MCP 服务」,默认关闭,打开后需重连该插件的 MCP 服务).
> CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (`stdout`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 `stderr`。
When MCP *is* available, two tools are exposed:
---
- `seal_cli` — **read-only only.** Reads tenant state without changing it. It is annotated `readOnlyHint: true`, so clients may auto-approve it.
- `seal_cli_write` — everything that mutates tenant state, publishes configuration, mints credentials, self-updates or starts a server. Annotated `destructiveHint: true`; **confirm the exact command with the user before calling it.**
## 0. 全局业务术语与对外输出契约(Mandatory Vocabulary Contract)⚠️ 核心红线
The boundary is enforced, not merely advertised: `seal_cli` refuses any command that is not on its read-only allow-list, and unclassified commands fail closed. A refusal names `seal_cli_write` as the follow-up. `seal-use tool <name>` is allowed through `seal_cli` only for tools the registry classifies as read-only (`SEAL_READ_ONLY_TOOLS`); the rest need `seal_cli_write`.
**所有场景强制生效**(包括规则列表、规则详情、规则修补与 Diff、单据核对、体检诊断、客诉排查及所有日常对话):
This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
### 1.1 业务术语强制映射与违禁词红线
| 系统字段 / 英文枚举 | 强制使用的业务术语 | 严禁自创 / 违禁词(红线) |
| :--- | :--- | :--- |
| `scope` | **适用场景** | ❌ 适用范围、适用模版、触发条件、触发范围 |
| `strictness` | **遵守程度** | ❌ 严格度、执行力度、严重性、级别 |
| `MUST_FOLLOW` | **必须遵守** | ❌ 必须执行、强阻断、必须遵守(系统) |
| `SHOULD_FOLLOW`| **建议遵守** | ❌ 建议执行、弱提示、建议参考 |
| `SUGGESTION` | **提示参考** | ❌ 参考、建议、提示 |
| `code` | **规则编号** (如 `#0038`) | ❌ 规则代码、code、系统code |
| `status` | **启用状态** (`已启用` / `已停用` / `草稿`) | ❌ active/inactive、生效状态 |
| `description` | **规则内容 / 审核要求** | ❌ 规则描述、说明文案 |
## Bootstrap & Installation (环境安装与自愈)
### 1.2 隐藏内部机器标识与脱敏原则
- **严禁向用户直接暴露系统底层存储 UUID**(如 `01a00f34...`、`cly...` 等机器哈希),对外交流与呈现统一使用用户与管理后台唯一认知的业务编号:`规则编号: #xxxx`。
- **严禁暴露内部技术参数名**:严禁向用户直接输出 `boundCorpRole: testTarget`、`tenantSlug`、`permissions: ["*"]` 等生硬技术字段,一律转化为业务中文表述(如“测试靶场环境”、“具备全部超级管理员权限”)。
- **手机号脱敏**:凡涉及员工或管理员手机号,必须脱敏中间 4 位(`138****5678`),严防信息泄露。
Agent 必须确保使用最新版本的 `seal-use` CLI、Skill 与 Agent 插件。在执行任何配置或业务任务前,优先核验版本状态:
---
```bash
seal-use version
seal-use corps list
```
## 1. 首次接入图文引导(Newbie 3-Step & Mandatory Image Rule)
如果 CLI 或 Skill 尚未安装或落后于发布版本,通过以下命令一键安装或升级:
> **【强制执行契约】**:当用户首次使用、询问如何接入、或需要用户提供凭证材料时,**Agent 必须主动使用 Markdown 图片语法将对应步骤的截图呈现给用户,绝对禁止只发干瘪文字!**
```bash
# 方式 1:CLI 自更新(已安装时推荐)
seal-use update
### 新手接入 3 步走:
1. **确认材料类型**:向用户自然询问拥有的材料(合思开放平台凭据、协助链接、或网页 cURL)。
2. **图文指导获取(必须贴图)**:
- **路径一:合思开放平台(推荐·永久开发者凭据)**
1. 进入「应用中心」搜索“接口”,进入「开放接口(新)」:
![进入开放接口](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-open-platform-app-center.png)
2. 点击「商品配置」:
![点击商品配置](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-open-platform-product-config.png)
3. 复制「接入账号」(`appKey`) 与「接入密码」(`appSecurity`):
![找到接入账号和密码](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-open-platform-credentials.png)
- **路径二:从已登录网页复制 cURL(零门槛·会话快照或自动提权)**
1. 在企业网页右键选择「检查」打开开发者工具:
![打开检查](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-curl-open-page-check.png)
2. 切换到「网络」-「Fetch/XHR」,刷新或点击任一列表:
![网络Fetch/XHR](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-curl-network-fetch-xhr.png)
3. 找到任一正常业务请求,右键「复制」-「以 cURL 格式复制」:
![以cURL格式复制](file:///Users/yingqing/Code/seal-use/skills/seal-use/assets/hose-curl-copy-as-curl.png)
3. **无感接入**:Agent 接收材料后自动执行 `corps add-hose`、`corps add-link` 或 `corps extract-keys --save`,系统自动反查拉取真实企业中文名,自动绑定管理员,完成接入。无需用户手动查找 `corpId` 或 `staffId`。详阅 `references/first-time-user.md` 与 `references/enterprise-onboarding.md`。
# 方式 2:国内高速一键安装与自愈(Gitea 镜像源,免代理、秒级完成)
curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash
---
# 方式 3:Global / GitHub Direct
curl -fsSL https://raw.githubusercontent.com/yunyingk/seal-use/main/scripts/install.sh | bash
```
## 2. 80% 日常业务运维场景(Daily High-Frequency Operations)
安装或升级后,验证系统连通性:
```bash
seal-use version
seal-use corps list
```
日常 80% 的工作聚焦在企业切换、规则查验、单据定位与运行大盘:
## First Rules
### 2.1 企业定位与切换
- 关键字智能搜索(支持同音字/拼音/简拼/容错):`seal-use corps search <keyword>`
- 常用企业列表(默认展示 7 天使用频次最高的 10 家):`seal-use corps list`
- 查看企业详情(富属性安全脱敏查看):`seal-use corps get <corpId>`
- Treat CLI/MCP as the Agent's execution channel, not the user's interface. Translate natural-language intent into commands yourself; never ask the user to compose CLI syntax, JSON payloads, placeholder values, or internal IDs.
- Before asking for enterprise parameters, resolve the target enterprise: when an enterprise is named, hinted, or keyword-identifiable, ALWAYS run `seal-use corps search <keyword>` (or `seal-use corps get <corpId>` if an exact ID is known) — DO NOT dump the entire enterprise catalog with `seal-use corps list` when the target is already known. Only run `seal-use corps list` (or `corps list --env <test|production>`) for initial discovery when zero enterprise context is known. Resolve its human name to the returned `id` and pass that value as `--corp`; do not ask the user to know `corpId`. Use `seal-use corps get <corpId>` to inspect rich enterprise attributes (URLs, tenant slugs, staff IDs, environment relations, and config file locations) with sensitive secrets safely redacted.
- If no enterprise is configured, the user is installing for the first time, or the user provides credentials, an assistance link, or a browser-copied cURL, read `references/first-time-user.md` for the plain-language, screenshot-based path first, then read `references/enterprise-onboarding.md` before asking questions or running setup commands.
- When the user provides a Hose/合思 `thirdparty.html` assistance link, use `seal-use corps add-link <url> [--name ...]` for temporary session access, or elevate privileges to permanent developer credentials using `seal-use corps extract-keys <url> --save` (or `seal-use corps add-link <url> --as-hose`). This Hose-exclusive capability extracts `appKey`/`appSecurity`. If the enterprise has multiple keys, specify `--app-key <key>` or `--key-id <id>`.
- **同等凭据原则(Equal Credential Scope Principle)**: A Hose assistance link and a cURL copied from an authenticated **Hose admin** page are both Hose web frontend sessions — structurally different in format only, carrying the same `accesstoken`/`corpid` web session credentials. **When a Hose administrator provides a browser cURL, do NOT silently downgrade it to a plain short-lived session import.** Attempt privilege elevation first by extracting `accesstoken`+`corpid`+`baseUrl` from the cURL and invoking the Hose key interface (`/api/innerapi/v1/key`) to retrieve permanent `appKey`/`appSecurity`. Only fall back to temporary session import if the user is not a Hose administrator or the key interface returns no keys.
- Keep enterprise identity origin separate from credential acquisition. A Hose/合思-sourced Seal tenant can be accessed with standard Hose app credentials, an assistance link, or a captured web session; receiving a Seal Bearer token does not by itself prove the tenant is Seal-native. Calling key extraction or `keys` on native Seal enterprises is strictly blocked.
- Never ask a normal user for `corpId`, `staffId`, `proxyStaffBizId`, `tenantId`, or another discoverable internal ID. Discover it first. If discovery fails, explain what the field means, why it could not be discovered, and exactly where the user can find it.
- Prefer compact commands first: `pick`, `--summary`, `--fields`, `attachments --summary`, `rules count`, and `rules list --summary`.
- Parse JSON stdout. Do not scrape human text.
- Do not hand-edit enterprise configs for normal setup. Use `seal-use corps ...`.
- Before write operations on rules, documents, style preferences, or publishing, fetch current state and confirm the intended mutation with the user. For supported configuration writes, prefer the universal `--dry-run` preview first (rules clear/push, `corps sync-test`, preference updates, thinking-depth policies, HoseCloud configure, and Webhook add/update/delete), then use `--yes` only after reviewing its redacted `changesDiff`.
- Knowledge document creation and deletion are now supported. Validate `contentType` and `scenarios` before creating; use `enabled: false` when the document should be withdrawn without deletion. For an explicit deletion, re-read the document and obtain confirmation before using the low-level `seal_approval_delete_document` tool.
- For customer-feedback rule remediation, show an exact field-level diff and obtain explicit approval before updating. Default to changing only the narrowest necessary part of `description`; preserve `scope`, `strictness`, and unrelated clauses unless the user explicitly approves otherwise. Always follow the Presentation & Report Contract in `references/customer-feedback-rule-remediation.md`: hide internal UUIDs, use standard business terms (适用场景, 遵守程度), present unmodified fields cleanly without colloquial fluff, format description changes as standard Git Diff, and avoid repeating full report text in chat context once structured HTML/PDF artifacts are delivered (guide users to external browsers/viewers instead).
- Resolve and lock the target enterprise `corpId` before diagnosis or mutation. Never assume the current tenant is the customer tenant. Re-fetch the target rule immediately before updating, then verify the draft and newly published version after writing.
- For date questions, use explicit dates and `--timezone Asia/Shanghai`.
- If output may be large, use `--summary`, `--fields`, `--count`, or `--output-file`; use `--full` only when the user really needs full payloads.
- When returning ANY authorization, login, or delegation links (e.g. 合思授权链接, Seal授权链接/委托链接), ALWAYS provide BOTH a code block (` ```text ... ``` `) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
- For delegation links, always prefer `seal-use delegation create` over `users delegation` for link generation to ensure persistent token tracking.
- Never treat “Seal 协助/Seal 授权/委托” as a 合思授权入口. They are different links and must use different commands.
- For approval run links (`seal-use approval-runs url <recordId> [--corp <corpId>]`):
- Always default to returning the clean deep link (`type: 'deep_link'`), which contains no credentials and requires no sensitive access. Users in their authorized browsers open it directly with zero token leakage risk.
- ONLY provide an SSO link (`--sso`) when the user explicitly requests an unauthenticated/cross-browser/no-login/免密 link and acknowledges risks.
- When returning an `--sso` link, the Agent MUST:
1. Declare the 4 mandatory security disclosures:
- 身份主体(Identity attribution: name and admin status)
- 权限范围(Full Seal AI operation permissions under this user)
- 时效性(2-hour provisional ticket TTL, 30-day session after opening)
- 安全与防扩散边界(No Hose main system access, strictly internal, never share to public/external groups)
2. Provide BOTH a code block (` ```text ... ``` `) and a clickable hyperlink.
- In the default stateless mode, every enterprise command requires `--corp <corpId>`. In stateful mode, omitting `--corp` uses the configured default enterprise and is unsafe for an explicitly named enterprise.
- For an explicitly named enterprise, resolve it directly with `seal-use corps search <name>` (or `seal-use corps get <corpId>` if given an exact ID) rather than dumping all enterprises with `seal-use corps list`. Then pass its exact `corpId` to every command. After creation, verify the returned URL host matches that enterprise's Seal tenant; if the host is the current/default tenant or cannot be verified, do not present the link as the target enterprise's link.
- 生产规则变更建议优先遵循“生产改草稿 -> 同步测试企业 -> 自动化回归测试矩阵/真实单据模拟验证 -> 生产发布投产”安全闭环;Agent 应主动提示并建议在测试环境中验证,但最终操作权与决策权在用户手中,绝不代替用户做决定。若用户明确要求直接在生产环境发布,尊重用户意图并严格执行。
- 在对企业执行高风险操作、批量审批或发布前,优先运行 `seal-use doctor tenant --corp <corpId>` 校验租户健康契约:验证身份管理权限、AI 审核扣费点数余量(`balance` 与 `deductionAmount`)、活跃规则与未发布草稿箱、Webhook 通道以及测试环境绑定。
- 在测试企业完成规则同步后,强烈推荐运行 `seal-use test regression --corp <corpId> [--samples 10]` 执行自动化回归测试矩阵:自动采样生产历史单据并在测试靶场重放对比决策,核验决策翻转率(Flips)与一致率,确保 `safeToPublish: true` 后再行投产。硬性红线:回归测试严禁直接在纯生产企业运行(必须下挂测试靶场),且测试环境点数余额必须充足。
- 单据 Webhook 重放安全与用户自主权策略:单据重放建议优先在绑定的测试企业中验证(CLI 与 MCP 默认拦截向生产环境重放以防污染真实审批流或产生实际外发回调)。Agent 应主动向用户解释风险并优先建议在测试环境模拟;但工具绝不反客为主,最终决策权在用户手中。若用户未绑定测试企业,或明确要求直接向生产环境重放,Agent 应向用户客观说明可能污染生产审批流或触发真实外部回调的风险;在确认用户明确意图后,通过追加 `--force`(或 MCP `force: true`)严格执行,绝不擅自拒绝用户要求。
- 测试环境合思模拟安全隔离:`corps sync-test` 自动将生产企业合思凭证以 `assisted` 模式注入测试企业,名称格式为 `{企业名前缀}(Seal测)`。该配置仅保存在测试 Seal 侧,绝对不执行 `deploy hosecloud sync`,杜绝向生产合思费控推送 EBot 节点或创建外发 webhook。
### 2.2 规则查验(遵循术语契约,使用规则编号 #xxxx)
- 规则总数快速感知:`seal-use rules count --corp <corpId>`
- 规则精简列表(聚焦业务字段,不漏底层 UUID):`seal-use rules list --corp <corpId> --summary`
- 查看单条规则详情:`seal-use rules get --corp <corpId> --code '#0038'`
## Route By Intent
### 2.3 单据定位与审核追踪
- 单号秒级定位:`seal-use approval-runs pick --corp <corpId> --sn <单据编号> --latest`
- 单据摘要与审核结论:`seal-use approval-runs get <recordId> --corp <corpId> --summary`
- 单据引用规则速查:`seal-use approval-runs cited-rules <recordId> --corp <corpId>`
- 生成业务审批单深链接(安全直达,无需凭据):`seal-use approval-runs url <recordId> --corp <corpId>`
- 生产规则安全演进、搭配配置与测试模拟闭环: read `references/staging-simulation-workflow.md`. 适用于:用户提出规则变更需求/客诉修复、生产与测试企业搭配接入与 1 对 1 绑定、生产环境仅改草稿隔离风险、`seal-use corps sync-test` 一键同步测试环境(含合思集成免配同步)、测试靶场运行自动化规则回归测试矩阵(`test regression`)或真实单据模拟验证、验证通过后才在生产正式发布的完整安全生命周期。
- First install / zero configuration / “how do I connect my enterprise?” / user supplies app credentials, an assistance link, or F12/Network cURL: read `references/first-time-user.md` and `references/enterprise-onboarding.md`. Ask what material the user already has in plain language, then discover all remaining identifiers automatically.
- User-facing Seal tenant assistance link (Seal 协助/Seal 授权/委托): resolve the named enterprise first, then run `seal-use delegation create --corp <corpId> --note '<enterprise>'`; verify the returned hostname is that tenant's Seal hostname. Always provide BOTH a code block (` ```text ... ``` `) AND a hyperlink.
- Packaged customer feedback → approval-rule remediation: read `references/customer-feedback-rule-remediation.md`. Use this route for WeChat messages, screenshots, rejection notifications, document numbers, customer complaints, expected approval behavior, rule-only mitigation, exact diffs, or requests to update and publish a rule version.
- 自动化规则回归测试矩阵 (Automated Rule Regression Test Matrix): `seal-use test regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips] [--prod-corp <id>] [--test-corp <id>]` (快捷别名 `seal-use corps regression`)。采样生产企业历史已完成单据,通过出站 HTTPS 轮询重放到配对测试靶场执行 AI 审核并对比双端决策,计算一致率(Concordance Rate),识别决策翻转(Decision Flips),给出 `safeToPublish` 综合判定。硬性红线:目标环境必须为测试企业且测试点数余额充足,严禁在纯生产环境发起。
- 模拟测试发布闭环: `seal-use simulation create --mode hosecloud --flow-ids ... --no-wait --corp <corpId>` (合思指定单号) 或 `--mode material_pack --package-ids ... --schema-config file.json` (材料包导入), 支持多源系统 `--source-system <hosecloud|feishu|weaver|helios|maycur|material_pack>`, `simulation status <batchId>` 单次查询状态, `simulation wait <batchId>` 轮询等待完成, `simulation clean <batchId>` 清理数据, `simulation specifications` 列出单据模板, `simulation approval-definitions` 查询飞书审批定义, `simulation list`/`get`/`batch-records` 查看批次与记录。创建前确认目标环境为测试环境。
- 企业检索、详情查看、环境标记、关联与配置规则同步: `seal-use corps list [query] [--env <production|test>] [--limit <n>] [--all] [--sort <usage|name|id>] [--strict]` (列表与轻量检索,默认展示 7 天使用频次最高的 10 个租户;`--all` 展示全量;`--sort usage|name|id` 切换排序), `seal-use corps search <query> [--env <production|test>] [--strict]` (跨字段智能软搜索:默认支持同音字、前后鼻音、平翘舌音、拼音与简拼、拼音或字母缺漏容错;`--strict` 切换为严格子串匹配), `seal-use corps get <corpId>` (富属性安全查看,敏感信息脱敏), `seal-use corps mark <corpId> --env <production|test> --confirm` (严格标记环境), `seal-use corps bind-test <prodCorpId> <testCorpId> --confirm` (严格1对1下挂,禁止多层级串联), `seal-use corps unbind-test <corpId> --confirm`, `seal-use corps sync-test <prodCorpId> [--dry-run|--yes] [--version-name <name>]` (将正式企业的偏好、草稿规则和知识文档覆盖同步到测试企业并自动发布语义版本 `[Prod vN · #M -> Test vM]`,输出并本地缓存 `versionMapping`/`ruleMapping`,正式企业规则保持草稿态不发布), `seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]` (将绑定的生产企业历史审批记录批量或单条重放到测试企业 Webhook 并做环境隔离与自动通道补齐;若未绑定测试企业可加 `--force` 直接重放), `seal-use rules map [--corp <corpId>] [--version <v|latest>] [--code <code>]` (离线毫秒级速查测试与生产规则对照映射)。
- 规则本地工作流: `seal-use rules pull` 导出草稿规则,`rules lint` 做质量检查,`rules push --dry-run` 预览增量更新,确认后用 `--yes` 写入;`rules map` 查询 `corps sync-test` 生成的跨企业规则映射。规则版本与草稿/发布 code 空间的区别详见 `references/rule-lightweight.md` 和 `references/cli.md`。
- Seal AI 智能审核发布到合思费控: `seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>`; read `references/hose-enterprise-deploy.md`.
- 审核决策偏好与思考深度: `seal-use preference get --corp <corpId>`, `preference decision update --json '...' --corp <corpId>`, `preference thinking-depth set --default <medium|high> --corp <corpId>`, `preference thinking-depth policies <list|upsert|remove> --corp <corpId>`.
- 审核大盘统计与去重分析: `seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp <corpId>`, `approval-runs count`, `analytics insight|risks|performance|analyze`, 以及 `approval-runs export`(Excel 报表,文件名强制追加精确到分钟的 `_YYYYMMDD_HHmm` 时间戳后缀防止覆盖;支持 `--sn <SN1,SN2>` 定向筛选极速导出并跳过全量分页;追加 `--with-flow` 可额外输出 **E人工行为** / **E人工意见** 两列——基于合思原生审批流对齐,含样式 2-B 三行展开式驳回目标与重审规则、中途修改置顶事实且保留时序、动作 Emoji,200 条以上单据约增加 30 秒);需要追踪单据时再使用 `url` 或 `bridge`。
- User-facing 合思 authorization link (合思/易快报授权): `seal-use auth hose-link --corp <corpId> [--expire <seconds>] [--force]`; read `references/hose-enterprise-auth.md`. Never use this route when the user says Seal 协助. 凭证独立生成且不污染本地会话。Always provide BOTH a code block (` ```text ... ``` `) AND a hyperlink.
- Delegation links management (【Seal 审核后台】委托授权链接): `seal-use delegation list --corp <corpId>`, `create [--note ...] --corp <corpId>`, `create --from-link <url> [--note ...]`, `revoke <tokenId> --corp <corpId>`. 注意:此处管理 Seal AI 智能审核后台的委托令牌,不包含合思主站免密链接(后者走 `auth hose-link`,不可在 `delegation list` 中查询)。
- User & Contacts Management (用户搜索、激活与一键代生成授权): `seal-use users search [keyword] --corp <corpId>`, `users delegation <userIdOrPhone> --corp <corpId>` (仅适用于 Seal 本地创建的账号 `provider: local`;对合思同步账号系统拒绝重置密码,需改用 `auth hose-link`), `users activate <userId> --corp <corpId>`, `users create --name ... --phone ... --corp <corpId>`, `users reset-password <userId> --corp <corpId>`, `users get <userId> --corp <corpId>`, `users delete <userId> --corp <corpId>`.
- 只读业务数据与组织发现: `seal-use contacts departments|children|users|sync-time --corp <corpId>`, `seal-use data expenses|invoices --corp <corpId>`, `seal-use analytics insight|risks|performance --corp <corpId>`, `seal-use context --corp <corpId>`, `seal-use source config --corp <corpId>`;这些查询优先用于定位企业结构、原始费用/发票和当前审核知识,不要把结果误当成写操作。
- LLM Model Config & Providers: `seal-use llm config --corp <corpId>`, `seal-use llm providers --corp <corpId>`.
- System Permissions Config: `seal-use permissions available --corp <corpId>`, `seal-use permissions configs --corp <corpId>`.
- Billing & Feature Quotas: `seal-use billing status --corp <corpId>`, `seal-use billing plans --corp <corpId>`, `seal-use billing features --corp <corpId>`.
- Webhook 准备看板与审批回调管理: `seal-use webhook ready [<资源包.zip>] [--webhook <idOrName>] --corp <corpId>` 检查企业环境、租户连通性、已激活通道与资源包预检;`seal-use webhook <list|get|add|update|delete> --corp <corpId>`.
- Webhook 资源包管理 (Webhook Resource Pack): `seal-use webhook resource-pack export [--limit <n>] [--status <status>] [--output <file.zip>] [--to-downloads] --corp <corpId>` 从线上审核记录直接打包导出为标准 Webhook 资源包(包含根目录 `信息表.xlsx` 与下载好的单据附件),便于通过邮件/微信等第三方渠道离线分发;`seal-use webhook resource-pack preview <资源包.zip> --corp <corpId>` 本地预检单据与附件;`seal-use webhook resource-pack push <资源包.zip> [--webhook <idOrName>] --corp <corpId>` 上传附件并通过入站 Webhook 触发 AI 审批(租户仅有 1 个通道时自动锁定无需指定 `--webhook`)。CLI 简写别名 `pack`,旧名 `material-pack` 完整向下兼容保留。每个 Webhook 可配置资源包附件的最小字节数、可选最大字节数和文件后缀白名单;这是可修改的持久化策略,不是不可绕过的硬编码。校验不通过时不会上传附件或推送单据。资源包格式:ZIP 根目录名 = `documentId`(或 `documentId@annotation`),Excel 附件列以 `[附件]` 为前缀(如 `[附件]合同协议`),单元格值为 ZIP 相对路径(支持多行/逗号/分号分隔);系统执行严格双向验证(Excel 声明附件的单据必须有对应根目录,ZIP 中的文件必须在某个 `[附件]` 列中声明)。详见 `references/cli.md` 中 "Webhook Resource Pack Workflow" 一节。它与 Seal 官方在模拟测试中使用的 `simulation material_pack` 流程相互独立,避免混淆。
- 审批记录转 Webhook 重放 (Universal Record Replay): `seal-use webhook replay [<recordId>] [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--sn-suffix <str>] [--dry-run] [--force] [--corp <corpId>]` 以及生产测专用快捷命令 `seal-use corps replay-test [<prodCorpId>] [--force]`。通用支持从历史审批记录(Webhook 来源、Hose 来源等)汲取结构化表单与明细字段,自动清洗规范化字段类型,支持按状态/数量批量重放到目标企业 Webhook 触发审批。默认推荐并导向测试企业(测试企业无 Webhook 时自动开通辅助模式通道并锁定环境隔离);若用户未绑定测试企业或明确要求向生产企业重放,支持通过 `--force` 显式执行,方便环境回归验证与 Bad Case 靶向调试。
### 2.4 审核大盘与健康体检
- 审核大盘统计(按单据去重):`seal-use approval-runs stats --corp <corpId> --dedupe-by sourceDocumentSN`
- 企业健康契约体检(点数余额、管理员身份、规则状态):`seal-use doctor tenant --corp <corpId>`
- HTTP REST API & Docs Server: `seal-use http [--port 8787] [--host 127.0.0.1]` (提供 `/docs` 交互文档、`/openapi.json`、`POST /api/cli` 与 `/v1/*` REST API)。
- 审批规则质量校验 (Linter): `seal-use rules lint [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary] --corp <corpId>`; read `references/rule-lint.md`. 全局配置默认关闭 (`config lint <enable|disable>`),状态由 `seal-use doctor` 实时感知并自检;规则修改与治理时,Agent 应主动询问用户是否开启。
- 系统自检、租户健康契约与内嵌架构规范白皮书: `seal-use doctor` (整机环境、目录状态、企业资产统计与健康自检,零磁盘写入), `seal-use doctor tenant [--corp <corpId>] [--quiet]` (企业租户级健康契约探针:身份/管理员角色、AI 审批点数余额与单次扣费、活跃规则数、草稿安全性、Webhook 通道与环境配对), `seal-use doctor guide` (纯内存只读输出内嵌白皮书与目录规范), `seal-use doctor paths` (紧凑型核心目录健康检查)。
- Full CLI inventory: read `references/cli.md`.
---
## Material-pack Webhook policy and recovery
## 3. 生产规则变更安全闭环(Rule Remediation & Change Cycle)
材料包附件策略保存在目标入站 Webhook 的 `materialPackFilePolicy` 下,按 Webhook 生效。新建 Webhook 的默认策略是:最小文件大小 `500` 字节、最大文件大小不限制、后缀白名单为常见 PDF/Office/文本/邮件/图片格式。`信息表.xlsx` 是材料包根清单,不属于普通附件,不受这三个附件策略限制。完整默认后缀和边界规则见 `references/cli.md`。
生产环境规则修改必须遵守安全演进闭环:
`生产改草稿 -> 同步测试企业 -> 靶场模拟/回归矩阵验证 -> 生产确认发布`
这套策略允许人工或助手修改。错误处理有两条通道:先通过错误通道明确告诉助手是哪一个文件、哪一条规则失败;再通过配置或文件处置通道完成恢复。遇到附件被拦截时按以下闭环处理:
1. **草稿修改与规范 Diff 呈现**:
- 规则客诉修复与修改详阅 `references/customer-feedback-rule-remediation.md`;
- 必须向用户呈现统一 Git Diff,展示业务字段(适用场景、遵守程度、规则编号),隐藏内部 UUID;
- 生产修改时默认仅保存为**草稿态**,绝不直接线上生效。
2. **一键同步测试环境**:
- 运行 `seal-use corps sync-test <prodCorpId>`,自动将草稿规则发布到绑定的测试靶场 `[Prod vN · #M -> Test vM]`,同时自动同步免配的合思测试通道。
3. **测试靶场自动化验证**:
- 运行 `seal-use test regression --corp <testCorpId> --samples 10` 执行自动化规则回归测试矩阵;
- 重放生产历史单据,检验决策一致率(Concordance Rate)与决策翻转(Flips),确保 `safeToPublish: true`。
4. **用户授权确认与生产发布**:
- 严禁代替用户决策,只有在用户明确确认批准后,方可在生产环境正式发布。
1. 从错误中识别被拦截的文件、实际大小、失败规则和目标 Webhook。
2. 向用户说明可选处置:替换/压缩文件,或在确认允许该格式/大小后修改 Webhook 策略。
3. 用户或业务负责人明确确认放宽策略后,读取目标 Webhook 当前配置:`seal-use webhook get`/`webhook list`,或等价的 `seal-use tool seal_webhook_get`/`seal_webhook_list`(MCP 下经 `seal_cli` 执行)。
4. 修改最小值、最大值或完整后缀白名单:`seal-use webhook update`,或等价的 `seal-use tool seal_webhook_update`(MCP 下经 `seal_cli_write` 执行,需用户确认)。写入后重新读取核对,再重试原来的材料包 push。
---
push 会重新读取最新 Webhook 配置;校验通过后才会开始上传附件。CLI 以非零退出码和 `stderr` 返回可恢复的业务错误,MCP 以工具错误返回。没有用户授权或没有修改权限时,不能擅自放宽策略,也不能绕过校验。
## 4. 进阶能力路由(Advanced Capabilities & References)
注意:直接执行本地 `material-pack preview` 只使用默认策略或命令行临时覆盖,不会自动读取某个 Webhook 的持久化策略;`webhook ready --file`(指定 Webhook 时)和 `material-pack push` 才使用保存的 Webhook 策略。需要验证实际入站通道策略时,优先使用 `ready --file --webhook ...`,或直接重试 push。
需要执行进阶或专项目标时,按需查阅对应子文档:
- **新手首次接入图文说明**:详阅 `references/first-time-user.md`(面向小白用户的看图指南)
- **企业认证凭证模型与提权机制**:详阅 `references/enterprise-onboarding.md`(同等凭据原则、OpenAPI 开发者密钥提取)
- **生产与测试环境搭配与模拟全流程**:详阅 `references/staging-simulation-workflow.md`(生产改草稿、测试验证闭环)
- **客诉定界排查与最小规则 Patch 规范**:详阅 `references/customer-feedback-rule-remediation.md`(差旅、费用争议的标准报告闭环)
- **合思 EBot 审核节点发布与部署**:详阅 `references/hose-enterprise-deploy.md`
- **合思企业配置、认证诊断与授权链接**:详阅 `references/hose-enterprise-auth.md`
- **单据附件与发票争议 Langfuse 追踪**:详阅 `references/approval-attachment-trace.md`
- **规则质量校验器 (Linter)**:详阅 `references/rule-lint.md`(builtin / strict / hlab 规则质检规范)
- **Webhook 资源包导出与离线重放**:详阅 `references/cli.md` (Webhook Resource Pack 章节)
- **完整 CLI 命令全景**:详阅 `references/cli.md`
## High-Value Commands
---
```bash
seal-use doctor
seal-use doctor tenant --corp <corpId>
seal-use doctor guide
seal-use test regression --corp <corpId> --dry-run
seal-use test regression --corp <corpId> --samples 10 --fail-on-flips
seal-use corps list [query] [--env production|test] [--limit 10] [--all] [--sort usage|name|id]
seal-use corps search <keyword> [--env production|test] [--strict]
seal-use corps get <corpId>
seal-use approval-runs url <recordId> --corp <corpId>
seal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest
seal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --batch <batchId> --latest --fields recordId,status,aiDecision,aiSummary
seal-use approval-runs get <recordId> --corp <corpId> --summary
seal-use approval-runs get <recordId> --corp <corpId> --fields metadata,document.fields,result.summary
seal-use approval-runs document-summary <recordId> --corp <corpId>
seal-use approval-runs cited-rules <recordId> --corp <corpId>
seal-use approval-runs attachments <recordId> --corp <corpId> --summary
seal-use approval-runs result <recordId> --corp <corpId> --summary
seal-use rules count --corp <corpId>
seal-use rules list --corp <corpId> --summary
seal-use rules lint --corp <corpId> --summary
seal-use rules pull --corp <corpId> --out ./rules.local.json
seal-use rules push --corp <corpId> --file ./rules.local.json --dry-run
seal-use rules map --corp <corpId> --version latest
seal-use rules clear --corp <corpId> --dry-run
seal-use rules clear --corp <corpId> --yes
seal-use rules get --corp <corpId> --version 16 --code '#0038'
seal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205
seal-use simulation create --corp <corpId> --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high]
seal-use simulation create --corp <corpId> --mode material_pack --package-ids <materialPackageId> [--schema-config file.json]
seal-use simulation package-upload <材料包.zip> --corp <corpId>
seal-use simulation list --corp <corpId>
seal-use simulation get <batchId> --corp <corpId>
seal-use simulation batch-records <batchId> --corp <corpId>
seal-use simulation status <batchId> --corp <corpId>
seal-use simulation approval-definitions --corp <corpId>
seal-use approval-runs export --corp <corpId> --downloads --completed-only
# Add --with-flow to also populate E人工行为 / E人工意见 columns (Hose Open API, adds ~30s):
seal-use approval-runs export --corp <corpId> --downloads --with-flow
# Target specific document SNs for instant export without full pagination:
seal-use approval-runs export --corp <corpId> --sn B26002307,B26002144 --with-flow --downloads
seal-use analytics insight --corp <corpId>
seal-use contacts departments --corp <corpId>
seal-use data invoices --corp <corpId> --limit 20
seal-use tool seal_approval_search --corp <corpId> --json '{"keywords":["差旅","发票"],"areas":["rules"],"snippetOnly":true,"maxChars":500,"fields":["id","title","snippet"]}'
```
## 5. 安全守则与参数责任(Safety Guardrails & Parameter Ownership)
## Important Fields
- `sourceDocumentSN`: external document number, often the easiest 合思/易快报 lookup key.
- `sourceDocumentId`: external source document ID.
- `recordId`: Seal approval run record ID.
- `simulationBatchId`: simulation batch identifier.
- `status`: run status.
- `taskMode` / `finalExecutionMode`: execution mode information.
- `ruleSetVersionNumber`: approval rule version used by a run.
- `langfuseTraceId`: direct Langfuse trace lookup key.
- `langfuseSessionFallback`: fallback session key, usually `hosecloud-{sourceDocumentSN}`.
## References
- `references/first-time-user.md`: 面向完全新手的首次接入图文说明,包含合思开放接口密钥和浏览器 cURL 两条路径;配套图片在同级 `assets/` 目录。
- `references/enterprise-onboarding.md`: 首次安装、零配置、合思来源与 Seal 原生来源的区分、标准密钥/协助链接/F12 cURL 接入、参数责任与安全边界。
- `references/approval-run-lightweight.md`: 单号定位、字段裁剪、摘要、引用规则、单据摘要、附件摘要。
- `references/rule-lightweight.md`: 规则 count/list summary、按版本/编号取单条规则、规则搜索裁剪。
- `references/rule-lint.md`: 规则质量检查器(Linter,含 builtin / strict / hlab 官方规范)、模糊词拦截、悬空例外闭环、多 TS 校验器切换与发布门禁。
- `references/customer-feedback-rule-remediation.md`: 微信/截图反馈包到企业定位、审批追踪、根因分类、最小规则 diff、确认、发布与验收的固定闭环。
- `references/hose-enterprise-auth.md`: Hose 企业配置、认证诊断、授权链接。
- `references/hose-enterprise-init.md`: 合思标准密钥的域名、企业与管理员自动发现,以及多候选管理员的安全选择。
- `references/hose-enterprise-deploy.md`: Seal AI 智能审核发布到合思费控(添加/编辑配置、平台自动探测、一键同步与 EBot 节点发布)。
- `references/approval-attachment-trace.md`: 附件/发票/OCR/图片争议的 Langfuse 追踪工作流。
- `references/staging-simulation-workflow.md`: 生产与测试环境搭配配置、合思集成免配自动同步、单据模拟测试验证与生产规则安全演进闭环指南。
- `references/cli.md`: 完整 CLI 命令清单。
## Safety
Rule, document, style preference, and publish actions mutate Seal configuration. Make the target enterprise explicit, show the intended payload, and verify after the write. Never send real `enterprises/*.json` files, tokens, signed URLs, or full raw documents to GitHub, tickets, logs, or chat unless the user explicitly requests a safe export.
- **参数责任原则**:绝不向普通用户索要 `corpId`、`staffId`、`proxyStaffBizId`、`tenantId` 等底层机器 ID。所有参数必须由 Agent 自动发现与解析。若有多位管理员,展示脱敏手机号与姓名让用户抉择。
- **链接安全规范**:
- 返回授权、协助或委托链接时,必须同时提供代码块(便于复制)与可点击链接;
- 审批单链接默认提供只读 Deep Link(`type: 'deep_link'`);仅在用户明确需要免密时才使用 `--sso` 并声明四项安全告知。
- **高危写操作防线**:规则推送(`rules push`)、清空(`rules clear`)、发布(`rules publish`)等破坏性写操作必须先通过 `--dry-run` 预览 diff 并获得用户明确批准后方可执行。
@@ -1,6 +1,8 @@
# Enterprise Onboarding
Read this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.
> 💡 **新手接入指引分工**:
> - 若是引导无技术背景的用户找凭证材料、找按钮,**必须直接使用 `references/first-time-user.md` 并渲染其中的指引截图**;
> - 本文档用于 Agent 理解企业身份源划分、标准凭证/协助链接/cURL 的后台凭据生命周期、合思子域 OpenAPI 提权机制与参数自动发现。
## Start With Discovery
+13 -12
View File
@@ -1,29 +1,30 @@
# 第一次接入:看图找到材料
> **【Agent 呈现铁律(Mandatory Image Rule)】**:
> 当向用户提供接入指引或引导用户获取材料时,**Agent 必须将本文档中对应的截图主动按顺序渲染到 Markdown 对话中**(使用图片语法 `![说明](路径)`),**绝不允许只讲纯文字步骤!** 真实业务用户必须对照图片界面才能准确找到按钮。
这份说明给第一次使用 Seal Use、还不熟悉“合思”“Seal”“appKey”“cURL”等词的用户。
用户不需要先知道 `corpId`、`staffId`、域名或内部命令。只要能进入企业网页,助手会负责识别企业和接入方式。
## 路径一:从合思开放接口取得接入账号和接入密码
## 路径一:从合思开放接口取得接入账号和接入密码(推荐·永久配置)
这条路径适用于有合思开放平台或应用管理权限的用户。
在合思网页中依次完成:
1. 打开「应用中心」或「应用商店」。
2. 搜索“接口”。
3. 进入「开放接口(新)」。
4. 点击「商品配置」。
5. 在配置面板中找到:
1. 打开「应用中心」或「应用商店」,搜索“接口”,进入「开放接口(新)」:
![在应用中心搜索并进入开放接口](../assets/hose-open-platform-app-center.png)
2. 点击「商品配置」:
![进入开放接口后点击商品配置](../assets/hose-open-platform-product-config.png)
3. 在配置面板中找到:
- **接入账号**:这就是 `appKey`。
- **接入密码**:这就是 `appSecurity`。需要先点击「显示」再复制。
6. 将这两项只交给当前本地助手,不要发到群聊、工单、公共文档或代码仓库。
![在商品配置中找到接入账号和接入密码](../assets/hose-open-platform-credentials.png)
![在应用中心搜索并进入开放接口](../assets/hose-open-platform-app-center.png)
![进入开放接口后点击商品配置](../assets/hose-open-platform-product-config.png)
![在商品配置中找到接入账号和接入密码](../assets/hose-open-platform-credentials.png)
4. 将这两项直接发送给当前本地助手,不要发到外部群聊、工单、公共文档或代码仓库。
助手拿到这两项后,会自动探测合思环境、识别企业、发现管理员绑定,并验证 Seal 会话。用户不需要填写 `corpId`、`staffId` 或域名。
+18
View File
@@ -841,4 +841,22 @@ describe("Hose OpenAPI key extraction from assistance link", () => {
expect(authResult.exitCode).toBe(2);
expect(authResult.stderr).toContain("合思子域专享能力");
});
test("maskCellphone masks standard 11-digit mobile and non-standard phones safely", async () => {
const { maskCellphone } = await import("./corps.js");
expect(maskCellphone("13812345678")).toBe("138****5678");
expect(maskCellphone("19988887777")).toBe("199****7777");
expect(maskCellphone(undefined)).toBe("未绑定手机");
expect(maskCellphone("")).toBe("未绑定手机");
expect(maskCellphone("010123456")).toBe("010****3456");
});
test("RULE_SUMMARY_FIELDS excludes raw internal UUID and prioritizes business fields", async () => {
const { RULE_SUMMARY_FIELDS } = await import("../printer.js");
expect(RULE_SUMMARY_FIELDS).not.toContain("id");
expect(RULE_SUMMARY_FIELDS).toContain("code");
expect(RULE_SUMMARY_FIELDS).toContain("status");
expect(RULE_SUMMARY_FIELDS).toContain("strictness");
expect(RULE_SUMMARY_FIELDS).toContain("scope");
});
});
+36 -9
View File
@@ -1038,6 +1038,25 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
throw new Error(`Unknown corps command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}
// ---------------------------------------------------------------------------
// Helpers & Sanitizers
// ---------------------------------------------------------------------------
export function maskCellphone(phone: string | undefined | null): string {
if (!phone) return "未绑定手机";
const cleaned = phone.trim();
if (cleaned.length === 11) {
return `${cleaned.slice(0, 3)}****${cleaned.slice(7)}`;
}
if (cleaned.length >= 7) {
return `${cleaned.slice(0, 3)}****${cleaned.slice(-4)}`;
}
if (cleaned.length > 4) {
return `${cleaned.slice(0, 2)}****${cleaned.slice(-2)}`;
}
return cleaned;
}
// ---------------------------------------------------------------------------
// Hosecloud integration sync helpers
// ---------------------------------------------------------------------------
@@ -1326,12 +1345,16 @@ async function addHoseCorp(input: Record<string, unknown>) {
);
}
} else if (!force) {
const candidates = staffDetails
.map((s) => `${s.name} (${s.cellphone || "no-phone"}, id: ${s.id}, active: ${s.active})`)
.join("\n - ");
const candidateLines = staffDetails
.map((s, idx) => ` [${idx + 1}] ${s.name} (${maskCellphone(s.cellphone)})`)
.join("\n");
throw new Error(
`Missing required parameter: staffId. Found ${staffDetails.length} candidate administrators:\n - ${candidates}\n` +
`Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`
`Missing required parameter: staffId. 当前企业共配置了 ${staffDetails.length} 位管理员账号(手机号已脱敏):\n\n` +
`${candidateLines}\n\n` +
`👉 请指定要作为审计身份绑定的管理员:\n` +
` • 按姓名选择:追加 --staffName <姓名>(支持关键字,如: --staffName 谢子豪)\n` +
` • 按手机选择:追加 --staffPhone <手机号>(支持手机后4位,如: --staffPhone 5678)\n` +
` • 或传 force:true / --force 自动使用默认首位管理员。`
);
}
}
@@ -1348,7 +1371,7 @@ async function addHoseCorp(input: Record<string, unknown>) {
}
const id = optionalString(input, "id") ?? corpId;
const name = corpName ?? corpId;
let name = nameInput ?? corpName ?? corpId;
const sealUrl = optionalString(input, "sealUrl") ?? `https://${corpId.toLowerCase()}.sealai.cc`;
const config: CorpConfig = {
@@ -1376,7 +1399,11 @@ async function addHoseCorp(input: Record<string, unknown>) {
if (verify) {
clearCorpTokenCache(id);
await resolveLiveSealEnterpriseConfig(config);
const live = await resolveLiveSealEnterpriseConfig(config);
if ((!nameInput || nameInput === corpId) && live.tenantName && live.tenantName !== corpId) {
name = live.tenantName;
config.name = live.tenantName;
}
}
const enterprisesDir = resolveWritableEnterprisesDir();
@@ -1529,7 +1556,7 @@ async function addLinkAsHoseCorp(
appKey: selectedKey.appKey,
appSecurity: selectedKey.appSecurity,
corpId: result.corpId,
name: name ?? result.corpName ?? result.corpId,
name: name ?? result.corpName,
staffId: result.staffId,
overwrite,
force
@@ -1566,7 +1593,7 @@ export async function extractKeysFromLinkAction(
appKey: selectedKey.appKey,
appSecurity: selectedKey.appSecurity,
corpId: result.corpId,
name: options.name ?? result.corpName ?? result.corpId,
name: options.name ?? result.corpName,
staffId: result.staffId,
overwrite: options.overwrite,
force: options.force
+1 -1
View File
@@ -5,7 +5,7 @@ import type { OutputOptions } from "./types.js";
const RULE_LIST_FULL_COUNT_LIMIT = 100;
const RULE_LIST_FULL_BYTES_LIMIT = 120_000;
export const RULE_SUMMARY_FIELDS = ["id", "code", "status", "strictness", "scope", "createdAt", "updatedAt"];
export const RULE_SUMMARY_FIELDS = ["code", "status", "strictness", "scope", "updatedAt"];
const DEFAULT_OUTPUT_BYTES_LIMIT = 200_000;
export function formatConsoleOutput(values: unknown[]): string {
+14 -3
View File
@@ -22,6 +22,7 @@ export interface TenantDoctorDiagnosis {
sourceType: string;
boundCorpId?: string;
boundCorpRole?: "prodParent" | "testTarget";
boundCorpRoleDescription?: string;
};
summary: {
totalChecks: number;
@@ -58,6 +59,11 @@ export async function diagnoseTenantContract(
const environment = corp.environment === "test" ? "test" : "production";
const boundCorpId = environment === "test" ? corp.prodCorpId : corp.testCorpId;
const boundCorpRole = environment === "test" ? "prodParent" : "testTarget";
const boundCorpRoleDescription = boundCorpId
? environment === "test"
? "已绑定生产母企业 (上游配置与样本源)"
: "已绑定测试靶场 (下游隔离演练环境)"
: undefined;
// 1. Auth & Admin Probe
let userDetail: any = null;
@@ -78,6 +84,8 @@ export async function diagnoseTenantContract(
userId: userDetail.id,
userName: userDetail.name,
isAdmin: true,
permissionLevel: "超级管理员(具备完整操作权限)",
tenantName: tenantDetail?.name,
tenantSlug: tenantDetail?.tenantSlug,
permissions: userDetail.permissions
}
@@ -92,6 +100,8 @@ export async function diagnoseTenantContract(
userId: userDetail.id,
userName: userDetail.name,
isAdmin: false,
permissionLevel: "普通用户(部分管理配置受限)",
tenantName: tenantDetail?.name,
permissions: userDetail.permissions
},
recommendation: "建议使用具有管理权限的企业主账号执行规则修改与集成发布"
@@ -301,7 +311,7 @@ export async function diagnoseTenantContract(
name: "测试环境配对契约",
status: "pass",
summary: `测试租户已绑定生产母企业「${boundCorpId}」,具备样本拉取与配置同步能力`,
details: { environment, boundCorpId, boundCorpRole }
details: { environment, boundCorpId, boundCorpRole, boundCorpRoleDescription }
});
} else {
checks.push({
@@ -320,7 +330,7 @@ export async function diagnoseTenantContract(
name: "生产环境安全隔离契约",
status: "pass",
summary: `生产企业已绑定沙箱测试靶场「${boundCorpId}」,回归测试将严格限制在靶场中运行`,
details: { environment, boundCorpId, boundCorpRole }
details: { environment, boundCorpId, boundCorpRole, boundCorpRoleDescription }
});
} else {
checks.push({
@@ -356,7 +366,8 @@ export async function diagnoseTenantContract(
environment,
sourceType: corp.source?.type ?? "native",
boundCorpId,
boundCorpRole
boundCorpRole,
boundCorpRoleDescription
},
summary: {
totalChecks: checks.length,