dsh-edge 0.16.0-alpha.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/worker/direct/index.js
CHANGED
|
@@ -150,7 +150,7 @@ Known schemas:
|
|
|
150
150
|
- `)}`,new Error(Ee)}let qe=`${c}/$ref`,be=Ur(e,he,n,r,i,s,o,qe,l);if(be.valid||de.push({instanceLocation:o,keyword:"$ref",keywordLocation:qe,error:"A subschema had errors."},...be.errors),n==="4"||n==="7")return{valid:de.length===0,errors:de}}if(Array.isArray(g)){let Ie=g.length,he=!1;for(let qe=0;qe<Ie;qe++)if(d===g[qe]||g[qe]==="integer"&&d==="number"&&e%1===0&&e===e){he=!0;break}he||de.push({instanceLocation:o,keyword:"type",keywordLocation:`${c}/type`,error:`Instance type "${d}" is invalid. Expected "${g.join('", "')}".`})}else g==="integer"?(d!=="number"||e%1||e!==e)&&de.push({instanceLocation:o,keyword:"type",keywordLocation:`${c}/type`,error:`Instance type "${d}" is invalid. Expected "${g}".`}):g!==void 0&&d!==g&&de.push({instanceLocation:o,keyword:"type",keywordLocation:`${c}/type`,error:`Instance type "${d}" is invalid. Expected "${g}".`});if(y!==void 0&&(d==="object"||d==="array"?Fm(e,y)||de.push({instanceLocation:o,keyword:"const",keywordLocation:`${c}/const`,error:`Instance does not match ${JSON.stringify(y)}.`}):e!==y&&de.push({instanceLocation:o,keyword:"const",keywordLocation:`${c}/const`,error:`Instance does not match ${JSON.stringify(y)}.`})),v!==void 0&&(d==="object"||d==="array"?v.some(Ie=>Fm(e,Ie))||de.push({instanceLocation:o,keyword:"enum",keywordLocation:`${c}/enum`,error:`Instance does not match any of ${JSON.stringify(v)}.`}):v.some(Ie=>e===Ie)||de.push({instanceLocation:o,keyword:"enum",keywordLocation:`${c}/enum`,error:`Instance does not match any of ${JSON.stringify(v)}.`})),b!==void 0){let Ie=`${c}/not`;Ur(e,b,n,r,i,s,o,Ie).valid&&de.push({instanceLocation:o,keyword:"not",keywordLocation:Ie,error:'Instance matched "not" schema.'})}let pt=[];if(w!==void 0){let Ie=`${c}/anyOf`,he=de.length,qe=!1;for(let be=0;be<w.length;be++){let Ee=w[be],ze=Object.create(l),le=Ur(e,Ee,n,r,i,f===!0?s:null,o,`${Ie}/${be}`,ze);de.push(...le.errors),qe=qe||le.valid,le.valid&&pt.push(ze)}qe?de.length=he:de.splice(he,0,{instanceLocation:o,keyword:"anyOf",keywordLocation:Ie,error:"Instance does not match any subschemas."})}if(E!==void 0){let Ie=`${c}/allOf`,he=de.length,qe=!0;for(let be=0;be<E.length;be++){let Ee=E[be],ze=Object.create(l),le=Ur(e,Ee,n,r,i,f===!0?s:null,o,`${Ie}/${be}`,ze);de.push(...le.errors),qe=qe&&le.valid,le.valid&&pt.push(ze)}qe?de.length=he:de.splice(he,0,{instanceLocation:o,keyword:"allOf",keywordLocation:Ie,error:"Instance does not match every subschema."})}if(S!==void 0){let Ie=`${c}/oneOf`,he=de.length,qe=S.filter((be,Ee)=>{let ze=Object.create(l),le=Ur(e,be,n,r,i,f===!0?s:null,o,`${Ie}/${Ee}`,ze);return de.push(...le.errors),le.valid&&pt.push(ze),le.valid}).length;qe===1?de.length=he:de.splice(he,0,{instanceLocation:o,keyword:"oneOf",keywordLocation:Ie,error:`Instance does not match exactly one subschema (${qe} matches).`})}if((d==="object"||d==="array")&&Object.assign(l,...pt),k!==void 0){let Ie=`${c}/if`;if(Ur(e,k,n,r,i,s,o,Ie,l).valid){if(_!==void 0){let qe=Ur(e,_,n,r,i,s,o,`${c}/then`,l);qe.valid||de.push({instanceLocation:o,keyword:"if",keywordLocation:Ie,error:'Instance does not match "then" schema.'},...qe.errors)}}else if(O!==void 0){let qe=Ur(e,O,n,r,i,s,o,`${c}/else`,l);qe.valid||de.push({instanceLocation:o,keyword:"if",keywordLocation:Ie,error:'Instance does not match "else" schema.'},...qe.errors)}}if(d==="object"){if(x!==void 0)for(let be of x)be in e||de.push({instanceLocation:o,keyword:"required",keywordLocation:`${c}/required`,error:`Instance does not have required property "${be}".`});let Ie=Object.keys(e);if(T!==void 0&&Ie.length<T&&de.push({instanceLocation:o,keyword:"minProperties",keywordLocation:`${c}/minProperties`,error:`Instance does not have at least ${T} properties.`}),F!==void 0&&Ie.length>F&&de.push({instanceLocation:o,keyword:"maxProperties",keywordLocation:`${c}/maxProperties`,error:`Instance does not have at least ${F} properties.`}),V!==void 0){let be=`${c}/propertyNames`;for(let Ee in e){let ze=`${o}/${Ao(Ee)}`,le=Ur(Ee,V,n,r,i,s,ze,be);le.valid||de.push({instanceLocation:o,keyword:"propertyNames",keywordLocation:be,error:`Property name "${Ee}" does not match schema.`},...le.errors)}}if(Y!==void 0){let be=`${c}/dependantRequired`;for(let Ee in Y)if(Ee in e){let ze=Y[Ee];for(let le of ze)le in e||de.push({instanceLocation:o,keyword:"dependentRequired",keywordLocation:be,error:`Instance has "${Ee}" but does not have "${le}".`})}}if(H!==void 0)for(let be in H){let Ee=`${c}/dependentSchemas`;if(be in e){let ze=Ur(e,H[be],n,r,i,s,o,`${Ee}/${Ao(be)}`,l);ze.valid||de.push({instanceLocation:o,keyword:"dependentSchemas",keywordLocation:Ee,error:`Instance has "${be}" but does not match dependant schema.`},...ze.errors)}}if(W!==void 0){let be=`${c}/dependencies`;for(let Ee in W)if(Ee in e){let ze=W[Ee];if(Array.isArray(ze))for(let le of ze)le in e||de.push({instanceLocation:o,keyword:"dependencies",keywordLocation:be,error:`Instance has "${Ee}" but does not have "${le}".`});else{let le=Ur(e,ze,n,r,i,s,o,`${be}/${Ao(Ee)}`);le.valid||de.push({instanceLocation:o,keyword:"dependencies",keywordLocation:be,error:`Instance has "${Ee}" but does not match dependant schema.`},...le.errors)}}}let he=Object.create(null),qe=!1;if(D!==void 0){let be=`${c}/properties`;for(let Ee in D){if(!(Ee in e))continue;let ze=`${o}/${Ao(Ee)}`,le=Ur(e[Ee],D[Ee],n,r,i,s,ze,`${be}/${Ao(Ee)}`);if(le.valid)l[Ee]=he[Ee]=!0;else if(qe=i,de.push({instanceLocation:o,keyword:"properties",keywordLocation:be,error:`Property "${Ee}" does not match schema.`},...le.errors),qe)break}}if(!qe&&$!==void 0){let be=`${c}/patternProperties`;for(let Ee in $){let ze=new RegExp(Ee,"u"),le=$[Ee];for(let Ve in e){if(!ze.test(Ve))continue;let St=`${o}/${Ao(Ve)}`,or=Ur(e[Ve],le,n,r,i,s,St,`${be}/${Ao(Ee)}`);or.valid?l[Ve]=he[Ve]=!0:(qe=i,de.push({instanceLocation:o,keyword:"patternProperties",keywordLocation:be,error:`Property "${Ve}" matches pattern "${Ee}" but does not match associated schema.`},...or.errors))}}}if(!qe&&M!==void 0){let be=`${c}/additionalProperties`;for(let Ee in e){if(he[Ee])continue;let ze=`${o}/${Ao(Ee)}`,le=Ur(e[Ee],M,n,r,i,s,ze,be);le.valid?l[Ee]=!0:(qe=i,de.push({instanceLocation:o,keyword:"additionalProperties",keywordLocation:be,error:`Property "${Ee}" does not match additional properties schema.`},...le.errors))}}else if(!qe&&U!==void 0){let be=`${c}/unevaluatedProperties`;for(let Ee in e)if(!l[Ee]){let ze=`${o}/${Ao(Ee)}`,le=Ur(e[Ee],U,n,r,i,s,ze,be);le.valid?l[Ee]=!0:de.push({instanceLocation:o,keyword:"unevaluatedProperties",keywordLocation:be,error:`Property "${Ee}" does not match unevaluated properties schema.`},...le.errors)}}}else if(d==="array"){ve!==void 0&&e.length>ve&&de.push({instanceLocation:o,keyword:"maxItems",keywordLocation:`${c}/maxItems`,error:`Array has too many items (${e.length} > ${ve}).`}),Te!==void 0&&e.length<Te&&de.push({instanceLocation:o,keyword:"minItems",keywordLocation:`${c}/minItems`,error:`Array has too few items (${e.length} < ${Te}).`});let Ie=e.length,he=0,qe=!1;if(z!==void 0){let be=`${c}/prefixItems`,Ee=Math.min(z.length,Ie);for(;he<Ee;he++){let ze=Ur(e[he],z[he],n,r,i,s,`${o}/${he}`,`${be}/${he}`);if(l[he]=!0,!ze.valid&&(qe=i,de.push({instanceLocation:o,keyword:"prefixItems",keywordLocation:be,error:"Items did not match schema."},...ze.errors),qe))break}}if(ne!==void 0){let be=`${c}/items`;if(Array.isArray(ne)){let Ee=Math.min(ne.length,Ie);for(;he<Ee;he++){let ze=Ur(e[he],ne[he],n,r,i,s,`${o}/${he}`,`${be}/${he}`);if(l[he]=!0,!ze.valid&&(qe=i,de.push({instanceLocation:o,keyword:"items",keywordLocation:be,error:"Items did not match schema."},...ze.errors),qe))break}}else for(;he<Ie;he++){let Ee=Ur(e[he],ne,n,r,i,s,`${o}/${he}`,be);if(l[he]=!0,!Ee.valid&&(qe=i,de.push({instanceLocation:o,keyword:"items",keywordLocation:be,error:"Items did not match schema."},...Ee.errors),qe))break}if(!qe&&oe!==void 0){let Ee=`${c}/additionalItems`;for(;he<Ie;he++){let ze=Ur(e[he],oe,n,r,i,s,`${o}/${he}`,Ee);l[he]=!0,ze.valid||(qe=i,de.push({instanceLocation:o,keyword:"additionalItems",keywordLocation:Ee,error:"Items did not match additional items schema."},...ze.errors))}}}if(j!==void 0)if(Ie===0&&ge===void 0)de.push({instanceLocation:o,keyword:"contains",keywordLocation:`${c}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(ge!==void 0&&Ie<ge)de.push({instanceLocation:o,keyword:"minContains",keywordLocation:`${c}/minContains`,error:`Array has less items (${Ie}) than minContains (${ge}).`});else{let be=`${c}/contains`,Ee=de.length,ze=0;for(let le=0;le<Ie;le++){let Ve=Ur(e[le],j,n,r,i,s,`${o}/${le}`,be);Ve.valid?(l[le]=!0,ze++):de.push(...Ve.errors)}ze>=(ge||0)&&(de.length=Ee),ge===void 0&&Pe===void 0&&ze===0?de.splice(Ee,0,{instanceLocation:o,keyword:"contains",keywordLocation:be,error:"Array does not contain item matching schema."}):ge!==void 0&&ze<ge?de.push({instanceLocation:o,keyword:"minContains",keywordLocation:`${c}/minContains`,error:`Array must contain at least ${ge} items matching schema. Only ${ze} items were found.`}):Pe!==void 0&&ze>Pe&&de.push({instanceLocation:o,keyword:"maxContains",keywordLocation:`${c}/maxContains`,error:`Array may contain at most ${Pe} items matching schema. ${ze} items were found.`})}if(!qe&&ee!==void 0){let be=`${c}/unevaluatedItems`;for(he;he<Ie;he++){if(l[he])continue;let Ee=Ur(e[he],ee,n,r,i,s,`${o}/${he}`,be);l[he]=!0,Ee.valid||de.push({instanceLocation:o,keyword:"unevaluatedItems",keywordLocation:be,error:"Items did not match unevaluated items schema."},...Ee.errors)}}if(Ze)for(let be=0;be<Ie;be++){let Ee=e[be],ze=typeof Ee=="object"&&Ee!==null;for(let le=0;le<Ie;le++){if(be===le)continue;let Ve=e[le];(Ee===Ve||ze&&(typeof Ve=="object"&&Ve!==null)&&Fm(Ee,Ve))&&(de.push({instanceLocation:o,keyword:"uniqueItems",keywordLocation:`${c}/uniqueItems`,error:`Duplicate items at indexes ${be} and ${le}.`}),be=Number.MAX_SAFE_INTEGER,le=Number.MAX_SAFE_INTEGER)}}}else if(d==="number"){if(n==="4"?(Ce!==void 0&&(te===!0&&e<=Ce||e<Ce)&&de.push({instanceLocation:o,keyword:"minimum",keywordLocation:`${c}/minimum`,error:`${e} is less than ${te?"or equal to ":""} ${Ce}.`}),ae!==void 0&&(st===!0&&e>=ae||e>ae)&&de.push({instanceLocation:o,keyword:"maximum",keywordLocation:`${c}/maximum`,error:`${e} is greater than ${st?"or equal to ":""} ${ae}.`})):(Ce!==void 0&&e<Ce&&de.push({instanceLocation:o,keyword:"minimum",keywordLocation:`${c}/minimum`,error:`${e} is less than ${Ce}.`}),ae!==void 0&&e>ae&&de.push({instanceLocation:o,keyword:"maximum",keywordLocation:`${c}/maximum`,error:`${e} is greater than ${ae}.`}),te!==void 0&&e<=te&&de.push({instanceLocation:o,keyword:"exclusiveMinimum",keywordLocation:`${c}/exclusiveMinimum`,error:`${e} is less than ${te}.`}),st!==void 0&&e>=st&&de.push({instanceLocation:o,keyword:"exclusiveMaximum",keywordLocation:`${c}/exclusiveMaximum`,error:`${e} is greater than or equal to ${st}.`})),$e!==void 0){let Ie=e%$e;Math.abs(0-Ie)>=11920929e-14&&Math.abs($e-Ie)>=11920929e-14&&de.push({instanceLocation:o,keyword:"multipleOf",keywordLocation:`${c}/multipleOf`,error:`${e} is not a multiple of ${$e}.`})}}else if(d==="string"){let Ie=Ne===void 0&&kt===void 0?0:oie(e);Ne!==void 0&&Ie<Ne&&de.push({instanceLocation:o,keyword:"minLength",keywordLocation:`${c}/minLength`,error:`String is too short (${Ie} < ${Ne}).`}),kt!==void 0&&Ie>kt&&de.push({instanceLocation:o,keyword:"maxLength",keywordLocation:`${c}/maxLength`,error:`String is too long (${Ie} > ${kt}).`}),Be!==void 0&&!new RegExp(Be,"u").test(e)&&de.push({instanceLocation:o,keyword:"pattern",keywordLocation:`${c}/pattern`,error:"String does not match pattern."}),C!==void 0&&_M[C]&&!_M[C](e)&&de.push({instanceLocation:o,keyword:"format",keywordLocation:`${c}/format`,error:`String does not match format "${C}".`})}return{valid:de.length===0,errors:de}}var AM=J(()=>{kM();t2();TM();e2();IM();a(Ur,"validate")});var n2,aie=J(()=>{t2();AM();n2=class{static{a(this,"Validator")}schema;draft;shortCircuit;lookup;constructor(t,n="2019-09",r=!0){this.schema=t,this.draft=n,this.shortCircuit=r,this.lookup=Hl(t)}validate(t){return Ur(t,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(t,n){n&&(t={...t,$id:n}),Hl(t,this.lookup)}}});var cie=J(()=>{kM();t2();TM();e2();sie();IM();AM();aie()});var r2,lie=J(()=>{cie();r2=class{static{a(this,"CfWorkerJsonSchemaValidator")}constructor(t){this.shortcircuit=t?.shortcircuit??!0,this.draft=t?.draft??"2020-12"}getValidator(t){let n=new n2(t,this.draft,this.shortcircuit);return r=>{let i=n.validate(r);return i.valid?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:i.errors.map(s=>`${s.instanceLocation}: ${s.error}`).join("; ")}}}}});var bi,i2=J(()=>{"use strict";bi={probeTimeoutMs:3e4,callTimeoutMs:6e4,maxToolsPerServer:128,maxCatalogPages:10,maxCatalogBytes:131072,maxDescriptionLength:512,maxErrorMessageChars:300,maxPublicNameLength:64,maxInstructionsLength:1024,metaToolThreshold:20}});import{createHash as RBe}from"node:crypto";function NBe(e){let t=e.replace(/[.*+?^${}()|[\]\\]/gu,n=>n==="*"?"\0":`\\${n}`);return new RegExp(`^${t.replaceAll("\0",".*")}$`)}function uie(e,t,n){let r=t??"read_only";return r==="allow_all"?"allow":r==="approve_all"?"ask":n===!0?"allow":n===!1?"ask":OBe.some(i=>NBe(i).test(e))?"allow":"ask"}function Kc(e){return e.replace(/Bearer\s+[^\s"']+/giu,"Bearer ***").replace(/(https?:\/\/[^\s"'?]+)\?[^\s"']*/giu,"$1?***").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/gu,"").slice(0,bi.maxErrorMessageChars)}function die(e,t){let n=`mcp__${e}__${t}`,r=n.replace(/[^A-Za-z0-9_-]/gu,"_");if(r===n&&r.length<=bi.maxPublicNameLength)return r;let i=PBe(e,t),s=bi.maxPublicNameLength-i.length-1;return`${r.slice(0,s)}_${i}`}function PBe(e,t){return RBe("sha256").update(`${e}\0${t}`).digest("hex").slice(0,12)}function pie(e){if(!(e==null||typeof e!="object"))try{let t=JSON.parse(JSON.stringify(e));return Ep(t),t}catch{return}}function LBe(e){return MBe.has(e)}function fie(e){return e.type!=="image"||e.data===void 0||e.mimeType===void 0||!LBe(e.mimeType)||!DBe.test(e.data)?void 0:{data:Uint8Array.from(atob(e.data),n=>n.charCodeAt(0)),mediaType:e.mimeType}}function hie(e){return e.some(t=>t.type==="image"&&t.data!==void 0)}function s1(e){if(e.isError)return[{type:"text",text:e.content.filter(i=>i.type==="text"&&typeof i.text=="string").map(i=>i.text).join(`
|
|
151
151
|
`)||"MCP tool returned an error."}];let t=[],n=[];for(let r of e.content)if(r.type==="text"&&typeof r.text=="string")n.push(r.text);else if(r.type==="resource_link"&&r.uri!==void 0)n.push(`Resource: ${r.name??"unnamed"} (${r.uri})`);else if(r.type==="image"&&r.data!==void 0)n.push(``);else if(r.type==="image")n.push(`[image: ${r.mimeType??"unknown type"}]`);else if(r.type==="audio")n.push("[audio result unsupported on Cloudflare Workers]");else if(r.type==="resource"&&r.resource?.text!==void 0){let i=r.resource.uri??"embedded resource";n.push(`--- ${i} ---
|
|
152
152
|
${r.resource.text}`)}else r.type==="resource"?n.push("[embedded resource: binary content not displayed]"):n.push(`[unsupported MCP content type: ${r.type}]`);return n.length>0&&t.push({type:"text",text:n.join(`
|
|
153
|
-
`)}),t.length>0?t:[{type:"text",text:"(empty MCP result)"}]}var OBe,MBe,DBe,s2=J(()=>{"use strict";bs();i2();OBe=["get_*","list_*","read_*","search_*","find_*","fetch_*","describe_*"];a(NBe,"globToRegExp");a(uie,"evaluateMcpToolPolicy");a(Kc,"scrubMcpErrorMessage");a(die,"publicToolName");a(PBe,"hashSuffix");a(pie,"supportedOutputSchema");MBe=new Set(["image/png","image/jpeg"]),DBe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u;a(LBe,"isImageMediaType");a(fie,"decodeImageBlock");a(hie,"containsImage");a(s1,"mapMcpResultToContentBlocks")});var $M,mie=J(()=>{$M={name:"dsh-edge",version:"0.16.0-alpha.1",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.5-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cfworker/json-schema":"^4.1.1","@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.5-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.5-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.5-rc.2","@deepseek-ai/dsh-api-gateway":"0.1.5-rc.2","@deepseek-ai/dsh-api-remotes":"0.1.5-rc.2","@deepseek-ai/dsh-api-session-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-settings-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-files":"0.1.5-rc.2","@deepseek-ai/dsh-attachment":"0.1.5-rc.2","@deepseek-ai/dsh-brand":"0.1.5-rc.2","@deepseek-ai/dsh-client-store":"0.1.5-rc.2","@deepseek-ai/dsh-commands":"0.1.5-rc.2","@deepseek-ai/dsh-compaction":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.5-rc.2","@deepseek-ai/dsh-credentials":"0.1.5-rc.2","@deepseek-ai/dsh-file-reference":"0.1.5-rc.2","@deepseek-ai/dsh-fs":"0.1.5-rc.2","@deepseek-ai/dsh-goal":"0.1.5-rc.2","@deepseek-ai/dsh-goal-round-driver":"0.1.5-rc.2","@deepseek-ai/dsh-host-directory-picker":"0.1.5-rc.2","@deepseek-ai/dsh-host-plugin-inventory":"0.1.5-rc.2","@deepseek-ai/dsh-invariants":"0.1.5-rc.2","@deepseek-ai/dsh-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-jobs-local":"0.1.5-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.5-rc.2","@deepseek-ai/dsh-llm":"0.1.5-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-message-feedback":"0.1.5-rc.2","@deepseek-ai/dsh-output-retention":"0.1.5-rc.2","@deepseek-ai/dsh-plan-mode":"0.1.5-rc.2","@deepseek-ai/dsh-sandbox":"0.1.5-rc.2","@deepseek-ai/dsh-schedule":"0.1.5-rc.2","@deepseek-ai/dsh-scope":"0.1.5-rc.2","@deepseek-ai/dsh-session":"0.1.5-rc.2","@deepseek-ai/dsh-session-format":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-catalog":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v0-to-v1":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v1-to-v2":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v2-to-v3":"0.1.5-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection-cache":"0.1.5-rc.2","@deepseek-ai/dsh-session-query":"0.1.5-rc.2","@deepseek-ai/dsh-session-reference":"0.1.5-rc.2","@deepseek-ai/dsh-session-title":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.5-rc.2","@deepseek-ai/dsh-settings":"0.1.5-rc.2","@deepseek-ai/dsh-skill":"0.1.5-rc.2","@deepseek-ai/dsh-spill":"0.1.5-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.5-rc.2","@deepseek-ai/dsh-storage":"0.1.5-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.5-rc.2","@deepseek-ai/dsh-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.5-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.5-rc.2","@deepseek-ai/dsh-timeout":"0.1.5-rc.2","@deepseek-ai/dsh-token-meter":"0.1.5-rc.2","@deepseek-ai/dsh-tool-ask-user":"0.1.5-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.5-rc.2","@deepseek-ai/dsh-tool-fs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-goal":"0.1.5-rc.2","@deepseek-ai/dsh-tool-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-skill":"0.1.5-rc.2","@deepseek-ai/dsh-tool-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-tool-web":"0.1.5-rc.2","@deepseek-ai/dsh-tools":"0.1.5-rc.2","@deepseek-ai/dsh-typert-protocol":"0.1.5-rc.2","@deepseek-ai/dsh-typert-registry":"0.1.5-rc.2","@deepseek-ai/dsh-user-approval":"0.1.5-rc.2","@deepseek-ai/dsh-user-questions":"0.1.5-rc.2","@deepseek-ai/dsh-util-values":"0.1.5-rc.2","@deepseek-ai/dsh-web":"0.1.5-rc.2","@deepseek-ai/dsh-web-fetch-http":"0.1.5-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-workspace":"0.1.5-rc.2","@deepseek-ai/schemastery":"3.18.2","@mixmark-io/domino":"2.2.0","@modelcontextprotocol/sdk":"1.30.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}}});var jm,gie,o2=J(()=>{"use strict";mie();jm=$M.version,gie=$M.dshEdge.upstreamVersion});function UBe(e){let t=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/iu.exec(e);if(t!==null)return t[1];let n=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/iu.exec(e);if(n!==null){let r=parseInt(n[1],16),i=parseInt(n[2],16);return`${String(r>>8)}.${String(r&255)}.${String(i>>8)}.${String(i&255)}`}}function BBe(e){return/^\d+\.\d+\.\d+\.\d+$/u.test(e)||e.includes(":")}function Vl(e){let t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error("MCP server URL must use http: or https: protocol.");let n=t.hostname.toLowerCase(),r=n.endsWith(".")?n.slice(0,-1):n,i=r.startsWith("[")&&r.endsWith("]")?r.slice(1,-1):r;if(!(i==="localhost"||i==="127.0.0.1"||i==="::1")){for(let s of jBe)if(i.endsWith(s))throw new Error(`MCP server hostname "${i}" is blocked.`);if(BBe(i)){let s=UBe(i),o=s??i;for(let c of qBe)if(c.test(o))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`);if(s===void 0){for(let c of zBe)if(c.test(i))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`)}}}}function WBe(e){return e?.type==="bearer"&&e.token!==void 0?{Authorization:`Bearer ${e.token}`}:{}}async function yie(e,t,n){Vl(e);let r=new Qk(new URL(e),{requestInit:{headers:WBe(t),signal:n},fetch:Jp}),i=new Yk({name:"dsh-edge",version:jm},{capabilities:{},jsonSchemaValidator:HBe});return await i.connect(r),{client:i,close:a(async()=>{await i.close().catch(()=>{})},"close")}}async function vie(e,t,n){let r=AbortSignal.timeout(bi.probeTimeoutMs),i;try{i=await yie(t,n,r)}catch(c){throw new Error(Kc(c instanceof Error?c.message:String(c)))}let{client:s,close:o}=i;try{let c=[],l=new Set,u=new Set,d;for(let f=0;f<bi.maxCatalogPages;f++){let g=await s.listTools(d===void 0?void 0:{cursor:d},{signal:r});for(let y of g.tools){if(c.length>=bi.maxToolsPerServer)break;let v=die(e,y.name);if(l.has(v))throw new Error(`Server listed tool "${y.name}" more than once`);l.add(v);let x=y.annotations?.readOnlyHint,b=pie(y.outputSchema);c.push({name:y.name,publicName:v,description:y.description??"",inputSchema:y.inputSchema??{type:"object"},...b!==void 0?{outputSchema:b}:{},...x!==void 0?{annotations:{readOnlyHint:x}}:{}})}if(c.length>=bi.maxToolsPerServer||(d=g.nextCursor??void 0,d===void 0))break;if(u.has(d))throw new Error("Server repeated a tools/list continuation cursor");u.add(d)}let p=s.getServerVersion?.(),h=s.getInstructions?.();return{tools:c,serverInfo:p?{name:p.name,version:p.version}:void 0,instructions:typeof h=="string"&&h.length>0?h.slice(0,bi.maxInstructionsLength):void 0}}finally{await o()}}async function a2(e,t,n,r,i,s){let o=s??bi.callTimeoutMs,c=i?AbortSignal.any([i,AbortSignal.timeout(o)]):AbortSignal.timeout(o),l;try{l=await yie(e,r,c)}catch(u){throw new Error(Kc(u instanceof Error?u.message:String(u)))}try{let u=await l.client.callTool({name:t,arguments:n},void 0,{signal:c});return{content:u.content??[],structuredContent:u.structuredContent,isError:u.isError===!0}}catch(u){throw new Error(Kc(u instanceof Error?u.message:String(u)))}finally{await l.close()}}var jBe,qBe,zBe,HBe,Jp,o1=J(()=>{"use strict";Sre();tie();lie();s2();i2();o2();jBe=[".internal",".local",".localhost"],qBe=[/^127\./u,/^10\./u,/^172\.(1[6-9]|2\d|3[01])\./u,/^192\.168\./u,/^0\./u,/^169\.254\./u],zBe=[/^::1$/u,/^fc/iu,/^fd/iu,/^fe[89ab][0-9a-f]:/iu];a(UBe,"extractMappedIPv4");a(BBe,"isIpAddress");a(Vl,"assertSafeUrl");a(WBe,"buildHeaders");HBe=new r2,Jp=a(async(e,t)=>{let n=await globalThis.fetch(e,{...t,redirect:"manual"});if(n.status>=300&&n.status<400)throw new Error(`MCP server returned HTTP ${String(n.status)} redirect; redirects are blocked for security.`);return n},"noRedirectFetch");a(yie,"connectClient");a(vie,"probe");a(a2,"callTool")});import{Buffer as VBe}from"node:buffer";function JBe(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&KBe.has(e.code)}function xie(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&ZBe.has(e.code)}function wie(e,t,n){let r=VBe.from(e,"base64");if(e.length===0&&t==="reject"||r.toString("base64")!==e)throw new Gt(n==="INVALID_IMAGE_BASE64"?"Image upload is not canonical base64.":"File upload is not canonical base64.",n);return new Uint8Array(r)}function YBe(e){return wie(e,"reject","INVALID_IMAGE_BASE64")}function XBe(e){return{data:YBe(e.data),mediaType:e.mediaType,...e.name===void 0?{}:{name:e.name}}}async function a1(e,t){return e.saveImages(t.map(XBe))}async function QBe(e,t){return e.saveFile({data:wie(t.data,"accept","INVALID_FILE_BASE64"),...t.name===void 0?{}:{name:t.name}})}function Sie(e,t,n){let r=Math.min(1,Math.sqrt(n/(e*t)));if(r===1)return{width:e,height:t};if(e>=t){let o=Math.max(1,Math.floor(e*r)),c=Math.max(1,Math.round(o*t/e));for(;o*c>n&&o>1;)o-=1,c=Math.max(1,Math.round(o*t/e));return{width:o,height:c}}let i=Math.max(1,Math.floor(t*r)),s=Math.max(1,Math.round(i*e/t));for(;s*i>n&&i>1;)i-=1,s=Math.max(1,Math.round(i*e/t));return{width:s,height:i}}var bie,GBe,ZBe,KBe,Gt,CM,Gl=J(()=>{ln();bie=["TOO_MANY_IMAGES","IMAGES_TOO_LARGE","UNSUPPORTED_IMAGE_TYPE","INVALID_IMAGE_BASE64","INVALID_IMAGE","IMAGE_TYPE_MISMATCH","IMAGE_TOO_LARGE","IMAGE_TOO_MANY_PIXELS","IMAGE_DIMENSION_TOO_LARGE"],GBe=[...bie,"INVALID_FILE_BASE64","INVALID_ATTACHMENT_REF","ATTACHMENT_CORRUPT","ATTACHMENT_WRITE_FAILED","ATTACHMENT_NOT_FOUND","ATTACHMENT_READ_FAILED","ATTACHMENT_PROJECTION_UNSUPPORTED","ATTACHMENT_FILES_UNSUPPORTED"],ZBe=new Set(bie),KBe=new Set(GBe),Gt=class extends Error{static{a(this,"AttachmentError")}code;constructor(e,t,n){super(e,n),this.name="AttachmentError",this.code=t}};a(JBe,"isAttachmentError");a(xie,"isImageAdmissionError");a(wie,"decodeCanonicalBase64");a(YBe,"decodeBase64");a(XBe,"saveInput");a(a1,"admitEncodedImages");a(QBe,"admitEncodedFile");a(Sie,"requestImageDimensions");CM=class extends Ge{static{a(this,"AttachmentStore")}constructor(e){super(e,"attachments")}validateImageBatch(e){let{maxImagesPerMessage:t,maxMessageImageBytes:n,mediaTypes:r}=this.imageLimits;if(e.length>t)throw new Gt("Image batch exceeds the configured image-count limit.","TOO_MANY_IMAGES");if(e.reduce((i,s)=>i+s.data.byteLength,0)>n)throw new Gt("Image batch exceeds the configured aggregate image-byte limit.","IMAGES_TOO_LARGE");for(let i of e)if(!r.includes(i.mediaType))throw new Gt(`Image type ${i.mediaType} is not accepted by this deployment.`,"UNSUPPORTED_IMAGE_TYPE")}async saveImages(e){this.validateImageBatch(e);for(let n of e)await this.validateImage(n);let t=[];for(let n of e)t.push(await this.saveImage(n));return t}async admitPromptContent(e){if(e.every(r=>r.type!=="image"))return e.map(r=>r.type==="text"?{type:"text",text:r.text}:{type:"file",attachment:r.attachment});let t=await a1(this,e.filter(r=>r.type==="image")),n=0;return e.map(r=>r.type==="text"?{type:"text",text:r.text}:r.type==="file"?{type:"file",attachment:r.attachment}:{type:"image",attachment:t[n++]})}admitEncodedFile(e){return QBe(this,e)}isAttachmentError(e){return JBe(e)}imageHostPath(e){}saveFile(e){return Promise.reject(new Gt("The mounted attachment provider cannot store verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}saveFileStream(e){return Promise.reject(new Gt("The mounted attachment provider cannot stream verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}async*readFileStream(e,t){t?.throwIfAborted(),await Promise.reject(new Gt("The mounted attachment provider cannot read verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}fileHostPath(e){}readImageRequest(e,t,n){return n?.throwIfAborted(),Promise.reject(new Gt("The mounted attachment provider cannot derive model-request images.","ATTACHMENT_PROJECTION_UNSUPPORTED"))}}});var l2={};Zt(l2,{buildAuthorizationUrl:()=>cWe,discoverEndpoints:()=>oWe,exchangeCode:()=>lWe,isTokenExpired:()=>dWe,refreshToken:()=>uWe,registerClient:()=>aWe});function Tie(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,n=>n.toString(16).padStart(2,"0")).join("").slice(0,e)}async function sWe(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return btoa(String.fromCharCode(...new Uint8Array(n))).replace(/\+/gu,"-").replace(/\//gu,"_").replace(/=/gu,"")}async function oWe(e){let t=AbortSignal.timeout(c2),n=new URL(e),r=n.pathname==="/"?"/.well-known/oauth-protected-resource":`/.well-known/oauth-protected-resource${n.pathname}`,i=new URL(r,n.origin);Vl(i.href);let s=await Jp(i.href,{signal:t});if(!s.ok)throw new Error(`PRM discovery failed: HTTP ${s.status}`);let c=(await s.json()).authorization_servers?.[0];if(typeof c!="string")throw new Error("No authorization server in PRM");let l=new URL(c),u=l.pathname==="/"?"/.well-known/oauth-authorization-server":`/.well-known/oauth-authorization-server${l.pathname}`,d=new URL(u,l.origin);Vl(d.href);let p=await Jp(d.href,{signal:t});if(!p.ok)throw new Error(`AS metadata failed: HTTP ${p.status}`);let h=await p.json();if(typeof h.authorization_endpoint!="string"||typeof h.token_endpoint!="string")throw new Error("Missing required endpoints in AS metadata");return{authorization:h.authorization_endpoint,token:h.token_endpoint,registration:h.registration_endpoint}}async function aWe(e,t,n){let r=AbortSignal.timeout(c2);Vl(e);let i=await Jp(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_name:n,redirect_uris:[t],grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}),signal:r});if(!i.ok)throw new Error(`DCR failed: HTTP ${i.status}`);let s=await i.json();if(typeof s.client_id!="string")throw new Error("DCR response missing client_id");return{clientId:s.client_id,clientSecret:s.client_secret}}async function cWe(e,t,n,r,i){let s=Tie(32),o=Tie(64),c=await sWe(o),l=new URL(e.authorization);for(let[u,d]of Object.entries({response_type:"code",client_id:t.clientId,redirect_uri:n,state:s,code_challenge:c,code_challenge_method:"S256",resource:i}))l.searchParams.set(u,d);return{authorizationUrl:l.href,pendingFlow:{state:s,codeVerifier:o,redirectUri:n,serverName:r,serverUrl:i,stagedClient:t,createdAt:Date.now()}}}async function lWe(e,t,n,r,i,s){let o=AbortSignal.timeout(c2),c=new URLSearchParams({grant_type:"authorization_code",code:n,redirect_uri:i,client_id:t.clientId,code_verifier:r});s!==void 0&&c.set("resource",s),t.clientSecret!==void 0&&c.set("client_secret",t.clientSecret),Vl(e);let l=await Jp(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:c.toString(),signal:o});if(!l.ok)throw new Error(`Token exchange failed: HTTP ${l.status}`);return Iie(await l.json())}async function uWe(e,t,n,r){let i=AbortSignal.timeout(c2),s=new URLSearchParams({grant_type:"refresh_token",refresh_token:n,client_id:t.clientId});r!==void 0&&s.set("resource",r),t.clientSecret!==void 0&&s.set("client_secret",t.clientSecret),Vl(e);let o=await Jp(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s.toString(),signal:i});if(!o.ok)throw new Error(`Token refresh failed: HTTP ${o.status}`);return Iie(await o.json())}function Iie(e){let t=e;if(typeof t.access_token!="string")throw new Error("Missing access_token");let n=typeof t.expires_in=="number"?t.expires_in:void 0;return{accessToken:t.access_token,refreshToken:typeof t.refresh_token=="string"?t.refresh_token:void 0,expiresAt:n!==void 0?Date.now()+n*1e3:void 0,tokenType:typeof t.token_type=="string"?t.token_type:"Bearer",scope:typeof t.scope=="string"?t.scope:void 0}}function dWe(e){return e.expiresAt===void 0?!1:Date.now()>e.expiresAt-12e4}var c2,u2=J(()=>{"use strict";o1();c2=1e4;a(Tie,"randomString");a(sWe,"sha256Base64Url");a(oWe,"discoverEndpoints");a(aWe,"registerClient");a(cWe,"buildAuthorizationUrl");a(lWe,"exchangeCode");a(uWe,"refreshToken");a(Iie,"parseTokenResponse");a(dWe,"isTokenExpired")});var Yt,Mie,p2=J(()=>{ln();In();Yt=class extends Mn{static{a(this,"FsError")}code;constructor(e,t,n){super(e,t,n),this.code=t}},Mie=class extends Ge{static{a(this,"FileSystem")}constructor(e){super(e,"fs")}get sandboxMode(){}processPathFromHostPath(e){}}});function ZM(e){return S2.test(e)}function E2(e){return e.invocation.modelInvocable}function zm(e){return e.invocation.userInvocable}function KM(e){let t=VHe(e);return[`<skill_content name="${GHe(e.name)}">`,"<skill_resources>",...t,"</skill_resources>","","<skill_instructions>",e.content,"</skill_instructions>","</skill_content>"].join(`
|
|
153
|
+
`)}),t.length>0?t:[{type:"text",text:"(empty MCP result)"}]}var OBe,MBe,DBe,s2=J(()=>{"use strict";bs();i2();OBe=["get_*","list_*","read_*","search_*","find_*","fetch_*","describe_*"];a(NBe,"globToRegExp");a(uie,"evaluateMcpToolPolicy");a(Kc,"scrubMcpErrorMessage");a(die,"publicToolName");a(PBe,"hashSuffix");a(pie,"supportedOutputSchema");MBe=new Set(["image/png","image/jpeg"]),DBe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u;a(LBe,"isImageMediaType");a(fie,"decodeImageBlock");a(hie,"containsImage");a(s1,"mapMcpResultToContentBlocks")});var $M,mie=J(()=>{$M={name:"dsh-edge",version:"0.16.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.5-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cfworker/json-schema":"^4.1.1","@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.5-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.5-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.5-rc.2","@deepseek-ai/dsh-api-gateway":"0.1.5-rc.2","@deepseek-ai/dsh-api-remotes":"0.1.5-rc.2","@deepseek-ai/dsh-api-session-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-settings-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-files":"0.1.5-rc.2","@deepseek-ai/dsh-attachment":"0.1.5-rc.2","@deepseek-ai/dsh-brand":"0.1.5-rc.2","@deepseek-ai/dsh-client-store":"0.1.5-rc.2","@deepseek-ai/dsh-commands":"0.1.5-rc.2","@deepseek-ai/dsh-compaction":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.5-rc.2","@deepseek-ai/dsh-credentials":"0.1.5-rc.2","@deepseek-ai/dsh-file-reference":"0.1.5-rc.2","@deepseek-ai/dsh-fs":"0.1.5-rc.2","@deepseek-ai/dsh-goal":"0.1.5-rc.2","@deepseek-ai/dsh-goal-round-driver":"0.1.5-rc.2","@deepseek-ai/dsh-host-directory-picker":"0.1.5-rc.2","@deepseek-ai/dsh-host-plugin-inventory":"0.1.5-rc.2","@deepseek-ai/dsh-invariants":"0.1.5-rc.2","@deepseek-ai/dsh-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-jobs-local":"0.1.5-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.5-rc.2","@deepseek-ai/dsh-llm":"0.1.5-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-message-feedback":"0.1.5-rc.2","@deepseek-ai/dsh-output-retention":"0.1.5-rc.2","@deepseek-ai/dsh-plan-mode":"0.1.5-rc.2","@deepseek-ai/dsh-sandbox":"0.1.5-rc.2","@deepseek-ai/dsh-schedule":"0.1.5-rc.2","@deepseek-ai/dsh-scope":"0.1.5-rc.2","@deepseek-ai/dsh-session":"0.1.5-rc.2","@deepseek-ai/dsh-session-format":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-catalog":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v0-to-v1":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v1-to-v2":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v2-to-v3":"0.1.5-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection-cache":"0.1.5-rc.2","@deepseek-ai/dsh-session-query":"0.1.5-rc.2","@deepseek-ai/dsh-session-reference":"0.1.5-rc.2","@deepseek-ai/dsh-session-title":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.5-rc.2","@deepseek-ai/dsh-settings":"0.1.5-rc.2","@deepseek-ai/dsh-skill":"0.1.5-rc.2","@deepseek-ai/dsh-spill":"0.1.5-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.5-rc.2","@deepseek-ai/dsh-storage":"0.1.5-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.5-rc.2","@deepseek-ai/dsh-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.5-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.5-rc.2","@deepseek-ai/dsh-timeout":"0.1.5-rc.2","@deepseek-ai/dsh-token-meter":"0.1.5-rc.2","@deepseek-ai/dsh-tool-ask-user":"0.1.5-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.5-rc.2","@deepseek-ai/dsh-tool-fs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-goal":"0.1.5-rc.2","@deepseek-ai/dsh-tool-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-skill":"0.1.5-rc.2","@deepseek-ai/dsh-tool-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-tool-web":"0.1.5-rc.2","@deepseek-ai/dsh-tools":"0.1.5-rc.2","@deepseek-ai/dsh-typert-protocol":"0.1.5-rc.2","@deepseek-ai/dsh-typert-registry":"0.1.5-rc.2","@deepseek-ai/dsh-user-approval":"0.1.5-rc.2","@deepseek-ai/dsh-user-questions":"0.1.5-rc.2","@deepseek-ai/dsh-util-values":"0.1.5-rc.2","@deepseek-ai/dsh-web":"0.1.5-rc.2","@deepseek-ai/dsh-web-fetch-http":"0.1.5-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-workspace":"0.1.5-rc.2","@deepseek-ai/schemastery":"3.18.2","@mixmark-io/domino":"2.2.0","@modelcontextprotocol/sdk":"1.30.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}}});var jm,gie,o2=J(()=>{"use strict";mie();jm=$M.version,gie=$M.dshEdge.upstreamVersion});function UBe(e){let t=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/iu.exec(e);if(t!==null)return t[1];let n=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/iu.exec(e);if(n!==null){let r=parseInt(n[1],16),i=parseInt(n[2],16);return`${String(r>>8)}.${String(r&255)}.${String(i>>8)}.${String(i&255)}`}}function BBe(e){return/^\d+\.\d+\.\d+\.\d+$/u.test(e)||e.includes(":")}function Vl(e){let t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error("MCP server URL must use http: or https: protocol.");let n=t.hostname.toLowerCase(),r=n.endsWith(".")?n.slice(0,-1):n,i=r.startsWith("[")&&r.endsWith("]")?r.slice(1,-1):r;if(!(i==="localhost"||i==="127.0.0.1"||i==="::1")){for(let s of jBe)if(i.endsWith(s))throw new Error(`MCP server hostname "${i}" is blocked.`);if(BBe(i)){let s=UBe(i),o=s??i;for(let c of qBe)if(c.test(o))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`);if(s===void 0){for(let c of zBe)if(c.test(i))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`)}}}}function WBe(e){return e?.type==="bearer"&&e.token!==void 0?{Authorization:`Bearer ${e.token}`}:{}}async function yie(e,t,n){Vl(e);let r=new Qk(new URL(e),{requestInit:{headers:WBe(t),signal:n},fetch:Jp}),i=new Yk({name:"dsh-edge",version:jm},{capabilities:{},jsonSchemaValidator:HBe});return await i.connect(r),{client:i,close:a(async()=>{await i.close().catch(()=>{})},"close")}}async function vie(e,t,n){let r=AbortSignal.timeout(bi.probeTimeoutMs),i;try{i=await yie(t,n,r)}catch(c){throw new Error(Kc(c instanceof Error?c.message:String(c)))}let{client:s,close:o}=i;try{let c=[],l=new Set,u=new Set,d;for(let f=0;f<bi.maxCatalogPages;f++){let g=await s.listTools(d===void 0?void 0:{cursor:d},{signal:r});for(let y of g.tools){if(c.length>=bi.maxToolsPerServer)break;let v=die(e,y.name);if(l.has(v))throw new Error(`Server listed tool "${y.name}" more than once`);l.add(v);let x=y.annotations?.readOnlyHint,b=pie(y.outputSchema);c.push({name:y.name,publicName:v,description:y.description??"",inputSchema:y.inputSchema??{type:"object"},...b!==void 0?{outputSchema:b}:{},...x!==void 0?{annotations:{readOnlyHint:x}}:{}})}if(c.length>=bi.maxToolsPerServer||(d=g.nextCursor??void 0,d===void 0))break;if(u.has(d))throw new Error("Server repeated a tools/list continuation cursor");u.add(d)}let p=s.getServerVersion?.(),h=s.getInstructions?.();return{tools:c,serverInfo:p?{name:p.name,version:p.version}:void 0,instructions:typeof h=="string"&&h.length>0?h.slice(0,bi.maxInstructionsLength):void 0}}finally{await o()}}async function a2(e,t,n,r,i,s){let o=s??bi.callTimeoutMs,c=i?AbortSignal.any([i,AbortSignal.timeout(o)]):AbortSignal.timeout(o),l;try{l=await yie(e,r,c)}catch(u){throw new Error(Kc(u instanceof Error?u.message:String(u)))}try{let u=await l.client.callTool({name:t,arguments:n},void 0,{signal:c});return{content:u.content??[],structuredContent:u.structuredContent,isError:u.isError===!0}}catch(u){throw new Error(Kc(u instanceof Error?u.message:String(u)))}finally{await l.close()}}var jBe,qBe,zBe,HBe,Jp,o1=J(()=>{"use strict";Sre();tie();lie();s2();i2();o2();jBe=[".internal",".local",".localhost"],qBe=[/^127\./u,/^10\./u,/^172\.(1[6-9]|2\d|3[01])\./u,/^192\.168\./u,/^0\./u,/^169\.254\./u],zBe=[/^::1$/u,/^fc/iu,/^fd/iu,/^fe[89ab][0-9a-f]:/iu];a(UBe,"extractMappedIPv4");a(BBe,"isIpAddress");a(Vl,"assertSafeUrl");a(WBe,"buildHeaders");HBe=new r2,Jp=a(async(e,t)=>{let n=await globalThis.fetch(e,{...t,redirect:"manual"});if(n.status>=300&&n.status<400)throw new Error(`MCP server returned HTTP ${String(n.status)} redirect; redirects are blocked for security.`);return n},"noRedirectFetch");a(yie,"connectClient");a(vie,"probe");a(a2,"callTool")});import{Buffer as VBe}from"node:buffer";function JBe(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&KBe.has(e.code)}function xie(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&ZBe.has(e.code)}function wie(e,t,n){let r=VBe.from(e,"base64");if(e.length===0&&t==="reject"||r.toString("base64")!==e)throw new Gt(n==="INVALID_IMAGE_BASE64"?"Image upload is not canonical base64.":"File upload is not canonical base64.",n);return new Uint8Array(r)}function YBe(e){return wie(e,"reject","INVALID_IMAGE_BASE64")}function XBe(e){return{data:YBe(e.data),mediaType:e.mediaType,...e.name===void 0?{}:{name:e.name}}}async function a1(e,t){return e.saveImages(t.map(XBe))}async function QBe(e,t){return e.saveFile({data:wie(t.data,"accept","INVALID_FILE_BASE64"),...t.name===void 0?{}:{name:t.name}})}function Sie(e,t,n){let r=Math.min(1,Math.sqrt(n/(e*t)));if(r===1)return{width:e,height:t};if(e>=t){let o=Math.max(1,Math.floor(e*r)),c=Math.max(1,Math.round(o*t/e));for(;o*c>n&&o>1;)o-=1,c=Math.max(1,Math.round(o*t/e));return{width:o,height:c}}let i=Math.max(1,Math.floor(t*r)),s=Math.max(1,Math.round(i*e/t));for(;s*i>n&&i>1;)i-=1,s=Math.max(1,Math.round(i*e/t));return{width:s,height:i}}var bie,GBe,ZBe,KBe,Gt,CM,Gl=J(()=>{ln();bie=["TOO_MANY_IMAGES","IMAGES_TOO_LARGE","UNSUPPORTED_IMAGE_TYPE","INVALID_IMAGE_BASE64","INVALID_IMAGE","IMAGE_TYPE_MISMATCH","IMAGE_TOO_LARGE","IMAGE_TOO_MANY_PIXELS","IMAGE_DIMENSION_TOO_LARGE"],GBe=[...bie,"INVALID_FILE_BASE64","INVALID_ATTACHMENT_REF","ATTACHMENT_CORRUPT","ATTACHMENT_WRITE_FAILED","ATTACHMENT_NOT_FOUND","ATTACHMENT_READ_FAILED","ATTACHMENT_PROJECTION_UNSUPPORTED","ATTACHMENT_FILES_UNSUPPORTED"],ZBe=new Set(bie),KBe=new Set(GBe),Gt=class extends Error{static{a(this,"AttachmentError")}code;constructor(e,t,n){super(e,n),this.name="AttachmentError",this.code=t}};a(JBe,"isAttachmentError");a(xie,"isImageAdmissionError");a(wie,"decodeCanonicalBase64");a(YBe,"decodeBase64");a(XBe,"saveInput");a(a1,"admitEncodedImages");a(QBe,"admitEncodedFile");a(Sie,"requestImageDimensions");CM=class extends Ge{static{a(this,"AttachmentStore")}constructor(e){super(e,"attachments")}validateImageBatch(e){let{maxImagesPerMessage:t,maxMessageImageBytes:n,mediaTypes:r}=this.imageLimits;if(e.length>t)throw new Gt("Image batch exceeds the configured image-count limit.","TOO_MANY_IMAGES");if(e.reduce((i,s)=>i+s.data.byteLength,0)>n)throw new Gt("Image batch exceeds the configured aggregate image-byte limit.","IMAGES_TOO_LARGE");for(let i of e)if(!r.includes(i.mediaType))throw new Gt(`Image type ${i.mediaType} is not accepted by this deployment.`,"UNSUPPORTED_IMAGE_TYPE")}async saveImages(e){this.validateImageBatch(e);for(let n of e)await this.validateImage(n);let t=[];for(let n of e)t.push(await this.saveImage(n));return t}async admitPromptContent(e){if(e.every(r=>r.type!=="image"))return e.map(r=>r.type==="text"?{type:"text",text:r.text}:{type:"file",attachment:r.attachment});let t=await a1(this,e.filter(r=>r.type==="image")),n=0;return e.map(r=>r.type==="text"?{type:"text",text:r.text}:r.type==="file"?{type:"file",attachment:r.attachment}:{type:"image",attachment:t[n++]})}admitEncodedFile(e){return QBe(this,e)}isAttachmentError(e){return JBe(e)}imageHostPath(e){}saveFile(e){return Promise.reject(new Gt("The mounted attachment provider cannot store verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}saveFileStream(e){return Promise.reject(new Gt("The mounted attachment provider cannot stream verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}async*readFileStream(e,t){t?.throwIfAborted(),await Promise.reject(new Gt("The mounted attachment provider cannot read verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}fileHostPath(e){}readImageRequest(e,t,n){return n?.throwIfAborted(),Promise.reject(new Gt("The mounted attachment provider cannot derive model-request images.","ATTACHMENT_PROJECTION_UNSUPPORTED"))}}});var l2={};Zt(l2,{buildAuthorizationUrl:()=>cWe,discoverEndpoints:()=>oWe,exchangeCode:()=>lWe,isTokenExpired:()=>dWe,refreshToken:()=>uWe,registerClient:()=>aWe});function Tie(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,n=>n.toString(16).padStart(2,"0")).join("").slice(0,e)}async function sWe(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return btoa(String.fromCharCode(...new Uint8Array(n))).replace(/\+/gu,"-").replace(/\//gu,"_").replace(/=/gu,"")}async function oWe(e){let t=AbortSignal.timeout(c2),n=new URL(e),r=n.pathname==="/"?"/.well-known/oauth-protected-resource":`/.well-known/oauth-protected-resource${n.pathname}`,i=new URL(r,n.origin);Vl(i.href);let s=await Jp(i.href,{signal:t});if(!s.ok)throw new Error(`PRM discovery failed: HTTP ${s.status}`);let c=(await s.json()).authorization_servers?.[0];if(typeof c!="string")throw new Error("No authorization server in PRM");let l=new URL(c),u=l.pathname==="/"?"/.well-known/oauth-authorization-server":`/.well-known/oauth-authorization-server${l.pathname}`,d=new URL(u,l.origin);Vl(d.href);let p=await Jp(d.href,{signal:t});if(!p.ok)throw new Error(`AS metadata failed: HTTP ${p.status}`);let h=await p.json();if(typeof h.authorization_endpoint!="string"||typeof h.token_endpoint!="string")throw new Error("Missing required endpoints in AS metadata");return{authorization:h.authorization_endpoint,token:h.token_endpoint,registration:h.registration_endpoint}}async function aWe(e,t,n){let r=AbortSignal.timeout(c2);Vl(e);let i=await Jp(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_name:n,redirect_uris:[t],grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}),signal:r});if(!i.ok)throw new Error(`DCR failed: HTTP ${i.status}`);let s=await i.json();if(typeof s.client_id!="string")throw new Error("DCR response missing client_id");return{clientId:s.client_id,clientSecret:s.client_secret}}async function cWe(e,t,n,r,i){let s=Tie(32),o=Tie(64),c=await sWe(o),l=new URL(e.authorization);for(let[u,d]of Object.entries({response_type:"code",client_id:t.clientId,redirect_uri:n,state:s,code_challenge:c,code_challenge_method:"S256",resource:i}))l.searchParams.set(u,d);return{authorizationUrl:l.href,pendingFlow:{state:s,codeVerifier:o,redirectUri:n,serverName:r,serverUrl:i,stagedClient:t,createdAt:Date.now()}}}async function lWe(e,t,n,r,i,s){let o=AbortSignal.timeout(c2),c=new URLSearchParams({grant_type:"authorization_code",code:n,redirect_uri:i,client_id:t.clientId,code_verifier:r});s!==void 0&&c.set("resource",s),t.clientSecret!==void 0&&c.set("client_secret",t.clientSecret),Vl(e);let l=await Jp(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:c.toString(),signal:o});if(!l.ok)throw new Error(`Token exchange failed: HTTP ${l.status}`);return Iie(await l.json())}async function uWe(e,t,n,r){let i=AbortSignal.timeout(c2),s=new URLSearchParams({grant_type:"refresh_token",refresh_token:n,client_id:t.clientId});r!==void 0&&s.set("resource",r),t.clientSecret!==void 0&&s.set("client_secret",t.clientSecret),Vl(e);let o=await Jp(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s.toString(),signal:i});if(!o.ok)throw new Error(`Token refresh failed: HTTP ${o.status}`);return Iie(await o.json())}function Iie(e){let t=e;if(typeof t.access_token!="string")throw new Error("Missing access_token");let n=typeof t.expires_in=="number"?t.expires_in:void 0;return{accessToken:t.access_token,refreshToken:typeof t.refresh_token=="string"?t.refresh_token:void 0,expiresAt:n!==void 0?Date.now()+n*1e3:void 0,tokenType:typeof t.token_type=="string"?t.token_type:"Bearer",scope:typeof t.scope=="string"?t.scope:void 0}}function dWe(e){return e.expiresAt===void 0?!1:Date.now()>e.expiresAt-12e4}var c2,u2=J(()=>{"use strict";o1();c2=1e4;a(Tie,"randomString");a(sWe,"sha256Base64Url");a(oWe,"discoverEndpoints");a(aWe,"registerClient");a(cWe,"buildAuthorizationUrl");a(lWe,"exchangeCode");a(uWe,"refreshToken");a(Iie,"parseTokenResponse");a(dWe,"isTokenExpired")});var Yt,Mie,p2=J(()=>{ln();In();Yt=class extends Mn{static{a(this,"FsError")}code;constructor(e,t,n){super(e,t,n),this.code=t}},Mie=class extends Ge{static{a(this,"FileSystem")}constructor(e){super(e,"fs")}get sandboxMode(){}processPathFromHostPath(e){}}});function ZM(e){return S2.test(e)}function E2(e){return e.invocation.modelInvocable}function zm(e){return e.invocation.userInvocable}function KM(e){let t=VHe(e);return[`<skill_content name="${GHe(e.name)}">`,"<skill_resources>",...t,"</skill_resources>","","<skill_instructions>",e.content,"</skill_instructions>","</skill_content>"].join(`
|
|
154
154
|
`)}function VHe(e){let t=e.resourceBase;if(t===void 0)return[`Resources for this skill are managed by provider "${qm(e.provider)}".`,"Load referenced resources only as needed."];switch(t.kind){case"directory":return[`Base directory for this skill: ${qm(t.path)}`,"Resolve relative paths mentioned by this skill against the base directory before using them. Load referenced resources only as needed."];case"url":return[`Base URL for this skill: ${qm(t.url)}`,"Resolve relative URLs mentioned by this skill against the base URL before using them. Load referenced resources only as needed."];case"opaque":return[`Resources for this skill: ${qm(t.description)}`,"Load referenced resources only as needed."];default:return ar(t,"SkillResourceBase.kind")}}function GHe(e){return e.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}function qm(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function KHe(e,t){if(Array.isArray(e))return{candidates:e,complete:!0};if(e===null||typeof e!="object")throw cse(t);let n=e;if(!Array.isArray(n.candidates)||typeof n.complete!="boolean")throw cse(t);return n}function cse(e){return new TypeError(`skill provider "${e}" list() must return an array or { candidates, complete } observation`)}function YHe(e){return{name:e.name,description:e.description,...e.whenToUse!==void 0?{whenToUse:e.whenToUse}:{},invocation:e.invocation,source:e.source,provider:e.provider,...e.resourceBase!==void 0?{resourceBase:e.resourceBase}:{},rank:HHe,locator:e,...e.path!==void 0?{path:e.path}:{},...e.metadata!==void 0?{metadata:e.metadata}:{}}}function XHe(e,t){if(typeof e.name!="string")throw new TypeError(`skill provider "${t}" returned a non-string skill name`);if(!S2.test(e.name))throw new Error(`skill provider "${t}" returned invalid skill name "${e.name}"`);if(typeof e.description!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string description`);if(e.description.length===0)throw new Error(`skill provider "${t}" returned skill "${e.name}" without a description`);if(JM(e.invocation,`skill provider "${t}" returned skill "${e.name}"`),e.whenToUse!==void 0&&typeof e.whenToUse!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string whenToUse`);if(typeof e.source!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string source`);if(typeof e.rank!="number"||!Number.isFinite(e.rank))throw new Error(`skill provider "${t}" returned skill "${e.name}" with an invalid rank`);if(typeof e.provider!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string provider`);if(e.provider!==t)throw new Error(`skill provider "${t}" returned skill "${e.name}" for provider "${e.provider}"`);if(e.path!==void 0&&typeof e.path!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string path`)}function QHe(e){if(!S2.test(e.name))throw new Error(`invalid skill name "${e.name}"`);if(e.description.length===0)throw new Error(`skill "${e.name}" requires a description`);JM(e.invocation,`runtime skill "${e.name}"`)}function eVe(e){let t=e.name,n=e.description,r=e.whenToUse,i=e.invocation,s=e.source,o=e.provider,c=e.content,l=e.path;if(typeof t!="string")throw new TypeError("loaded skill name must be a string");if(!S2.test(t))throw new Error(`loaded skill has invalid name "${t}"`);if(typeof n!="string")throw new TypeError(`loaded skill "${t}" description must be a string`);if(n.length===0)throw new Error(`loaded skill "${t}" requires a description`);if(JM(i,`loaded skill "${t}"`),r!==void 0&&typeof r!="string")throw new TypeError(`loaded skill "${t}" whenToUse must be a string`);if(typeof s!="string")throw new TypeError(`loaded skill "${t}" source must be a string`);if(typeof o!="string")throw new TypeError(`loaded skill "${t}" provider must be a string`);if(typeof c!="string")throw new TypeError(`loaded skill "${t}" content must be a string`);if(l!==void 0&&typeof l!="string")throw new TypeError(`loaded skill "${t}" path must be a string`)}function tVe(e){let{name:t,description:n,whenToUse:r,invocation:i,source:s,provider:o,resourceBase:c}=e;return{name:t,description:n,...r!==void 0?{whenToUse:r}:{},invocation:i,source:s,provider:o,...c!==void 0?{resourceBase:c}:{}}}function JM(e,t){if(e===void 0)return;if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError(`${t} with a non-object invocation policy`);let n=e;if(typeof n.modelInvocable!="boolean")throw new TypeError(`${t} with a non-boolean invocation.modelInvocable`);if(typeof n.userInvocable!="boolean")throw new TypeError(`${t} with a non-boolean invocation.userInvocable`)}function nVe(e,t){return pse(e.name,t.name)}function pse(e,t){return e<t?-1:e>t?1:0}function rVe(e,t){return e.candidate.rank-t.candidate.rank||e.providerOrder-t.providerOrder||e.localOrder-t.localOrder}function iVe(e,t,n=1){if(!Number.isInteger(t)||t<n)throw new Error(`skill: ${e} must be an integer greater than or equal to ${n}`)}function lse(e,t){return t===void 0?e:(d1(t),new Promise((n,r)=>{let i=a(()=>{t.removeEventListener("abort",s)},"cleanup"),s=a(()=>{i(),r(w2(t.reason))},"onAbort");t.addEventListener("abort",s,{once:!0}),e.then(o=>{i(),n(o)},o=>{i(),r(w2(o))})}))}function d1(e){if(e?.aborted===!0)throw w2(e.reason)}function w2(e){try{if(e instanceof Error)return e}catch{}return new Error(x2(e))}function x2(e){try{return String(e)}catch{return"[unrenderable thrown value]"}}var S2,ase,WHe,b2,HHe,use,ZHe,dse,JHe,Um=J(()=>{ln();Yr();eo();En();S2=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,ase=128,WHe=2,b2="runtime",HHe=250,use=600;a(ZM,"isSkillName");a(E2,"isModelInvocable");a(zm,"isUserInvocable");a(KM,"renderSkillContent");a(VHe,"renderResourceHint");a(GHe,"escapeAttr");a(qm,"escapeText");ZHe=class{static{a(this,"SkillLayer")}providers;runtime=new Map;constructor(e){this.providers=new Fc(t=>new Error(e===void 0?`a skill provider named "${t}" is already registered`:`a skill provider named "${t}" is already registered in this scope`))}isEmpty(){return this.providers.isEmpty()&&this.runtime.size===0}},dse=class extends Ge{static{a(this,"SkillRegistry")}static Config=P.object({collectCacheMaxEntries:P.number().default(ase)});collectCacheMaxEntries;layers=new qc(e=>new ZHe(e),()=>{this.invalidateCache()});collectCache=new Map;revision=0;nextProviderOrder=0;scopeIds=new WeakMap;nextScopeId=1;constructor(e,t={}){super(e,"skills"),this.collectCacheMaxEntries=t.collectCacheMaxEntries??ase,iVe("collectCacheMaxEntries",this.collectCacheMaxEntries)}registerProvider(e){let t=new AbortController,n,r,i={signal:t.signal,invalidate:a(()=>{let s=n;s!==void 0&&s.layer.providers.get(s.name)?.provider===r&&this.invalidateCache()},"invalidate")};try{r=e(i);let s=r.name;if(s===b2)throw new Error(`"${b2}" is reserved for runtime skill registrations`);let o=this.nextProviderOrder;return this.nextProviderOrder+=1,this.layers.effect(this.ctx,c=>{let l=c.providers.insert(s,{provider:r,order:o});return n={layer:c,name:s},()=>{n=void 0,l(),t.abort(new Error(`skill provider "${s}" disposed`))}},{label:"skills.registerProvider()"})}catch(s){throw t.abort(s),s}}register(e){QHe(e);let t=vs(this.ctx),n=t===void 0?this.layers.global:this.layers.peek(t);if(n!==void 0&&n.runtime.has(e.name))return this.ctx.logger.warn(`runtime skill "${e.name}" ignored because it is already registered`),()=>{};let r={...e,invocation:e.invocation??{modelInvocable:!0,userInvocable:!0},provider:e.provider??b2};return this.layers.effect(this.ctx,i=>(i.runtime.set(r.name,r),()=>{i.runtime.delete(r.name)}),{label:"skills.register()"})}async list(e={}){return(await this.snapshot(e)).skills}async snapshot(e={}){let t=await this.collect(e);return{skills:[...t.entries.values()].map(n=>tVe(n.candidate)).sort(nVe),complete:t.cacheable}}async get(e,t={}){if(!ZM(e))return;let n=await this.collect(t);d1(t.signal);let r=n.entries.get(e);if(r===void 0)return;let i=await lse(r.provider.get(r.candidate,t),t.signal);if(i!==void 0){if(eVe(i),i.name!==r.candidate.name){this.invalidateEntry(r);return}return i}}async collect(e){d1(e.signal);let t=1;for(;;){let n=this.revision,r=this.collectCacheKey(e.cwd,P0(e.scope),n),i=this.collectCache.get(r);if(i!==void 0)return{entries:i,cacheable:!0};let s=await this.collectFresh(e);if(d1(e.signal),n!==this.revision){if(t<WHe){t+=1;continue}return{entries:s.entries,cacheable:!1}}if(s.cacheable&&(this.collectCache.set(r,s.entries),this.collectCache.size>this.collectCacheMaxEntries)){let o=this.collectCache.keys().next();this.collectCache.delete(o.value)}return s}}async collectFresh(e){let t=[this.layers.global,...this.layers.chainLayers(e.scope)],n=new Map,r=!0;for(let i of t){let s=await this.collectLayer(i,e);s.cacheable||(r=!1);for(let o of s.entries)n.set(o.candidate.name,o)}return{entries:n,cacheable:r}}async collectLayer(e,t){let n=await this.listLayerCandidates(e,t);n.entries.sort(rVe);let r=new Set,i=[];for(let s of n.entries){let o=s.candidate;if(r.has(o.name)){this.ctx.logger.warn(`skill "${o.name}" from ${o.source} ignored because a higher-priority skill already exists`);continue}r.add(o.name),i.push(s)}return{entries:i,cacheable:n.cacheable}}async listLayerCandidates(e,t){d1(t.signal);let n=[],r=!0,i=0;for(let s of[...e.runtime.values()].sort((o,c)=>pse(o.name,c.name)))n.push({candidate:YHe(s),provider:JHe,providerOrder:-1,localOrder:i,layer:e}),i+=1;for(let{provider:s,order:o}of[...e.providers.values()]){let c=0,l;try{l=await lse(s.list(t),t.signal)}catch(d){if(t.signal?.aborted===!0)throw w2(t.signal.reason);r=!1,this.ctx.logger.warn(`skill provider "${s.name}" skipped: ${x2(d)}`)}if(l===void 0)continue;let u=KHe(l,s.name);u.complete||(r=!1);for(let d of u.candidates)XHe(d,s.name),n.push({candidate:d,provider:s,providerOrder:o,localOrder:c,layer:e}),c+=1}return{entries:n,cacheable:r}}invalidateCache(){this.revision+=1,this.collectCache.clear(),this.notifyChange()}invalidateEntry(e){e.layer.providers.get(e.provider.name)?.provider===e.provider&&this.invalidateCache()}scopeId(e){let t=this.scopeIds.get(e);return t===void 0&&(t=this.nextScopeId,this.nextScopeId+=1,this.scopeIds.set(e,t)),t}collectCacheKey(e,t,n){return JSON.stringify({cwd:e,scopes:t.map(r=>this.scopeId(r)),revision:n})}notifyChange(){for(let e of this.ctx.events.dispatch("emit",["skills/change"]))try{let t=e();Promise.resolve(t).catch(n=>{this.ctx.logger.warn(`skills/change listener rejected: ${x2(n)}`)})}catch(t){this.ctx.logger.warn(`skills/change listener threw: ${x2(t)}`)}}};a(KHe,"normalizeProviderObservation");a(cse,"invalidProviderObservation");JHe={name:b2,list(){return Promise.resolve([])},get(e){return Promise.resolve(e.locator)}};a(YHe,"runtimeCandidate");a(XHe,"validateCandidate");a(QHe,"validateRuntimeSkill");a(eVe,"validateDefinition");a(tVe,"toSummary");a(JM,"validateInvocation");a(nVe,"compareSkillSummary");a(pse,"compareCodePoints");a(rVe,"compareIndexedCandidates");a(iVe,"assertPositiveInteger");a(lse,"waitWithAbort");a(d1,"throwIfAborted");a(w2,"toError");a(x2,"errorMessage")});var Wa,Wm=J(()=>{Wa=class{static{a(this,"Deque")}buffer=new Array(16);head=0;count=0;get size(){return this.count}pushBack(e){this.ensureCapacity();let t=this.head+this.count;this.buffer[t<this.buffer.length?t:t-this.buffer.length]=e,this.count+=1}pushFront(e){this.ensureCapacity(),this.head=this.head===0?this.buffer.length-1:this.head-1,this.buffer[this.head]=e,this.count+=1}popFront(){if(this.count===0)return;let e=this.buffer[this.head];return this.buffer[this.head]=void 0,this.head+=1,this.head===this.buffer.length&&(this.head=0),this.count-=1,this.compact(),e}clear(){this.buffer=new Array(16),this.head=0,this.count=0}ensureCapacity(){this.count<this.buffer.length||this.resize(this.buffer.length*2)}compact(){if(this.count===0){this.head=0;return}this.buffer.length>16&&this.count<=this.buffer.length/4&&this.resize(Math.max(16,this.buffer.length/2))}resize(e){let t=new Array(e),n=this.head;for(let r=0;r<this.count;r+=1)t[r]=this.buffer[n],n+=1,n===this.buffer.length&&(n=0);this.buffer=t,this.head=0}}});var Kl,Kse,lD=J(()=>{ln();Kl=class extends Error{static{a(this,"DirectoryPickerError")}code;path;constructor(e,t,n){super(n),this.code=e,this.path=t,this.name="DirectoryPickerError"}},Kse=class extends Ge{static{a(this,"DirectoryPicker")}constructor(e){super(e,"directoryPicker")}}});var wae=pe((QWt,n_)=>{var xae=xae||function(e){return Buffer.from(e).toString("base64")};function ZKe(e){var t=this,n=Math.round,r=Math.floor,i=new Array(64),s=new Array(64),o=new Array(64),c=new Array(64),l,u,d,p,h=new Array(65535),f=new Array(65535),g=new Array(64),y=new Array(64),v=[],x=0,b=7,w=new Array(64),E=new Array(64),S=new Array(64),k=new Array(256),_=new Array(2048),O,C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],D=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],M=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],U=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],T=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],V=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],Y=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function H(ie){for(var je=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],de=0;de<64;de++){var pt=r((je[de]*ie+50)/100);pt<1?pt=1:pt>255&&(pt=255),i[C[de]]=pt}for(var Ie=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],he=0;he<64;he++){var qe=r((Ie[he]*ie+50)/100);qe<1?qe=1:qe>255&&(qe=255),s[C[he]]=qe}for(var be=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Ee=0,ze=0;ze<8;ze++)for(var le=0;le<8;le++)o[Ee]=1/(i[C[Ee]]*be[ze]*be[le]*8),c[Ee]=1/(s[C[Ee]]*be[ze]*be[le]*8),Ee++}a(H,"initQuantTables");function W(ie,je){for(var de=0,pt=0,Ie=new Array,he=1;he<=16;he++){for(var qe=1;qe<=ie[he];qe++)Ie[je[pt]]=[],Ie[je[pt]][0]=de,Ie[je[pt]][1]=he,pt++,de++;de*=2}return Ie}a(W,"computeHuffmanTbl");function z(){l=W(D,$),u=W(T,F),d=W(M,U),p=W(V,Y)}a(z,"initHuffmanTbl");function ne(){for(var ie=1,je=2,de=1;de<=15;de++){for(var pt=ie;pt<je;pt++)f[32767+pt]=de,h[32767+pt]=[],h[32767+pt][1]=de,h[32767+pt][0]=pt;for(var Ie=-(je-1);Ie<=-ie;Ie++)f[32767+Ie]=de,h[32767+Ie]=[],h[32767+Ie][1]=de,h[32767+Ie][0]=je-1+Ie;ie<<=1,je<<=1}}a(ne,"initCategoryNumber");function oe(){for(var ie=0;ie<256;ie++)_[ie]=19595*ie,_[ie+256>>0]=38470*ie,_[ie+512>>0]=7471*ie+32768,_[ie+768>>0]=-11059*ie,_[ie+1024>>0]=-21709*ie,_[ie+1280>>0]=32768*ie+8421375,_[ie+1536>>0]=-27439*ie,_[ie+1792>>0]=-5329*ie}a(oe,"initRGBYUVTable");function ee(ie){for(var je=ie[0],de=ie[1]-1;de>=0;)je&1<<de&&(x|=1<<b),de--,b--,b<0&&(x==255?(j(255),j(0)):j(x),b=7,x=0)}a(ee,"writeBits");function j(ie){v.push(ie)}a(j,"writeByte");function ge(ie){j(ie>>8&255),j(ie&255)}a(ge,"writeWord");function Pe(ie,je){var de,pt,Ie,he,qe,be,Ee,ze,le=0,Ve,St=8,or=64;for(Ve=0;Ve<St;++Ve){de=ie[le],pt=ie[le+1],Ie=ie[le+2],he=ie[le+3],qe=ie[le+4],be=ie[le+5],Ee=ie[le+6],ze=ie[le+7];var en=de+ze,it=de-ze,nt=pt+Ee,ot=pt-Ee,tn=Ie+be,dr=Ie-be,Wn=he+qe,di=he-qe,Et=en+Wn,Uo=en-Wn,gc=nt+tn,wl=nt-tn;ie[le]=Et+gc,ie[le+4]=Et-gc;var yc=(wl+Uo)*.707106781;ie[le+2]=Uo+yc,ie[le+6]=Uo-yc,Et=di+dr,gc=dr+ot,wl=ot+it;var _a=(Et-wl)*.382683433,Sl=.5411961*Et+_a,Wd=1.306562965*wl+_a,El=gc*.707106781,pi=it+El,vc=it-El;ie[le+5]=vc+Sl,ie[le+3]=vc-Sl,ie[le+1]=pi+Wd,ie[le+7]=pi-Wd,le+=8}for(le=0,Ve=0;Ve<St;++Ve){de=ie[le],pt=ie[le+8],Ie=ie[le+16],he=ie[le+24],qe=ie[le+32],be=ie[le+40],Ee=ie[le+48],ze=ie[le+56];var mx=de+ze,vy=de-ze,bc=pt+Ee,ft=pt-Ee,cn=Ie+be,Ta=Ie-be,yu=he+qe,xc=he-qe,kl=mx+yu,by=mx-yu,uh=bc+cn,Hd=bc-cn;ie[le]=kl+uh,ie[le+32]=kl-uh;var gx=(Hd+by)*.707106781;ie[le+16]=by+gx,ie[le+48]=by-gx,kl=xc+Ta,uh=Ta+ft,Hd=ft+vy;var yx=(kl-Hd)*.382683433,vx=.5411961*kl+yx,bx=1.306562965*Hd+yx,xx=uh*.707106781,wx=vy+xx,Sx=vy-xx;ie[le+40]=Sx+vx,ie[le+24]=Sx-vx,ie[le+8]=wx+bx,ie[le+56]=wx-bx,le++}var dh;for(Ve=0;Ve<or;++Ve)dh=ie[Ve]*je[Ve],g[Ve]=dh>0?dh+.5|0:dh-.5|0;return g}a(Pe,"fDCTQuant");function Te(){ge(65504),ge(16),j(74),j(70),j(73),j(70),j(0),j(1),j(1),j(0),ge(1),ge(1),j(0),j(0)}a(Te,"writeAPP0");function ve(ie){if(ie){ge(65505),ie[0]===69&&ie[1]===120&&ie[2]===105&&ie[3]===102?ge(ie.length+2):(ge(ie.length+5+2),j(69),j(120),j(105),j(102),j(0));for(var je=0;je<ie.length;je++)j(ie[je])}}a(ve,"writeAPP1");function Ze(ie,je){ge(65472),ge(17),j(8),ge(je),ge(ie),j(3),j(1),j(17),j(0),j(2),j(17),j(1),j(3),j(17),j(1)}a(Ze,"writeSOF0");function Ce(){ge(65499),ge(132),j(0);for(var ie=0;ie<64;ie++)j(i[ie]);j(1);for(var je=0;je<64;je++)j(s[je])}a(Ce,"writeDQT");function ae(){ge(65476),ge(418),j(0);for(var ie=0;ie<16;ie++)j(D[ie+1]);for(var je=0;je<=11;je++)j($[je]);j(16);for(var de=0;de<16;de++)j(M[de+1]);for(var pt=0;pt<=161;pt++)j(U[pt]);j(1);for(var Ie=0;Ie<16;Ie++)j(T[Ie+1]);for(var he=0;he<=11;he++)j(F[he]);j(17);for(var qe=0;qe<16;qe++)j(V[qe+1]);for(var be=0;be<=161;be++)j(Y[be])}a(ae,"writeDHT");function te(ie){typeof ie>"u"||ie.constructor!==Array||ie.forEach(je=>{if(typeof je=="string"){ge(65534);var de=je.length;ge(de+2);var pt;for(pt=0;pt<de;pt++)j(je.charCodeAt(pt))}})}a(te,"writeCOM");function st(){ge(65498),ge(12),j(3),j(1),j(0),j(2),j(17),j(3),j(17),j(0),j(63),j(0)}a(st,"writeSOS");function $e(ie,je,de,pt,Ie){for(var he=Ie[0],qe=Ie[240],be,Ee=16,ze=63,le=64,Ve=Pe(ie,je),St=0;St<le;++St)y[C[St]]=Ve[St];var or=y[0]-de;de=y[0],or==0?ee(pt[0]):(be=32767+or,ee(pt[f[be]]),ee(h[be]));for(var en=63;en>0&&y[en]==0;en--);if(en==0)return ee(he),de;for(var it=1,nt;it<=en;){for(var ot=it;y[it]==0&&it<=en;++it);var tn=it-ot;if(tn>=Ee){nt=tn>>4;for(var dr=1;dr<=nt;++dr)ee(qe);tn=tn&15}be=32767+y[it],ee(Ie[(tn<<4)+f[be]]),ee(h[be]),it++}return en!=ze&&ee(he),de}a($e,"processDU");function Ne(){for(var ie=String.fromCharCode,je=0;je<256;je++)k[je]=ie(je)}a(Ne,"initCharLookupTable"),this.encode=function(ie,je){var de=new Date().getTime();je&&kt(je),v=new Array,x=0,b=7,ge(65496),Te(),te(ie.comments),ve(ie.exifBuffer),Ce(),Ze(ie.width,ie.height),ae(),st();var pt=0,Ie=0,he=0;x=0,b=7,this.encode.displayName="_encode_";for(var qe=ie.data,be=ie.width,Ee=ie.height,ze=be*4,le=be*3,Ve,St=0,or,en,it,nt,ot,tn,dr,Wn;St<Ee;){for(Ve=0;Ve<ze;){for(nt=ze*St+Ve,ot=nt,tn=-1,dr=0,Wn=0;Wn<64;Wn++)dr=Wn>>3,tn=(Wn&7)*4,ot=nt+dr*ze+tn,St+dr>=Ee&&(ot-=ze*(St+1+dr-Ee)),Ve+tn>=ze&&(ot-=Ve+tn-ze+4),or=qe[ot++],en=qe[ot++],it=qe[ot++],w[Wn]=(_[or]+_[en+256>>0]+_[it+512>>0]>>16)-128,E[Wn]=(_[or+768>>0]+_[en+1024>>0]+_[it+1280>>0]>>16)-128,S[Wn]=(_[or+1280>>0]+_[en+1536>>0]+_[it+1792>>0]>>16)-128;pt=$e(w,o,pt,l,d),Ie=$e(E,c,Ie,u,p),he=$e(S,c,he,u,p),Ve+=32}St+=8}if(b>=0){var di=[];di[1]=b+1,di[0]=(1<<b+1)-1,ee(di)}if(ge(65497),typeof n_>"u")return new Uint8Array(v);return Buffer.from(v);var Et,Uo};function kt(ie){if(ie<=0&&(ie=1),ie>100&&(ie=100),O!=ie){var je=0;ie<50?je=Math.floor(5e3/ie):je=Math.floor(200-ie*2),H(je),O=ie}}a(kt,"setQuality");function Be(){var ie=new Date().getTime();e||(e=50),Ne(),z(),ne(),oe(),kt(e);var je=new Date().getTime()-ie}a(Be,"init"),Be()}a(ZKe,"JPEGEncoder");typeof n_<"u"?n_.exports=bae:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=bae);function bae(e,t){typeof t>"u"&&(t=50);var n=new ZKe(t),r=n.encode(e,t);return{data:r,width:e.width,height:e.height}}a(bae,"encode")});var Eae=pe((tHt,jD)=>{var FD=a((function(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),n=4017,r=799,i=3406,s=2276,o=1567,c=3784,l=5793,u=2896;function d(){}a(d,"constructor");function p(b,w){for(var E=0,S=[],k,_,O=16;O>0&&!b[O-1];)O--;S.push({children:[],index:0});var C=S[0],D;for(k=0;k<O;k++){for(_=0;_<b[k];_++){for(C=S.pop(),C.children[C.index]=w[E];C.index>0;){if(S.length===0)throw new Error("Could not recreate Huffman Table");C=S.pop()}for(C.index++,S.push(C);S.length<=k;)S.push(D={children:[],index:0}),C.children[C.index]=D.children,C=D;E++}k+1<O&&(S.push(D={children:[],index:0}),C.children[C.index]=D.children,C=D)}return S[0].children}a(p,"buildHuffmanTable");function h(b,w,E,S,k,_,O,C,D,$){var M=E.precision,U=E.samplesPerLine,T=E.scanLines,F=E.mcusPerLine,V=E.progressive,Y=E.maxH,H=E.maxV,W=w,z=0,ne=0;function oe(){if(ne>0)return ne--,z>>ne&1;if(z=b[w++],z==255){var le=b[w++];if(le)throw new Error("unexpected marker: "+(z<<8|le).toString(16))}return ne=7,z>>>7}a(oe,"readBit");function ee(le){for(var Ve=le,St;(St=oe())!==null;){if(Ve=Ve[St],typeof Ve=="number")return Ve;if(typeof Ve!="object")throw new Error("invalid huffman sequence")}return null}a(ee,"decodeHuffman");function j(le){for(var Ve=0;le>0;){var St=oe();if(St===null)return;Ve=Ve<<1|St,le--}return Ve}a(j,"receive");function ge(le){var Ve=j(le);return Ve>=1<<le-1?Ve:Ve+(-1<<le)+1}a(ge,"receiveAndExtend");function Pe(le,Ve){var St=ee(le.huffmanTableDC),or=St===0?0:ge(St);Ve[0]=le.pred+=or;for(var en=1;en<64;){var it=ee(le.huffmanTableAC),nt=it&15,ot=it>>4;if(nt===0){if(ot<15)break;en+=16;continue}en+=ot;var tn=t[en];Ve[tn]=ge(nt),en++}}a(Pe,"decodeBaseline");function Te(le,Ve){var St=ee(le.huffmanTableDC),or=St===0?0:ge(St)<<D;Ve[0]=le.pred+=or}a(Te,"decodeDCFirst");function ve(le,Ve){Ve[0]|=oe()<<D}a(ve,"decodeDCSuccessive");var Ze=0;function Ce(le,Ve){if(Ze>0){Ze--;return}for(var St=_,or=O;St<=or;){var en=ee(le.huffmanTableAC),it=en&15,nt=en>>4;if(it===0){if(nt<15){Ze=j(nt)+(1<<nt)-1;break}St+=16;continue}St+=nt;var ot=t[St];Ve[ot]=ge(it)*(1<<D),St++}}a(Ce,"decodeACFirst");var ae=0,te;function st(le,Ve){for(var St=_,or=O,en=0;St<=or;){var it=t[St],nt=Ve[it]<0?-1:1;switch(ae){case 0:var ot=ee(le.huffmanTableAC),tn=ot&15,en=ot>>4;if(tn===0)en<15?(Ze=j(en)+(1<<en),ae=4):(en=16,ae=1);else{if(tn!==1)throw new Error("invalid ACn encoding");te=ge(tn),ae=en?2:3}continue;case 1:case 2:Ve[it]?Ve[it]+=(oe()<<D)*nt:(en--,en===0&&(ae=ae==2?3:0));break;case 3:Ve[it]?Ve[it]+=(oe()<<D)*nt:(Ve[it]=te<<D,ae=0);break;case 4:Ve[it]&&(Ve[it]+=(oe()<<D)*nt);break}St++}ae===4&&(Ze--,Ze===0&&(ae=0))}a(st,"decodeACSuccessive");function $e(le,Ve,St,or,en){var it=St/F|0,nt=St%F,ot=it*le.v+or,tn=nt*le.h+en;le.blocks[ot]===void 0&&$.tolerantDecoding||Ve(le,le.blocks[ot][tn])}a($e,"decodeMcu");function Ne(le,Ve,St){var or=St/le.blocksPerLine|0,en=St%le.blocksPerLine;le.blocks[or]===void 0&&$.tolerantDecoding||Ve(le,le.blocks[or][en])}a(Ne,"decodeBlock");var kt=S.length,Be,ie,je,de,pt,Ie;V?_===0?Ie=C===0?Te:ve:Ie=C===0?Ce:st:Ie=Pe;var he=0,qe,be;kt==1?be=S[0].blocksPerLine*S[0].blocksPerColumn:be=F*E.mcusPerColumn,k||(k=be);for(var Ee,ze;he<be;){for(ie=0;ie<kt;ie++)S[ie].pred=0;if(Ze=0,kt==1)for(Be=S[0],pt=0;pt<k;pt++)Ne(Be,Ie,he),he++;else for(pt=0;pt<k;pt++){for(ie=0;ie<kt;ie++)for(Be=S[ie],Ee=Be.h,ze=Be.v,je=0;je<ze;je++)for(de=0;de<Ee;de++)$e(Be,Ie,he,je,de);if(he++,he===be)break}if(he===be)do{if(b[w]===255&&b[w+1]!==0)break;w+=1}while(w<b.length-2);if(ne=0,qe=b[w]<<8|b[w+1],qe<65280)throw new Error("marker was not found");if(qe>=65488&&qe<=65495)w+=2;else break}return w-W}a(h,"decodeScan");function f(b,w){var E=[],S=w.blocksPerLine,k=w.blocksPerColumn,_=S<<3,O=new Int32Array(64),C=new Uint8Array(64);function D(W,z,ne){var oe=w.quantizationTable,ee,j,ge,Pe,Te,ve,Ze,Ce,ae,te=ne,st;for(st=0;st<64;st++)te[st]=W[st]*oe[st];for(st=0;st<8;++st){var $e=8*st;if(te[1+$e]==0&&te[2+$e]==0&&te[3+$e]==0&&te[4+$e]==0&&te[5+$e]==0&&te[6+$e]==0&&te[7+$e]==0){ae=l*te[0+$e]+512>>10,te[0+$e]=ae,te[1+$e]=ae,te[2+$e]=ae,te[3+$e]=ae,te[4+$e]=ae,te[5+$e]=ae,te[6+$e]=ae,te[7+$e]=ae;continue}ee=l*te[0+$e]+128>>8,j=l*te[4+$e]+128>>8,ge=te[2+$e],Pe=te[6+$e],Te=u*(te[1+$e]-te[7+$e])+128>>8,Ce=u*(te[1+$e]+te[7+$e])+128>>8,ve=te[3+$e]<<4,Ze=te[5+$e]<<4,ae=ee-j+1>>1,ee=ee+j+1>>1,j=ae,ae=ge*c+Pe*o+128>>8,ge=ge*o-Pe*c+128>>8,Pe=ae,ae=Te-Ze+1>>1,Te=Te+Ze+1>>1,Ze=ae,ae=Ce+ve+1>>1,ve=Ce-ve+1>>1,Ce=ae,ae=ee-Pe+1>>1,ee=ee+Pe+1>>1,Pe=ae,ae=j-ge+1>>1,j=j+ge+1>>1,ge=ae,ae=Te*s+Ce*i+2048>>12,Te=Te*i-Ce*s+2048>>12,Ce=ae,ae=ve*r+Ze*n+2048>>12,ve=ve*n-Ze*r+2048>>12,Ze=ae,te[0+$e]=ee+Ce,te[7+$e]=ee-Ce,te[1+$e]=j+Ze,te[6+$e]=j-Ze,te[2+$e]=ge+ve,te[5+$e]=ge-ve,te[3+$e]=Pe+Te,te[4+$e]=Pe-Te}for(st=0;st<8;++st){var Ne=st;if(te[8+Ne]==0&&te[16+Ne]==0&&te[24+Ne]==0&&te[32+Ne]==0&&te[40+Ne]==0&&te[48+Ne]==0&&te[56+Ne]==0){ae=l*ne[st+0]+8192>>14,te[0+Ne]=ae,te[8+Ne]=ae,te[16+Ne]=ae,te[24+Ne]=ae,te[32+Ne]=ae,te[40+Ne]=ae,te[48+Ne]=ae,te[56+Ne]=ae;continue}ee=l*te[0+Ne]+2048>>12,j=l*te[32+Ne]+2048>>12,ge=te[16+Ne],Pe=te[48+Ne],Te=u*(te[8+Ne]-te[56+Ne])+2048>>12,Ce=u*(te[8+Ne]+te[56+Ne])+2048>>12,ve=te[24+Ne],Ze=te[40+Ne],ae=ee-j+1>>1,ee=ee+j+1>>1,j=ae,ae=ge*c+Pe*o+2048>>12,ge=ge*o-Pe*c+2048>>12,Pe=ae,ae=Te-Ze+1>>1,Te=Te+Ze+1>>1,Ze=ae,ae=Ce+ve+1>>1,ve=Ce-ve+1>>1,Ce=ae,ae=ee-Pe+1>>1,ee=ee+Pe+1>>1,Pe=ae,ae=j-ge+1>>1,j=j+ge+1>>1,ge=ae,ae=Te*s+Ce*i+2048>>12,Te=Te*i-Ce*s+2048>>12,Ce=ae,ae=ve*r+Ze*n+2048>>12,ve=ve*n-Ze*r+2048>>12,Ze=ae,te[0+Ne]=ee+Ce,te[56+Ne]=ee-Ce,te[8+Ne]=j+Ze,te[48+Ne]=j-Ze,te[16+Ne]=ge+ve,te[40+Ne]=ge-ve,te[24+Ne]=Pe+Te,te[32+Ne]=Pe-Te}for(st=0;st<64;++st){var kt=128+(te[st]+8>>4);z[st]=kt<0?0:kt>255?255:kt}}a(D,"quantizeAndInverse"),x(_*k*8);for(var $,M,U=0;U<k;U++){var T=U<<3;for($=0;$<8;$++)E.push(new Uint8Array(_));for(var F=0;F<S;F++){D(w.blocks[U][F],C,O);var V=0,Y=F<<3;for(M=0;M<8;M++){var H=E[T+M];for($=0;$<8;$++)H[Y+$]=C[V++]}}}return E}a(f,"buildComponentData");function g(b){return b<0?0:b>255?255:b}a(g,"clampTo8bit"),d.prototype={load:a(function(w){var E=new XMLHttpRequest;E.open("GET",w,!0),E.responseType="arraybuffer",E.onload=(function(){var S=new Uint8Array(E.response||E.mozResponseArrayBuffer);this.parse(S),this.onload&&this.onload()}).bind(this),E.send(null)},"load"),parse:a(function(w){var E=this.opts.maxResolutionInMP*1e3*1e3,S=0,k=w.length;function _(){var ot=w[S]<<8|w[S+1];return S+=2,ot}a(_,"readUint16");function O(){var ot=_(),tn=w.subarray(S,S+ot-2);return S+=tn.length,tn}a(O,"readDataBlock");function C(ot){var tn=1,dr=1,Wn,di;for(di in ot.components)ot.components.hasOwnProperty(di)&&(Wn=ot.components[di],tn<Wn.h&&(tn=Wn.h),dr<Wn.v&&(dr=Wn.v));var Et=Math.ceil(ot.samplesPerLine/8/tn),Uo=Math.ceil(ot.scanLines/8/dr);for(di in ot.components)if(ot.components.hasOwnProperty(di)){Wn=ot.components[di];var gc=Math.ceil(Math.ceil(ot.samplesPerLine/8)*Wn.h/tn),wl=Math.ceil(Math.ceil(ot.scanLines/8)*Wn.v/dr),yc=Et*Wn.h,_a=Uo*Wn.v,Sl=_a*yc,Wd=[];x(Sl*256);for(var El=0;El<_a;El++){for(var pi=[],vc=0;vc<yc;vc++)pi.push(new Int32Array(64));Wd.push(pi)}Wn.blocksPerLine=gc,Wn.blocksPerColumn=wl,Wn.blocks=Wd}ot.maxH=tn,ot.maxV=dr,ot.mcusPerLine=Et,ot.mcusPerColumn=Uo}a(C,"prepareComponents");var D=null,$=null,M=null,U,T,F=[],V=[],Y=[],H=[],W=_(),z=-1;if(this.comments=[],W!=65496)throw new Error("SOI not found");for(W=_();W!=65497;){var ne,oe,ee;switch(W){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var j=O();if(W===65534){var ge=String.fromCharCode.apply(null,j);this.comments.push(ge)}W===65504&&j[0]===74&&j[1]===70&&j[2]===73&&j[3]===70&&j[4]===0&&(D={version:{major:j[5],minor:j[6]},densityUnits:j[7],xDensity:j[8]<<8|j[9],yDensity:j[10]<<8|j[11],thumbWidth:j[12],thumbHeight:j[13],thumbData:j.subarray(14,14+3*j[12]*j[13])}),W===65505&&j[0]===69&&j[1]===120&&j[2]===105&&j[3]===102&&j[4]===0&&(this.exifBuffer=j.subarray(5,j.length)),W===65518&&j[0]===65&&j[1]===100&&j[2]===111&&j[3]===98&&j[4]===101&&j[5]===0&&($={version:j[6],flags0:j[7]<<8|j[8],flags1:j[9]<<8|j[10],transformCode:j[11]});break;case 65499:for(var Pe=_(),Te=Pe+S-2;S<Te;){var ve=w[S++];x(256);var Ze=new Int32Array(64);if(ve>>4===0)for(oe=0;oe<64;oe++){var Ce=t[oe];Ze[Ce]=w[S++]}else if(ve>>4===1)for(oe=0;oe<64;oe++){var Ce=t[oe];Ze[Ce]=_()}else throw new Error("DQT: invalid table spec");F[ve&15]=Ze}break;case 65472:case 65473:case 65474:_(),U={},U.extended=W===65473,U.progressive=W===65474,U.precision=w[S++],U.scanLines=_(),U.samplesPerLine=_(),U.components={},U.componentsOrder=[];var ae=U.scanLines*U.samplesPerLine;if(ae>E){var te=Math.ceil((ae-E)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${te}MP`)}var st=w[S++],$e,Ne=0,kt=0;for(ne=0;ne<st;ne++){$e=w[S];var Be=w[S+1]>>4,ie=w[S+1]&15,je=w[S+2];if(Be<=0||ie<=0)throw new Error("Invalid sampling factor, expected values above 0");U.componentsOrder.push($e),U.components[$e]={h:Be,v:ie,quantizationIdx:je},S+=3}C(U),V.push(U);break;case 65476:var de=_();for(ne=2;ne<de;){var pt=w[S++],Ie=new Uint8Array(16),he=0;for(oe=0;oe<16;oe++,S++)he+=Ie[oe]=w[S];x(16+he);var qe=new Uint8Array(he);for(oe=0;oe<he;oe++,S++)qe[oe]=w[S];ne+=17+he,(pt>>4===0?H:Y)[pt&15]=p(Ie,qe)}break;case 65501:_(),T=_();break;case 65500:_(),_();break;case 65498:var be=_(),Ee=w[S++],ze=[],le;for(ne=0;ne<Ee;ne++){le=U.components[w[S++]];var Ve=w[S++];le.huffmanTableDC=H[Ve>>4],le.huffmanTableAC=Y[Ve&15],ze.push(le)}var St=w[S++],or=w[S++],en=w[S++],it=h(w,S,U,ze,T,St,or,en>>4,en&15,this.opts);S+=it;break;case 65535:w[S]!==255&&S--;break;default:if(w[S-3]==255&&w[S-2]>=192&&w[S-2]<=254){S-=3;break}else if(W===224||W==225){if(z!==-1)throw new Error(`first unknown JPEG marker at offset ${z.toString(16)}, second unknown JPEG marker ${W.toString(16)} at offset ${(S-1).toString(16)}`);z=S-1;let ot=_();if(w[S+ot-2]===255){S+=ot-2;break}}throw new Error("unknown JPEG marker "+W.toString(16))}W=_()}if(V.length!=1)throw new Error("only single frame JPEGs supported");for(var ne=0;ne<V.length;ne++){var nt=V[ne].components;for(var oe in nt)nt[oe].quantizationTable=F[nt[oe].quantizationIdx],delete nt[oe].quantizationIdx}this.width=U.samplesPerLine,this.height=U.scanLines,this.jfif=D,this.adobe=$,this.components=[];for(var ne=0;ne<U.componentsOrder.length;ne++){var le=U.components[U.componentsOrder[ne]];this.components.push({lines:f(U,le),scaleX:le.h/U.maxH,scaleY:le.v/U.maxV})}},"parse"),getData:a(function(w,E){var S=this.width/w,k=this.height/E,_,O,C,D,$,M,U,T,F,V,Y=0,H,W,z,ne,oe,ee,j,ge,Pe,Te,ve,Ze=w*E*this.components.length;x(Ze);var Ce=new Uint8Array(Ze);switch(this.components.length){case 1:for(_=this.components[0],V=0;V<E;V++)for($=_.lines[0|V*_.scaleY*k],F=0;F<w;F++)H=$[0|F*_.scaleX*S],Ce[Y++]=H;break;case 2:for(_=this.components[0],O=this.components[1],V=0;V<E;V++)for($=_.lines[0|V*_.scaleY*k],M=O.lines[0|V*O.scaleY*k],F=0;F<w;F++)H=$[0|F*_.scaleX*S],Ce[Y++]=H,H=M[0|F*O.scaleX*S],Ce[Y++]=H;break;case 3:for(ve=!0,this.adobe&&this.adobe.transformCode?ve=!0:typeof this.opts.colorTransform<"u"&&(ve=!!this.opts.colorTransform),_=this.components[0],O=this.components[1],C=this.components[2],V=0;V<E;V++)for($=_.lines[0|V*_.scaleY*k],M=O.lines[0|V*O.scaleY*k],U=C.lines[0|V*C.scaleY*k],F=0;F<w;F++)ve?(H=$[0|F*_.scaleX*S],W=M[0|F*O.scaleX*S],z=U[0|F*C.scaleX*S],ge=g(H+1.402*(z-128)),Pe=g(H-.3441363*(W-128)-.71413636*(z-128)),Te=g(H+1.772*(W-128))):(ge=$[0|F*_.scaleX*S],Pe=M[0|F*O.scaleX*S],Te=U[0|F*C.scaleX*S]),Ce[Y++]=ge,Ce[Y++]=Pe,Ce[Y++]=Te;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(ve=!1,this.adobe&&this.adobe.transformCode?ve=!0:typeof this.opts.colorTransform<"u"&&(ve=!!this.opts.colorTransform),_=this.components[0],O=this.components[1],C=this.components[2],D=this.components[3],V=0;V<E;V++)for($=_.lines[0|V*_.scaleY*k],M=O.lines[0|V*O.scaleY*k],U=C.lines[0|V*C.scaleY*k],T=D.lines[0|V*D.scaleY*k],F=0;F<w;F++)ve?(H=$[0|F*_.scaleX*S],W=M[0|F*O.scaleX*S],z=U[0|F*C.scaleX*S],ne=T[0|F*D.scaleX*S],oe=255-g(H+1.402*(z-128)),ee=255-g(H-.3441363*(W-128)-.71413636*(z-128)),j=255-g(H+1.772*(W-128))):(oe=$[0|F*_.scaleX*S],ee=M[0|F*O.scaleX*S],j=U[0|F*C.scaleX*S],ne=T[0|F*D.scaleX*S]),Ce[Y++]=255-oe,Ce[Y++]=255-ee,Ce[Y++]=255-j,Ce[Y++]=255-ne;break;default:throw new Error("Unsupported color mode")}return Ce},"getData"),copyToImageData:a(function(w,E){var S=w.width,k=w.height,_=w.data,O=this.getData(S,k),C=0,D=0,$,M,U,T,F,V,Y,H,W;switch(this.components.length){case 1:for(M=0;M<k;M++)for($=0;$<S;$++)U=O[C++],_[D++]=U,_[D++]=U,_[D++]=U,E&&(_[D++]=255);break;case 3:for(M=0;M<k;M++)for($=0;$<S;$++)Y=O[C++],H=O[C++],W=O[C++],_[D++]=Y,_[D++]=H,_[D++]=W,E&&(_[D++]=255);break;case 4:for(M=0;M<k;M++)for($=0;$<S;$++)F=O[C++],V=O[C++],U=O[C++],T=O[C++],Y=255-g(F*(1-T/255)+T),H=255-g(V*(1-T/255)+T),W=255-g(U*(1-T/255)+T),_[D++]=Y,_[D++]=H,_[D++]=W,E&&(_[D++]=255);break;default:throw new Error("Unsupported color mode")}},"copyToImageData")};var y=0,v=0;function x(b=0){var w=y+b;if(w>v){var E=Math.ceil((w-v)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${E}MB`)}y=w}return a(x,"requestMemoryAllocation"),d.resetMaxMemoryUsage=function(b){y=0,v=b},d.getBytesAllocated=function(){return y},d.requestMemoryAllocation=x,d}),"jpegImage")();typeof jD<"u"?jD.exports=Sae:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=Sae);function Sae(e,t={}){var n={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},r={...n,...t},i=new Uint8Array(e),s=new FD;s.opts=r,FD.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),s.parse(i);var o=r.formatAsRGBA?4:3,c=s.width*s.height*o;try{FD.requestMemoryAllocation(c);var l={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:r.useTArray?new Uint8Array(c):Buffer.alloc(c)};s.comments.length>0&&(l.comments=s.comments)}catch(u){throw u instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+c):u instanceof ReferenceError&&u.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):u}return s.copyToImageData(l,r.formatAsRGBA),l}a(Sae,"decode")});var _ae=pe((rHt,kae)=>{var KKe=wae(),JKe=Eae();kae.exports={encode:KKe,decode:JKe}});var sg=pe((UVt,Vce)=>{"use strict";Vce.exports=cf;cf.CAPTURING_PHASE=1;cf.AT_TARGET=2;cf.BUBBLING_PHASE=3;function cf(e,t){if(this.type="",this.target=null,this.currentTarget=null,this.eventPhase=cf.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,e&&(this.type=e),t)for(var n in t)this[n]=t[n]}a(cf,"Event");cf.prototype=Object.create(Object.prototype,{constructor:{value:cf},stopPropagation:{value:a(function(){this._propagationStopped=!0},"stopPropagation")},stopImmediatePropagation:{value:a(function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0},"stopImmediatePropagation")},preventDefault:{value:a(function(){this.cancelable&&(this.defaultPrevented=!0)},"preventDefault")},initEvent:{value:a(function(t,n,r){this._initialized=!0,!this._dispatching&&(this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=t,this.bubbles=n,this.cancelable=r)},"initEvent")}})});var M5=pe((WVt,Zce)=>{"use strict";var Gce=sg();Zce.exports=P5;function P5(){Gce.call(this),this.view=null,this.detail=0}a(P5,"UIEvent");P5.prototype=Object.create(Gce.prototype,{constructor:{value:P5},initUIEvent:{value:a(function(e,t,n,r,i){this.initEvent(e,t,n),this.view=r,this.detail=i},"value")}})});var L5=pe((VVt,Jce)=>{"use strict";var Kce=M5();Jce.exports=D5;function D5(){Kce.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}a(D5,"MouseEvent");D5.prototype=Object.create(Kce.prototype,{constructor:{value:D5},initMouseEvent:{value:a(function(e,t,n,r,i,s,o,c,l,u,d,p,h,f,g){switch(this.initEvent(e,t,n,r,i),this.screenX=s,this.screenY=o,this.clientX=c,this.clientY=l,this.ctrlKey=u,this.altKey=d,this.shiftKey=p,this.metaKey=h,this.button=f,f){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break}this.relatedTarget=g},"value")},getModifierState:{value:a(function(e){switch(e){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return!1}},"value")}})});var k_=pe((ZVt,Xce)=>{"use strict";Xce.exports=E_;var cQe=1,lQe=3,uQe=4,dQe=5,pQe=7,fQe=8,hQe=9,mQe=11,gQe=12,yQe=13,vQe=14,bQe=15,xQe=17,wQe=18,SQe=19,EQe=20,kQe=21,_Qe=22,TQe=23,IQe=24,AQe=25,$Qe=[null,"INDEX_SIZE_ERR",null,"HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR",null,"NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INUSE_ATTRIBUTE_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR",null,"TYPE_MISMATCH_ERR","SECURITY_ERR","NETWORK_ERR","ABORT_ERR","URL_MISMATCH_ERR","QUOTA_EXCEEDED_ERR","TIMEOUT_ERR","INVALID_NODE_TYPE_ERR","DATA_CLONE_ERR"],CQe=[null,"INDEX_SIZE_ERR (1): the index is not in the allowed range",null,"HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model","WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required","INVALID_CHARACTER_ERR (5): the string contains invalid characters",null,"NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified","NOT_FOUND_ERR (8): the object can not be found here","NOT_SUPPORTED_ERR (9): this operation is not supported","INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute","INVALID_STATE_ERR (11): the object is in an invalid state","SYNTAX_ERR (12): the string did not match the expected pattern","INVALID_MODIFICATION_ERR (13): the object can not be modified in this way","NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML","INVALID_ACCESS_ERR (15): the object does not support the operation or argument",null,"TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type","SECURITY_ERR (18): the operation is insecure","NETWORK_ERR (19): a network error occurred","ABORT_ERR (20): the user aborted an operation","URL_MISMATCH_ERR (21): the given URL does not match another URL","QUOTA_EXCEEDED_ERR (22): the quota has been exceeded","TIMEOUT_ERR (23): a timeout occurred","INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation","DATA_CLONE_ERR (25): the object can not be cloned."],Yce={INDEX_SIZE_ERR:cQe,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:lQe,WRONG_DOCUMENT_ERR:uQe,INVALID_CHARACTER_ERR:dQe,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:pQe,NOT_FOUND_ERR:fQe,NOT_SUPPORTED_ERR:hQe,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:mQe,SYNTAX_ERR:gQe,INVALID_MODIFICATION_ERR:yQe,NAMESPACE_ERR:vQe,INVALID_ACCESS_ERR:bQe,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:xQe,SECURITY_ERR:wQe,NETWORK_ERR:SQe,ABORT_ERR:EQe,URL_MISMATCH_ERR:kQe,QUOTA_EXCEEDED_ERR:_Qe,TIMEOUT_ERR:TQe,INVALID_NODE_TYPE_ERR:IQe,DATA_CLONE_ERR:AQe};function E_(e){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=e,this.message=CQe[e],this.name=$Qe[e]}a(E_,"DOMException");E_.prototype.__proto__=Error.prototype;for(S_ in Yce)F5={value:Yce[S_]},Object.defineProperty(E_,S_,F5),Object.defineProperty(E_.prototype,S_,F5);var F5,S_});var __=pe(Qce=>{Qce.isApiWritable=!globalThis.__domino_frozen__});var si=pe(Jn=>{"use strict";var ii=k_(),xi=ii,RQe=__().isApiWritable;Jn.NAMESPACE={HTML:"http://www.w3.org/1999/xhtml",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};Jn.IndexSizeError=function(){throw new ii(xi.INDEX_SIZE_ERR)};Jn.HierarchyRequestError=function(){throw new ii(xi.HIERARCHY_REQUEST_ERR)};Jn.WrongDocumentError=function(){throw new ii(xi.WRONG_DOCUMENT_ERR)};Jn.InvalidCharacterError=function(){throw new ii(xi.INVALID_CHARACTER_ERR)};Jn.NoModificationAllowedError=function(){throw new ii(xi.NO_MODIFICATION_ALLOWED_ERR)};Jn.NotFoundError=function(){throw new ii(xi.NOT_FOUND_ERR)};Jn.NotSupportedError=function(){throw new ii(xi.NOT_SUPPORTED_ERR)};Jn.InvalidStateError=function(){throw new ii(xi.INVALID_STATE_ERR)};Jn.SyntaxError=function(){throw new ii(xi.SYNTAX_ERR)};Jn.InvalidModificationError=function(){throw new ii(xi.INVALID_MODIFICATION_ERR)};Jn.NamespaceError=function(){throw new ii(xi.NAMESPACE_ERR)};Jn.InvalidAccessError=function(){throw new ii(xi.INVALID_ACCESS_ERR)};Jn.TypeMismatchError=function(){throw new ii(xi.TYPE_MISMATCH_ERR)};Jn.SecurityError=function(){throw new ii(xi.SECURITY_ERR)};Jn.NetworkError=function(){throw new ii(xi.NETWORK_ERR)};Jn.AbortError=function(){throw new ii(xi.ABORT_ERR)};Jn.UrlMismatchError=function(){throw new ii(xi.URL_MISMATCH_ERR)};Jn.QuotaExceededError=function(){throw new ii(xi.QUOTA_EXCEEDED_ERR)};Jn.TimeoutError=function(){throw new ii(xi.TIMEOUT_ERR)};Jn.InvalidNodeTypeError=function(){throw new ii(xi.INVALID_NODE_TYPE_ERR)};Jn.DataCloneError=function(){throw new ii(xi.DATA_CLONE_ERR)};Jn.nyi=function(){throw new Error("NotYetImplemented")};Jn.shouldOverride=function(){throw new Error("Abstract function; should be overriding in subclass.")};Jn.assert=function(e,t){if(!e)throw new Error("Assertion failed: "+(t||"")+`
|
|
155
155
|
`+new Error().stack)};Jn.expose=function(e,t){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],writable:RQe})};Jn.merge=function(e,t){for(var n in t)e[n]=t[n]};Jn.documentOrder=function(e,t){return 3-(e.compareDocumentPosition(t)&6)};Jn.toASCIILowerCase=function(e){return e.replace(/[A-Z]+/g,function(t){return t.toLowerCase()})};Jn.toASCIIUpperCase=function(e){return e.replace(/[a-z]+/g,function(t){return t.toUpperCase()})}});var j5=pe((XVt,tle)=>{"use strict";var lf=sg(),OQe=L5(),NQe=si();tle.exports=ele;function ele(){}a(ele,"EventTarget");ele.prototype={addEventListener:a(function(t,n,r){if(n){r===void 0&&(r=!1),this._listeners||(this._listeners=Object.create(null)),this._listeners[t]||(this._listeners[t]=[]);for(var i=this._listeners[t],s=0,o=i.length;s<o;s++){var c=i[s];if(c.listener===n&&c.capture===r)return}var l={listener:n,capture:r};typeof n=="function"&&(l.f=n),i.push(l)}},"addEventListener"),removeEventListener:a(function(t,n,r){if(r===void 0&&(r=!1),this._listeners){var i=this._listeners[t];if(i)for(var s=0,o=i.length;s<o;s++){var c=i[s];if(c.listener===n&&c.capture===r){i.length===1?this._listeners[t]=void 0:i.splice(s,1);return}}}},"removeEventListener"),dispatchEvent:a(function(t){return this._dispatchEvent(t,!1)},"dispatchEvent"),_dispatchEvent:a(function(t,n){typeof n!="boolean"&&(n=!1);function r(u,d){var p=d.type,h=d.eventPhase;if(d.currentTarget=u,h!==lf.CAPTURING_PHASE&&u._handlers&&u._handlers[p]){var f=u._handlers[p],g;if(typeof f=="function")g=f.call(d.currentTarget,d);else{var y=f.handleEvent;if(typeof y!="function")throw new TypeError("handleEvent property of event handler object isnot a function.");g=y.call(f,d)}d.type==="mouseover"?g===!0&&d.preventDefault():g===!1&&d.preventDefault()}var v=u._listeners&&u._listeners[p];if(v){v=v.slice();for(var x=0,b=v.length;x<b;x++){if(d._immediatePropagationStopped)return;var w=v[x];if(!(h===lf.CAPTURING_PHASE&&!w.capture||h===lf.BUBBLING_PHASE&&w.capture))if(w.f)w.f.call(d.currentTarget,d);else{var E=w.listener.handleEvent;if(typeof E!="function")throw new TypeError("handleEvent property of event listener object is not a function.");E.call(w.listener,d)}}}}a(r,"invoke"),(!t._initialized||t._dispatching)&&NQe.InvalidStateError(),t.isTrusted=n,t._dispatching=!0,t.target=this;for(var i=[],s=this.parentNode;s;s=s.parentNode)i.push(s);t.eventPhase=lf.CAPTURING_PHASE;for(var o=i.length-1;o>=0&&(r(i[o],t),!t._propagationStopped);o--);if(t._propagationStopped||(t.eventPhase=lf.AT_TARGET,r(this,t)),t.bubbles&&!t._propagationStopped){t.eventPhase=lf.BUBBLING_PHASE;for(var c=0,l=i.length;c<l&&(r(i[c],t),!t._propagationStopped);c++);}if(t._dispatching=!1,t.eventPhase=lf.AT_TARGET,t.currentTarget=null,n&&!t.defaultPrevented&&t instanceof OQe)switch(t.type){case"mousedown":this._armed={x:t.clientX,y:t.clientY,t:t.timeStamp};break;case"mouseout":case"mouseover":this._armed=null;break;case"mouseup":this._isClick(t)&&this._doClick(t),this._armed=null;break}return!t.defaultPrevented},"_dispatchEvent"),_isClick:a(function(e){return this._armed!==null&&e.type==="mouseup"&&e.isTrusted&&e.button===0&&e.timeStamp-this._armed.t<1e3&&Math.abs(e.clientX-this._armed.x)<10&&Math.abs(e.clientY-this._armed.Y)<10},"_isClick"),_doClick:a(function(e){if(!this._click_in_progress){this._click_in_progress=!0;for(var t=this;t&&!t._post_click_activation_steps;)t=t.parentNode;t&&t._pre_click_activation_steps&&t._pre_click_activation_steps();var n=this.ownerDocument.createEvent("MouseEvent");n.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,null);var r=this._dispatchEvent(n,!0);t&&(r?t._post_click_activation_steps&&t._post_click_activation_steps(n):t._cancelled_activation_steps&&t._cancelled_activation_steps())}},"_doClick"),_setEventHandler:a(function(t,n){this._handlers||(this._handlers=Object.create(null)),this._handlers[t]=n},"_setEventHandler"),_getEventHandler:a(function(t){return this._handlers&&this._handlers[t]||null},"_getEventHandler")}});var q5=pe((eGt,nle)=>{"use strict";var Xl=si(),oa=nle.exports={valid:a(function(e){return Xl.assert(e,"list falsy"),Xl.assert(e._previousSibling,"previous falsy"),Xl.assert(e._nextSibling,"next falsy"),!0},"valid"),insertBefore:a(function(e,t){Xl.assert(oa.valid(e)&&oa.valid(t));var n=e,r=e._previousSibling,i=t,s=t._previousSibling;n._previousSibling=s,r._nextSibling=i,s._nextSibling=n,i._previousSibling=r,Xl.assert(oa.valid(e)&&oa.valid(t))},"insertBefore"),replace:a(function(e,t){Xl.assert(oa.valid(e)&&(t===null||oa.valid(t))),t!==null&&oa.insertBefore(t,e),oa.remove(e),Xl.assert(oa.valid(e)&&(t===null||oa.valid(t)))},"replace"),remove:a(function(e){Xl.assert(oa.valid(e));var t=e._previousSibling;if(t!==e){var n=e._nextSibling;t._nextSibling=n,n._previousSibling=t,e._previousSibling=e._nextSibling=e,Xl.assert(oa.valid(e))}},"remove")}});var z5=pe((nGt,ule)=>{"use strict";ule.exports={serializeOne:qQe,\u0275escapeMatchingClosingTag:ale,\u0275escapeClosingCommentTag:cle,\u0275escapeProcessingInstructionContent:lle};var ole=si(),uf=ole.NAMESPACE,rle={STYLE:!0,SCRIPT:!0,XMP:!0,IFRAME:!0,NOEMBED:!0,NOFRAMES:!0,PLAINTEXT:!0},PQe={area:!0,base:!0,basefont:!0,bgsound:!0,br:!0,col:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},MQe={},ile=/[&<>\u00A0]/g,sle=/[&"<>\u00A0]/g;function DQe(e){return ile.test(e)?e.replace(ile,t=>{switch(t){case"&":return"&";case"<":return"<";case">":return">";case"\xA0":return" "}}):e}a(DQe,"escape");function LQe(e){return sle.test(e)?e.replace(sle,t=>{switch(t){case"<":return"<";case">":return">";case"&":return"&";case'"':return""";case"\xA0":return" "}}):e}a(LQe,"escapeAttr");function FQe(e){var t=e.namespaceURI;return t?t===uf.XML?"xml:"+e.localName:t===uf.XLINK?"xlink:"+e.localName:t===uf.XMLNS?e.localName==="xmlns"?"xmlns":"xmlns:"+e.localName:e.name:e.localName}a(FQe,"attrname");function ale(e,t){let n="</"+t;if(!e.toLowerCase().includes(n))return e;let r=[...e],i=e.matchAll(new RegExp(n,"ig"));for(let s of i)r[s.index]="<";return r.join("")}a(ale,"escapeMatchingClosingTag");var jQe=/--!?>/;function cle(e){return jQe.test(e)?e.replace(/(--\!?)>/g,"$1>"):e}a(cle,"escapeClosingCommentTag");function lle(e){return e.includes(">")?e.replaceAll(">",">"):e}a(lle,"escapeProcessingInstructionContent");function qQe(e,t){var n="";switch(e.nodeType){case 1:var r=e.namespaceURI,i=r===uf.HTML,s=i||r===uf.SVG||r===uf.MATHML?e.localName:e.tagName;n+="<"+s;for(var o=0,c=e._numattrs;o<c;o++){var l=e._attr(o);n+=" "+FQe(l),l.value!==void 0&&(n+='="'+LQe(l.value)+'"')}if(n+=">",!(i&&PQe[s])){var u=e.serialize();rle[s.toUpperCase()]&&(u=ale(u,s)),i&&MQe[s]&&u.charAt(0)===`
|
|
156
156
|
`&&(n+=`
|
|
@@ -4333,7 +4333,7 @@ The web search request used endpoint ${JSON.stringify(e)}. Search endpoint confi
|
|
|
4333
4333
|
button, .button { display: inline-block; box-sizing: border-box; margin-top: 1rem; padding: .75rem 1rem; border: 0; border-radius: .6rem; background: #5a87ff; color: #071022; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
|
|
4334
4334
|
.secondary { background: #29314b; color: #edf2ff; }
|
|
4335
4335
|
.error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
|
|
4336
|
-
`}a(Pge,"pageStyles");o2();function Pdt(){return"dsh-edge@0.16.0-alpha.1/direct"}a(Pdt,"resolveEdgeDeploymentId");function mb(e){return{baseURL:A5(e.DEEPSEEK_BASE_URL),maxTokens:R5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:af(e.DEEPSEEK_MODEL),reasoningEffort:$5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:lT(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:C5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:db(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(mb,"resolveEdgeDeploymentConfig");function Mdt(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}a(Mdt,"edgeDeploymentApiKeyConfigured");function Ddt(e){let t=A5(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}a(Ddt,"projectedEdgeBaseURL");function pj(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:Pdt(),apiKeyConfigured:Mdt(e),baseURL:Ddt(e.DEEPSEEK_BASE_URL),maxTokens:R5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:af(e.DEEPSEEK_MODEL),reasoningEffort:$5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:lT(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:C5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:db(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(pj,"resolveEdgeDeploymentProfile");function KT(e){mb(e);let t=pj(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,...e.CF_VERSION_METADATA===void 0?{}:{workerVersionId:e.CF_VERSION_METADATA.id},version:jm,upstreamVersion:gie,status:"ready"}}a(KT,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as W_t}from"node:async_hooks";import{WorkerEntrypoint as wnn}from"cloudflare:workers";var ch=Ec(Mge());var fj=a((e,t,n)=>{let r=e instanceof RegExp?Dge(e,n):e,i=t instanceof RegExp?Dge(t,n):t,s=r!==null&&i!=null&&Ldt(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),Dge=a((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Ldt=a((e,t,n)=>{let r,i,s,o,c,l=n.indexOf(e),u=n.indexOf(t,l+1),d=l;if(l>=0&&u>0){if(e===t)return[l,u];for(r=[],s=n.length;d>=0&&!c;){if(d===l)r.push(d),l=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(c=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,o=u),u=n.indexOf(t,d+1);d=l<u&&l>=0?l:u}r.length&&o!==void 0&&(c=[s,o])}return c},"range");var Lge="\0SLASH"+Math.random()+"\0",Fge="\0OPEN"+Math.random()+"\0",gj="\0CLOSE"+Math.random()+"\0",jge="\0COMMA"+Math.random()+"\0",qge="\0PERIOD"+Math.random()+"\0",Fdt=new RegExp(Lge,"g"),jdt=new RegExp(Fge,"g"),qdt=new RegExp(gj,"g"),zdt=new RegExp(jge,"g"),Udt=new RegExp(qge,"g"),Bdt=/\\\\/g,Wdt=/\\{/g,Hdt=/\\}/g,Vdt=/\\,/g,Gdt=/\\\./g,Zdt=1e5,Kdt=4e6;function hj(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}a(hj,"numeric");function Jdt(e){return e.replace(Bdt,Lge).replace(Wdt,Fge).replace(Hdt,gj).replace(Vdt,jge).replace(Gdt,qge)}a(Jdt,"escapeBraces");function Ydt(e){return e.replace(Fdt,"\\").replace(jdt,"{").replace(qdt,"}").replace(zdt,",").replace(Udt,".")}a(Ydt,"unescapeBraces");function zge(e){if(!e)return[""];let t=[],n=fj("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,o=r.split(",");o[o.length-1]+="{"+i+"}";let c=zge(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),t.push.apply(t,o),t}a(zge,"parseCommaParts");function Uge(e,t={}){if(!e)return[];let{max:n=Zdt,maxLength:r=Kdt}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),mj(Jdt(e),n,r,!0).map(Ydt)}a(Uge,"expand");function Xdt(e){return"{"+e+"}"}a(Xdt,"embrace");function Qdt(e){return/^-?0\d/.test(e)}a(Qdt,"isPadded");function ept(e,t){return e<=t}a(ept,"lte");function tpt(e,t){return e>=t}a(tpt,"gte");function gb(e,t,n,r,i,s){let o=[],c=0;for(let l=0;l<e.length;l++)for(let u=0;u<n.length;u++){if(o.length>=r)return o;let d=e[l]+t+n[u];if(!(s&&!d)){if(c+d.length>i)return o;o.push(d),c+=d.length}}return o}a(gb,"combine");function npt(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=hj(i[0]),c=hj(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(hj(i[2])),1):1,d=ept;c<o&&(u*=-1,d=tpt);let h=i.some(Qdt),f=0;for(let g=o;d(g,c)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),h){let v=l-y.length;if(v>0){let x=new Array(v+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(f+y.length>r)break;s.push(y),f+=y.length}return s}a(npt,"expandSequence");function mj(e,t,n,r){let i=[""],s=!1,o=!0;for(;;){let c=fj("{","}",e);if(!c)return gb(i,e,[""],t,n,s);let l=c.pre;if(/\$$/.test(l)){if(i=gb(i,l+"{"+c.body+"}",[""],t,n,s&&!c.post.length),o=!1,!c.post.length)break;e=c.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body),p=u||d,h=c.body.indexOf(",")>=0;if(!p&&!h){if(c.post.match(/,(?!,).*\}/)){e=c.pre+"{"+c.body+gj+c.post,r=!0;continue}return gb(i,l+"{"+c.body+"}"+c.post,[""],t,n,s)}o&&(s=r&&!p,o=!1);let f;if(p)f=npt(c.body,d,t,n);else{let g=zge(c.body);if(g.length===1&&g[0]!==void 0&&(g=mj(g[0],t,n,!1).map(Xdt),g.length===1)){if(i=gb(i,l+g[0],[""],t,n,s&&!c.post.length),!c.post.length)break;e=c.post;continue}let y=s&&!c.post.length&&!l;for(let x=0;y&&x<i.length;x++)i[x]&&(y=!1);f=[];let v=0;e:for(let x=0;x<g.length;x++){let b=mj(g[x],t,n,!1);for(let w=0;w<b.length;w++){let E=b[w];if(!(y&&!E)){if(f.length>=t||v+E.length>n)break e;f.push(E),v+=E.length}}}}if(i=gb(i,l,f,t,n,s&&!c.post.length),!c.post.length)break;e=c.post}return i}a(mj,"expand_");var yb=a(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var rpt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},vb=a(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),ipt=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Bge=a(e=>e.join(""),"rangesToString"),Wge=a((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,c=!1,l=!1,u=!1,d=n,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&o&&!l){d=s+1;break}if(o=!0,y==="\\"&&!l){l=!0,s++;continue}if(y==="["&&!l){for(let[v,[x,b,w]]of Object.entries(rpt))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-n,!0];s+=v.length,w?i.push(x):r.push(x),c=c||b;continue e}}if(l=!1,p){y>p?r.push(vb(p)+"-"+vb(y)):y===p&&r.push(vb(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(vb(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(vb(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[ipt(y),!1,d-n,!1]}let h="["+(u?"^":"")+Bge(r)+"]",f="["+(u?"":"^")+Bge(i)+"]";return[r.length&&i.length?"("+h+"|"+f+")":r.length?h:f,c,d-n,!0]},"parseClass");var $d=a((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var fo,spt=new Set(["!","?","+","*","@"]),yj=a(e=>spt.has(e),"isExtglobType"),Hge=a(e=>yj(e.type),"isExtglobAST"),opt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),apt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cpt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Vge=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),lpt="(?!(?:^|/)\\.\\.?(?:$|/))",YT="(?!\\.)",upt=new Set(["[","."]),dpt=new Set(["..","."]),ppt=new Set("().*{}+?[]^$\\!"),fpt=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),vj="[^/]",Gge=vj+"*?",Zge=vj+"+?",hpt=0,Rf=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#a;#d=!1;#c;#o;#l=!1;id=++hpt;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?r:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#d&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof fo&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let r=t.#t[n];if(!(r instanceof fo&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new fo(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,d=!1;if(n.type===null){let y=r,v="";for(;y<t.length;){let x=t.charAt(y++);if(c||x==="\\"){c=!c,v+=x;continue}if(l){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(l=!1),v+=x;continue}else if(x==="["){l=!0,u=y,d=!1,v+=x;continue}if(!i.noext&&yj(x)&&t.charAt(y)==="("&&s<=o){n.push(v),v="";let w=new fo(x,n);y=fo.#m(t,w,y,i,s+1),n.push(w);continue}v+=x}return n.push(v),y}let p=r+1,h=new fo(null,n),f=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(c||y==="\\"){c=!c,g+=y;continue}if(l){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(l=!1),g+=y;continue}else if(y==="["){l=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&yj(y)&&t.charAt(p)==="("&&(s<=o||n&&n.#y(y))){let x=n&&n.#y(y)?0:1;h.push(g),g="";let b=new fo(y,h);h.push(b),p=fo.#m(t,b,p,i,s+x);continue}if(y==="|"){h.push(g),g="",f.push(h),h=new fo(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#l=!0),h.push(g),g="",n.push(...f,h),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#N(t){return this.#g(t,apt)}#g(t,n=opt){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=cpt){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new fo(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#T(t){return!!Vge.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#T(n.type)}#v(t){let n=Vge.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#o=void 0,this.#l=!1}static fromGlob(t,n={}){let r=new fo(null,void 0,n);return fo.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#c.nocase&&!this.#c.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,c),{_src:n,_glob:t})}get options(){return this.#c}toRegExpSource(t){let n=t??!!this.#c.dot;if(this.#e===this&&(this.#f(),this.#k()),!Hge(this)){let l=this.isStart()&&this.isEnd()&&!this.#t.some(f=>typeof f!="string"),u=this.#t.map(f=>{let[g,y,v,x]=typeof f=="string"?fo.#I(f,this.#n,l):f.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&dpt.has(this.#t[0]))){let g=upt,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!n&&!t&&g.has(u.charAt(0));d=y?lpt:v?YT:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,$d(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,$d(this.toString()),!1,!1]}let o=!r||t||n||!YT?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!n?YT:"")+Zge;else{let l=this.type==="!"?"))"+(this.isStart()&&!n&&!t?YT:"")+Gge+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,$d(s),this.#n=!!this.#n,this.#r]}#f(){if(Hge(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#N(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#v(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#b(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(t);return this.#r=this.#r||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#I(t,n,r=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<t.length;l++){let u=t.charAt(l);if(i){i=!1,s+=(ppt.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(t)?Zge:Gge,n=!0;continue}else c=!1;if(u==="\\"){l===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,h,f]=Wge(t,l);if(h){s+=d,o=o||p,l+=h-1,n=n||f;continue}}if(u==="?"){s+=vj,n=!0;continue}s+=fpt(u)}return[s,$d(t),!!n,o]}};fo=Rf;var bj=a((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Vi=a((e,t,n={})=>(yb(t),!n.nocomment&&t.charAt(0)==="#"?!1:new $g(t,n).match(e)),"minimatch"),mpt=/^\*+([^+@!?*[(]*)$/,gpt=a(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),ypt=a(e=>t=>t.endsWith(e),"starDotExtTestDot"),vpt=a(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),bpt=a(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),xpt=/^\*+\.\*+$/,wpt=a(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Spt=a(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Ept=/^\.\*+$/,kpt=a(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),_pt=/^\*+$/,Tpt=a(e=>e.length!==0&&!e.startsWith("."),"starTest"),Ipt=a(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Apt=/^\?+([^+@!?*[(]*)?$/,$pt=a(([e,t=""])=>{let n=Yge([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),Cpt=a(([e,t=""])=>{let n=Xge([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),Rpt=a(([e,t=""])=>{let n=Xge([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),Opt=a(([e,t=""])=>{let n=Yge([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),Yge=a(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),Xge=a(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),Qge=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Kge={win32:{sep:"\\"},posix:{sep:"/"}},Npt=Qge==="win32"?Kge.win32.sep:Kge.posix.sep;Vi.sep=Npt;var Cs=Symbol("globstar **");Vi.GLOBSTAR=Cs;var Ppt="[^/]",Mpt=Ppt+"*?",Dpt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Lpt="(?:(?!(?:\\/|^)\\.).)*?",Fpt=a((e,t={})=>n=>Vi(n,e,t),"filter");Vi.filter=Fpt;var la=a((e,t={})=>Object.assign({},e,t),"ext"),jpt=a(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Vi;let t=Vi;return Object.assign(a((r,i,s={})=>t(r,i,la(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,la(e,s))}static defaults(i){return t.defaults(la(e,i)).Minimatch}},AST:class extends t.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,la(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,la(e,s))}},unescape:a((r,i={})=>t.unescape(r,la(e,i)),"unescape"),escape:a((r,i={})=>t.escape(r,la(e,i)),"escape"),filter:a((r,i={})=>t.filter(r,la(e,i)),"filter"),defaults:a(r=>t.defaults(la(e,r)),"defaults"),makeRe:a((r,i={})=>t.makeRe(r,la(e,i)),"makeRe"),braceExpand:a((r,i={})=>t.braceExpand(r,la(e,i)),"braceExpand"),match:a((r,i,s={})=>t.match(r,i,la(e,s)),"match"),sep:t.sep,GLOBSTAR:Cs})},"defaults");Vi.defaults=jpt;var eye=a((e,t={})=>(yb(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Uge(e,{max:t.braceExpandMax})),"braceExpand");Vi.braceExpand=eye;var qpt=a((e,t={})=>new $g(e,t).makeRe(),"makeRe");Vi.makeRe=qpt;var zpt=a((e,t,n={})=>{let r=new $g(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");Vi.match=zpt;var Jge=/[?*]|[+@!]\(.*?\)|\[|\]/,Upt=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),$g=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){yb(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||Qge,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Jge.test(s[2]))&&!Jge.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let c=r[o];o===1&&c===""&&r[0]===""||(c==="."||c==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,o=[],c="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])o.push(c==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])o.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])o.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(c==="b")return!1;c="a",o.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(c==="a")return!1;c="b",o.push(n[s]),i++,s++}else return!1;return t.length===n.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!c&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),p=l?3:c?0:void 0,h=d?3:u?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,g]=[t[p],n[h]];f.toLowerCase()===g.toLowerCase()&&(n[h]=f,s=h,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Cs)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let o=n.indexOf(Cs,s),c=n.lastIndexOf(Cs),[l,u,d]=r?[n.slice(s,o),n.slice(o+1),[]]:[n.slice(s,o),n.slice(o+1,c),n.slice(c+1)];if(l.length){let b=t.slice(i,i+l.length);if(!this.#r(b,l,r,0,0))return!1;i+=l.length,s+=l.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let b=t.length-d.length;if(this.#r(t,d,r,b,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(b--,!this.#r(t,d,r,b,0)))return!1;p=d.length+1}}if(!u.length){let b=!!p;for(let w=i;w<t.length-p;w++){let E=String(t[w]);if(b=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||b}let h=[[[],0]],f=h[0],g=0,y=[0];for(let b of u)b===Cs?(y.push(g),f=[[],0],h.push(f)):(f[0].push(b),g++);let v=h.length-1,x=t.length-p;for(let b of h)b[1]=x-(y[v--]+b[0].length);return!!this.#n(t,h,i,0,r,0,!!p)}#n(t,n,r,i,s,o,c){let l=n[i];if(!l){for(let p=r;p<t.length;p++){c=!0;let h=t[p];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1}return c}let[u,d]=l;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&o<this.maxGlobstarRecursion){let f=this.#n(t,n,r+u.length,i+1,s,o+1,c);if(f!==!1)return f}let h=t[r];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let o,c,l,u;for(o=i,c=s,u=t.length,l=n.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let d=n[c],p=t[o];if(this.debug(n,d,p),d===!1||d===Cs)return!1;let h;if(typeof d=="string"?(h=p===d,this.debug("string match",d,p,h)):(h=d.test(p),this.debug("pattern match",d,p,h)),!h)return!1}if(o===u&&c===l)return!0;if(o===u)return r;if(c===l)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return eye(this.pattern,this.options)}parse(t){yb(t);let n=this.options;if(t==="**")return Cs;if(t==="")return"";let r,i=null;(r=t.match(_pt))?i=n.dot?Ipt:Tpt:(r=t.match(mpt))?i=(n.nocase?n.dot?bpt:vpt:n.dot?ypt:gpt)(r[1]):(r=t.match(Apt))?i=(n.nocase?n.dot?Cpt:$pt:n.dot?Rpt:Opt)(r):(r=t.match(xpt))?i=n.dot?Spt:wpt:(r=t.match(Ept))&&(i=kpt);let s=Rf.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?Mpt:n.dot?Dpt:Lpt,i=new Set(n.nocase?["i"]:[]),s=t.map(l=>{let u=l.map(p=>{if(p instanceof RegExp)for(let h of p.flags.split(""))i.add(h);return typeof p=="string"?Upt(p):p===Cs?Cs:p._src});u.forEach((p,h)=>{let f=u[h+1],g=u[h-1];p!==Cs||g===Cs||(g===void 0?f!==void 0&&f!==Cs?u[h+1]="(?:\\/|"+r+"\\/)?"+f:u[h]=r:f===void 0?u[h-1]=g+"(?:\\/|\\/"+r+")?":f!==Cs&&(u[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+f,u[h+1]=Cs))});let d=u.filter(p=>p!==Cs);if(this.partial&&d.length>=1){let p=[];for(let h=1;h<=d.length;h++)p.push(d.slice(0,h).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[o,c]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+c+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c of s){let l=i;if(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return Vi.defaults(t).Minimatch}};Vi.AST=Rf;Vi.Minimatch=$g;Vi.escape=bj;Vi.unescape=$d;import{gunzipSync as Ght}from"node:zlib";var bb=class{static{a(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),o=this.castInput(n,r),c=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(c,l,r,i)}diffWithOptionsObj(t,n,r,i){var s;let o=a(b=>{if(b=this.postProcess(b,r),i){setTimeout(function(){i(b)},0);return}else return b},"done"),c=n.length,l=t.length,u=1,d=c+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+p,f=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&g+1>=c)return o(this.buildValues(f[0].lastComponent,n,t));let y=-1/0,v=1/0,x=a(()=>{for(let b=Math.max(y,-u);b<=Math.min(v,u);b+=2){let w,E=f[b-1],S=f[b+1];E&&(f[b-1]=void 0);let k=!1;if(S){let O=S.oldPos-b;k=S&&0<=O&&O<c}let _=E&&E.oldPos+1<l;if(!k&&!_){f[b]=void 0;continue}if(!_||k&&E.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,r):w=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(w,n,t,b,r),w.oldPos+1>=l&&g+1>=c)return o(this.buildValues(w.lastComponent,n,t))||!0;f[b]=w,w.oldPos+1>=l&&(v=Math.min(v,b-1)),g+1>=c&&(y=Math.max(y,b+1))}u++},"execEditLength");if(i)a(function b(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);x()||b()},0)},"exec")();else for(;u<=d&&Date.now()<=h;){let b=x();if(b)return b}}addToPath(t,n,r,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(t,n,r,i,s){let o=n.length,c=r.length,l=t.oldPos,u=l-i,d=0;for(;u+1<o&&l+1<c&&this.equals(r[l+1],n[u+1],s);)u++,l++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,c=0,l=0,u=0;for(;c<o;c++){let d=i[c];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(l,l+d.count);p=p.map(function(h,f){let g=r[u+f];return g.length>h.length?g:h}),d.value=this.join(p)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return i}};var xj=class extends bb{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Wpt}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
4336
|
+
`}a(Pge,"pageStyles");o2();function Pdt(){return"dsh-edge@0.16.0/direct"}a(Pdt,"resolveEdgeDeploymentId");function mb(e){return{baseURL:A5(e.DEEPSEEK_BASE_URL),maxTokens:R5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:af(e.DEEPSEEK_MODEL),reasoningEffort:$5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:lT(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:C5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:db(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(mb,"resolveEdgeDeploymentConfig");function Mdt(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}a(Mdt,"edgeDeploymentApiKeyConfigured");function Ddt(e){let t=A5(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}a(Ddt,"projectedEdgeBaseURL");function pj(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:Pdt(),apiKeyConfigured:Mdt(e),baseURL:Ddt(e.DEEPSEEK_BASE_URL),maxTokens:R5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:af(e.DEEPSEEK_MODEL),reasoningEffort:$5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:lT(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:C5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:db(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(pj,"resolveEdgeDeploymentProfile");function KT(e){mb(e);let t=pj(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,...e.CF_VERSION_METADATA===void 0?{}:{workerVersionId:e.CF_VERSION_METADATA.id},version:jm,upstreamVersion:gie,status:"ready"}}a(KT,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as W_t}from"node:async_hooks";import{WorkerEntrypoint as wnn}from"cloudflare:workers";var ch=Ec(Mge());var fj=a((e,t,n)=>{let r=e instanceof RegExp?Dge(e,n):e,i=t instanceof RegExp?Dge(t,n):t,s=r!==null&&i!=null&&Ldt(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),Dge=a((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Ldt=a((e,t,n)=>{let r,i,s,o,c,l=n.indexOf(e),u=n.indexOf(t,l+1),d=l;if(l>=0&&u>0){if(e===t)return[l,u];for(r=[],s=n.length;d>=0&&!c;){if(d===l)r.push(d),l=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(c=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,o=u),u=n.indexOf(t,d+1);d=l<u&&l>=0?l:u}r.length&&o!==void 0&&(c=[s,o])}return c},"range");var Lge="\0SLASH"+Math.random()+"\0",Fge="\0OPEN"+Math.random()+"\0",gj="\0CLOSE"+Math.random()+"\0",jge="\0COMMA"+Math.random()+"\0",qge="\0PERIOD"+Math.random()+"\0",Fdt=new RegExp(Lge,"g"),jdt=new RegExp(Fge,"g"),qdt=new RegExp(gj,"g"),zdt=new RegExp(jge,"g"),Udt=new RegExp(qge,"g"),Bdt=/\\\\/g,Wdt=/\\{/g,Hdt=/\\}/g,Vdt=/\\,/g,Gdt=/\\\./g,Zdt=1e5,Kdt=4e6;function hj(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}a(hj,"numeric");function Jdt(e){return e.replace(Bdt,Lge).replace(Wdt,Fge).replace(Hdt,gj).replace(Vdt,jge).replace(Gdt,qge)}a(Jdt,"escapeBraces");function Ydt(e){return e.replace(Fdt,"\\").replace(jdt,"{").replace(qdt,"}").replace(zdt,",").replace(Udt,".")}a(Ydt,"unescapeBraces");function zge(e){if(!e)return[""];let t=[],n=fj("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,o=r.split(",");o[o.length-1]+="{"+i+"}";let c=zge(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),t.push.apply(t,o),t}a(zge,"parseCommaParts");function Uge(e,t={}){if(!e)return[];let{max:n=Zdt,maxLength:r=Kdt}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),mj(Jdt(e),n,r,!0).map(Ydt)}a(Uge,"expand");function Xdt(e){return"{"+e+"}"}a(Xdt,"embrace");function Qdt(e){return/^-?0\d/.test(e)}a(Qdt,"isPadded");function ept(e,t){return e<=t}a(ept,"lte");function tpt(e,t){return e>=t}a(tpt,"gte");function gb(e,t,n,r,i,s){let o=[],c=0;for(let l=0;l<e.length;l++)for(let u=0;u<n.length;u++){if(o.length>=r)return o;let d=e[l]+t+n[u];if(!(s&&!d)){if(c+d.length>i)return o;o.push(d),c+=d.length}}return o}a(gb,"combine");function npt(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=hj(i[0]),c=hj(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(hj(i[2])),1):1,d=ept;c<o&&(u*=-1,d=tpt);let h=i.some(Qdt),f=0;for(let g=o;d(g,c)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),h){let v=l-y.length;if(v>0){let x=new Array(v+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(f+y.length>r)break;s.push(y),f+=y.length}return s}a(npt,"expandSequence");function mj(e,t,n,r){let i=[""],s=!1,o=!0;for(;;){let c=fj("{","}",e);if(!c)return gb(i,e,[""],t,n,s);let l=c.pre;if(/\$$/.test(l)){if(i=gb(i,l+"{"+c.body+"}",[""],t,n,s&&!c.post.length),o=!1,!c.post.length)break;e=c.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body),p=u||d,h=c.body.indexOf(",")>=0;if(!p&&!h){if(c.post.match(/,(?!,).*\}/)){e=c.pre+"{"+c.body+gj+c.post,r=!0;continue}return gb(i,l+"{"+c.body+"}"+c.post,[""],t,n,s)}o&&(s=r&&!p,o=!1);let f;if(p)f=npt(c.body,d,t,n);else{let g=zge(c.body);if(g.length===1&&g[0]!==void 0&&(g=mj(g[0],t,n,!1).map(Xdt),g.length===1)){if(i=gb(i,l+g[0],[""],t,n,s&&!c.post.length),!c.post.length)break;e=c.post;continue}let y=s&&!c.post.length&&!l;for(let x=0;y&&x<i.length;x++)i[x]&&(y=!1);f=[];let v=0;e:for(let x=0;x<g.length;x++){let b=mj(g[x],t,n,!1);for(let w=0;w<b.length;w++){let E=b[w];if(!(y&&!E)){if(f.length>=t||v+E.length>n)break e;f.push(E),v+=E.length}}}}if(i=gb(i,l,f,t,n,s&&!c.post.length),!c.post.length)break;e=c.post}return i}a(mj,"expand_");var yb=a(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var rpt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},vb=a(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),ipt=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Bge=a(e=>e.join(""),"rangesToString"),Wge=a((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,c=!1,l=!1,u=!1,d=n,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&o&&!l){d=s+1;break}if(o=!0,y==="\\"&&!l){l=!0,s++;continue}if(y==="["&&!l){for(let[v,[x,b,w]]of Object.entries(rpt))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-n,!0];s+=v.length,w?i.push(x):r.push(x),c=c||b;continue e}}if(l=!1,p){y>p?r.push(vb(p)+"-"+vb(y)):y===p&&r.push(vb(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(vb(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(vb(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[ipt(y),!1,d-n,!1]}let h="["+(u?"^":"")+Bge(r)+"]",f="["+(u?"":"^")+Bge(i)+"]";return[r.length&&i.length?"("+h+"|"+f+")":r.length?h:f,c,d-n,!0]},"parseClass");var $d=a((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var fo,spt=new Set(["!","?","+","*","@"]),yj=a(e=>spt.has(e),"isExtglobType"),Hge=a(e=>yj(e.type),"isExtglobAST"),opt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),apt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cpt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Vge=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),lpt="(?!(?:^|/)\\.\\.?(?:$|/))",YT="(?!\\.)",upt=new Set(["[","."]),dpt=new Set(["..","."]),ppt=new Set("().*{}+?[]^$\\!"),fpt=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),vj="[^/]",Gge=vj+"*?",Zge=vj+"+?",hpt=0,Rf=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#a;#d=!1;#c;#o;#l=!1;id=++hpt;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?r:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#d&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof fo&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let r=t.#t[n];if(!(r instanceof fo&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new fo(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,d=!1;if(n.type===null){let y=r,v="";for(;y<t.length;){let x=t.charAt(y++);if(c||x==="\\"){c=!c,v+=x;continue}if(l){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(l=!1),v+=x;continue}else if(x==="["){l=!0,u=y,d=!1,v+=x;continue}if(!i.noext&&yj(x)&&t.charAt(y)==="("&&s<=o){n.push(v),v="";let w=new fo(x,n);y=fo.#m(t,w,y,i,s+1),n.push(w);continue}v+=x}return n.push(v),y}let p=r+1,h=new fo(null,n),f=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(c||y==="\\"){c=!c,g+=y;continue}if(l){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(l=!1),g+=y;continue}else if(y==="["){l=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&yj(y)&&t.charAt(p)==="("&&(s<=o||n&&n.#y(y))){let x=n&&n.#y(y)?0:1;h.push(g),g="";let b=new fo(y,h);h.push(b),p=fo.#m(t,b,p,i,s+x);continue}if(y==="|"){h.push(g),g="",f.push(h),h=new fo(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#l=!0),h.push(g),g="",n.push(...f,h),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#N(t){return this.#g(t,apt)}#g(t,n=opt){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=cpt){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new fo(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#T(t){return!!Vge.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#T(n.type)}#v(t){let n=Vge.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#o=void 0,this.#l=!1}static fromGlob(t,n={}){let r=new fo(null,void 0,n);return fo.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#c.nocase&&!this.#c.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,c),{_src:n,_glob:t})}get options(){return this.#c}toRegExpSource(t){let n=t??!!this.#c.dot;if(this.#e===this&&(this.#f(),this.#k()),!Hge(this)){let l=this.isStart()&&this.isEnd()&&!this.#t.some(f=>typeof f!="string"),u=this.#t.map(f=>{let[g,y,v,x]=typeof f=="string"?fo.#I(f,this.#n,l):f.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&dpt.has(this.#t[0]))){let g=upt,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!n&&!t&&g.has(u.charAt(0));d=y?lpt:v?YT:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,$d(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,$d(this.toString()),!1,!1]}let o=!r||t||n||!YT?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!n?YT:"")+Zge;else{let l=this.type==="!"?"))"+(this.isStart()&&!n&&!t?YT:"")+Gge+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,$d(s),this.#n=!!this.#n,this.#r]}#f(){if(Hge(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#N(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#v(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#b(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(t);return this.#r=this.#r||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#I(t,n,r=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<t.length;l++){let u=t.charAt(l);if(i){i=!1,s+=(ppt.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(t)?Zge:Gge,n=!0;continue}else c=!1;if(u==="\\"){l===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,h,f]=Wge(t,l);if(h){s+=d,o=o||p,l+=h-1,n=n||f;continue}}if(u==="?"){s+=vj,n=!0;continue}s+=fpt(u)}return[s,$d(t),!!n,o]}};fo=Rf;var bj=a((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Vi=a((e,t,n={})=>(yb(t),!n.nocomment&&t.charAt(0)==="#"?!1:new $g(t,n).match(e)),"minimatch"),mpt=/^\*+([^+@!?*[(]*)$/,gpt=a(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),ypt=a(e=>t=>t.endsWith(e),"starDotExtTestDot"),vpt=a(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),bpt=a(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),xpt=/^\*+\.\*+$/,wpt=a(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Spt=a(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Ept=/^\.\*+$/,kpt=a(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),_pt=/^\*+$/,Tpt=a(e=>e.length!==0&&!e.startsWith("."),"starTest"),Ipt=a(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Apt=/^\?+([^+@!?*[(]*)?$/,$pt=a(([e,t=""])=>{let n=Yge([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),Cpt=a(([e,t=""])=>{let n=Xge([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),Rpt=a(([e,t=""])=>{let n=Xge([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),Opt=a(([e,t=""])=>{let n=Yge([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),Yge=a(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),Xge=a(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),Qge=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Kge={win32:{sep:"\\"},posix:{sep:"/"}},Npt=Qge==="win32"?Kge.win32.sep:Kge.posix.sep;Vi.sep=Npt;var Cs=Symbol("globstar **");Vi.GLOBSTAR=Cs;var Ppt="[^/]",Mpt=Ppt+"*?",Dpt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Lpt="(?:(?!(?:\\/|^)\\.).)*?",Fpt=a((e,t={})=>n=>Vi(n,e,t),"filter");Vi.filter=Fpt;var la=a((e,t={})=>Object.assign({},e,t),"ext"),jpt=a(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Vi;let t=Vi;return Object.assign(a((r,i,s={})=>t(r,i,la(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,la(e,s))}static defaults(i){return t.defaults(la(e,i)).Minimatch}},AST:class extends t.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,la(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,la(e,s))}},unescape:a((r,i={})=>t.unescape(r,la(e,i)),"unescape"),escape:a((r,i={})=>t.escape(r,la(e,i)),"escape"),filter:a((r,i={})=>t.filter(r,la(e,i)),"filter"),defaults:a(r=>t.defaults(la(e,r)),"defaults"),makeRe:a((r,i={})=>t.makeRe(r,la(e,i)),"makeRe"),braceExpand:a((r,i={})=>t.braceExpand(r,la(e,i)),"braceExpand"),match:a((r,i,s={})=>t.match(r,i,la(e,s)),"match"),sep:t.sep,GLOBSTAR:Cs})},"defaults");Vi.defaults=jpt;var eye=a((e,t={})=>(yb(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Uge(e,{max:t.braceExpandMax})),"braceExpand");Vi.braceExpand=eye;var qpt=a((e,t={})=>new $g(e,t).makeRe(),"makeRe");Vi.makeRe=qpt;var zpt=a((e,t,n={})=>{let r=new $g(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");Vi.match=zpt;var Jge=/[?*]|[+@!]\(.*?\)|\[|\]/,Upt=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),$g=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){yb(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||Qge,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Jge.test(s[2]))&&!Jge.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let c=r[o];o===1&&c===""&&r[0]===""||(c==="."||c==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,o=[],c="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])o.push(c==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])o.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])o.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(c==="b")return!1;c="a",o.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(c==="a")return!1;c="b",o.push(n[s]),i++,s++}else return!1;return t.length===n.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!c&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),p=l?3:c?0:void 0,h=d?3:u?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,g]=[t[p],n[h]];f.toLowerCase()===g.toLowerCase()&&(n[h]=f,s=h,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Cs)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let o=n.indexOf(Cs,s),c=n.lastIndexOf(Cs),[l,u,d]=r?[n.slice(s,o),n.slice(o+1),[]]:[n.slice(s,o),n.slice(o+1,c),n.slice(c+1)];if(l.length){let b=t.slice(i,i+l.length);if(!this.#r(b,l,r,0,0))return!1;i+=l.length,s+=l.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let b=t.length-d.length;if(this.#r(t,d,r,b,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(b--,!this.#r(t,d,r,b,0)))return!1;p=d.length+1}}if(!u.length){let b=!!p;for(let w=i;w<t.length-p;w++){let E=String(t[w]);if(b=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||b}let h=[[[],0]],f=h[0],g=0,y=[0];for(let b of u)b===Cs?(y.push(g),f=[[],0],h.push(f)):(f[0].push(b),g++);let v=h.length-1,x=t.length-p;for(let b of h)b[1]=x-(y[v--]+b[0].length);return!!this.#n(t,h,i,0,r,0,!!p)}#n(t,n,r,i,s,o,c){let l=n[i];if(!l){for(let p=r;p<t.length;p++){c=!0;let h=t[p];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1}return c}let[u,d]=l;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&o<this.maxGlobstarRecursion){let f=this.#n(t,n,r+u.length,i+1,s,o+1,c);if(f!==!1)return f}let h=t[r];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let o,c,l,u;for(o=i,c=s,u=t.length,l=n.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let d=n[c],p=t[o];if(this.debug(n,d,p),d===!1||d===Cs)return!1;let h;if(typeof d=="string"?(h=p===d,this.debug("string match",d,p,h)):(h=d.test(p),this.debug("pattern match",d,p,h)),!h)return!1}if(o===u&&c===l)return!0;if(o===u)return r;if(c===l)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return eye(this.pattern,this.options)}parse(t){yb(t);let n=this.options;if(t==="**")return Cs;if(t==="")return"";let r,i=null;(r=t.match(_pt))?i=n.dot?Ipt:Tpt:(r=t.match(mpt))?i=(n.nocase?n.dot?bpt:vpt:n.dot?ypt:gpt)(r[1]):(r=t.match(Apt))?i=(n.nocase?n.dot?Cpt:$pt:n.dot?Rpt:Opt)(r):(r=t.match(xpt))?i=n.dot?Spt:wpt:(r=t.match(Ept))&&(i=kpt);let s=Rf.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?Mpt:n.dot?Dpt:Lpt,i=new Set(n.nocase?["i"]:[]),s=t.map(l=>{let u=l.map(p=>{if(p instanceof RegExp)for(let h of p.flags.split(""))i.add(h);return typeof p=="string"?Upt(p):p===Cs?Cs:p._src});u.forEach((p,h)=>{let f=u[h+1],g=u[h-1];p!==Cs||g===Cs||(g===void 0?f!==void 0&&f!==Cs?u[h+1]="(?:\\/|"+r+"\\/)?"+f:u[h]=r:f===void 0?u[h-1]=g+"(?:\\/|\\/"+r+")?":f!==Cs&&(u[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+f,u[h+1]=Cs))});let d=u.filter(p=>p!==Cs);if(this.partial&&d.length>=1){let p=[];for(let h=1;h<=d.length;h++)p.push(d.slice(0,h).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[o,c]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+c+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c of s){let l=i;if(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return Vi.defaults(t).Minimatch}};Vi.AST=Rf;Vi.Minimatch=$g;Vi.escape=bj;Vi.unescape=$d;import{gunzipSync as Ght}from"node:zlib";var bb=class{static{a(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),o=this.castInput(n,r),c=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(c,l,r,i)}diffWithOptionsObj(t,n,r,i){var s;let o=a(b=>{if(b=this.postProcess(b,r),i){setTimeout(function(){i(b)},0);return}else return b},"done"),c=n.length,l=t.length,u=1,d=c+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+p,f=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&g+1>=c)return o(this.buildValues(f[0].lastComponent,n,t));let y=-1/0,v=1/0,x=a(()=>{for(let b=Math.max(y,-u);b<=Math.min(v,u);b+=2){let w,E=f[b-1],S=f[b+1];E&&(f[b-1]=void 0);let k=!1;if(S){let O=S.oldPos-b;k=S&&0<=O&&O<c}let _=E&&E.oldPos+1<l;if(!k&&!_){f[b]=void 0;continue}if(!_||k&&E.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,r):w=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(w,n,t,b,r),w.oldPos+1>=l&&g+1>=c)return o(this.buildValues(w.lastComponent,n,t))||!0;f[b]=w,w.oldPos+1>=l&&(v=Math.min(v,b-1)),g+1>=c&&(y=Math.max(y,b+1))}u++},"execEditLength");if(i)a(function b(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);x()||b()},0)},"exec")();else for(;u<=d&&Date.now()<=h;){let b=x();if(b)return b}}addToPath(t,n,r,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(t,n,r,i,s){let o=n.length,c=r.length,l=t.oldPos,u=l-i,d=0;for(;u+1<o&&l+1<c&&this.equals(r[l+1],n[u+1],s);)u++,l++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,c=0,l=0,u=0;for(;c<o;c++){let d=i[c];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(l,l+d.count);p=p.map(function(h,f){let g=r[u+f];return g.length>h.length?g:h}),d.value=this.join(p)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return i}};var xj=class extends bb{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Wpt}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
4337
4337
|
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
4338
4338
|
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
4339
4339
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
package/worker/isolated/index.js
CHANGED
|
@@ -150,7 +150,7 @@ Known schemas:
|
|
|
150
150
|
- `)}`,new Error(we)}let Le=`${l}/$ref`,ye=wr(e,ue,n,r,i,s,a,Le,c);if(ye.valid||ae.push({instanceLocation:a,keyword:"$ref",keywordLocation:Le,error:"A subschema had errors."},...ye.errors),n==="4"||n==="7")return{valid:ae.length===0,errors:ae}}if(Array.isArray(g)){let ke=g.length,ue=!1;for(let Le=0;Le<ke;Le++)if(d===g[Le]||g[Le]==="integer"&&d==="number"&&e%1===0&&e===e){ue=!0;break}ue||ae.push({instanceLocation:a,keyword:"type",keywordLocation:`${l}/type`,error:`Instance type "${d}" is invalid. Expected "${g.join('", "')}".`})}else g==="integer"?(d!=="number"||e%1||e!==e)&&ae.push({instanceLocation:a,keyword:"type",keywordLocation:`${l}/type`,error:`Instance type "${d}" is invalid. Expected "${g}".`}):g!==void 0&&d!==g&&ae.push({instanceLocation:a,keyword:"type",keywordLocation:`${l}/type`,error:`Instance type "${d}" is invalid. Expected "${g}".`});if(y!==void 0&&(d==="object"||d==="array"?eh(e,y)||ae.push({instanceLocation:a,keyword:"const",keywordLocation:`${l}/const`,error:`Instance does not match ${JSON.stringify(y)}.`}):e!==y&&ae.push({instanceLocation:a,keyword:"const",keywordLocation:`${l}/const`,error:`Instance does not match ${JSON.stringify(y)}.`})),v!==void 0&&(d==="object"||d==="array"?v.some(ke=>eh(e,ke))||ae.push({instanceLocation:a,keyword:"enum",keywordLocation:`${l}/enum`,error:`Instance does not match any of ${JSON.stringify(v)}.`}):v.some(ke=>e===ke)||ae.push({instanceLocation:a,keyword:"enum",keywordLocation:`${l}/enum`,error:`Instance does not match any of ${JSON.stringify(v)}.`})),b!==void 0){let ke=`${l}/not`;wr(e,b,n,r,i,s,a,ke).valid&&ae.push({instanceLocation:a,keyword:"not",keywordLocation:ke,error:'Instance matched "not" schema.'})}let ct=[];if(w!==void 0){let ke=`${l}/anyOf`,ue=ae.length,Le=!1;for(let ye=0;ye<w.length;ye++){let we=w[ye],je=Object.create(c),ie=wr(e,we,n,r,i,h===!0?s:null,a,`${ke}/${ye}`,je);ae.push(...ie.errors),Le=Le||ie.valid,ie.valid&&ct.push(je)}Le?ae.length=ue:ae.splice(ue,0,{instanceLocation:a,keyword:"anyOf",keywordLocation:ke,error:"Instance does not match any subschemas."})}if(E!==void 0){let ke=`${l}/allOf`,ue=ae.length,Le=!0;for(let ye=0;ye<E.length;ye++){let we=E[ye],je=Object.create(c),ie=wr(e,we,n,r,i,h===!0?s:null,a,`${ke}/${ye}`,je);ae.push(...ie.errors),Le=Le&&ie.valid,ie.valid&&ct.push(je)}Le?ae.length=ue:ae.splice(ue,0,{instanceLocation:a,keyword:"allOf",keywordLocation:ke,error:"Instance does not match every subschema."})}if(S!==void 0){let ke=`${l}/oneOf`,ue=ae.length,Le=S.filter((ye,we)=>{let je=Object.create(c),ie=wr(e,ye,n,r,i,h===!0?s:null,a,`${ke}/${we}`,je);return ae.push(...ie.errors),ie.valid&&ct.push(je),ie.valid}).length;Le===1?ae.length=ue:ae.splice(ue,0,{instanceLocation:a,keyword:"oneOf",keywordLocation:ke,error:`Instance does not match exactly one subschema (${Le} matches).`})}if((d==="object"||d==="array")&&Object.assign(c,...ct),k!==void 0){let ke=`${l}/if`;if(wr(e,k,n,r,i,s,a,ke,c).valid){if(T!==void 0){let Le=wr(e,T,n,r,i,s,a,`${l}/then`,c);Le.valid||ae.push({instanceLocation:a,keyword:"if",keywordLocation:ke,error:'Instance does not match "then" schema.'},...Le.errors)}}else if(D!==void 0){let Le=wr(e,D,n,r,i,s,a,`${l}/else`,c);Le.valid||ae.push({instanceLocation:a,keyword:"if",keywordLocation:ke,error:'Instance does not match "else" schema.'},...Le.errors)}}if(d==="object"){if(x!==void 0)for(let ye of x)ye in e||ae.push({instanceLocation:a,keyword:"required",keywordLocation:`${l}/required`,error:`Instance does not have required property "${ye}".`});let ke=Object.keys(e);if(I!==void 0&&ke.length<I&&ae.push({instanceLocation:a,keyword:"minProperties",keywordLocation:`${l}/minProperties`,error:`Instance does not have at least ${I} properties.`}),L!==void 0&&ke.length>L&&ae.push({instanceLocation:a,keyword:"maxProperties",keywordLocation:`${l}/maxProperties`,error:`Instance does not have at least ${L} properties.`}),Q!==void 0){let ye=`${l}/propertyNames`;for(let we in e){let je=`${a}/${Us(we)}`,ie=wr(we,Q,n,r,i,s,je,ye);ie.valid||ae.push({instanceLocation:a,keyword:"propertyNames",keywordLocation:ye,error:`Property name "${we}" does not match schema.`},...ie.errors)}}if(K!==void 0){let ye=`${l}/dependantRequired`;for(let we in K)if(we in e){let je=K[we];for(let ie of je)ie in e||ae.push({instanceLocation:a,keyword:"dependentRequired",keywordLocation:ye,error:`Instance has "${we}" but does not have "${ie}".`})}}if(fe!==void 0)for(let ye in fe){let we=`${l}/dependentSchemas`;if(ye in e){let je=wr(e,fe[ye],n,r,i,s,a,`${we}/${Us(ye)}`,c);je.valid||ae.push({instanceLocation:a,keyword:"dependentSchemas",keywordLocation:we,error:`Instance has "${ye}" but does not match dependant schema.`},...je.errors)}}if(ce!==void 0){let ye=`${l}/dependencies`;for(let we in ce)if(we in e){let je=ce[we];if(Array.isArray(je))for(let ie of je)ie in e||ae.push({instanceLocation:a,keyword:"dependencies",keywordLocation:ye,error:`Instance has "${we}" but does not have "${ie}".`});else{let ie=wr(e,je,n,r,i,s,a,`${ye}/${Us(we)}`);ie.valid||ae.push({instanceLocation:a,keyword:"dependencies",keywordLocation:ye,error:`Instance has "${we}" but does not match dependant schema.`},...ie.errors)}}}let ue=Object.create(null),Le=!1;if(W!==void 0){let ye=`${l}/properties`;for(let we in W){if(!(we in e))continue;let je=`${a}/${Us(we)}`,ie=wr(e[we],W[we],n,r,i,s,je,`${ye}/${Us(we)}`);if(ie.valid)c[we]=ue[we]=!0;else if(Le=i,ae.push({instanceLocation:a,keyword:"properties",keywordLocation:ye,error:`Property "${we}" does not match schema.`},...ie.errors),Le)break}}if(!Le&&R!==void 0){let ye=`${l}/patternProperties`;for(let we in R){let je=new RegExp(we,"u"),ie=R[we];for(let ze in e){if(!je.test(ze))continue;let xt=`${a}/${Us(ze)}`,Zn=wr(e[ze],ie,n,r,i,s,xt,`${ye}/${Us(we)}`);Zn.valid?c[ze]=ue[ze]=!0:(Le=i,ae.push({instanceLocation:a,keyword:"patternProperties",keywordLocation:ye,error:`Property "${ze}" matches pattern "${we}" but does not match associated schema.`},...Zn.errors))}}}if(!Le&&N!==void 0){let ye=`${l}/additionalProperties`;for(let we in e){if(ue[we])continue;let je=`${a}/${Us(we)}`,ie=wr(e[we],N,n,r,i,s,je,ye);ie.valid?c[we]=!0:(Le=i,ae.push({instanceLocation:a,keyword:"additionalProperties",keywordLocation:ye,error:`Property "${we}" does not match additional properties schema.`},...ie.errors))}}else if(!Le&&H!==void 0){let ye=`${l}/unevaluatedProperties`;for(let we in e)if(!c[we]){let je=`${a}/${Us(we)}`,ie=wr(e[we],H,n,r,i,s,je,ye);ie.valid?c[we]=!0:ae.push({instanceLocation:a,keyword:"unevaluatedProperties",keywordLocation:ye,error:`Property "${we}" does not match unevaluated properties schema.`},...ie.errors)}}}else if(d==="array"){me!==void 0&&e.length>me&&ae.push({instanceLocation:a,keyword:"maxItems",keywordLocation:`${l}/maxItems`,error:`Array has too many items (${e.length} > ${me}).`}),Te!==void 0&&e.length<Te&&ae.push({instanceLocation:a,keyword:"minItems",keywordLocation:`${l}/minItems`,error:`Array has too few items (${e.length} < ${Te}).`});let ke=e.length,ue=0,Le=!1;if(Z!==void 0){let ye=`${l}/prefixItems`,we=Math.min(Z.length,ke);for(;ue<we;ue++){let je=wr(e[ue],Z[ue],n,r,i,s,`${a}/${ue}`,`${ye}/${ue}`);if(c[ue]=!0,!je.valid&&(Le=i,ae.push({instanceLocation:a,keyword:"prefixItems",keywordLocation:ye,error:"Items did not match schema."},...je.errors),Le))break}}if(he!==void 0){let ye=`${l}/items`;if(Array.isArray(he)){let we=Math.min(he.length,ke);for(;ue<we;ue++){let je=wr(e[ue],he[ue],n,r,i,s,`${a}/${ue}`,`${ye}/${ue}`);if(c[ue]=!0,!je.valid&&(Le=i,ae.push({instanceLocation:a,keyword:"items",keywordLocation:ye,error:"Items did not match schema."},...je.errors),Le))break}}else for(;ue<ke;ue++){let we=wr(e[ue],he,n,r,i,s,`${a}/${ue}`,ye);if(c[ue]=!0,!we.valid&&(Le=i,ae.push({instanceLocation:a,keyword:"items",keywordLocation:ye,error:"Items did not match schema."},...we.errors),Le))break}if(!Le&&pe!==void 0){let we=`${l}/additionalItems`;for(;ue<ke;ue++){let je=wr(e[ue],pe,n,r,i,s,`${a}/${ue}`,we);c[ue]=!0,je.valid||(Le=i,ae.push({instanceLocation:a,keyword:"additionalItems",keywordLocation:we,error:"Items did not match additional items schema."},...je.errors))}}}if(O!==void 0)if(ke===0&&ge===void 0)ae.push({instanceLocation:a,keyword:"contains",keywordLocation:`${l}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(ge!==void 0&&ke<ge)ae.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${l}/minContains`,error:`Array has less items (${ke}) than minContains (${ge}).`});else{let ye=`${l}/contains`,we=ae.length,je=0;for(let ie=0;ie<ke;ie++){let ze=wr(e[ie],O,n,r,i,s,`${a}/${ie}`,ye);ze.valid?(c[ie]=!0,je++):ae.push(...ze.errors)}je>=(ge||0)&&(ae.length=we),ge===void 0&&Pe===void 0&&je===0?ae.splice(we,0,{instanceLocation:a,keyword:"contains",keywordLocation:ye,error:"Array does not contain item matching schema."}):ge!==void 0&&je<ge?ae.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${l}/minContains`,error:`Array must contain at least ${ge} items matching schema. Only ${je} items were found.`}):Pe!==void 0&&je>Pe&&ae.push({instanceLocation:a,keyword:"maxContains",keywordLocation:`${l}/maxContains`,error:`Array may contain at most ${Pe} items matching schema. ${je} items were found.`})}if(!Le&&X!==void 0){let ye=`${l}/unevaluatedItems`;for(ue;ue<ke;ue++){if(c[ue])continue;let we=wr(e[ue],X,n,r,i,s,`${a}/${ue}`,ye);c[ue]=!0,we.valid||ae.push({instanceLocation:a,keyword:"unevaluatedItems",keywordLocation:ye,error:"Items did not match unevaluated items schema."},...we.errors)}}if(We)for(let ye=0;ye<ke;ye++){let we=e[ye],je=typeof we=="object"&&we!==null;for(let ie=0;ie<ke;ie++){if(ye===ie)continue;let ze=e[ie];(we===ze||je&&(typeof ze=="object"&&ze!==null)&&eh(we,ze))&&(ae.push({instanceLocation:a,keyword:"uniqueItems",keywordLocation:`${l}/uniqueItems`,error:`Duplicate items at indexes ${ye} and ${ie}.`}),ye=Number.MAX_SAFE_INTEGER,ie=Number.MAX_SAFE_INTEGER)}}}else if(d==="number"){if(n==="4"?(Ie!==void 0&&(J===!0&&e<=Ie||e<Ie)&&ae.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${l}/minimum`,error:`${e} is less than ${J?"or equal to ":""} ${Ie}.`}),ne!==void 0&&(tt===!0&&e>=ne||e>ne)&&ae.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${l}/maximum`,error:`${e} is greater than ${tt?"or equal to ":""} ${ne}.`})):(Ie!==void 0&&e<Ie&&ae.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${l}/minimum`,error:`${e} is less than ${Ie}.`}),ne!==void 0&&e>ne&&ae.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${l}/maximum`,error:`${e} is greater than ${ne}.`}),J!==void 0&&e<=J&&ae.push({instanceLocation:a,keyword:"exclusiveMinimum",keywordLocation:`${l}/exclusiveMinimum`,error:`${e} is less than ${J}.`}),tt!==void 0&&e>=tt&&ae.push({instanceLocation:a,keyword:"exclusiveMaximum",keywordLocation:`${l}/exclusiveMaximum`,error:`${e} is greater than or equal to ${tt}.`})),Ae!==void 0){let ke=e%Ae;Math.abs(0-ke)>=11920929e-14&&Math.abs(Ae-ke)>=11920929e-14&&ae.push({instanceLocation:a,keyword:"multipleOf",keywordLocation:`${l}/multipleOf`,error:`${e} is not a multiple of ${Ae}.`})}}else if(d==="string"){let ke=$e===void 0&&wt===void 0?0:rY(e);$e!==void 0&&ke<$e&&ae.push({instanceLocation:a,keyword:"minLength",keywordLocation:`${l}/minLength`,error:`String is too short (${ke} < ${$e}).`}),wt!==void 0&&ke>wt&&ae.push({instanceLocation:a,keyword:"maxLength",keywordLocation:`${l}/maxLength`,error:`String is too long (${ke} > ${wt}).`}),Ue!==void 0&&!new RegExp(Ue,"u").test(e)&&ae.push({instanceLocation:a,keyword:"pattern",keywordLocation:`${l}/pattern`,error:"String does not match pattern."}),j!==void 0&&a$[j]&&!a$[j](e)&&ae.push({instanceLocation:a,keyword:"format",keywordLocation:`${l}/format`,error:`String does not match format "${j}".`})}return{valid:ae.length===0,errors:ae}}var c$=B(()=>{s$();Tb();o$();Ab();l$();o(wr,"validate")});var Ib,iY=B(()=>{Tb();c$();Ib=class{static{o(this,"Validator")}schema;draft;shortCircuit;lookup;constructor(t,n="2019-09",r=!0){this.schema=t,this.draft=n,this.shortCircuit=r,this.lookup=Ml(t)}validate(t){return wr(t,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(t,n){n&&(t={...t,$id:n}),Ml(t,this.lookup)}}});var sY=B(()=>{s$();Tb();o$();Ab();nY();l$();c$();iY()});var Cb,aY=B(()=>{sY();Cb=class{static{o(this,"CfWorkerJsonSchemaValidator")}constructor(t){this.shortcircuit=t?.shortcircuit??!0,this.draft=t?.draft??"2020-12"}getValidator(t){let n=new Ib(t,this.draft,this.shortcircuit);return r=>{let i=n.validate(r);return i.valid?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:i.errors.map(s=>`${s.instanceLocation}: ${s.error}`).join("; ")}}}}});var Zr,Rb=B(()=>{"use strict";Zr={probeTimeoutMs:3e4,callTimeoutMs:6e4,maxToolsPerServer:128,maxCatalogPages:10,maxCatalogBytes:131072,maxDescriptionLength:512,maxErrorMessageChars:300,maxPublicNameLength:64,maxInstructionsLength:1024,metaToolThreshold:20}});import{createHash as iPe}from"node:crypto";function aPe(e){let t=e.replace(/[.*+?^${}()|[\]\\]/gu,n=>n==="*"?"\0":`\\${n}`);return new RegExp(`^${t.replaceAll("\0",".*")}$`)}function oY(e,t,n){let r=t??"read_only";return r==="allow_all"?"allow":r==="approve_all"?"ask":n===!0?"allow":n===!1?"ask":sPe.some(i=>aPe(i).test(e))?"allow":"ask"}function Go(e){return e.replace(/Bearer\s+[^\s"']+/giu,"Bearer ***").replace(/(https?:\/\/[^\s"'?]+)\?[^\s"']*/giu,"$1?***").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/gu,"").slice(0,Zr.maxErrorMessageChars)}function lY(e,t){let n=`mcp__${e}__${t}`,r=n.replace(/[^A-Za-z0-9_-]/gu,"_");if(r===n&&r.length<=Zr.maxPublicNameLength)return r;let i=oPe(e,t),s=Zr.maxPublicNameLength-i.length-1;return`${r.slice(0,s)}_${i}`}function oPe(e,t){return iPe("sha256").update(`${e}\0${t}`).digest("hex").slice(0,12)}function cY(e){if(!(e==null||typeof e!="object"))try{let t=JSON.parse(JSON.stringify(e));return Yu(t),t}catch{return}}function uPe(e){return lPe.has(e)}function uY(e){return e.type!=="image"||e.data===void 0||e.mimeType===void 0||!uPe(e.mimeType)||!cPe.test(e.data)?void 0:{data:Uint8Array.from(atob(e.data),n=>n.charCodeAt(0)),mediaType:e.mimeType}}function dY(e){return e.some(t=>t.type==="image"&&t.data!==void 0)}function J1(e){if(e.isError)return[{type:"text",text:e.content.filter(i=>i.type==="text"&&typeof i.text=="string").map(i=>i.text).join(`
|
|
151
151
|
`)||"MCP tool returned an error."}];let t=[],n=[];for(let r of e.content)if(r.type==="text"&&typeof r.text=="string")n.push(r.text);else if(r.type==="resource_link"&&r.uri!==void 0)n.push(`Resource: ${r.name??"unnamed"} (${r.uri})`);else if(r.type==="image"&&r.data!==void 0)n.push(``);else if(r.type==="image")n.push(`[image: ${r.mimeType??"unknown type"}]`);else if(r.type==="audio")n.push("[audio result unsupported on Cloudflare Workers]");else if(r.type==="resource"&&r.resource?.text!==void 0){let i=r.resource.uri??"embedded resource";n.push(`--- ${i} ---
|
|
152
152
|
${r.resource.text}`)}else r.type==="resource"?n.push("[embedded resource: binary content not displayed]"):n.push(`[unsupported MCP content type: ${r.type}]`);return n.length>0&&t.push({type:"text",text:n.join(`
|
|
153
|
-
`)}),t.length>0?t:[{type:"text",text:"(empty MCP result)"}]}var sPe,lPe,cPe,$b=B(()=>{"use strict";Ui();Rb();sPe=["get_*","list_*","read_*","search_*","find_*","fetch_*","describe_*"];o(aPe,"globToRegExp");o(oY,"evaluateMcpToolPolicy");o(Go,"scrubMcpErrorMessage");o(lY,"publicToolName");o(oPe,"hashSuffix");o(cY,"supportedOutputSchema");lPe=new Set(["image/png","image/jpeg"]),cPe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u;o(uPe,"isImageMediaType");o(uY,"decodeImageBlock");o(dY,"containsImage");o(J1,"mapMcpResultToContentBlocks")});var u$,pY=B(()=>{u$={name:"dsh-edge",version:"0.16.0-alpha.1",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.5-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cfworker/json-schema":"^4.1.1","@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.5-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.5-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.5-rc.2","@deepseek-ai/dsh-api-gateway":"0.1.5-rc.2","@deepseek-ai/dsh-api-remotes":"0.1.5-rc.2","@deepseek-ai/dsh-api-session-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-settings-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-files":"0.1.5-rc.2","@deepseek-ai/dsh-attachment":"0.1.5-rc.2","@deepseek-ai/dsh-brand":"0.1.5-rc.2","@deepseek-ai/dsh-client-store":"0.1.5-rc.2","@deepseek-ai/dsh-commands":"0.1.5-rc.2","@deepseek-ai/dsh-compaction":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.5-rc.2","@deepseek-ai/dsh-credentials":"0.1.5-rc.2","@deepseek-ai/dsh-file-reference":"0.1.5-rc.2","@deepseek-ai/dsh-fs":"0.1.5-rc.2","@deepseek-ai/dsh-goal":"0.1.5-rc.2","@deepseek-ai/dsh-goal-round-driver":"0.1.5-rc.2","@deepseek-ai/dsh-host-directory-picker":"0.1.5-rc.2","@deepseek-ai/dsh-host-plugin-inventory":"0.1.5-rc.2","@deepseek-ai/dsh-invariants":"0.1.5-rc.2","@deepseek-ai/dsh-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-jobs-local":"0.1.5-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.5-rc.2","@deepseek-ai/dsh-llm":"0.1.5-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-message-feedback":"0.1.5-rc.2","@deepseek-ai/dsh-output-retention":"0.1.5-rc.2","@deepseek-ai/dsh-plan-mode":"0.1.5-rc.2","@deepseek-ai/dsh-sandbox":"0.1.5-rc.2","@deepseek-ai/dsh-schedule":"0.1.5-rc.2","@deepseek-ai/dsh-scope":"0.1.5-rc.2","@deepseek-ai/dsh-session":"0.1.5-rc.2","@deepseek-ai/dsh-session-format":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-catalog":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v0-to-v1":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v1-to-v2":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v2-to-v3":"0.1.5-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection-cache":"0.1.5-rc.2","@deepseek-ai/dsh-session-query":"0.1.5-rc.2","@deepseek-ai/dsh-session-reference":"0.1.5-rc.2","@deepseek-ai/dsh-session-title":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.5-rc.2","@deepseek-ai/dsh-settings":"0.1.5-rc.2","@deepseek-ai/dsh-skill":"0.1.5-rc.2","@deepseek-ai/dsh-spill":"0.1.5-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.5-rc.2","@deepseek-ai/dsh-storage":"0.1.5-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.5-rc.2","@deepseek-ai/dsh-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.5-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.5-rc.2","@deepseek-ai/dsh-timeout":"0.1.5-rc.2","@deepseek-ai/dsh-token-meter":"0.1.5-rc.2","@deepseek-ai/dsh-tool-ask-user":"0.1.5-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.5-rc.2","@deepseek-ai/dsh-tool-fs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-goal":"0.1.5-rc.2","@deepseek-ai/dsh-tool-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-skill":"0.1.5-rc.2","@deepseek-ai/dsh-tool-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-tool-web":"0.1.5-rc.2","@deepseek-ai/dsh-tools":"0.1.5-rc.2","@deepseek-ai/dsh-typert-protocol":"0.1.5-rc.2","@deepseek-ai/dsh-typert-registry":"0.1.5-rc.2","@deepseek-ai/dsh-user-approval":"0.1.5-rc.2","@deepseek-ai/dsh-user-questions":"0.1.5-rc.2","@deepseek-ai/dsh-util-values":"0.1.5-rc.2","@deepseek-ai/dsh-web":"0.1.5-rc.2","@deepseek-ai/dsh-web-fetch-http":"0.1.5-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-workspace":"0.1.5-rc.2","@deepseek-ai/schemastery":"3.18.2","@mixmark-io/domino":"2.2.0","@modelcontextprotocol/sdk":"1.30.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}}});var th,fY,Ob=B(()=>{"use strict";pY();th=u$.version,fY=u$.dshEdge.upstreamVersion});function mPe(e){let t=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/iu.exec(e);if(t!==null)return t[1];let n=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/iu.exec(e);if(n!==null){let r=parseInt(n[1],16),i=parseInt(n[2],16);return`${String(r>>8)}.${String(r&255)}.${String(i>>8)}.${String(i&255)}`}}function gPe(e){return/^\d+\.\d+\.\d+\.\d+$/u.test(e)||e.includes(":")}function Ll(e){let t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error("MCP server URL must use http: or https: protocol.");let n=t.hostname.toLowerCase(),r=n.endsWith(".")?n.slice(0,-1):n,i=r.startsWith("[")&&r.endsWith("]")?r.slice(1,-1):r;if(!(i==="localhost"||i==="127.0.0.1"||i==="::1")){for(let s of pPe)if(i.endsWith(s))throw new Error(`MCP server hostname "${i}" is blocked.`);if(gPe(i)){let s=mPe(i),a=s??i;for(let l of fPe)if(l.test(a))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`);if(s===void 0){for(let l of hPe)if(l.test(i))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`)}}}}function yPe(e){return e?.type==="bearer"&&e.token!==void 0?{Authorization:`Bearer ${e.token}`}:{}}async function hY(e,t,n){Ll(e);let r=new _b(new URL(e),{requestInit:{headers:yPe(t),signal:n},fetch:Ad}),i=new Eb({name:"dsh-edge",version:th},{capabilities:{},jsonSchemaValidator:vPe});return await i.connect(r),{client:i,close:o(async()=>{await i.close().catch(()=>{})},"close")}}async function mY(e,t,n){let r=AbortSignal.timeout(Zr.probeTimeoutMs),i;try{i=await hY(t,n,r)}catch(l){throw new Error(Go(l instanceof Error?l.message:String(l)))}let{client:s,close:a}=i;try{let l=[],c=new Set,u=new Set,d;for(let h=0;h<Zr.maxCatalogPages;h++){let g=await s.listTools(d===void 0?void 0:{cursor:d},{signal:r});for(let y of g.tools){if(l.length>=Zr.maxToolsPerServer)break;let v=lY(e,y.name);if(c.has(v))throw new Error(`Server listed tool "${y.name}" more than once`);c.add(v);let x=y.annotations?.readOnlyHint,b=cY(y.outputSchema);l.push({name:y.name,publicName:v,description:y.description??"",inputSchema:y.inputSchema??{type:"object"},...b!==void 0?{outputSchema:b}:{},...x!==void 0?{annotations:{readOnlyHint:x}}:{}})}if(l.length>=Zr.maxToolsPerServer||(d=g.nextCursor??void 0,d===void 0))break;if(u.has(d))throw new Error("Server repeated a tools/list continuation cursor");u.add(d)}let p=s.getServerVersion?.(),m=s.getInstructions?.();return{tools:l,serverInfo:p?{name:p.name,version:p.version}:void 0,instructions:typeof m=="string"&&m.length>0?m.slice(0,Zr.maxInstructionsLength):void 0}}finally{await a()}}async function Nb(e,t,n,r,i,s){let a=s??Zr.callTimeoutMs,l=i?AbortSignal.any([i,AbortSignal.timeout(a)]):AbortSignal.timeout(a),c;try{c=await hY(e,r,l)}catch(u){throw new Error(Go(u instanceof Error?u.message:String(u)))}try{let u=await c.client.callTool({name:t,arguments:n},void 0,{signal:l});return{content:u.content??[],structuredContent:u.structuredContent,isError:u.isError===!0}}catch(u){throw new Error(Go(u instanceof Error?u.message:String(u)))}finally{await c.close()}}var pPe,fPe,hPe,vPe,Ad,X1=B(()=>{"use strict";xQ();QQ();aY();$b();Rb();Ob();pPe=[".internal",".local",".localhost"],fPe=[/^127\./u,/^10\./u,/^172\.(1[6-9]|2\d|3[01])\./u,/^192\.168\./u,/^0\./u,/^169\.254\./u],hPe=[/^::1$/u,/^fc/iu,/^fd/iu,/^fe[89ab][0-9a-f]:/iu];o(mPe,"extractMappedIPv4");o(gPe,"isIpAddress");o(Ll,"assertSafeUrl");o(yPe,"buildHeaders");vPe=new Cb,Ad=o(async(e,t)=>{let n=await globalThis.fetch(e,{...t,redirect:"manual"});if(n.status>=300&&n.status<400)throw new Error(`MCP server returned HTTP ${String(n.status)} redirect; redirects are blocked for security.`);return n},"noRedirectFetch");o(hY,"connectClient");o(mY,"probe");o(Nb,"callTool")});import{Buffer as xPe}from"node:buffer";function EPe(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&SPe.has(e.code)}function yY(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&wPe.has(e.code)}function vY(e,t,n){let r=xPe.from(e,"base64");if(e.length===0&&t==="reject"||r.toString("base64")!==e)throw new Bt(n==="INVALID_IMAGE_BASE64"?"Image upload is not canonical base64.":"File upload is not canonical base64.",n);return new Uint8Array(r)}function kPe(e){return vY(e,"reject","INVALID_IMAGE_BASE64")}function _Pe(e){return{data:kPe(e.data),mediaType:e.mediaType,...e.name===void 0?{}:{name:e.name}}}async function Q1(e,t){return e.saveImages(t.map(_Pe))}async function APe(e,t){return e.saveFile({data:vY(t.data,"accept","INVALID_FILE_BASE64"),...t.name===void 0?{}:{name:t.name}})}function xY(e,t,n){let r=Math.min(1,Math.sqrt(n/(e*t)));if(r===1)return{width:e,height:t};if(e>=t){let a=Math.max(1,Math.floor(e*r)),l=Math.max(1,Math.round(a*t/e));for(;a*l>n&&a>1;)a-=1,l=Math.max(1,Math.round(a*t/e));return{width:a,height:l}}let i=Math.max(1,Math.floor(t*r)),s=Math.max(1,Math.round(i*e/t));for(;s*i>n&&i>1;)i-=1,s=Math.max(1,Math.round(i*e/t));return{width:s,height:i}}var gY,bPe,wPe,SPe,Bt,d$,jl=B(()=>{nn();gY=["TOO_MANY_IMAGES","IMAGES_TOO_LARGE","UNSUPPORTED_IMAGE_TYPE","INVALID_IMAGE_BASE64","INVALID_IMAGE","IMAGE_TYPE_MISMATCH","IMAGE_TOO_LARGE","IMAGE_TOO_MANY_PIXELS","IMAGE_DIMENSION_TOO_LARGE"],bPe=[...gY,"INVALID_FILE_BASE64","INVALID_ATTACHMENT_REF","ATTACHMENT_CORRUPT","ATTACHMENT_WRITE_FAILED","ATTACHMENT_NOT_FOUND","ATTACHMENT_READ_FAILED","ATTACHMENT_PROJECTION_UNSUPPORTED","ATTACHMENT_FILES_UNSUPPORTED"],wPe=new Set(gY),SPe=new Set(bPe),Bt=class extends Error{static{o(this,"AttachmentError")}code;constructor(e,t,n){super(e,n),this.name="AttachmentError",this.code=t}};o(EPe,"isAttachmentError");o(yY,"isImageAdmissionError");o(vY,"decodeCanonicalBase64");o(kPe,"decodeBase64");o(_Pe,"saveInput");o(Q1,"admitEncodedImages");o(APe,"admitEncodedFile");o(xY,"requestImageDimensions");d$=class extends Be{static{o(this,"AttachmentStore")}constructor(e){super(e,"attachments")}validateImageBatch(e){let{maxImagesPerMessage:t,maxMessageImageBytes:n,mediaTypes:r}=this.imageLimits;if(e.length>t)throw new Bt("Image batch exceeds the configured image-count limit.","TOO_MANY_IMAGES");if(e.reduce((i,s)=>i+s.data.byteLength,0)>n)throw new Bt("Image batch exceeds the configured aggregate image-byte limit.","IMAGES_TOO_LARGE");for(let i of e)if(!r.includes(i.mediaType))throw new Bt(`Image type ${i.mediaType} is not accepted by this deployment.`,"UNSUPPORTED_IMAGE_TYPE")}async saveImages(e){this.validateImageBatch(e);for(let n of e)await this.validateImage(n);let t=[];for(let n of e)t.push(await this.saveImage(n));return t}async admitPromptContent(e){if(e.every(r=>r.type!=="image"))return e.map(r=>r.type==="text"?{type:"text",text:r.text}:{type:"file",attachment:r.attachment});let t=await Q1(this,e.filter(r=>r.type==="image")),n=0;return e.map(r=>r.type==="text"?{type:"text",text:r.text}:r.type==="file"?{type:"file",attachment:r.attachment}:{type:"image",attachment:t[n++]})}admitEncodedFile(e){return APe(this,e)}isAttachmentError(e){return EPe(e)}imageHostPath(e){}saveFile(e){return Promise.reject(new Bt("The mounted attachment provider cannot store verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}saveFileStream(e){return Promise.reject(new Bt("The mounted attachment provider cannot stream verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}async*readFileStream(e,t){t?.throwIfAborted(),await Promise.reject(new Bt("The mounted attachment provider cannot read verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}fileHostPath(e){}readImageRequest(e,t,n){return n?.throwIfAborted(),Promise.reject(new Bt("The mounted attachment provider cannot derive model-request images.","ATTACHMENT_PROJECTION_UNSUPPORTED"))}}});var Db={};Wt(Db,{buildAuthorizationUrl:()=>DPe,discoverEndpoints:()=>NPe,exchangeCode:()=>MPe,isTokenExpired:()=>jPe,refreshToken:()=>LPe,registerClient:()=>PPe});function EY(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,n=>n.toString(16).padStart(2,"0")).join("").slice(0,e)}async function OPe(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return btoa(String.fromCharCode(...new Uint8Array(n))).replace(/\+/gu,"-").replace(/\//gu,"_").replace(/=/gu,"")}async function NPe(e){let t=AbortSignal.timeout(Pb),n=new URL(e),r=n.pathname==="/"?"/.well-known/oauth-protected-resource":`/.well-known/oauth-protected-resource${n.pathname}`,i=new URL(r,n.origin);Ll(i.href);let s=await Ad(i.href,{signal:t});if(!s.ok)throw new Error(`PRM discovery failed: HTTP ${s.status}`);let l=(await s.json()).authorization_servers?.[0];if(typeof l!="string")throw new Error("No authorization server in PRM");let c=new URL(l),u=c.pathname==="/"?"/.well-known/oauth-authorization-server":`/.well-known/oauth-authorization-server${c.pathname}`,d=new URL(u,c.origin);Ll(d.href);let p=await Ad(d.href,{signal:t});if(!p.ok)throw new Error(`AS metadata failed: HTTP ${p.status}`);let m=await p.json();if(typeof m.authorization_endpoint!="string"||typeof m.token_endpoint!="string")throw new Error("Missing required endpoints in AS metadata");return{authorization:m.authorization_endpoint,token:m.token_endpoint,registration:m.registration_endpoint}}async function PPe(e,t,n){let r=AbortSignal.timeout(Pb);Ll(e);let i=await Ad(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_name:n,redirect_uris:[t],grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}),signal:r});if(!i.ok)throw new Error(`DCR failed: HTTP ${i.status}`);let s=await i.json();if(typeof s.client_id!="string")throw new Error("DCR response missing client_id");return{clientId:s.client_id,clientSecret:s.client_secret}}async function DPe(e,t,n,r,i){let s=EY(32),a=EY(64),l=await OPe(a),c=new URL(e.authorization);for(let[u,d]of Object.entries({response_type:"code",client_id:t.clientId,redirect_uri:n,state:s,code_challenge:l,code_challenge_method:"S256",resource:i}))c.searchParams.set(u,d);return{authorizationUrl:c.href,pendingFlow:{state:s,codeVerifier:a,redirectUri:n,serverName:r,serverUrl:i,stagedClient:t,createdAt:Date.now()}}}async function MPe(e,t,n,r,i,s){let a=AbortSignal.timeout(Pb),l=new URLSearchParams({grant_type:"authorization_code",code:n,redirect_uri:i,client_id:t.clientId,code_verifier:r});s!==void 0&&l.set("resource",s),t.clientSecret!==void 0&&l.set("client_secret",t.clientSecret),Ll(e);let c=await Ad(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:l.toString(),signal:a});if(!c.ok)throw new Error(`Token exchange failed: HTTP ${c.status}`);return kY(await c.json())}async function LPe(e,t,n,r){let i=AbortSignal.timeout(Pb),s=new URLSearchParams({grant_type:"refresh_token",refresh_token:n,client_id:t.clientId});r!==void 0&&s.set("resource",r),t.clientSecret!==void 0&&s.set("client_secret",t.clientSecret),Ll(e);let a=await Ad(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s.toString(),signal:i});if(!a.ok)throw new Error(`Token refresh failed: HTTP ${a.status}`);return kY(await a.json())}function kY(e){let t=e;if(typeof t.access_token!="string")throw new Error("Missing access_token");let n=typeof t.expires_in=="number"?t.expires_in:void 0;return{accessToken:t.access_token,refreshToken:typeof t.refresh_token=="string"?t.refresh_token:void 0,expiresAt:n!==void 0?Date.now()+n*1e3:void 0,tokenType:typeof t.token_type=="string"?t.token_type:"Bearer",scope:typeof t.scope=="string"?t.scope:void 0}}function jPe(e){return e.expiresAt===void 0?!1:Date.now()>e.expiresAt-12e4}var Pb,Mb=B(()=>{"use strict";X1();Pb=1e4;o(EY,"randomString");o(OPe,"sha256Base64Url");o(NPe,"discoverEndpoints");o(PPe,"registerClient");o(DPe,"buildAuthorizationUrl");o(MPe,"exchangeCode");o(LPe,"refreshToken");o(kY,"parseTokenResponse");o(jPe,"isTokenExpired")});var Gt,OY,jb=B(()=>{nn();xn();Gt=class extends An{static{o(this,"FsError")}code;constructor(e,t,n){super(e,t,n),this.code=t}},OY=class extends Be{static{o(this,"FileSystem")}constructor(e){super(e,"fs")}get sandboxMode(){}processPathFromHostPath(e){}}});function C$(e){return Zb.test(e)}function Kb(e){return e.invocation.modelInvocable}function rh(e){return e.invocation.userInvocable}function R$(e){let t=xMe(e);return[`<skill_content name="${bMe(e.name)}">`,"<skill_resources>",...t,"</skill_resources>","","<skill_instructions>",e.content,"</skill_instructions>","</skill_content>"].join(`
|
|
153
|
+
`)}),t.length>0?t:[{type:"text",text:"(empty MCP result)"}]}var sPe,lPe,cPe,$b=B(()=>{"use strict";Ui();Rb();sPe=["get_*","list_*","read_*","search_*","find_*","fetch_*","describe_*"];o(aPe,"globToRegExp");o(oY,"evaluateMcpToolPolicy");o(Go,"scrubMcpErrorMessage");o(lY,"publicToolName");o(oPe,"hashSuffix");o(cY,"supportedOutputSchema");lPe=new Set(["image/png","image/jpeg"]),cPe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u;o(uPe,"isImageMediaType");o(uY,"decodeImageBlock");o(dY,"containsImage");o(J1,"mapMcpResultToContentBlocks")});var u$,pY=B(()=>{u$={name:"dsh-edge",version:"0.16.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.5-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cfworker/json-schema":"^4.1.1","@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.5-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.5-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.5-rc.2","@deepseek-ai/dsh-api-gateway":"0.1.5-rc.2","@deepseek-ai/dsh-api-remotes":"0.1.5-rc.2","@deepseek-ai/dsh-api-session-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-settings-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-controller":"0.1.5-rc.2","@deepseek-ai/dsh-api-workspace-files":"0.1.5-rc.2","@deepseek-ai/dsh-attachment":"0.1.5-rc.2","@deepseek-ai/dsh-brand":"0.1.5-rc.2","@deepseek-ai/dsh-client-store":"0.1.5-rc.2","@deepseek-ai/dsh-commands":"0.1.5-rc.2","@deepseek-ai/dsh-compaction":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.5-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.5-rc.2","@deepseek-ai/dsh-credentials":"0.1.5-rc.2","@deepseek-ai/dsh-file-reference":"0.1.5-rc.2","@deepseek-ai/dsh-fs":"0.1.5-rc.2","@deepseek-ai/dsh-goal":"0.1.5-rc.2","@deepseek-ai/dsh-goal-round-driver":"0.1.5-rc.2","@deepseek-ai/dsh-host-directory-picker":"0.1.5-rc.2","@deepseek-ai/dsh-host-plugin-inventory":"0.1.5-rc.2","@deepseek-ai/dsh-invariants":"0.1.5-rc.2","@deepseek-ai/dsh-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-jobs-local":"0.1.5-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.5-rc.2","@deepseek-ai/dsh-llm":"0.1.5-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-message-feedback":"0.1.5-rc.2","@deepseek-ai/dsh-output-retention":"0.1.5-rc.2","@deepseek-ai/dsh-plan-mode":"0.1.5-rc.2","@deepseek-ai/dsh-sandbox":"0.1.5-rc.2","@deepseek-ai/dsh-schedule":"0.1.5-rc.2","@deepseek-ai/dsh-scope":"0.1.5-rc.2","@deepseek-ai/dsh-session":"0.1.5-rc.2","@deepseek-ai/dsh-session-format":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-catalog":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v0-to-v1":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v1-to-v2":"0.1.5-rc.2","@deepseek-ai/dsh-session-format-v2-to-v3":"0.1.5-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection":"0.1.5-rc.2","@deepseek-ai/dsh-session-projection-cache":"0.1.5-rc.2","@deepseek-ai/dsh-session-query":"0.1.5-rc.2","@deepseek-ai/dsh-session-reference":"0.1.5-rc.2","@deepseek-ai/dsh-session-title":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.5-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.5-rc.2","@deepseek-ai/dsh-settings":"0.1.5-rc.2","@deepseek-ai/dsh-skill":"0.1.5-rc.2","@deepseek-ai/dsh-spill":"0.1.5-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.5-rc.2","@deepseek-ai/dsh-storage":"0.1.5-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.5-rc.2","@deepseek-ai/dsh-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.5-rc.2","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.5-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.5-rc.2","@deepseek-ai/dsh-timeout":"0.1.5-rc.2","@deepseek-ai/dsh-token-meter":"0.1.5-rc.2","@deepseek-ai/dsh-tool-ask-user":"0.1.5-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.5-rc.2","@deepseek-ai/dsh-tool-fs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-goal":"0.1.5-rc.2","@deepseek-ai/dsh-tool-jobs":"0.1.5-rc.2","@deepseek-ai/dsh-tool-skill":"0.1.5-rc.2","@deepseek-ai/dsh-tool-subagent":"0.1.5-rc.2","@deepseek-ai/dsh-tool-web":"0.1.5-rc.2","@deepseek-ai/dsh-tools":"0.1.5-rc.2","@deepseek-ai/dsh-typert-protocol":"0.1.5-rc.2","@deepseek-ai/dsh-typert-registry":"0.1.5-rc.2","@deepseek-ai/dsh-user-approval":"0.1.5-rc.2","@deepseek-ai/dsh-user-questions":"0.1.5-rc.2","@deepseek-ai/dsh-util-values":"0.1.5-rc.2","@deepseek-ai/dsh-web":"0.1.5-rc.2","@deepseek-ai/dsh-web-fetch-http":"0.1.5-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.5-rc.2","@deepseek-ai/dsh-workspace":"0.1.5-rc.2","@deepseek-ai/schemastery":"3.18.2","@mixmark-io/domino":"2.2.0","@modelcontextprotocol/sdk":"1.30.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}}});var th,fY,Ob=B(()=>{"use strict";pY();th=u$.version,fY=u$.dshEdge.upstreamVersion});function mPe(e){let t=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/iu.exec(e);if(t!==null)return t[1];let n=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/iu.exec(e);if(n!==null){let r=parseInt(n[1],16),i=parseInt(n[2],16);return`${String(r>>8)}.${String(r&255)}.${String(i>>8)}.${String(i&255)}`}}function gPe(e){return/^\d+\.\d+\.\d+\.\d+$/u.test(e)||e.includes(":")}function Ll(e){let t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error("MCP server URL must use http: or https: protocol.");let n=t.hostname.toLowerCase(),r=n.endsWith(".")?n.slice(0,-1):n,i=r.startsWith("[")&&r.endsWith("]")?r.slice(1,-1):r;if(!(i==="localhost"||i==="127.0.0.1"||i==="::1")){for(let s of pPe)if(i.endsWith(s))throw new Error(`MCP server hostname "${i}" is blocked.`);if(gPe(i)){let s=mPe(i),a=s??i;for(let l of fPe)if(l.test(a))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`);if(s===void 0){for(let l of hPe)if(l.test(i))throw new Error(`MCP server address "${i}" is a private IP and is blocked.`)}}}}function yPe(e){return e?.type==="bearer"&&e.token!==void 0?{Authorization:`Bearer ${e.token}`}:{}}async function hY(e,t,n){Ll(e);let r=new _b(new URL(e),{requestInit:{headers:yPe(t),signal:n},fetch:Ad}),i=new Eb({name:"dsh-edge",version:th},{capabilities:{},jsonSchemaValidator:vPe});return await i.connect(r),{client:i,close:o(async()=>{await i.close().catch(()=>{})},"close")}}async function mY(e,t,n){let r=AbortSignal.timeout(Zr.probeTimeoutMs),i;try{i=await hY(t,n,r)}catch(l){throw new Error(Go(l instanceof Error?l.message:String(l)))}let{client:s,close:a}=i;try{let l=[],c=new Set,u=new Set,d;for(let h=0;h<Zr.maxCatalogPages;h++){let g=await s.listTools(d===void 0?void 0:{cursor:d},{signal:r});for(let y of g.tools){if(l.length>=Zr.maxToolsPerServer)break;let v=lY(e,y.name);if(c.has(v))throw new Error(`Server listed tool "${y.name}" more than once`);c.add(v);let x=y.annotations?.readOnlyHint,b=cY(y.outputSchema);l.push({name:y.name,publicName:v,description:y.description??"",inputSchema:y.inputSchema??{type:"object"},...b!==void 0?{outputSchema:b}:{},...x!==void 0?{annotations:{readOnlyHint:x}}:{}})}if(l.length>=Zr.maxToolsPerServer||(d=g.nextCursor??void 0,d===void 0))break;if(u.has(d))throw new Error("Server repeated a tools/list continuation cursor");u.add(d)}let p=s.getServerVersion?.(),m=s.getInstructions?.();return{tools:l,serverInfo:p?{name:p.name,version:p.version}:void 0,instructions:typeof m=="string"&&m.length>0?m.slice(0,Zr.maxInstructionsLength):void 0}}finally{await a()}}async function Nb(e,t,n,r,i,s){let a=s??Zr.callTimeoutMs,l=i?AbortSignal.any([i,AbortSignal.timeout(a)]):AbortSignal.timeout(a),c;try{c=await hY(e,r,l)}catch(u){throw new Error(Go(u instanceof Error?u.message:String(u)))}try{let u=await c.client.callTool({name:t,arguments:n},void 0,{signal:l});return{content:u.content??[],structuredContent:u.structuredContent,isError:u.isError===!0}}catch(u){throw new Error(Go(u instanceof Error?u.message:String(u)))}finally{await c.close()}}var pPe,fPe,hPe,vPe,Ad,X1=B(()=>{"use strict";xQ();QQ();aY();$b();Rb();Ob();pPe=[".internal",".local",".localhost"],fPe=[/^127\./u,/^10\./u,/^172\.(1[6-9]|2\d|3[01])\./u,/^192\.168\./u,/^0\./u,/^169\.254\./u],hPe=[/^::1$/u,/^fc/iu,/^fd/iu,/^fe[89ab][0-9a-f]:/iu];o(mPe,"extractMappedIPv4");o(gPe,"isIpAddress");o(Ll,"assertSafeUrl");o(yPe,"buildHeaders");vPe=new Cb,Ad=o(async(e,t)=>{let n=await globalThis.fetch(e,{...t,redirect:"manual"});if(n.status>=300&&n.status<400)throw new Error(`MCP server returned HTTP ${String(n.status)} redirect; redirects are blocked for security.`);return n},"noRedirectFetch");o(hY,"connectClient");o(mY,"probe");o(Nb,"callTool")});import{Buffer as xPe}from"node:buffer";function EPe(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&SPe.has(e.code)}function yY(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&wPe.has(e.code)}function vY(e,t,n){let r=xPe.from(e,"base64");if(e.length===0&&t==="reject"||r.toString("base64")!==e)throw new Bt(n==="INVALID_IMAGE_BASE64"?"Image upload is not canonical base64.":"File upload is not canonical base64.",n);return new Uint8Array(r)}function kPe(e){return vY(e,"reject","INVALID_IMAGE_BASE64")}function _Pe(e){return{data:kPe(e.data),mediaType:e.mediaType,...e.name===void 0?{}:{name:e.name}}}async function Q1(e,t){return e.saveImages(t.map(_Pe))}async function APe(e,t){return e.saveFile({data:vY(t.data,"accept","INVALID_FILE_BASE64"),...t.name===void 0?{}:{name:t.name}})}function xY(e,t,n){let r=Math.min(1,Math.sqrt(n/(e*t)));if(r===1)return{width:e,height:t};if(e>=t){let a=Math.max(1,Math.floor(e*r)),l=Math.max(1,Math.round(a*t/e));for(;a*l>n&&a>1;)a-=1,l=Math.max(1,Math.round(a*t/e));return{width:a,height:l}}let i=Math.max(1,Math.floor(t*r)),s=Math.max(1,Math.round(i*e/t));for(;s*i>n&&i>1;)i-=1,s=Math.max(1,Math.round(i*e/t));return{width:s,height:i}}var gY,bPe,wPe,SPe,Bt,d$,jl=B(()=>{nn();gY=["TOO_MANY_IMAGES","IMAGES_TOO_LARGE","UNSUPPORTED_IMAGE_TYPE","INVALID_IMAGE_BASE64","INVALID_IMAGE","IMAGE_TYPE_MISMATCH","IMAGE_TOO_LARGE","IMAGE_TOO_MANY_PIXELS","IMAGE_DIMENSION_TOO_LARGE"],bPe=[...gY,"INVALID_FILE_BASE64","INVALID_ATTACHMENT_REF","ATTACHMENT_CORRUPT","ATTACHMENT_WRITE_FAILED","ATTACHMENT_NOT_FOUND","ATTACHMENT_READ_FAILED","ATTACHMENT_PROJECTION_UNSUPPORTED","ATTACHMENT_FILES_UNSUPPORTED"],wPe=new Set(gY),SPe=new Set(bPe),Bt=class extends Error{static{o(this,"AttachmentError")}code;constructor(e,t,n){super(e,n),this.name="AttachmentError",this.code=t}};o(EPe,"isAttachmentError");o(yY,"isImageAdmissionError");o(vY,"decodeCanonicalBase64");o(kPe,"decodeBase64");o(_Pe,"saveInput");o(Q1,"admitEncodedImages");o(APe,"admitEncodedFile");o(xY,"requestImageDimensions");d$=class extends Be{static{o(this,"AttachmentStore")}constructor(e){super(e,"attachments")}validateImageBatch(e){let{maxImagesPerMessage:t,maxMessageImageBytes:n,mediaTypes:r}=this.imageLimits;if(e.length>t)throw new Bt("Image batch exceeds the configured image-count limit.","TOO_MANY_IMAGES");if(e.reduce((i,s)=>i+s.data.byteLength,0)>n)throw new Bt("Image batch exceeds the configured aggregate image-byte limit.","IMAGES_TOO_LARGE");for(let i of e)if(!r.includes(i.mediaType))throw new Bt(`Image type ${i.mediaType} is not accepted by this deployment.`,"UNSUPPORTED_IMAGE_TYPE")}async saveImages(e){this.validateImageBatch(e);for(let n of e)await this.validateImage(n);let t=[];for(let n of e)t.push(await this.saveImage(n));return t}async admitPromptContent(e){if(e.every(r=>r.type!=="image"))return e.map(r=>r.type==="text"?{type:"text",text:r.text}:{type:"file",attachment:r.attachment});let t=await Q1(this,e.filter(r=>r.type==="image")),n=0;return e.map(r=>r.type==="text"?{type:"text",text:r.text}:r.type==="file"?{type:"file",attachment:r.attachment}:{type:"image",attachment:t[n++]})}admitEncodedFile(e){return APe(this,e)}isAttachmentError(e){return EPe(e)}imageHostPath(e){}saveFile(e){return Promise.reject(new Bt("The mounted attachment provider cannot store verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}saveFileStream(e){return Promise.reject(new Bt("The mounted attachment provider cannot stream verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}async*readFileStream(e,t){t?.throwIfAborted(),await Promise.reject(new Bt("The mounted attachment provider cannot read verbatim files.","ATTACHMENT_FILES_UNSUPPORTED"))}fileHostPath(e){}readImageRequest(e,t,n){return n?.throwIfAborted(),Promise.reject(new Bt("The mounted attachment provider cannot derive model-request images.","ATTACHMENT_PROJECTION_UNSUPPORTED"))}}});var Db={};Wt(Db,{buildAuthorizationUrl:()=>DPe,discoverEndpoints:()=>NPe,exchangeCode:()=>MPe,isTokenExpired:()=>jPe,refreshToken:()=>LPe,registerClient:()=>PPe});function EY(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,n=>n.toString(16).padStart(2,"0")).join("").slice(0,e)}async function OPe(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return btoa(String.fromCharCode(...new Uint8Array(n))).replace(/\+/gu,"-").replace(/\//gu,"_").replace(/=/gu,"")}async function NPe(e){let t=AbortSignal.timeout(Pb),n=new URL(e),r=n.pathname==="/"?"/.well-known/oauth-protected-resource":`/.well-known/oauth-protected-resource${n.pathname}`,i=new URL(r,n.origin);Ll(i.href);let s=await Ad(i.href,{signal:t});if(!s.ok)throw new Error(`PRM discovery failed: HTTP ${s.status}`);let l=(await s.json()).authorization_servers?.[0];if(typeof l!="string")throw new Error("No authorization server in PRM");let c=new URL(l),u=c.pathname==="/"?"/.well-known/oauth-authorization-server":`/.well-known/oauth-authorization-server${c.pathname}`,d=new URL(u,c.origin);Ll(d.href);let p=await Ad(d.href,{signal:t});if(!p.ok)throw new Error(`AS metadata failed: HTTP ${p.status}`);let m=await p.json();if(typeof m.authorization_endpoint!="string"||typeof m.token_endpoint!="string")throw new Error("Missing required endpoints in AS metadata");return{authorization:m.authorization_endpoint,token:m.token_endpoint,registration:m.registration_endpoint}}async function PPe(e,t,n){let r=AbortSignal.timeout(Pb);Ll(e);let i=await Ad(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_name:n,redirect_uris:[t],grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}),signal:r});if(!i.ok)throw new Error(`DCR failed: HTTP ${i.status}`);let s=await i.json();if(typeof s.client_id!="string")throw new Error("DCR response missing client_id");return{clientId:s.client_id,clientSecret:s.client_secret}}async function DPe(e,t,n,r,i){let s=EY(32),a=EY(64),l=await OPe(a),c=new URL(e.authorization);for(let[u,d]of Object.entries({response_type:"code",client_id:t.clientId,redirect_uri:n,state:s,code_challenge:l,code_challenge_method:"S256",resource:i}))c.searchParams.set(u,d);return{authorizationUrl:c.href,pendingFlow:{state:s,codeVerifier:a,redirectUri:n,serverName:r,serverUrl:i,stagedClient:t,createdAt:Date.now()}}}async function MPe(e,t,n,r,i,s){let a=AbortSignal.timeout(Pb),l=new URLSearchParams({grant_type:"authorization_code",code:n,redirect_uri:i,client_id:t.clientId,code_verifier:r});s!==void 0&&l.set("resource",s),t.clientSecret!==void 0&&l.set("client_secret",t.clientSecret),Ll(e);let c=await Ad(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:l.toString(),signal:a});if(!c.ok)throw new Error(`Token exchange failed: HTTP ${c.status}`);return kY(await c.json())}async function LPe(e,t,n,r){let i=AbortSignal.timeout(Pb),s=new URLSearchParams({grant_type:"refresh_token",refresh_token:n,client_id:t.clientId});r!==void 0&&s.set("resource",r),t.clientSecret!==void 0&&s.set("client_secret",t.clientSecret),Ll(e);let a=await Ad(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s.toString(),signal:i});if(!a.ok)throw new Error(`Token refresh failed: HTTP ${a.status}`);return kY(await a.json())}function kY(e){let t=e;if(typeof t.access_token!="string")throw new Error("Missing access_token");let n=typeof t.expires_in=="number"?t.expires_in:void 0;return{accessToken:t.access_token,refreshToken:typeof t.refresh_token=="string"?t.refresh_token:void 0,expiresAt:n!==void 0?Date.now()+n*1e3:void 0,tokenType:typeof t.token_type=="string"?t.token_type:"Bearer",scope:typeof t.scope=="string"?t.scope:void 0}}function jPe(e){return e.expiresAt===void 0?!1:Date.now()>e.expiresAt-12e4}var Pb,Mb=B(()=>{"use strict";X1();Pb=1e4;o(EY,"randomString");o(OPe,"sha256Base64Url");o(NPe,"discoverEndpoints");o(PPe,"registerClient");o(DPe,"buildAuthorizationUrl");o(MPe,"exchangeCode");o(LPe,"refreshToken");o(kY,"parseTokenResponse");o(jPe,"isTokenExpired")});var Gt,OY,jb=B(()=>{nn();xn();Gt=class extends An{static{o(this,"FsError")}code;constructor(e,t,n){super(e,t,n),this.code=t}},OY=class extends Be{static{o(this,"FileSystem")}constructor(e){super(e,"fs")}get sandboxMode(){}processPathFromHostPath(e){}}});function C$(e){return Zb.test(e)}function Kb(e){return e.invocation.modelInvocable}function rh(e){return e.invocation.userInvocable}function R$(e){let t=xMe(e);return[`<skill_content name="${bMe(e.name)}">`,"<skill_resources>",...t,"</skill_resources>","","<skill_instructions>",e.content,"</skill_instructions>","</skill_content>"].join(`
|
|
154
154
|
`)}function xMe(e){let t=e.resourceBase;if(t===void 0)return[`Resources for this skill are managed by provider "${nh(e.provider)}".`,"Load referenced resources only as needed."];switch(t.kind){case"directory":return[`Base directory for this skill: ${nh(t.path)}`,"Resolve relative paths mentioned by this skill against the base directory before using them. Load referenced resources only as needed."];case"url":return[`Base URL for this skill: ${nh(t.url)}`,"Resolve relative URLs mentioned by this skill against the base URL before using them. Load referenced resources only as needed."];case"opaque":return[`Resources for this skill: ${nh(t.description)}`,"Load referenced resources only as needed."];default:return Kn(t,"SkillResourceBase.kind")}}function bMe(e){return e.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}function nh(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function SMe(e,t){if(Array.isArray(e))return{candidates:e,complete:!0};if(e===null||typeof e!="object")throw see(t);let n=e;if(!Array.isArray(n.candidates)||typeof n.complete!="boolean")throw see(t);return n}function see(e){return new TypeError(`skill provider "${e}" list() must return an array or { candidates, complete } observation`)}function kMe(e){return{name:e.name,description:e.description,...e.whenToUse!==void 0?{whenToUse:e.whenToUse}:{},invocation:e.invocation,source:e.source,provider:e.provider,...e.resourceBase!==void 0?{resourceBase:e.resourceBase}:{},rank:vMe,locator:e,...e.path!==void 0?{path:e.path}:{},...e.metadata!==void 0?{metadata:e.metadata}:{}}}function _Me(e,t){if(typeof e.name!="string")throw new TypeError(`skill provider "${t}" returned a non-string skill name`);if(!Zb.test(e.name))throw new Error(`skill provider "${t}" returned invalid skill name "${e.name}"`);if(typeof e.description!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string description`);if(e.description.length===0)throw new Error(`skill provider "${t}" returned skill "${e.name}" without a description`);if($$(e.invocation,`skill provider "${t}" returned skill "${e.name}"`),e.whenToUse!==void 0&&typeof e.whenToUse!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string whenToUse`);if(typeof e.source!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string source`);if(typeof e.rank!="number"||!Number.isFinite(e.rank))throw new Error(`skill provider "${t}" returned skill "${e.name}" with an invalid rank`);if(typeof e.provider!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string provider`);if(e.provider!==t)throw new Error(`skill provider "${t}" returned skill "${e.name}" for provider "${e.provider}"`);if(e.path!==void 0&&typeof e.path!="string")throw new TypeError(`skill provider "${t}" returned skill "${e.name}" with a non-string path`)}function AMe(e){if(!Zb.test(e.name))throw new Error(`invalid skill name "${e.name}"`);if(e.description.length===0)throw new Error(`skill "${e.name}" requires a description`);$$(e.invocation,`runtime skill "${e.name}"`)}function TMe(e){let t=e.name,n=e.description,r=e.whenToUse,i=e.invocation,s=e.source,a=e.provider,l=e.content,c=e.path;if(typeof t!="string")throw new TypeError("loaded skill name must be a string");if(!Zb.test(t))throw new Error(`loaded skill has invalid name "${t}"`);if(typeof n!="string")throw new TypeError(`loaded skill "${t}" description must be a string`);if(n.length===0)throw new Error(`loaded skill "${t}" requires a description`);if($$(i,`loaded skill "${t}"`),r!==void 0&&typeof r!="string")throw new TypeError(`loaded skill "${t}" whenToUse must be a string`);if(typeof s!="string")throw new TypeError(`loaded skill "${t}" source must be a string`);if(typeof a!="string")throw new TypeError(`loaded skill "${t}" provider must be a string`);if(typeof l!="string")throw new TypeError(`loaded skill "${t}" content must be a string`);if(c!==void 0&&typeof c!="string")throw new TypeError(`loaded skill "${t}" path must be a string`)}function IMe(e){let{name:t,description:n,whenToUse:r,invocation:i,source:s,provider:a,resourceBase:l}=e;return{name:t,description:n,...r!==void 0?{whenToUse:r}:{},invocation:i,source:s,provider:a,...l!==void 0?{resourceBase:l}:{}}}function $$(e,t){if(e===void 0)return;if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError(`${t} with a non-object invocation policy`);let n=e;if(typeof n.modelInvocable!="boolean")throw new TypeError(`${t} with a non-boolean invocation.modelInvocable`);if(typeof n.userInvocable!="boolean")throw new TypeError(`${t} with a non-boolean invocation.userInvocable`)}function CMe(e,t){return cee(e.name,t.name)}function cee(e,t){return e<t?-1:e>t?1:0}function RMe(e,t){return e.candidate.rank-t.candidate.rank||e.providerOrder-t.providerOrder||e.localOrder-t.localOrder}function $Me(e,t,n=1){if(!Number.isInteger(t)||t<n)throw new Error(`skill: ${e} must be an integer greater than or equal to ${n}`)}function aee(e,t){return t===void 0?e:(n0(t),new Promise((n,r)=>{let i=o(()=>{t.removeEventListener("abort",s)},"cleanup"),s=o(()=>{i(),r(Gb(t.reason))},"onAbort");t.addEventListener("abort",s,{once:!0}),e.then(a=>{i(),n(a)},a=>{i(),r(Gb(a))})}))}function n0(e){if(e?.aborted===!0)throw Gb(e.reason)}function Gb(e){try{if(e instanceof Error)return e}catch{}return new Error(Vb(e))}function Vb(e){try{return String(e)}catch{return"[unrenderable thrown value]"}}var Zb,iee,yMe,Hb,vMe,oee,wMe,lee,EMe,ih=B(()=>{nn();Ir();xs();mn();Zb=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,iee=128,yMe=2,Hb="runtime",vMe=250,oee=600;o(C$,"isSkillName");o(Kb,"isModelInvocable");o(rh,"isUserInvocable");o(R$,"renderSkillContent");o(xMe,"renderResourceHint");o(bMe,"escapeAttr");o(nh,"escapeText");wMe=class{static{o(this,"SkillLayer")}providers;runtime=new Map;constructor(e){this.providers=new Mo(t=>new Error(e===void 0?`a skill provider named "${t}" is already registered`:`a skill provider named "${t}" is already registered in this scope`))}isEmpty(){return this.providers.isEmpty()&&this.runtime.size===0}},lee=class extends Be{static{o(this,"SkillRegistry")}static Config=C.object({collectCacheMaxEntries:C.number().default(iee)});collectCacheMaxEntries;layers=new jo(e=>new wMe(e),()=>{this.invalidateCache()});collectCache=new Map;revision=0;nextProviderOrder=0;scopeIds=new WeakMap;nextScopeId=1;constructor(e,t={}){super(e,"skills"),this.collectCacheMaxEntries=t.collectCacheMaxEntries??iee,$Me("collectCacheMaxEntries",this.collectCacheMaxEntries)}registerProvider(e){let t=new AbortController,n,r,i={signal:t.signal,invalidate:o(()=>{let s=n;s!==void 0&&s.layer.providers.get(s.name)?.provider===r&&this.invalidateCache()},"invalidate")};try{r=e(i);let s=r.name;if(s===Hb)throw new Error(`"${Hb}" is reserved for runtime skill registrations`);let a=this.nextProviderOrder;return this.nextProviderOrder+=1,this.layers.effect(this.ctx,l=>{let c=l.providers.insert(s,{provider:r,order:a});return n={layer:l,name:s},()=>{n=void 0,c(),t.abort(new Error(`skill provider "${s}" disposed`))}},{label:"skills.registerProvider()"})}catch(s){throw t.abort(s),s}}register(e){AMe(e);let t=Fi(this.ctx),n=t===void 0?this.layers.global:this.layers.peek(t);if(n!==void 0&&n.runtime.has(e.name))return this.ctx.logger.warn(`runtime skill "${e.name}" ignored because it is already registered`),()=>{};let r={...e,invocation:e.invocation??{modelInvocable:!0,userInvocable:!0},provider:e.provider??Hb};return this.layers.effect(this.ctx,i=>(i.runtime.set(r.name,r),()=>{i.runtime.delete(r.name)}),{label:"skills.register()"})}async list(e={}){return(await this.snapshot(e)).skills}async snapshot(e={}){let t=await this.collect(e);return{skills:[...t.entries.values()].map(n=>IMe(n.candidate)).sort(CMe),complete:t.cacheable}}async get(e,t={}){if(!C$(e))return;let n=await this.collect(t);n0(t.signal);let r=n.entries.get(e);if(r===void 0)return;let i=await aee(r.provider.get(r.candidate,t),t.signal);if(i!==void 0){if(TMe(i),i.name!==r.candidate.name){this.invalidateEntry(r);return}return i}}async collect(e){n0(e.signal);let t=1;for(;;){let n=this.revision,r=this.collectCacheKey(e.cwd,_g(e.scope),n),i=this.collectCache.get(r);if(i!==void 0)return{entries:i,cacheable:!0};let s=await this.collectFresh(e);if(n0(e.signal),n!==this.revision){if(t<yMe){t+=1;continue}return{entries:s.entries,cacheable:!1}}if(s.cacheable&&(this.collectCache.set(r,s.entries),this.collectCache.size>this.collectCacheMaxEntries)){let a=this.collectCache.keys().next();this.collectCache.delete(a.value)}return s}}async collectFresh(e){let t=[this.layers.global,...this.layers.chainLayers(e.scope)],n=new Map,r=!0;for(let i of t){let s=await this.collectLayer(i,e);s.cacheable||(r=!1);for(let a of s.entries)n.set(a.candidate.name,a)}return{entries:n,cacheable:r}}async collectLayer(e,t){let n=await this.listLayerCandidates(e,t);n.entries.sort(RMe);let r=new Set,i=[];for(let s of n.entries){let a=s.candidate;if(r.has(a.name)){this.ctx.logger.warn(`skill "${a.name}" from ${a.source} ignored because a higher-priority skill already exists`);continue}r.add(a.name),i.push(s)}return{entries:i,cacheable:n.cacheable}}async listLayerCandidates(e,t){n0(t.signal);let n=[],r=!0,i=0;for(let s of[...e.runtime.values()].sort((a,l)=>cee(a.name,l.name)))n.push({candidate:kMe(s),provider:EMe,providerOrder:-1,localOrder:i,layer:e}),i+=1;for(let{provider:s,order:a}of[...e.providers.values()]){let l=0,c;try{c=await aee(s.list(t),t.signal)}catch(d){if(t.signal?.aborted===!0)throw Gb(t.signal.reason);r=!1,this.ctx.logger.warn(`skill provider "${s.name}" skipped: ${Vb(d)}`)}if(c===void 0)continue;let u=SMe(c,s.name);u.complete||(r=!1);for(let d of u.candidates)_Me(d,s.name),n.push({candidate:d,provider:s,providerOrder:a,localOrder:l,layer:e}),l+=1}return{entries:n,cacheable:r}}invalidateCache(){this.revision+=1,this.collectCache.clear(),this.notifyChange()}invalidateEntry(e){e.layer.providers.get(e.provider.name)?.provider===e.provider&&this.invalidateCache()}scopeId(e){let t=this.scopeIds.get(e);return t===void 0&&(t=this.nextScopeId,this.nextScopeId+=1,this.scopeIds.set(e,t)),t}collectCacheKey(e,t,n){return JSON.stringify({cwd:e,scopes:t.map(r=>this.scopeId(r)),revision:n})}notifyChange(){for(let e of this.ctx.events.dispatch("emit",["skills/change"]))try{let t=e();Promise.resolve(t).catch(n=>{this.ctx.logger.warn(`skills/change listener rejected: ${Vb(n)}`)})}catch(t){this.ctx.logger.warn(`skills/change listener threw: ${Vb(t)}`)}}};o(SMe,"normalizeProviderObservation");o(see,"invalidProviderObservation");EMe={name:Hb,list(){return Promise.resolve([])},get(e){return Promise.resolve(e.locator)}};o(kMe,"runtimeCandidate");o(_Me,"validateCandidate");o(AMe,"validateRuntimeSkill");o(TMe,"validateDefinition");o(IMe,"toSummary");o($$,"validateInvocation");o(CMe,"compareSkillSummary");o(cee,"compareCodePoints");o(RMe,"compareIndexedCandidates");o($Me,"assertPositiveInteger");o(aee,"waitWithAbort");o(n0,"throwIfAborted");o(Gb,"toError");o(Vb,"errorMessage")});var Va,ah=B(()=>{Va=class{static{o(this,"Deque")}buffer=new Array(16);head=0;count=0;get size(){return this.count}pushBack(e){this.ensureCapacity();let t=this.head+this.count;this.buffer[t<this.buffer.length?t:t-this.buffer.length]=e,this.count+=1}pushFront(e){this.ensureCapacity(),this.head=this.head===0?this.buffer.length-1:this.head-1,this.buffer[this.head]=e,this.count+=1}popFront(){if(this.count===0)return;let e=this.buffer[this.head];return this.buffer[this.head]=void 0,this.head+=1,this.head===this.buffer.length&&(this.head=0),this.count-=1,this.compact(),e}clear(){this.buffer=new Array(16),this.head=0,this.count=0}ensureCapacity(){this.count<this.buffer.length||this.resize(this.buffer.length*2)}compact(){if(this.count===0){this.head=0;return}this.buffer.length>16&&this.count<=this.buffer.length/4&&this.resize(Math.max(16,this.buffer.length/2))}resize(e){let t=new Array(e),n=this.head;for(let r=0;r<this.count;r+=1)t[r]=this.buffer[n],n+=1,n===this.buffer.length&&(n=0);this.buffer=t,this.head=0}}});var Ul,Vee,W$=B(()=>{nn();Ul=class extends Error{static{o(this,"DirectoryPickerError")}code;path;constructor(e,t,n){super(n),this.code=e,this.path=t,this.name="DirectoryPickerError"}},Vee=class extends Be{static{o(this,"DirectoryPicker")}constructor(e){super(e,"directoryPicker")}}});var xne=oe((M8t,Tw)=>{var vne=vne||function(e){return Buffer.from(e).toString("base64")};function wUe(e){var t=this,n=Math.round,r=Math.floor,i=new Array(64),s=new Array(64),a=new Array(64),l=new Array(64),c,u,d,p,m=new Array(65535),h=new Array(65535),g=new Array(64),y=new Array(64),v=[],x=0,b=7,w=new Array(64),E=new Array(64),S=new Array(64),k=new Array(256),T=new Array(2048),D,j=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],W=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],H=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],I=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],Q=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],K=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function fe(ee){for(var Me=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],ae=0;ae<64;ae++){var ct=r((Me[ae]*ee+50)/100);ct<1?ct=1:ct>255&&(ct=255),i[j[ae]]=ct}for(var ke=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ue=0;ue<64;ue++){var Le=r((ke[ue]*ee+50)/100);Le<1?Le=1:Le>255&&(Le=255),s[j[ue]]=Le}for(var ye=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],we=0,je=0;je<8;je++)for(var ie=0;ie<8;ie++)a[we]=1/(i[j[we]]*ye[je]*ye[ie]*8),l[we]=1/(s[j[we]]*ye[je]*ye[ie]*8),we++}o(fe,"initQuantTables");function ce(ee,Me){for(var ae=0,ct=0,ke=new Array,ue=1;ue<=16;ue++){for(var Le=1;Le<=ee[ue];Le++)ke[Me[ct]]=[],ke[Me[ct]][0]=ae,ke[Me[ct]][1]=ue,ct++,ae++;ae*=2}return ke}o(ce,"computeHuffmanTbl");function Z(){c=ce(W,R),u=ce(I,L),d=ce(N,H),p=ce(Q,K)}o(Z,"initHuffmanTbl");function he(){for(var ee=1,Me=2,ae=1;ae<=15;ae++){for(var ct=ee;ct<Me;ct++)h[32767+ct]=ae,m[32767+ct]=[],m[32767+ct][1]=ae,m[32767+ct][0]=ct;for(var ke=-(Me-1);ke<=-ee;ke++)h[32767+ke]=ae,m[32767+ke]=[],m[32767+ke][1]=ae,m[32767+ke][0]=Me-1+ke;ee<<=1,Me<<=1}}o(he,"initCategoryNumber");function pe(){for(var ee=0;ee<256;ee++)T[ee]=19595*ee,T[ee+256>>0]=38470*ee,T[ee+512>>0]=7471*ee+32768,T[ee+768>>0]=-11059*ee,T[ee+1024>>0]=-21709*ee,T[ee+1280>>0]=32768*ee+8421375,T[ee+1536>>0]=-27439*ee,T[ee+1792>>0]=-5329*ee}o(pe,"initRGBYUVTable");function X(ee){for(var Me=ee[0],ae=ee[1]-1;ae>=0;)Me&1<<ae&&(x|=1<<b),ae--,b--,b<0&&(x==255?(O(255),O(0)):O(x),b=7,x=0)}o(X,"writeBits");function O(ee){v.push(ee)}o(O,"writeByte");function ge(ee){O(ee>>8&255),O(ee&255)}o(ge,"writeWord");function Pe(ee,Me){var ae,ct,ke,ue,Le,ye,we,je,ie=0,ze,xt=8,Zn=64;for(ze=0;ze<xt;++ze){ae=ee[ie],ct=ee[ie+1],ke=ee[ie+2],ue=ee[ie+3],Le=ee[ie+4],ye=ee[ie+5],we=ee[ie+6],je=ee[ie+7];var Kt=ae+je,et=ae-je,Qe=ct+we,nt=ct-we,Jt=ke+ye,Qn=ke-ye,Dn=ue+Le,Ur=ue-Le,bt=Kt+Dn,Js=Kt-Dn,ho=Qe+Jt,pl=Qe-Jt;ee[ie]=bt+ho,ee[ie+4]=bt-ho;var mo=(pl+Js)*.707106781;ee[ie+2]=Js+mo,ee[ie+6]=Js-mo,bt=Ur+Qn,ho=Qn+nt,pl=nt+et;var Ta=(bt-pl)*.382683433,fl=.5411961*bt+Ta,bu=1.306562965*pl+Ta,hl=ho*.707106781,qr=et+hl,go=et-hl;ee[ie+5]=go+fl,ee[ie+3]=go-fl,ee[ie+1]=qr+bu,ee[ie+7]=qr-bu,ie+=8}for(ie=0,ze=0;ze<xt;++ze){ae=ee[ie],ct=ee[ie+8],ke=ee[ie+16],ue=ee[ie+24],Le=ee[ie+32],ye=ee[ie+40],we=ee[ie+48],je=ee[ie+56];var qy=ae+je,cm=ae-je,yo=ct+we,ut=ct-we,tn=ke+ye,Ia=ke-ye,Ql=ue+Le,vo=ue-Le,ml=qy+Ql,um=qy-Ql,_p=yo+tn,wu=yo-tn;ee[ie]=ml+_p,ee[ie+32]=ml-_p;var zy=(wu+um)*.707106781;ee[ie+16]=um+zy,ee[ie+48]=um-zy,ml=vo+Ia,_p=Ia+ut,wu=ut+cm;var By=(ml-wu)*.382683433,Wy=.5411961*ml+By,Hy=1.306562965*wu+By,Vy=_p*.707106781,Gy=cm+Vy,Zy=cm-Vy;ee[ie+40]=Zy+Wy,ee[ie+24]=Zy-Wy,ee[ie+8]=Gy+Hy,ee[ie+56]=Gy-Hy,ie++}var Ap;for(ze=0;ze<Zn;++ze)Ap=ee[ze]*Me[ze],g[ze]=Ap>0?Ap+.5|0:Ap-.5|0;return g}o(Pe,"fDCTQuant");function Te(){ge(65504),ge(16),O(74),O(70),O(73),O(70),O(0),O(1),O(1),O(0),ge(1),ge(1),O(0),O(0)}o(Te,"writeAPP0");function me(ee){if(ee){ge(65505),ee[0]===69&&ee[1]===120&&ee[2]===105&&ee[3]===102?ge(ee.length+2):(ge(ee.length+5+2),O(69),O(120),O(105),O(102),O(0));for(var Me=0;Me<ee.length;Me++)O(ee[Me])}}o(me,"writeAPP1");function We(ee,Me){ge(65472),ge(17),O(8),ge(Me),ge(ee),O(3),O(1),O(17),O(0),O(2),O(17),O(1),O(3),O(17),O(1)}o(We,"writeSOF0");function Ie(){ge(65499),ge(132),O(0);for(var ee=0;ee<64;ee++)O(i[ee]);O(1);for(var Me=0;Me<64;Me++)O(s[Me])}o(Ie,"writeDQT");function ne(){ge(65476),ge(418),O(0);for(var ee=0;ee<16;ee++)O(W[ee+1]);for(var Me=0;Me<=11;Me++)O(R[Me]);O(16);for(var ae=0;ae<16;ae++)O(N[ae+1]);for(var ct=0;ct<=161;ct++)O(H[ct]);O(1);for(var ke=0;ke<16;ke++)O(I[ke+1]);for(var ue=0;ue<=11;ue++)O(L[ue]);O(17);for(var Le=0;Le<16;Le++)O(Q[Le+1]);for(var ye=0;ye<=161;ye++)O(K[ye])}o(ne,"writeDHT");function J(ee){typeof ee>"u"||ee.constructor!==Array||ee.forEach(Me=>{if(typeof Me=="string"){ge(65534);var ae=Me.length;ge(ae+2);var ct;for(ct=0;ct<ae;ct++)O(Me.charCodeAt(ct))}})}o(J,"writeCOM");function tt(){ge(65498),ge(12),O(3),O(1),O(0),O(2),O(17),O(3),O(17),O(0),O(63),O(0)}o(tt,"writeSOS");function Ae(ee,Me,ae,ct,ke){for(var ue=ke[0],Le=ke[240],ye,we=16,je=63,ie=64,ze=Pe(ee,Me),xt=0;xt<ie;++xt)y[j[xt]]=ze[xt];var Zn=y[0]-ae;ae=y[0],Zn==0?X(ct[0]):(ye=32767+Zn,X(ct[h[ye]]),X(m[ye]));for(var Kt=63;Kt>0&&y[Kt]==0;Kt--);if(Kt==0)return X(ue),ae;for(var et=1,Qe;et<=Kt;){for(var nt=et;y[et]==0&&et<=Kt;++et);var Jt=et-nt;if(Jt>=we){Qe=Jt>>4;for(var Qn=1;Qn<=Qe;++Qn)X(Le);Jt=Jt&15}ye=32767+y[et],X(ke[(Jt<<4)+h[ye]]),X(m[ye]),et++}return Kt!=je&&X(ue),ae}o(Ae,"processDU");function $e(){for(var ee=String.fromCharCode,Me=0;Me<256;Me++)k[Me]=ee(Me)}o($e,"initCharLookupTable"),this.encode=function(ee,Me){var ae=new Date().getTime();Me&&wt(Me),v=new Array,x=0,b=7,ge(65496),Te(),J(ee.comments),me(ee.exifBuffer),Ie(),We(ee.width,ee.height),ne(),tt();var ct=0,ke=0,ue=0;x=0,b=7,this.encode.displayName="_encode_";for(var Le=ee.data,ye=ee.width,we=ee.height,je=ye*4,ie=ye*3,ze,xt=0,Zn,Kt,et,Qe,nt,Jt,Qn,Dn;xt<we;){for(ze=0;ze<je;){for(Qe=je*xt+ze,nt=Qe,Jt=-1,Qn=0,Dn=0;Dn<64;Dn++)Qn=Dn>>3,Jt=(Dn&7)*4,nt=Qe+Qn*je+Jt,xt+Qn>=we&&(nt-=je*(xt+1+Qn-we)),ze+Jt>=je&&(nt-=ze+Jt-je+4),Zn=Le[nt++],Kt=Le[nt++],et=Le[nt++],w[Dn]=(T[Zn]+T[Kt+256>>0]+T[et+512>>0]>>16)-128,E[Dn]=(T[Zn+768>>0]+T[Kt+1024>>0]+T[et+1280>>0]>>16)-128,S[Dn]=(T[Zn+1280>>0]+T[Kt+1536>>0]+T[et+1792>>0]>>16)-128;ct=Ae(w,a,ct,c,d),ke=Ae(E,l,ke,u,p),ue=Ae(S,l,ue,u,p),ze+=32}xt+=8}if(b>=0){var Ur=[];Ur[1]=b+1,Ur[0]=(1<<b+1)-1,X(Ur)}if(ge(65497),typeof Tw>"u")return new Uint8Array(v);return Buffer.from(v);var bt,Js};function wt(ee){if(ee<=0&&(ee=1),ee>100&&(ee=100),D!=ee){var Me=0;ee<50?Me=Math.floor(5e3/ee):Me=Math.floor(200-ee*2),fe(Me),D=ee}}o(wt,"setQuality");function Ue(){var ee=new Date().getTime();e||(e=50),$e(),Z(),he(),pe(),wt(e);var Me=new Date().getTime()-ee}o(Ue,"init"),Ue()}o(wUe,"JPEGEncoder");typeof Tw<"u"?Tw.exports=yne:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=yne);function yne(e,t){typeof t>"u"&&(t=50);var n=new wUe(t),r=n.encode(e,t);return{data:r,width:e.width,height:e.height}}o(yne,"encode")});var wne=oe((j8t,wO)=>{var bO=o((function(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),n=4017,r=799,i=3406,s=2276,a=1567,l=3784,c=5793,u=2896;function d(){}o(d,"constructor");function p(b,w){for(var E=0,S=[],k,T,D=16;D>0&&!b[D-1];)D--;S.push({children:[],index:0});var j=S[0],W;for(k=0;k<D;k++){for(T=0;T<b[k];T++){for(j=S.pop(),j.children[j.index]=w[E];j.index>0;){if(S.length===0)throw new Error("Could not recreate Huffman Table");j=S.pop()}for(j.index++,S.push(j);S.length<=k;)S.push(W={children:[],index:0}),j.children[j.index]=W.children,j=W;E++}k+1<D&&(S.push(W={children:[],index:0}),j.children[j.index]=W.children,j=W)}return S[0].children}o(p,"buildHuffmanTable");function m(b,w,E,S,k,T,D,j,W,R){var N=E.precision,H=E.samplesPerLine,I=E.scanLines,L=E.mcusPerLine,Q=E.progressive,K=E.maxH,fe=E.maxV,ce=w,Z=0,he=0;function pe(){if(he>0)return he--,Z>>he&1;if(Z=b[w++],Z==255){var ie=b[w++];if(ie)throw new Error("unexpected marker: "+(Z<<8|ie).toString(16))}return he=7,Z>>>7}o(pe,"readBit");function X(ie){for(var ze=ie,xt;(xt=pe())!==null;){if(ze=ze[xt],typeof ze=="number")return ze;if(typeof ze!="object")throw new Error("invalid huffman sequence")}return null}o(X,"decodeHuffman");function O(ie){for(var ze=0;ie>0;){var xt=pe();if(xt===null)return;ze=ze<<1|xt,ie--}return ze}o(O,"receive");function ge(ie){var ze=O(ie);return ze>=1<<ie-1?ze:ze+(-1<<ie)+1}o(ge,"receiveAndExtend");function Pe(ie,ze){var xt=X(ie.huffmanTableDC),Zn=xt===0?0:ge(xt);ze[0]=ie.pred+=Zn;for(var Kt=1;Kt<64;){var et=X(ie.huffmanTableAC),Qe=et&15,nt=et>>4;if(Qe===0){if(nt<15)break;Kt+=16;continue}Kt+=nt;var Jt=t[Kt];ze[Jt]=ge(Qe),Kt++}}o(Pe,"decodeBaseline");function Te(ie,ze){var xt=X(ie.huffmanTableDC),Zn=xt===0?0:ge(xt)<<W;ze[0]=ie.pred+=Zn}o(Te,"decodeDCFirst");function me(ie,ze){ze[0]|=pe()<<W}o(me,"decodeDCSuccessive");var We=0;function Ie(ie,ze){if(We>0){We--;return}for(var xt=T,Zn=D;xt<=Zn;){var Kt=X(ie.huffmanTableAC),et=Kt&15,Qe=Kt>>4;if(et===0){if(Qe<15){We=O(Qe)+(1<<Qe)-1;break}xt+=16;continue}xt+=Qe;var nt=t[xt];ze[nt]=ge(et)*(1<<W),xt++}}o(Ie,"decodeACFirst");var ne=0,J;function tt(ie,ze){for(var xt=T,Zn=D,Kt=0;xt<=Zn;){var et=t[xt],Qe=ze[et]<0?-1:1;switch(ne){case 0:var nt=X(ie.huffmanTableAC),Jt=nt&15,Kt=nt>>4;if(Jt===0)Kt<15?(We=O(Kt)+(1<<Kt),ne=4):(Kt=16,ne=1);else{if(Jt!==1)throw new Error("invalid ACn encoding");J=ge(Jt),ne=Kt?2:3}continue;case 1:case 2:ze[et]?ze[et]+=(pe()<<W)*Qe:(Kt--,Kt===0&&(ne=ne==2?3:0));break;case 3:ze[et]?ze[et]+=(pe()<<W)*Qe:(ze[et]=J<<W,ne=0);break;case 4:ze[et]&&(ze[et]+=(pe()<<W)*Qe);break}xt++}ne===4&&(We--,We===0&&(ne=0))}o(tt,"decodeACSuccessive");function Ae(ie,ze,xt,Zn,Kt){var et=xt/L|0,Qe=xt%L,nt=et*ie.v+Zn,Jt=Qe*ie.h+Kt;ie.blocks[nt]===void 0&&R.tolerantDecoding||ze(ie,ie.blocks[nt][Jt])}o(Ae,"decodeMcu");function $e(ie,ze,xt){var Zn=xt/ie.blocksPerLine|0,Kt=xt%ie.blocksPerLine;ie.blocks[Zn]===void 0&&R.tolerantDecoding||ze(ie,ie.blocks[Zn][Kt])}o($e,"decodeBlock");var wt=S.length,Ue,ee,Me,ae,ct,ke;Q?T===0?ke=j===0?Te:me:ke=j===0?Ie:tt:ke=Pe;var ue=0,Le,ye;wt==1?ye=S[0].blocksPerLine*S[0].blocksPerColumn:ye=L*E.mcusPerColumn,k||(k=ye);for(var we,je;ue<ye;){for(ee=0;ee<wt;ee++)S[ee].pred=0;if(We=0,wt==1)for(Ue=S[0],ct=0;ct<k;ct++)$e(Ue,ke,ue),ue++;else for(ct=0;ct<k;ct++){for(ee=0;ee<wt;ee++)for(Ue=S[ee],we=Ue.h,je=Ue.v,Me=0;Me<je;Me++)for(ae=0;ae<we;ae++)Ae(Ue,ke,ue,Me,ae);if(ue++,ue===ye)break}if(ue===ye)do{if(b[w]===255&&b[w+1]!==0)break;w+=1}while(w<b.length-2);if(he=0,Le=b[w]<<8|b[w+1],Le<65280)throw new Error("marker was not found");if(Le>=65488&&Le<=65495)w+=2;else break}return w-ce}o(m,"decodeScan");function h(b,w){var E=[],S=w.blocksPerLine,k=w.blocksPerColumn,T=S<<3,D=new Int32Array(64),j=new Uint8Array(64);function W(ce,Z,he){var pe=w.quantizationTable,X,O,ge,Pe,Te,me,We,Ie,ne,J=he,tt;for(tt=0;tt<64;tt++)J[tt]=ce[tt]*pe[tt];for(tt=0;tt<8;++tt){var Ae=8*tt;if(J[1+Ae]==0&&J[2+Ae]==0&&J[3+Ae]==0&&J[4+Ae]==0&&J[5+Ae]==0&&J[6+Ae]==0&&J[7+Ae]==0){ne=c*J[0+Ae]+512>>10,J[0+Ae]=ne,J[1+Ae]=ne,J[2+Ae]=ne,J[3+Ae]=ne,J[4+Ae]=ne,J[5+Ae]=ne,J[6+Ae]=ne,J[7+Ae]=ne;continue}X=c*J[0+Ae]+128>>8,O=c*J[4+Ae]+128>>8,ge=J[2+Ae],Pe=J[6+Ae],Te=u*(J[1+Ae]-J[7+Ae])+128>>8,Ie=u*(J[1+Ae]+J[7+Ae])+128>>8,me=J[3+Ae]<<4,We=J[5+Ae]<<4,ne=X-O+1>>1,X=X+O+1>>1,O=ne,ne=ge*l+Pe*a+128>>8,ge=ge*a-Pe*l+128>>8,Pe=ne,ne=Te-We+1>>1,Te=Te+We+1>>1,We=ne,ne=Ie+me+1>>1,me=Ie-me+1>>1,Ie=ne,ne=X-Pe+1>>1,X=X+Pe+1>>1,Pe=ne,ne=O-ge+1>>1,O=O+ge+1>>1,ge=ne,ne=Te*s+Ie*i+2048>>12,Te=Te*i-Ie*s+2048>>12,Ie=ne,ne=me*r+We*n+2048>>12,me=me*n-We*r+2048>>12,We=ne,J[0+Ae]=X+Ie,J[7+Ae]=X-Ie,J[1+Ae]=O+We,J[6+Ae]=O-We,J[2+Ae]=ge+me,J[5+Ae]=ge-me,J[3+Ae]=Pe+Te,J[4+Ae]=Pe-Te}for(tt=0;tt<8;++tt){var $e=tt;if(J[8+$e]==0&&J[16+$e]==0&&J[24+$e]==0&&J[32+$e]==0&&J[40+$e]==0&&J[48+$e]==0&&J[56+$e]==0){ne=c*he[tt+0]+8192>>14,J[0+$e]=ne,J[8+$e]=ne,J[16+$e]=ne,J[24+$e]=ne,J[32+$e]=ne,J[40+$e]=ne,J[48+$e]=ne,J[56+$e]=ne;continue}X=c*J[0+$e]+2048>>12,O=c*J[32+$e]+2048>>12,ge=J[16+$e],Pe=J[48+$e],Te=u*(J[8+$e]-J[56+$e])+2048>>12,Ie=u*(J[8+$e]+J[56+$e])+2048>>12,me=J[24+$e],We=J[40+$e],ne=X-O+1>>1,X=X+O+1>>1,O=ne,ne=ge*l+Pe*a+2048>>12,ge=ge*a-Pe*l+2048>>12,Pe=ne,ne=Te-We+1>>1,Te=Te+We+1>>1,We=ne,ne=Ie+me+1>>1,me=Ie-me+1>>1,Ie=ne,ne=X-Pe+1>>1,X=X+Pe+1>>1,Pe=ne,ne=O-ge+1>>1,O=O+ge+1>>1,ge=ne,ne=Te*s+Ie*i+2048>>12,Te=Te*i-Ie*s+2048>>12,Ie=ne,ne=me*r+We*n+2048>>12,me=me*n-We*r+2048>>12,We=ne,J[0+$e]=X+Ie,J[56+$e]=X-Ie,J[8+$e]=O+We,J[48+$e]=O-We,J[16+$e]=ge+me,J[40+$e]=ge-me,J[24+$e]=Pe+Te,J[32+$e]=Pe-Te}for(tt=0;tt<64;++tt){var wt=128+(J[tt]+8>>4);Z[tt]=wt<0?0:wt>255?255:wt}}o(W,"quantizeAndInverse"),x(T*k*8);for(var R,N,H=0;H<k;H++){var I=H<<3;for(R=0;R<8;R++)E.push(new Uint8Array(T));for(var L=0;L<S;L++){W(w.blocks[H][L],j,D);var Q=0,K=L<<3;for(N=0;N<8;N++){var fe=E[I+N];for(R=0;R<8;R++)fe[K+R]=j[Q++]}}}return E}o(h,"buildComponentData");function g(b){return b<0?0:b>255?255:b}o(g,"clampTo8bit"),d.prototype={load:o(function(w){var E=new XMLHttpRequest;E.open("GET",w,!0),E.responseType="arraybuffer",E.onload=(function(){var S=new Uint8Array(E.response||E.mozResponseArrayBuffer);this.parse(S),this.onload&&this.onload()}).bind(this),E.send(null)},"load"),parse:o(function(w){var E=this.opts.maxResolutionInMP*1e3*1e3,S=0,k=w.length;function T(){var nt=w[S]<<8|w[S+1];return S+=2,nt}o(T,"readUint16");function D(){var nt=T(),Jt=w.subarray(S,S+nt-2);return S+=Jt.length,Jt}o(D,"readDataBlock");function j(nt){var Jt=1,Qn=1,Dn,Ur;for(Ur in nt.components)nt.components.hasOwnProperty(Ur)&&(Dn=nt.components[Ur],Jt<Dn.h&&(Jt=Dn.h),Qn<Dn.v&&(Qn=Dn.v));var bt=Math.ceil(nt.samplesPerLine/8/Jt),Js=Math.ceil(nt.scanLines/8/Qn);for(Ur in nt.components)if(nt.components.hasOwnProperty(Ur)){Dn=nt.components[Ur];var ho=Math.ceil(Math.ceil(nt.samplesPerLine/8)*Dn.h/Jt),pl=Math.ceil(Math.ceil(nt.scanLines/8)*Dn.v/Qn),mo=bt*Dn.h,Ta=Js*Dn.v,fl=Ta*mo,bu=[];x(fl*256);for(var hl=0;hl<Ta;hl++){for(var qr=[],go=0;go<mo;go++)qr.push(new Int32Array(64));bu.push(qr)}Dn.blocksPerLine=ho,Dn.blocksPerColumn=pl,Dn.blocks=bu}nt.maxH=Jt,nt.maxV=Qn,nt.mcusPerLine=bt,nt.mcusPerColumn=Js}o(j,"prepareComponents");var W=null,R=null,N=null,H,I,L=[],Q=[],K=[],fe=[],ce=T(),Z=-1;if(this.comments=[],ce!=65496)throw new Error("SOI not found");for(ce=T();ce!=65497;){var he,pe,X;switch(ce){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var O=D();if(ce===65534){var ge=String.fromCharCode.apply(null,O);this.comments.push(ge)}ce===65504&&O[0]===74&&O[1]===70&&O[2]===73&&O[3]===70&&O[4]===0&&(W={version:{major:O[5],minor:O[6]},densityUnits:O[7],xDensity:O[8]<<8|O[9],yDensity:O[10]<<8|O[11],thumbWidth:O[12],thumbHeight:O[13],thumbData:O.subarray(14,14+3*O[12]*O[13])}),ce===65505&&O[0]===69&&O[1]===120&&O[2]===105&&O[3]===102&&O[4]===0&&(this.exifBuffer=O.subarray(5,O.length)),ce===65518&&O[0]===65&&O[1]===100&&O[2]===111&&O[3]===98&&O[4]===101&&O[5]===0&&(R={version:O[6],flags0:O[7]<<8|O[8],flags1:O[9]<<8|O[10],transformCode:O[11]});break;case 65499:for(var Pe=T(),Te=Pe+S-2;S<Te;){var me=w[S++];x(256);var We=new Int32Array(64);if(me>>4===0)for(pe=0;pe<64;pe++){var Ie=t[pe];We[Ie]=w[S++]}else if(me>>4===1)for(pe=0;pe<64;pe++){var Ie=t[pe];We[Ie]=T()}else throw new Error("DQT: invalid table spec");L[me&15]=We}break;case 65472:case 65473:case 65474:T(),H={},H.extended=ce===65473,H.progressive=ce===65474,H.precision=w[S++],H.scanLines=T(),H.samplesPerLine=T(),H.components={},H.componentsOrder=[];var ne=H.scanLines*H.samplesPerLine;if(ne>E){var J=Math.ceil((ne-E)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${J}MP`)}var tt=w[S++],Ae,$e=0,wt=0;for(he=0;he<tt;he++){Ae=w[S];var Ue=w[S+1]>>4,ee=w[S+1]&15,Me=w[S+2];if(Ue<=0||ee<=0)throw new Error("Invalid sampling factor, expected values above 0");H.componentsOrder.push(Ae),H.components[Ae]={h:Ue,v:ee,quantizationIdx:Me},S+=3}j(H),Q.push(H);break;case 65476:var ae=T();for(he=2;he<ae;){var ct=w[S++],ke=new Uint8Array(16),ue=0;for(pe=0;pe<16;pe++,S++)ue+=ke[pe]=w[S];x(16+ue);var Le=new Uint8Array(ue);for(pe=0;pe<ue;pe++,S++)Le[pe]=w[S];he+=17+ue,(ct>>4===0?fe:K)[ct&15]=p(ke,Le)}break;case 65501:T(),I=T();break;case 65500:T(),T();break;case 65498:var ye=T(),we=w[S++],je=[],ie;for(he=0;he<we;he++){ie=H.components[w[S++]];var ze=w[S++];ie.huffmanTableDC=fe[ze>>4],ie.huffmanTableAC=K[ze&15],je.push(ie)}var xt=w[S++],Zn=w[S++],Kt=w[S++],et=m(w,S,H,je,I,xt,Zn,Kt>>4,Kt&15,this.opts);S+=et;break;case 65535:w[S]!==255&&S--;break;default:if(w[S-3]==255&&w[S-2]>=192&&w[S-2]<=254){S-=3;break}else if(ce===224||ce==225){if(Z!==-1)throw new Error(`first unknown JPEG marker at offset ${Z.toString(16)}, second unknown JPEG marker ${ce.toString(16)} at offset ${(S-1).toString(16)}`);Z=S-1;let nt=T();if(w[S+nt-2]===255){S+=nt-2;break}}throw new Error("unknown JPEG marker "+ce.toString(16))}ce=T()}if(Q.length!=1)throw new Error("only single frame JPEGs supported");for(var he=0;he<Q.length;he++){var Qe=Q[he].components;for(var pe in Qe)Qe[pe].quantizationTable=L[Qe[pe].quantizationIdx],delete Qe[pe].quantizationIdx}this.width=H.samplesPerLine,this.height=H.scanLines,this.jfif=W,this.adobe=R,this.components=[];for(var he=0;he<H.componentsOrder.length;he++){var ie=H.components[H.componentsOrder[he]];this.components.push({lines:h(H,ie),scaleX:ie.h/H.maxH,scaleY:ie.v/H.maxV})}},"parse"),getData:o(function(w,E){var S=this.width/w,k=this.height/E,T,D,j,W,R,N,H,I,L,Q,K=0,fe,ce,Z,he,pe,X,O,ge,Pe,Te,me,We=w*E*this.components.length;x(We);var Ie=new Uint8Array(We);switch(this.components.length){case 1:for(T=this.components[0],Q=0;Q<E;Q++)for(R=T.lines[0|Q*T.scaleY*k],L=0;L<w;L++)fe=R[0|L*T.scaleX*S],Ie[K++]=fe;break;case 2:for(T=this.components[0],D=this.components[1],Q=0;Q<E;Q++)for(R=T.lines[0|Q*T.scaleY*k],N=D.lines[0|Q*D.scaleY*k],L=0;L<w;L++)fe=R[0|L*T.scaleX*S],Ie[K++]=fe,fe=N[0|L*D.scaleX*S],Ie[K++]=fe;break;case 3:for(me=!0,this.adobe&&this.adobe.transformCode?me=!0:typeof this.opts.colorTransform<"u"&&(me=!!this.opts.colorTransform),T=this.components[0],D=this.components[1],j=this.components[2],Q=0;Q<E;Q++)for(R=T.lines[0|Q*T.scaleY*k],N=D.lines[0|Q*D.scaleY*k],H=j.lines[0|Q*j.scaleY*k],L=0;L<w;L++)me?(fe=R[0|L*T.scaleX*S],ce=N[0|L*D.scaleX*S],Z=H[0|L*j.scaleX*S],ge=g(fe+1.402*(Z-128)),Pe=g(fe-.3441363*(ce-128)-.71413636*(Z-128)),Te=g(fe+1.772*(ce-128))):(ge=R[0|L*T.scaleX*S],Pe=N[0|L*D.scaleX*S],Te=H[0|L*j.scaleX*S]),Ie[K++]=ge,Ie[K++]=Pe,Ie[K++]=Te;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(me=!1,this.adobe&&this.adobe.transformCode?me=!0:typeof this.opts.colorTransform<"u"&&(me=!!this.opts.colorTransform),T=this.components[0],D=this.components[1],j=this.components[2],W=this.components[3],Q=0;Q<E;Q++)for(R=T.lines[0|Q*T.scaleY*k],N=D.lines[0|Q*D.scaleY*k],H=j.lines[0|Q*j.scaleY*k],I=W.lines[0|Q*W.scaleY*k],L=0;L<w;L++)me?(fe=R[0|L*T.scaleX*S],ce=N[0|L*D.scaleX*S],Z=H[0|L*j.scaleX*S],he=I[0|L*W.scaleX*S],pe=255-g(fe+1.402*(Z-128)),X=255-g(fe-.3441363*(ce-128)-.71413636*(Z-128)),O=255-g(fe+1.772*(ce-128))):(pe=R[0|L*T.scaleX*S],X=N[0|L*D.scaleX*S],O=H[0|L*j.scaleX*S],he=I[0|L*W.scaleX*S]),Ie[K++]=255-pe,Ie[K++]=255-X,Ie[K++]=255-O,Ie[K++]=255-he;break;default:throw new Error("Unsupported color mode")}return Ie},"getData"),copyToImageData:o(function(w,E){var S=w.width,k=w.height,T=w.data,D=this.getData(S,k),j=0,W=0,R,N,H,I,L,Q,K,fe,ce;switch(this.components.length){case 1:for(N=0;N<k;N++)for(R=0;R<S;R++)H=D[j++],T[W++]=H,T[W++]=H,T[W++]=H,E&&(T[W++]=255);break;case 3:for(N=0;N<k;N++)for(R=0;R<S;R++)K=D[j++],fe=D[j++],ce=D[j++],T[W++]=K,T[W++]=fe,T[W++]=ce,E&&(T[W++]=255);break;case 4:for(N=0;N<k;N++)for(R=0;R<S;R++)L=D[j++],Q=D[j++],H=D[j++],I=D[j++],K=255-g(L*(1-I/255)+I),fe=255-g(Q*(1-I/255)+I),ce=255-g(H*(1-I/255)+I),T[W++]=K,T[W++]=fe,T[W++]=ce,E&&(T[W++]=255);break;default:throw new Error("Unsupported color mode")}},"copyToImageData")};var y=0,v=0;function x(b=0){var w=y+b;if(w>v){var E=Math.ceil((w-v)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${E}MB`)}y=w}return o(x,"requestMemoryAllocation"),d.resetMaxMemoryUsage=function(b){y=0,v=b},d.getBytesAllocated=function(){return y},d.requestMemoryAllocation=x,d}),"jpegImage")();typeof wO<"u"?wO.exports=bne:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=bne);function bne(e,t={}){var n={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},r={...n,...t},i=new Uint8Array(e),s=new bO;s.opts=r,bO.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),s.parse(i);var a=r.formatAsRGBA?4:3,l=s.width*s.height*a;try{bO.requestMemoryAllocation(l);var c={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:r.useTArray?new Uint8Array(l):Buffer.alloc(l)};s.comments.length>0&&(c.comments=s.comments)}catch(u){throw u instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+l):u instanceof ReferenceError&&u.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):u}return s.copyToImageData(c,r.formatAsRGBA),c}o(bne,"decode")});var Ene=oe((U8t,Sne)=>{var SUe=xne(),EUe=wne();Sne.exports={encode:SUe,decode:EUe}});var wh=oe((_9t,Wre)=>{"use strict";Wre.exports=Md;Md.CAPTURING_PHASE=1;Md.AT_TARGET=2;Md.BUBBLING_PHASE=3;function Md(e,t){if(this.type="",this.target=null,this.currentTarget=null,this.eventPhase=Md.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,e&&(this.type=e),t)for(var n in t)this[n]=t[n]}o(Md,"Event");Md.prototype=Object.create(Object.prototype,{constructor:{value:Md},stopPropagation:{value:o(function(){this._propagationStopped=!0},"stopPropagation")},stopImmediatePropagation:{value:o(function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0},"stopImmediatePropagation")},preventDefault:{value:o(function(){this.cancelable&&(this.defaultPrevented=!0)},"preventDefault")},initEvent:{value:o(function(t,n,r){this._initialized=!0,!this._dispatching&&(this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=t,this.bubbles=n,this.cancelable=r)},"initEvent")}})});var yN=oe((T9t,Vre)=>{"use strict";var Hre=wh();Vre.exports=gN;function gN(){Hre.call(this),this.view=null,this.detail=0}o(gN,"UIEvent");gN.prototype=Object.create(Hre.prototype,{constructor:{value:gN},initUIEvent:{value:o(function(e,t,n,r,i){this.initEvent(e,t,n),this.view=r,this.detail=i},"value")}})});var xN=oe((C9t,Zre)=>{"use strict";var Gre=yN();Zre.exports=vN;function vN(){Gre.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}o(vN,"MouseEvent");vN.prototype=Object.create(Gre.prototype,{constructor:{value:vN},initMouseEvent:{value:o(function(e,t,n,r,i,s,a,l,c,u,d,p,m,h,g){switch(this.initEvent(e,t,n,r,i),this.screenX=s,this.screenY=a,this.clientX=l,this.clientY=c,this.ctrlKey=u,this.altKey=d,this.shiftKey=p,this.metaKey=m,this.button=h,h){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break}this.relatedTarget=g},"value")},getModifierState:{value:o(function(e){switch(e){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return!1}},"value")}})});var Kw=oe(($9t,Jre)=>{"use strict";Jre.exports=Zw;var DBe=1,MBe=3,LBe=4,jBe=5,FBe=7,UBe=8,qBe=9,zBe=11,BBe=12,WBe=13,HBe=14,VBe=15,GBe=17,ZBe=18,KBe=19,JBe=20,XBe=21,QBe=22,YBe=23,eWe=24,tWe=25,nWe=[null,"INDEX_SIZE_ERR",null,"HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR",null,"NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INUSE_ATTRIBUTE_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR",null,"TYPE_MISMATCH_ERR","SECURITY_ERR","NETWORK_ERR","ABORT_ERR","URL_MISMATCH_ERR","QUOTA_EXCEEDED_ERR","TIMEOUT_ERR","INVALID_NODE_TYPE_ERR","DATA_CLONE_ERR"],rWe=[null,"INDEX_SIZE_ERR (1): the index is not in the allowed range",null,"HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model","WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required","INVALID_CHARACTER_ERR (5): the string contains invalid characters",null,"NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified","NOT_FOUND_ERR (8): the object can not be found here","NOT_SUPPORTED_ERR (9): this operation is not supported","INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute","INVALID_STATE_ERR (11): the object is in an invalid state","SYNTAX_ERR (12): the string did not match the expected pattern","INVALID_MODIFICATION_ERR (13): the object can not be modified in this way","NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML","INVALID_ACCESS_ERR (15): the object does not support the operation or argument",null,"TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type","SECURITY_ERR (18): the operation is insecure","NETWORK_ERR (19): a network error occurred","ABORT_ERR (20): the user aborted an operation","URL_MISMATCH_ERR (21): the given URL does not match another URL","QUOTA_EXCEEDED_ERR (22): the quota has been exceeded","TIMEOUT_ERR (23): a timeout occurred","INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation","DATA_CLONE_ERR (25): the object can not be cloned."],Kre={INDEX_SIZE_ERR:DBe,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:MBe,WRONG_DOCUMENT_ERR:LBe,INVALID_CHARACTER_ERR:jBe,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:FBe,NOT_FOUND_ERR:UBe,NOT_SUPPORTED_ERR:qBe,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:zBe,SYNTAX_ERR:BBe,INVALID_MODIFICATION_ERR:WBe,NAMESPACE_ERR:HBe,INVALID_ACCESS_ERR:VBe,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:GBe,SECURITY_ERR:ZBe,NETWORK_ERR:KBe,ABORT_ERR:JBe,URL_MISMATCH_ERR:XBe,QUOTA_EXCEEDED_ERR:QBe,TIMEOUT_ERR:YBe,INVALID_NODE_TYPE_ERR:eWe,DATA_CLONE_ERR:tWe};function Zw(e){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=e,this.message=rWe[e],this.name=nWe[e]}o(Zw,"DOMException");Zw.prototype.__proto__=Error.prototype;for(Gw in Kre)bN={value:Kre[Gw]},Object.defineProperty(Zw,Gw,bN),Object.defineProperty(Zw.prototype,Gw,bN);var bN,Gw});var Jw=oe(Xre=>{Xre.isApiWritable=!globalThis.__domino_frozen__});var Dr=oe(qn=>{"use strict";var Pr=Kw(),Kr=Pr,iWe=Jw().isApiWritable;qn.NAMESPACE={HTML:"http://www.w3.org/1999/xhtml",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};qn.IndexSizeError=function(){throw new Pr(Kr.INDEX_SIZE_ERR)};qn.HierarchyRequestError=function(){throw new Pr(Kr.HIERARCHY_REQUEST_ERR)};qn.WrongDocumentError=function(){throw new Pr(Kr.WRONG_DOCUMENT_ERR)};qn.InvalidCharacterError=function(){throw new Pr(Kr.INVALID_CHARACTER_ERR)};qn.NoModificationAllowedError=function(){throw new Pr(Kr.NO_MODIFICATION_ALLOWED_ERR)};qn.NotFoundError=function(){throw new Pr(Kr.NOT_FOUND_ERR)};qn.NotSupportedError=function(){throw new Pr(Kr.NOT_SUPPORTED_ERR)};qn.InvalidStateError=function(){throw new Pr(Kr.INVALID_STATE_ERR)};qn.SyntaxError=function(){throw new Pr(Kr.SYNTAX_ERR)};qn.InvalidModificationError=function(){throw new Pr(Kr.INVALID_MODIFICATION_ERR)};qn.NamespaceError=function(){throw new Pr(Kr.NAMESPACE_ERR)};qn.InvalidAccessError=function(){throw new Pr(Kr.INVALID_ACCESS_ERR)};qn.TypeMismatchError=function(){throw new Pr(Kr.TYPE_MISMATCH_ERR)};qn.SecurityError=function(){throw new Pr(Kr.SECURITY_ERR)};qn.NetworkError=function(){throw new Pr(Kr.NETWORK_ERR)};qn.AbortError=function(){throw new Pr(Kr.ABORT_ERR)};qn.UrlMismatchError=function(){throw new Pr(Kr.URL_MISMATCH_ERR)};qn.QuotaExceededError=function(){throw new Pr(Kr.QUOTA_EXCEEDED_ERR)};qn.TimeoutError=function(){throw new Pr(Kr.TIMEOUT_ERR)};qn.InvalidNodeTypeError=function(){throw new Pr(Kr.INVALID_NODE_TYPE_ERR)};qn.DataCloneError=function(){throw new Pr(Kr.DATA_CLONE_ERR)};qn.nyi=function(){throw new Error("NotYetImplemented")};qn.shouldOverride=function(){throw new Error("Abstract function; should be overriding in subclass.")};qn.assert=function(e,t){if(!e)throw new Error("Assertion failed: "+(t||"")+`
|
|
155
155
|
`+new Error().stack)};qn.expose=function(e,t){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],writable:iWe})};qn.merge=function(e,t){for(var n in t)e[n]=t[n]};qn.documentOrder=function(e,t){return 3-(e.compareDocumentPosition(t)&6)};qn.toASCIILowerCase=function(e){return e.replace(/[A-Z]+/g,function(t){return t.toLowerCase()})};qn.toASCIIUpperCase=function(e){return e.replace(/[a-z]+/g,function(t){return t.toUpperCase()})}});var wN=oe((D9t,Yre)=>{"use strict";var Ld=wh(),sWe=xN(),aWe=Dr();Yre.exports=Qre;function Qre(){}o(Qre,"EventTarget");Qre.prototype={addEventListener:o(function(t,n,r){if(n){r===void 0&&(r=!1),this._listeners||(this._listeners=Object.create(null)),this._listeners[t]||(this._listeners[t]=[]);for(var i=this._listeners[t],s=0,a=i.length;s<a;s++){var l=i[s];if(l.listener===n&&l.capture===r)return}var c={listener:n,capture:r};typeof n=="function"&&(c.f=n),i.push(c)}},"addEventListener"),removeEventListener:o(function(t,n,r){if(r===void 0&&(r=!1),this._listeners){var i=this._listeners[t];if(i)for(var s=0,a=i.length;s<a;s++){var l=i[s];if(l.listener===n&&l.capture===r){i.length===1?this._listeners[t]=void 0:i.splice(s,1);return}}}},"removeEventListener"),dispatchEvent:o(function(t){return this._dispatchEvent(t,!1)},"dispatchEvent"),_dispatchEvent:o(function(t,n){typeof n!="boolean"&&(n=!1);function r(u,d){var p=d.type,m=d.eventPhase;if(d.currentTarget=u,m!==Ld.CAPTURING_PHASE&&u._handlers&&u._handlers[p]){var h=u._handlers[p],g;if(typeof h=="function")g=h.call(d.currentTarget,d);else{var y=h.handleEvent;if(typeof y!="function")throw new TypeError("handleEvent property of event handler object isnot a function.");g=y.call(h,d)}d.type==="mouseover"?g===!0&&d.preventDefault():g===!1&&d.preventDefault()}var v=u._listeners&&u._listeners[p];if(v){v=v.slice();for(var x=0,b=v.length;x<b;x++){if(d._immediatePropagationStopped)return;var w=v[x];if(!(m===Ld.CAPTURING_PHASE&&!w.capture||m===Ld.BUBBLING_PHASE&&w.capture))if(w.f)w.f.call(d.currentTarget,d);else{var E=w.listener.handleEvent;if(typeof E!="function")throw new TypeError("handleEvent property of event listener object is not a function.");E.call(w.listener,d)}}}}o(r,"invoke"),(!t._initialized||t._dispatching)&&aWe.InvalidStateError(),t.isTrusted=n,t._dispatching=!0,t.target=this;for(var i=[],s=this.parentNode;s;s=s.parentNode)i.push(s);t.eventPhase=Ld.CAPTURING_PHASE;for(var a=i.length-1;a>=0&&(r(i[a],t),!t._propagationStopped);a--);if(t._propagationStopped||(t.eventPhase=Ld.AT_TARGET,r(this,t)),t.bubbles&&!t._propagationStopped){t.eventPhase=Ld.BUBBLING_PHASE;for(var l=0,c=i.length;l<c&&(r(i[l],t),!t._propagationStopped);l++);}if(t._dispatching=!1,t.eventPhase=Ld.AT_TARGET,t.currentTarget=null,n&&!t.defaultPrevented&&t instanceof sWe)switch(t.type){case"mousedown":this._armed={x:t.clientX,y:t.clientY,t:t.timeStamp};break;case"mouseout":case"mouseover":this._armed=null;break;case"mouseup":this._isClick(t)&&this._doClick(t),this._armed=null;break}return!t.defaultPrevented},"_dispatchEvent"),_isClick:o(function(e){return this._armed!==null&&e.type==="mouseup"&&e.isTrusted&&e.button===0&&e.timeStamp-this._armed.t<1e3&&Math.abs(e.clientX-this._armed.x)<10&&Math.abs(e.clientY-this._armed.Y)<10},"_isClick"),_doClick:o(function(e){if(!this._click_in_progress){this._click_in_progress=!0;for(var t=this;t&&!t._post_click_activation_steps;)t=t.parentNode;t&&t._pre_click_activation_steps&&t._pre_click_activation_steps();var n=this.ownerDocument.createEvent("MouseEvent");n.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,null);var r=this._dispatchEvent(n,!0);t&&(r?t._post_click_activation_steps&&t._post_click_activation_steps(n):t._cancelled_activation_steps&&t._cancelled_activation_steps())}},"_doClick"),_setEventHandler:o(function(t,n){this._handlers||(this._handlers=Object.create(null)),this._handlers[t]=n},"_setEventHandler"),_getEventHandler:o(function(t){return this._handlers&&this._handlers[t]||null},"_getEventHandler")}});var SN=oe((L9t,eie)=>{"use strict";var Bl=Dr(),ha=eie.exports={valid:o(function(e){return Bl.assert(e,"list falsy"),Bl.assert(e._previousSibling,"previous falsy"),Bl.assert(e._nextSibling,"next falsy"),!0},"valid"),insertBefore:o(function(e,t){Bl.assert(ha.valid(e)&&ha.valid(t));var n=e,r=e._previousSibling,i=t,s=t._previousSibling;n._previousSibling=s,r._nextSibling=i,s._nextSibling=n,i._previousSibling=r,Bl.assert(ha.valid(e)&&ha.valid(t))},"insertBefore"),replace:o(function(e,t){Bl.assert(ha.valid(e)&&(t===null||ha.valid(t))),t!==null&&ha.insertBefore(t,e),ha.remove(e),Bl.assert(ha.valid(e)&&(t===null||ha.valid(t)))},"replace"),remove:o(function(e){Bl.assert(ha.valid(e));var t=e._previousSibling;if(t!==e){var n=e._nextSibling;t._nextSibling=n,n._previousSibling=t,e._previousSibling=e._nextSibling=e,Bl.assert(ha.valid(e))}},"remove")}});var EN=oe((F9t,lie)=>{"use strict";lie.exports={serializeOne:fWe,\u0275escapeMatchingClosingTag:sie,\u0275escapeClosingCommentTag:aie,\u0275escapeProcessingInstructionContent:oie};var iie=Dr(),jd=iie.NAMESPACE,tie={STYLE:!0,SCRIPT:!0,XMP:!0,IFRAME:!0,NOEMBED:!0,NOFRAMES:!0,PLAINTEXT:!0},oWe={area:!0,base:!0,basefont:!0,bgsound:!0,br:!0,col:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},lWe={},nie=/[&<>\u00A0]/g,rie=/[&"<>\u00A0]/g;function cWe(e){return nie.test(e)?e.replace(nie,t=>{switch(t){case"&":return"&";case"<":return"<";case">":return">";case"\xA0":return" "}}):e}o(cWe,"escape");function uWe(e){return rie.test(e)?e.replace(rie,t=>{switch(t){case"<":return"<";case">":return">";case"&":return"&";case'"':return""";case"\xA0":return" "}}):e}o(uWe,"escapeAttr");function dWe(e){var t=e.namespaceURI;return t?t===jd.XML?"xml:"+e.localName:t===jd.XLINK?"xlink:"+e.localName:t===jd.XMLNS?e.localName==="xmlns"?"xmlns":"xmlns:"+e.localName:e.name:e.localName}o(dWe,"attrname");function sie(e,t){let n="</"+t;if(!e.toLowerCase().includes(n))return e;let r=[...e],i=e.matchAll(new RegExp(n,"ig"));for(let s of i)r[s.index]="<";return r.join("")}o(sie,"escapeMatchingClosingTag");var pWe=/--!?>/;function aie(e){return pWe.test(e)?e.replace(/(--\!?)>/g,"$1>"):e}o(aie,"escapeClosingCommentTag");function oie(e){return e.includes(">")?e.replaceAll(">",">"):e}o(oie,"escapeProcessingInstructionContent");function fWe(e,t){var n="";switch(e.nodeType){case 1:var r=e.namespaceURI,i=r===jd.HTML,s=i||r===jd.SVG||r===jd.MATHML?e.localName:e.tagName;n+="<"+s;for(var a=0,l=e._numattrs;a<l;a++){var c=e._attr(a);n+=" "+dWe(c),c.value!==void 0&&(n+='="'+uWe(c.value)+'"')}if(n+=">",!(i&&oWe[s])){var u=e.serialize();tie[s.toUpperCase()]&&(u=sie(u,s)),i&&lWe[s]&&u.charAt(0)===`
|
|
156
156
|
`&&(n+=`
|
|
@@ -4333,7 +4333,7 @@ The web search request used endpoint ${JSON.stringify(e)}. Search endpoint confi
|
|
|
4333
4333
|
button, .button { display: inline-block; box-sizing: border-box; margin-top: 1rem; padding: .75rem 1rem; border: 0; border-radius: .6rem; background: #5a87ff; color: #071022; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
|
|
4334
4334
|
.secondary { background: #29314b; color: #edf2ff; }
|
|
4335
4335
|
.error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
|
|
4336
|
-
`}o(Ode,"pageStyles");Ob();function ont(){return"dsh-edge@0.16.0-alpha.1/isolated"}o(ont,"resolveEdgeDeploymentId");function ay(e){return{baseURL:uN(e.DEEPSEEK_BASE_URL),maxTokens:fN(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Dd(e.DEEPSEEK_MODEL),reasoningEffort:dN(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:PS(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:pN(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ny(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(ay,"resolveEdgeDeploymentConfig");function lnt(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}o(lnt,"edgeDeploymentApiKeyConfigured");function cnt(e){let t=uN(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}o(cnt,"projectedEdgeBaseURL");function ZD(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:ont(),apiKeyConfigured:lnt(e),baseURL:cnt(e.DEEPSEEK_BASE_URL),maxTokens:fN(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Dd(e.DEEPSEEK_MODEL),reasoningEffort:dN(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:PS(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:pN(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ny(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(ZD,"resolveEdgeDeploymentProfile");function bE(e){ay(e);let t=ZD(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,...e.CF_VERSION_METADATA===void 0?{}:{workerVersionId:e.CF_VERSION_METADATA.id},version:th,upstreamVersion:fY,status:"ready"}}o(bE,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as Tpt}from"node:async_hooks";import{WorkerEntrypoint as Sqt}from"cloudflare:workers";var Sp=wo(Nde(),1);var KD=o((e,t,n)=>{let r=e instanceof RegExp?Pde(e,n):e,i=t instanceof RegExp?Pde(t,n):t,s=r!==null&&i!=null&&unt(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),Pde=o((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),unt=o((e,t,n)=>{let r,i,s,a,l,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],s=n.length;d>=0&&!l;){if(d===c)r.push(d),c=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(l=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}r.length&&a!==void 0&&(l=[s,a])}return l},"range");var Dde="\0SLASH"+Math.random()+"\0",Mde="\0OPEN"+Math.random()+"\0",QD="\0CLOSE"+Math.random()+"\0",Lde="\0COMMA"+Math.random()+"\0",jde="\0PERIOD"+Math.random()+"\0",dnt=new RegExp(Dde,"g"),pnt=new RegExp(Mde,"g"),fnt=new RegExp(QD,"g"),hnt=new RegExp(Lde,"g"),mnt=new RegExp(jde,"g"),gnt=/\\\\/g,ynt=/\\{/g,vnt=/\\}/g,xnt=/\\,/g,bnt=/\\\./g,wnt=1e5,Snt=4e6;function JD(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}o(JD,"numeric");function Ent(e){return e.replace(gnt,Dde).replace(ynt,Mde).replace(vnt,QD).replace(xnt,Lde).replace(bnt,jde)}o(Ent,"escapeBraces");function knt(e){return e.replace(dnt,"\\").replace(pnt,"{").replace(fnt,"}").replace(hnt,",").replace(mnt,".")}o(knt,"unescapeBraces");function Fde(e){if(!e)return[""];let t=[],n=KD("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,a=r.split(",");a[a.length-1]+="{"+i+"}";let l=Fde(s);return s.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}o(Fde,"parseCommaParts");function Ude(e,t={}){if(!e)return[];let{max:n=wnt,maxLength:r=Snt}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),XD(Ent(e),n,r,!0).map(knt)}o(Ude,"expand");function _nt(e){return"{"+e+"}"}o(_nt,"embrace");function Ant(e){return/^-?0\d/.test(e)}o(Ant,"isPadded");function Tnt(e,t){return e<=t}o(Tnt,"lte");function Int(e,t){return e>=t}o(Int,"gte");function oy(e,t,n,r,i,s){let a=[],l=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=r)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(l+d.length>i)return a;a.push(d),l+=d.length}}return a}o(oy,"combine");function Cnt(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let a=JD(i[0]),l=JD(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(JD(i[2])),1):1,d=Tnt;l<a&&(u*=-1,d=Int);let m=i.some(Ant),h=0;for(let g=a;d(g,l)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),m){let v=c-y.length;if(v>0){let x=new Array(v+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(h+y.length>r)break;s.push(y),h+=y.length}return s}o(Cnt,"expandSequence");function XD(e,t,n,r){let i=[""],s=!1,a=!0;for(;;){let l=KD("{","}",e);if(!l)return oy(i,e,[""],t,n,s);let c=l.pre;if(/\$$/.test(c)){if(i=oy(i,c+"{"+l.body+"}",[""],t,n,s&&!l.post.length),a=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,m=l.body.indexOf(",")>=0;if(!p&&!m){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+QD+l.post,r=!0;continue}return oy(i,c+"{"+l.body+"}"+l.post,[""],t,n,s)}a&&(s=r&&!p,a=!1);let h;if(p)h=Cnt(l.body,d,t,n);else{let g=Fde(l.body);if(g.length===1&&g[0]!==void 0&&(g=XD(g[0],t,n,!1).map(_nt),g.length===1)){if(i=oy(i,c+g[0],[""],t,n,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let x=0;y&&x<i.length;x++)i[x]&&(y=!1);h=[];let v=0;e:for(let x=0;x<g.length;x++){let b=XD(g[x],t,n,!1);for(let w=0;w<b.length;w++){let E=b[w];if(!(y&&!E)){if(h.length>=t||v+E.length>n)break e;h.push(E),v+=E.length}}}}if(i=oy(i,c,h,t,n,s&&!l.post.length),!l.post.length)break;e=l.post}return i}o(XD,"expand_");var ly=o(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Rnt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},cy=o(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),$nt=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),qde=o(e=>e.join(""),"rangesToString"),zde=o((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,a=!1,l=!1,c=!1,u=!1,d=n,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[x,b,w]]of Object.entries(Rnt))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-n,!0];s+=v.length,w?i.push(x):r.push(x),l=l||b;continue e}}if(c=!1,p){y>p?r.push(cy(p)+"-"+cy(y)):y===p&&r.push(cy(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(cy(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(cy(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[$nt(y),!1,d-n,!1]}let m="["+(u?"^":"")+qde(r)+"]",h="["+(u?"":"^")+qde(i)+"]";return[r.length&&i.length?"("+m+"|"+h+")":r.length?m:h,l,d-n,!0]},"parseClass");var uu=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var $s,Ont=new Set(["!","?","+","*","@"]),YD=o(e=>Ont.has(e),"isExtglobType"),Bde=o(e=>YD(e.type),"isExtglobAST"),Nnt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Pnt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Dnt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Wde=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Mnt="(?!(?:^|/)\\.\\.?(?:$|/))",SE="(?!\\.)",Lnt=new Set(["[","."]),jnt=new Set(["..","."]),Fnt=new Set("().*{}+?[]^$\\!"),Unt=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),eM="[^/]",Hde=eM+"*?",Vde=eM+"+?",qnt=0,sp=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#d=!1;#l;#a;#c=!1;id=++qnt;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?r:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#d&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof $s&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let r=t.#t[n];if(!(r instanceof $s&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new $s(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let a=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=r,v="";for(;y<t.length;){let x=t.charAt(y++);if(l||x==="\\"){l=!l,v+=x;continue}if(c){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(c=!1),v+=x;continue}else if(x==="["){c=!0,u=y,d=!1,v+=x;continue}if(!i.noext&&YD(x)&&t.charAt(y)==="("&&s<=a){n.push(v),v="";let w=new $s(x,n);y=$s.#m(t,w,y,i,s+1),n.push(w);continue}v+=x}return n.push(v),y}let p=r+1,m=new $s(null,n),h=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&YD(y)&&t.charAt(p)==="("&&(s<=a||n&&n.#y(y))){let x=n&&n.#y(y)?0:1;m.push(g),g="";let b=new $s(y,m);m.push(b),p=$s.#m(t,b,p,i,s+x);continue}if(y==="|"){m.push(g),g="",h.push(m),m=new $s(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),m.push(g),g="",n.push(...h,m),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#N(t){return this.#g(t,Pnt)}#g(t,n=Nnt){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=Dnt){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new $s(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#a=void 0}#A(t){return!!Wde.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#A(n.type)}#v(t){let n=Wde.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let r=new $s(null,void 0,n);return $s.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,l),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!Bde(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,v,x]=typeof h=="string"?$s.#T(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&jnt.has(this.#t[0]))){let g=Lnt,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!n&&!t&&g.has(u.charAt(0));d=y?Mnt:v?SE:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,uu(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#x(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,uu(this.toString()),!1,!1]}let a=!r||t||n||!SE?"":this.#x(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!n?SE:"")+Vde;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?SE:"")+Hde+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;l=i+s+c}return[l,uu(s),this.#n=!!this.#n,this.#r]}#f(){if(Bde(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#N(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#v(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#a=void 0}#x(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#T(t,n,r=!1){let i=!1,s="",a=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(Fnt.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=r&&/^[*]+$/.test(t)?Vde:Hde,n=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,m,h]=zde(t,c);if(m){s+=d,a=a||p,c+=m-1,n=n||h;continue}}if(u==="?"){s+=eM,n=!0;continue}s+=Unt(u)}return[s,uu(t),!!n,a]}};$s=sp;var tM=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var gi=o((e,t,n={})=>(ly(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Hh(t,n).match(e)),"minimatch"),znt=/^\*+([^+@!?*[(]*)$/,Bnt=o(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),Wnt=o(e=>t=>t.endsWith(e),"starDotExtTestDot"),Hnt=o(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Vnt=o(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),Gnt=/^\*+\.\*+$/,Znt=o(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Knt=o(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Jnt=/^\.\*+$/,Xnt=o(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Qnt=/^\*+$/,Ynt=o(e=>e.length!==0&&!e.startsWith("."),"starTest"),ert=o(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),trt=/^\?+([^+@!?*[(]*)?$/,nrt=o(([e,t=""])=>{let n=Kde([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),rrt=o(([e,t=""])=>{let n=Jde([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),irt=o(([e,t=""])=>{let n=Jde([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),srt=o(([e,t=""])=>{let n=Kde([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),Kde=o(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),Jde=o(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),Xde=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Gde={win32:{sep:"\\"},posix:{sep:"/"}},art=Xde==="win32"?Gde.win32.sep:Gde.posix.sep;gi.sep=art;var Xi=Symbol("globstar **");gi.GLOBSTAR=Xi;var ort="[^/]",lrt=ort+"*?",crt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",urt="(?:(?!(?:\\/|^)\\.).)*?",drt=o((e,t={})=>n=>gi(n,e,t),"filter");gi.filter=drt;var ya=o((e,t={})=>Object.assign({},e,t),"ext"),prt=o(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return gi;let t=gi;return Object.assign(o((r,i,s={})=>t(r,i,ya(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,ya(e,s))}static defaults(i){return t.defaults(ya(e,i)).Minimatch}},AST:class extends t.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,ya(e,a))}static fromGlob(i,s={}){return t.AST.fromGlob(i,ya(e,s))}},unescape:o((r,i={})=>t.unescape(r,ya(e,i)),"unescape"),escape:o((r,i={})=>t.escape(r,ya(e,i)),"escape"),filter:o((r,i={})=>t.filter(r,ya(e,i)),"filter"),defaults:o(r=>t.defaults(ya(e,r)),"defaults"),makeRe:o((r,i={})=>t.makeRe(r,ya(e,i)),"makeRe"),braceExpand:o((r,i={})=>t.braceExpand(r,ya(e,i)),"braceExpand"),match:o((r,i,s={})=>t.match(r,i,ya(e,s)),"match"),sep:t.sep,GLOBSTAR:Xi})},"defaults");gi.defaults=prt;var Qde=o((e,t={})=>(ly(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ude(e,{max:t.braceExpandMax})),"braceExpand");gi.braceExpand=Qde;var frt=o((e,t={})=>new Hh(e,t).makeRe(),"makeRe");gi.makeRe=frt;var hrt=o((e,t,n={})=>{let r=new Hh(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");gi.match=hrt;var Zde=/[?*]|[+@!]\(.*?\)|\[|\]/,mrt=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Hh=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){ly(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||Xde,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!Zde.test(s[2]))&&!Zde.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let l=r[i+1],c=r[i+2],u=r[i+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let l=r[a];a===1&&l===""&&r[0]===""||(l==="."||l==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,a=[],l="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])a.push(l==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])a.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])a.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(l==="b")return!1;l="a",a.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="b",a.push(n[s]),i++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),p=c?3:l?0:void 0,m=d?3:u?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[h,g]=[t[p],n[m]];h.toLowerCase()===g.toLowerCase()&&(n[m]=h,s=m,i=p)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Xi)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let a=n.indexOf(Xi,s),l=n.lastIndexOf(Xi),[c,u,d]=r?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,l),n.slice(l+1)];if(c.length){let b=t.slice(i,i+c.length);if(!this.#r(b,c,r,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let b=t.length-d.length;if(this.#r(t,d,r,b,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(b--,!this.#r(t,d,r,b,0)))return!1;p=d.length+1}}if(!u.length){let b=!!p;for(let w=i;w<t.length-p;w++){let E=String(t[w]);if(b=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||b}let m=[[[],0]],h=m[0],g=0,y=[0];for(let b of u)b===Xi?(y.push(g),h=[[],0],m.push(h)):(h[0].push(b),g++);let v=m.length-1,x=t.length-p;for(let b of m)b[1]=x-(y[v--]+b[0].length);return!!this.#n(t,m,i,0,r,0,!!p)}#n(t,n,r,i,s,a,l){let c=n[i];if(!c){for(let p=r;p<t.length;p++){l=!0;let m=t[p];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1}return l}let[u,d]=c;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,r+u.length,i+1,s,a+1,l);if(h!==!1)return h}let m=t[r];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let a,l,c,u;for(a=i,l=s,u=t.length,c=n.length;a<u&&l<c;a++,l++){this.debug("matchOne loop");let d=n[l],p=t[a];if(this.debug(n,d,p),d===!1||d===Xi)return!1;let m;if(typeof d=="string"?(m=p===d,this.debug("string match",d,p,m)):(m=d.test(p),this.debug("pattern match",d,p,m)),!m)return!1}if(a===u&&l===c)return!0;if(a===u)return r;if(l===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return Qde(this.pattern,this.options)}parse(t){ly(t);let n=this.options;if(t==="**")return Xi;if(t==="")return"";let r,i=null;(r=t.match(Qnt))?i=n.dot?ert:Ynt:(r=t.match(znt))?i=(n.nocase?n.dot?Vnt:Hnt:n.dot?Wnt:Bnt)(r[1]):(r=t.match(trt))?i=(n.nocase?n.dot?rrt:nrt:n.dot?irt:srt)(r):(r=t.match(Gnt))?i=n.dot?Knt:Znt:(r=t.match(Jnt))&&(i=Xnt);let s=sp.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?lrt:n.dot?crt:urt,i=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let m of p.flags.split(""))i.add(m);return typeof p=="string"?mrt(p):p===Xi?Xi:p._src});u.forEach((p,m)=>{let h=u[m+1],g=u[m-1];p!==Xi||g===Xi||(g===void 0?h!==void 0&&h!==Xi?u[m+1]="(?:\\/|"+r+"\\/)?"+h:u[m]=r:h===void 0?u[m-1]=g+"(?:\\/|\\/"+r+")?":h!==Xi&&(u[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+h,u[m+1]=Xi))});let d=u.filter(p=>p!==Xi);if(this.partial&&d.length>=1){let p=[];for(let m=1;m<=d.length;m++)p.push(d.slice(0,m).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[a,l]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+l+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let l=i.length-2;!a&&l>=0;l--)a=i[l];for(let l of s){let c=i;if(r.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return gi.defaults(t).Minimatch}};gi.AST=sp;gi.Minimatch=Hh;gi.escape=tM;gi.unescape=uu;import{gunzipSync as Fst}from"node:zlib";var uy=class{static{o(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),a=this.castInput(n,r),l=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(l,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;let a=o(b=>{if(b=this.postProcess(b,r),i){setTimeout(function(){i(b)},0);return}else return b},"done"),l=n.length,c=t.length,u=1,d=l+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,m=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&g+1>=l)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,v=1/0,x=o(()=>{for(let b=Math.max(y,-u);b<=Math.min(v,u);b+=2){let w,E=h[b-1],S=h[b+1];E&&(h[b-1]=void 0);let k=!1;if(S){let D=S.oldPos-b;k=S&&0<=D&&D<l}let T=E&&E.oldPos+1<c;if(!k&&!T){h[b]=void 0;continue}if(!T||k&&E.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,r):w=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(w,n,t,b,r),w.oldPos+1>=c&&g+1>=l)return a(this.buildValues(w.lastComponent,n,t))||!0;h[b]=w,w.oldPos+1>=c&&(v=Math.min(v,b-1)),g+1>=l&&(y=Math.max(y,b+1))}u++},"execEditLength");if(i)o(function b(){setTimeout(function(){if(u>d||Date.now()>m)return i(void 0);x()||b()},0)},"exec")();else for(;u<=d&&Date.now()<=m;){let b=x();if(b)return b}}addToPath(t,n,r,i,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,i,s){let a=n.length,l=r.length,c=t.oldPos,u=c-i,d=0;for(;u+1<a&&c+1<l&&this.equals(r[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let a=i.length,l=0,c=0,u=0;for(;l<a;l++){let d=i[l];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(c,c+d.count);p=p.map(function(m,h){let g=r[u+h];return g.length>m.length?g:m}),d.value=this.join(p)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var nM=class extends uy{static{o(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=yrt}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
4336
|
+
`}o(Ode,"pageStyles");Ob();function ont(){return"dsh-edge@0.16.0/isolated"}o(ont,"resolveEdgeDeploymentId");function ay(e){return{baseURL:uN(e.DEEPSEEK_BASE_URL),maxTokens:fN(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Dd(e.DEEPSEEK_MODEL),reasoningEffort:dN(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:PS(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:pN(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ny(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(ay,"resolveEdgeDeploymentConfig");function lnt(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}o(lnt,"edgeDeploymentApiKeyConfigured");function cnt(e){let t=uN(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}o(cnt,"projectedEdgeBaseURL");function ZD(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:ont(),apiKeyConfigured:lnt(e),baseURL:cnt(e.DEEPSEEK_BASE_URL),maxTokens:fN(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Dd(e.DEEPSEEK_MODEL),reasoningEffort:dN(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:PS(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:pN(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ny(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(ZD,"resolveEdgeDeploymentProfile");function bE(e){ay(e);let t=ZD(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,...e.CF_VERSION_METADATA===void 0?{}:{workerVersionId:e.CF_VERSION_METADATA.id},version:th,upstreamVersion:fY,status:"ready"}}o(bE,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as Tpt}from"node:async_hooks";import{WorkerEntrypoint as Sqt}from"cloudflare:workers";var Sp=wo(Nde(),1);var KD=o((e,t,n)=>{let r=e instanceof RegExp?Pde(e,n):e,i=t instanceof RegExp?Pde(t,n):t,s=r!==null&&i!=null&&unt(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),Pde=o((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),unt=o((e,t,n)=>{let r,i,s,a,l,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],s=n.length;d>=0&&!l;){if(d===c)r.push(d),c=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(l=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}r.length&&a!==void 0&&(l=[s,a])}return l},"range");var Dde="\0SLASH"+Math.random()+"\0",Mde="\0OPEN"+Math.random()+"\0",QD="\0CLOSE"+Math.random()+"\0",Lde="\0COMMA"+Math.random()+"\0",jde="\0PERIOD"+Math.random()+"\0",dnt=new RegExp(Dde,"g"),pnt=new RegExp(Mde,"g"),fnt=new RegExp(QD,"g"),hnt=new RegExp(Lde,"g"),mnt=new RegExp(jde,"g"),gnt=/\\\\/g,ynt=/\\{/g,vnt=/\\}/g,xnt=/\\,/g,bnt=/\\\./g,wnt=1e5,Snt=4e6;function JD(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}o(JD,"numeric");function Ent(e){return e.replace(gnt,Dde).replace(ynt,Mde).replace(vnt,QD).replace(xnt,Lde).replace(bnt,jde)}o(Ent,"escapeBraces");function knt(e){return e.replace(dnt,"\\").replace(pnt,"{").replace(fnt,"}").replace(hnt,",").replace(mnt,".")}o(knt,"unescapeBraces");function Fde(e){if(!e)return[""];let t=[],n=KD("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,a=r.split(",");a[a.length-1]+="{"+i+"}";let l=Fde(s);return s.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}o(Fde,"parseCommaParts");function Ude(e,t={}){if(!e)return[];let{max:n=wnt,maxLength:r=Snt}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),XD(Ent(e),n,r,!0).map(knt)}o(Ude,"expand");function _nt(e){return"{"+e+"}"}o(_nt,"embrace");function Ant(e){return/^-?0\d/.test(e)}o(Ant,"isPadded");function Tnt(e,t){return e<=t}o(Tnt,"lte");function Int(e,t){return e>=t}o(Int,"gte");function oy(e,t,n,r,i,s){let a=[],l=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=r)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(l+d.length>i)return a;a.push(d),l+=d.length}}return a}o(oy,"combine");function Cnt(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let a=JD(i[0]),l=JD(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(JD(i[2])),1):1,d=Tnt;l<a&&(u*=-1,d=Int);let m=i.some(Ant),h=0;for(let g=a;d(g,l)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),m){let v=c-y.length;if(v>0){let x=new Array(v+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(h+y.length>r)break;s.push(y),h+=y.length}return s}o(Cnt,"expandSequence");function XD(e,t,n,r){let i=[""],s=!1,a=!0;for(;;){let l=KD("{","}",e);if(!l)return oy(i,e,[""],t,n,s);let c=l.pre;if(/\$$/.test(c)){if(i=oy(i,c+"{"+l.body+"}",[""],t,n,s&&!l.post.length),a=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,m=l.body.indexOf(",")>=0;if(!p&&!m){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+QD+l.post,r=!0;continue}return oy(i,c+"{"+l.body+"}"+l.post,[""],t,n,s)}a&&(s=r&&!p,a=!1);let h;if(p)h=Cnt(l.body,d,t,n);else{let g=Fde(l.body);if(g.length===1&&g[0]!==void 0&&(g=XD(g[0],t,n,!1).map(_nt),g.length===1)){if(i=oy(i,c+g[0],[""],t,n,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let x=0;y&&x<i.length;x++)i[x]&&(y=!1);h=[];let v=0;e:for(let x=0;x<g.length;x++){let b=XD(g[x],t,n,!1);for(let w=0;w<b.length;w++){let E=b[w];if(!(y&&!E)){if(h.length>=t||v+E.length>n)break e;h.push(E),v+=E.length}}}}if(i=oy(i,c,h,t,n,s&&!l.post.length),!l.post.length)break;e=l.post}return i}o(XD,"expand_");var ly=o(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Rnt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},cy=o(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),$nt=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),qde=o(e=>e.join(""),"rangesToString"),zde=o((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,a=!1,l=!1,c=!1,u=!1,d=n,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[x,b,w]]of Object.entries(Rnt))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-n,!0];s+=v.length,w?i.push(x):r.push(x),l=l||b;continue e}}if(c=!1,p){y>p?r.push(cy(p)+"-"+cy(y)):y===p&&r.push(cy(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(cy(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(cy(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[$nt(y),!1,d-n,!1]}let m="["+(u?"^":"")+qde(r)+"]",h="["+(u?"":"^")+qde(i)+"]";return[r.length&&i.length?"("+m+"|"+h+")":r.length?m:h,l,d-n,!0]},"parseClass");var uu=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var $s,Ont=new Set(["!","?","+","*","@"]),YD=o(e=>Ont.has(e),"isExtglobType"),Bde=o(e=>YD(e.type),"isExtglobAST"),Nnt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Pnt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Dnt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Wde=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Mnt="(?!(?:^|/)\\.\\.?(?:$|/))",SE="(?!\\.)",Lnt=new Set(["[","."]),jnt=new Set(["..","."]),Fnt=new Set("().*{}+?[]^$\\!"),Unt=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),eM="[^/]",Hde=eM+"*?",Vde=eM+"+?",qnt=0,sp=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#d=!1;#l;#a;#c=!1;id=++qnt;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?r:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#d&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof $s&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let r=t.#t[n];if(!(r instanceof $s&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new $s(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let a=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=r,v="";for(;y<t.length;){let x=t.charAt(y++);if(l||x==="\\"){l=!l,v+=x;continue}if(c){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(c=!1),v+=x;continue}else if(x==="["){c=!0,u=y,d=!1,v+=x;continue}if(!i.noext&&YD(x)&&t.charAt(y)==="("&&s<=a){n.push(v),v="";let w=new $s(x,n);y=$s.#m(t,w,y,i,s+1),n.push(w);continue}v+=x}return n.push(v),y}let p=r+1,m=new $s(null,n),h=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&YD(y)&&t.charAt(p)==="("&&(s<=a||n&&n.#y(y))){let x=n&&n.#y(y)?0:1;m.push(g),g="";let b=new $s(y,m);m.push(b),p=$s.#m(t,b,p,i,s+x);continue}if(y==="|"){m.push(g),g="",h.push(m),m=new $s(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),m.push(g),g="",n.push(...h,m),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#N(t){return this.#g(t,Pnt)}#g(t,n=Nnt){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=Dnt){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new $s(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#a=void 0}#A(t){return!!Wde.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#A(n.type)}#v(t){let n=Wde.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let r=new $s(null,void 0,n);return $s.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,l),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!Bde(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,v,x]=typeof h=="string"?$s.#T(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&jnt.has(this.#t[0]))){let g=Lnt,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!n&&!t&&g.has(u.charAt(0));d=y?Mnt:v?SE:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,uu(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#x(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,uu(this.toString()),!1,!1]}let a=!r||t||n||!SE?"":this.#x(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!n?SE:"")+Vde;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?SE:"")+Hde+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;l=i+s+c}return[l,uu(s),this.#n=!!this.#n,this.#r]}#f(){if(Bde(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#N(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#v(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#a=void 0}#x(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#T(t,n,r=!1){let i=!1,s="",a=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(Fnt.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=r&&/^[*]+$/.test(t)?Vde:Hde,n=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,m,h]=zde(t,c);if(m){s+=d,a=a||p,c+=m-1,n=n||h;continue}}if(u==="?"){s+=eM,n=!0;continue}s+=Unt(u)}return[s,uu(t),!!n,a]}};$s=sp;var tM=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var gi=o((e,t,n={})=>(ly(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Hh(t,n).match(e)),"minimatch"),znt=/^\*+([^+@!?*[(]*)$/,Bnt=o(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),Wnt=o(e=>t=>t.endsWith(e),"starDotExtTestDot"),Hnt=o(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Vnt=o(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),Gnt=/^\*+\.\*+$/,Znt=o(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Knt=o(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Jnt=/^\.\*+$/,Xnt=o(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Qnt=/^\*+$/,Ynt=o(e=>e.length!==0&&!e.startsWith("."),"starTest"),ert=o(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),trt=/^\?+([^+@!?*[(]*)?$/,nrt=o(([e,t=""])=>{let n=Kde([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),rrt=o(([e,t=""])=>{let n=Jde([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),irt=o(([e,t=""])=>{let n=Jde([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),srt=o(([e,t=""])=>{let n=Kde([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),Kde=o(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),Jde=o(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),Xde=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Gde={win32:{sep:"\\"},posix:{sep:"/"}},art=Xde==="win32"?Gde.win32.sep:Gde.posix.sep;gi.sep=art;var Xi=Symbol("globstar **");gi.GLOBSTAR=Xi;var ort="[^/]",lrt=ort+"*?",crt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",urt="(?:(?!(?:\\/|^)\\.).)*?",drt=o((e,t={})=>n=>gi(n,e,t),"filter");gi.filter=drt;var ya=o((e,t={})=>Object.assign({},e,t),"ext"),prt=o(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return gi;let t=gi;return Object.assign(o((r,i,s={})=>t(r,i,ya(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,ya(e,s))}static defaults(i){return t.defaults(ya(e,i)).Minimatch}},AST:class extends t.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,ya(e,a))}static fromGlob(i,s={}){return t.AST.fromGlob(i,ya(e,s))}},unescape:o((r,i={})=>t.unescape(r,ya(e,i)),"unescape"),escape:o((r,i={})=>t.escape(r,ya(e,i)),"escape"),filter:o((r,i={})=>t.filter(r,ya(e,i)),"filter"),defaults:o(r=>t.defaults(ya(e,r)),"defaults"),makeRe:o((r,i={})=>t.makeRe(r,ya(e,i)),"makeRe"),braceExpand:o((r,i={})=>t.braceExpand(r,ya(e,i)),"braceExpand"),match:o((r,i,s={})=>t.match(r,i,ya(e,s)),"match"),sep:t.sep,GLOBSTAR:Xi})},"defaults");gi.defaults=prt;var Qde=o((e,t={})=>(ly(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ude(e,{max:t.braceExpandMax})),"braceExpand");gi.braceExpand=Qde;var frt=o((e,t={})=>new Hh(e,t).makeRe(),"makeRe");gi.makeRe=frt;var hrt=o((e,t,n={})=>{let r=new Hh(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");gi.match=hrt;var Zde=/[?*]|[+@!]\(.*?\)|\[|\]/,mrt=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Hh=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){ly(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||Xde,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!Zde.test(s[2]))&&!Zde.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let l=r[i+1],c=r[i+2],u=r[i+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let l=r[a];a===1&&l===""&&r[0]===""||(l==="."||l==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,a=[],l="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])a.push(l==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])a.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])a.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(l==="b")return!1;l="a",a.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="b",a.push(n[s]),i++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),p=c?3:l?0:void 0,m=d?3:u?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[h,g]=[t[p],n[m]];h.toLowerCase()===g.toLowerCase()&&(n[m]=h,s=m,i=p)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Xi)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let a=n.indexOf(Xi,s),l=n.lastIndexOf(Xi),[c,u,d]=r?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,l),n.slice(l+1)];if(c.length){let b=t.slice(i,i+c.length);if(!this.#r(b,c,r,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let b=t.length-d.length;if(this.#r(t,d,r,b,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(b--,!this.#r(t,d,r,b,0)))return!1;p=d.length+1}}if(!u.length){let b=!!p;for(let w=i;w<t.length-p;w++){let E=String(t[w]);if(b=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||b}let m=[[[],0]],h=m[0],g=0,y=[0];for(let b of u)b===Xi?(y.push(g),h=[[],0],m.push(h)):(h[0].push(b),g++);let v=m.length-1,x=t.length-p;for(let b of m)b[1]=x-(y[v--]+b[0].length);return!!this.#n(t,m,i,0,r,0,!!p)}#n(t,n,r,i,s,a,l){let c=n[i];if(!c){for(let p=r;p<t.length;p++){l=!0;let m=t[p];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1}return l}let[u,d]=c;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,r+u.length,i+1,s,a+1,l);if(h!==!1)return h}let m=t[r];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let a,l,c,u;for(a=i,l=s,u=t.length,c=n.length;a<u&&l<c;a++,l++){this.debug("matchOne loop");let d=n[l],p=t[a];if(this.debug(n,d,p),d===!1||d===Xi)return!1;let m;if(typeof d=="string"?(m=p===d,this.debug("string match",d,p,m)):(m=d.test(p),this.debug("pattern match",d,p,m)),!m)return!1}if(a===u&&l===c)return!0;if(a===u)return r;if(l===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return Qde(this.pattern,this.options)}parse(t){ly(t);let n=this.options;if(t==="**")return Xi;if(t==="")return"";let r,i=null;(r=t.match(Qnt))?i=n.dot?ert:Ynt:(r=t.match(znt))?i=(n.nocase?n.dot?Vnt:Hnt:n.dot?Wnt:Bnt)(r[1]):(r=t.match(trt))?i=(n.nocase?n.dot?rrt:nrt:n.dot?irt:srt)(r):(r=t.match(Gnt))?i=n.dot?Knt:Znt:(r=t.match(Jnt))&&(i=Xnt);let s=sp.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?lrt:n.dot?crt:urt,i=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let m of p.flags.split(""))i.add(m);return typeof p=="string"?mrt(p):p===Xi?Xi:p._src});u.forEach((p,m)=>{let h=u[m+1],g=u[m-1];p!==Xi||g===Xi||(g===void 0?h!==void 0&&h!==Xi?u[m+1]="(?:\\/|"+r+"\\/)?"+h:u[m]=r:h===void 0?u[m-1]=g+"(?:\\/|\\/"+r+")?":h!==Xi&&(u[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+h,u[m+1]=Xi))});let d=u.filter(p=>p!==Xi);if(this.partial&&d.length>=1){let p=[];for(let m=1;m<=d.length;m++)p.push(d.slice(0,m).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[a,l]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+l+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let l=i.length-2;!a&&l>=0;l--)a=i[l];for(let l of s){let c=i;if(r.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return gi.defaults(t).Minimatch}};gi.AST=sp;gi.Minimatch=Hh;gi.escape=tM;gi.unescape=uu;import{gunzipSync as Fst}from"node:zlib";var uy=class{static{o(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),a=this.castInput(n,r),l=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(l,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;let a=o(b=>{if(b=this.postProcess(b,r),i){setTimeout(function(){i(b)},0);return}else return b},"done"),l=n.length,c=t.length,u=1,d=l+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,m=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&g+1>=l)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,v=1/0,x=o(()=>{for(let b=Math.max(y,-u);b<=Math.min(v,u);b+=2){let w,E=h[b-1],S=h[b+1];E&&(h[b-1]=void 0);let k=!1;if(S){let D=S.oldPos-b;k=S&&0<=D&&D<l}let T=E&&E.oldPos+1<c;if(!k&&!T){h[b]=void 0;continue}if(!T||k&&E.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,r):w=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(w,n,t,b,r),w.oldPos+1>=c&&g+1>=l)return a(this.buildValues(w.lastComponent,n,t))||!0;h[b]=w,w.oldPos+1>=c&&(v=Math.min(v,b-1)),g+1>=l&&(y=Math.max(y,b+1))}u++},"execEditLength");if(i)o(function b(){setTimeout(function(){if(u>d||Date.now()>m)return i(void 0);x()||b()},0)},"exec")();else for(;u<=d&&Date.now()<=m;){let b=x();if(b)return b}}addToPath(t,n,r,i,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,i,s){let a=n.length,l=r.length,c=t.oldPos,u=c-i,d=0;for(;u+1<a&&c+1<l&&this.equals(r[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let a=i.length,l=0,c=0,u=0;for(;l<a;l++){let d=i[l];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(c,c+d.count);p=p.map(function(m,h){let g=r[u+h];return g.length>m.length?g:m}),d.value=this.join(p)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var nM=class extends uy{static{o(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=yrt}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
4337
4337
|
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
4338
4338
|
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
4339
4339
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|