@ripla/godd-mcp 1.0.8-canary.50 → 1.0.8-canary.52
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/dist/godd.cjs +125 -124
- package/dist/godd.js +15 -2
- package/dist/index.js +49 -48
- package/package.json +1 -1
package/dist/godd.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const __goddBundleUrl = require("node:url").pathToFileURL(__filename).href;
|
|
2
|
-
"use strict";var JA=Object.create;var Dp=Object.defineProperty;var YA=Object.getOwnPropertyDescriptor;var QA=Object.getOwnPropertyNames;var XA=Object.getPrototypeOf,eR=Object.prototype.hasOwnProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),
|
|
2
|
+
"use strict";var JA=Object.create;var Dp=Object.defineProperty;var YA=Object.getOwnPropertyDescriptor;var QA=Object.getOwnPropertyNames;var XA=Object.getPrototypeOf,eR=Object.prototype.hasOwnProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rr=(e,t)=>{for(var r in t)Dp(e,r,{get:t[r],enumerable:!0})},tR=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of QA(t))!eR.call(e,o)&&o!==r&&Dp(e,o,{get:()=>t[o],enumerable:!(n=YA(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?JA(XA(e)):{},tR(t||!e||!e.__esModule?Dp(r,"default",{value:e,enumerable:!0}):r,e));function Nr(){return"1.0.8-canary.52"}function nr(e){let t=Op.exec(e);if(!(!t||t[0]!==e)&&!t[4]?.split(".").some(r=>/^\d+$/.test(r)&&r.length>1&&r.startsWith("0")))return{version:e,channel:t[4]?.split(".")[0]??"latest"}}function g_(e,t){if(!nr(e)||!nr(t))throw new Error("Invalid release version");let r=Op.exec(e),n=Op.exec(t);for(let s of[1,2,3]){let a=BigInt(r[s])-BigInt(n[s]);if(a!==0n)return a<0n?-1:1}if(!r[4]||!n[4])return r[4]===n[4]?0:r[4]?-1:1;let o=r[4].split("."),i=n[4].split(".");for(let s=0;s<Math.min(o.length,i.length);s++){if(o[s]===i[s])continue;let a=/^\d+$/.test(o[s]),c=/^\d+$/.test(i[s]);return a&&c?BigInt(o[s])<BigInt(i[s])?-1:1:a!==c?a?-1:1:o[s]<i[s]?-1:1}return Math.sign(o.length-i.length)}var h_,ls,m_,Op,ri=b(()=>{"use strict";h_=require("node:fs"),ls=require("node:path"),m_=require("node:url");Op=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/});function uc(e){try{return(0,Ve.realpathSync)(e).replaceAll("\\","/")}catch{return e.replaceAll("\\","/")}}function nR(e=process.argv[1]??"",t="pkg"in process,r={}){if(t)return"binary";let n=uc(e),o=r.platform??process.platform,i=r.env??process.env,s=p=>o==="win32"?p.toLowerCase().replaceAll("\\","/").replace(/\/+$/,""):p.replace(/\/+$/,"");if(!n.toLowerCase().includes("/node_modules/@ripla/godd-mcp/"))return"source";if(/\/pnpm(?:-cache)?\/dlx\//i.test(n))return"pnpm-dlx";if(/(?:^|\/)bunx-[^/]+\//i.test(n))return"bunx";if(/\/pnpm\/global\//i.test(n)||i.PNPM_HOME&&s(n).startsWith(s(uc(i.PNPM_HOME))+"/global/"))return"pnpm-global";if(/\/yarn\/(?:data\/)?global\//i.test(n))return"yarn-global";if(n.includes("/_npx/"))return"npx";let a=n.indexOf("/node_modules/");if(a<0)return"source";let c=n.slice(0,a),u=i.npm_config_prefix??i.NPM_CONFIG_PREFIX??(o==="win32"?i.APPDATA?i.APPDATA+"/npm":"":(0,st.dirname)((0,st.dirname)(r.execPath??process.execPath)));if(u&&s(c)===s(uc(u)+(o==="win32"?"":"/lib")))return"npm-global";try{let p=JSON.parse((0,Ve.readFileSync)((0,st.join)(c,"package.json"),"utf8")),l=p&&typeof p=="object"?p:{};if([l.dependencies,l.devDependencies].some(d=>d&&typeof d=="object"&&ps in d)){let d=[];return(0,Ve.existsSync)((0,st.join)(c,"pnpm-lock.yaml"))&&d.push("pnpm-project"),(0,Ve.existsSync)((0,st.join)(c,"yarn.lock"))&&d.push("yarn-project"),((0,Ve.existsSync)((0,st.join)(c,"package-lock.json"))||(0,Ve.existsSync)((0,st.join)(c,"npm-shrinkwrap.json")))&&d.push("npm-project"),d.length===1?d[0]:"unknown"}}catch{}return"unknown"}function y_(e,t,r=process.platform,n){if(!/^[a-z][a-z0-9-]*$/.test(t))throw new Error("Invalid release channel");let o=`${ps}@${t}`,i=n?"'"+n.replace(/'/g,r==="win32"?"''":"'\\''")+"'":void 0;switch(e){case"npm-global":return`npm install --global ${o}`;case"npm-project":return`npm ${i?`--prefix ${i} `:""}install ${o}`;case"pnpm-global":return`pnpm add --global ${o}`;case"pnpm-project":return`pnpm ${i?`--dir ${i} `:""}add ${o}`;case"yarn-project":return`yarn ${i?`--cwd ${i} `:""}add ${o}`;case"yarn-global":return`yarn global add ${o}`;case"npx":return`npx --yes ${o} version`;case"pnpm-dlx":return`pnpm dlx ${o} version`;case"bunx":return`bunx ${o} version`;case"binary":return r==="win32"?".\\godd.exe install":"./godd install";case"source":return"\u30BD\u30FC\u30B9\u3092\u53D6\u5F97\u3057\u305F\u65B9\u6CD5\u3067\u540C\u3058\u7CFB\u5217\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002";case"unknown":return"\u5C0E\u5165\u65B9\u6CD5\u3068\u5C0E\u5165\u5148\u3092\u78BA\u8A8D\u3057\u3001\u540C\u3058\u7CFB\u5217\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u66F4\u65B0\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}async function __(e){let t=await e(`https://registry.npmjs.org/-/package/${ps}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(!t.ok)throw new Error("Package registry unavailable");return t.json()}function oR(e){return e.split(";").map(t=>t.trim().replace(/^"(.*)"$/,"$1")).filter(t=>st.win32.isAbsolute(t)&&(/^[A-Za-z]:[\\/]/.test(t)||/^\\\\[^\\]/.test(t)))}async function iR(e){let t="npm",r=[];if(process.platform==="win32"){let n=oR(process.env.PATH??""),o="pkg"in process?n.map(s=>(0,st.join)(s,"node.exe")).find(Ve.existsSync):process.execPath,i=[...o?[(0,st.dirname)(o)]:[],...n].map(s=>(0,st.join)(s,"node_modules","npm","bin","npm-cli.js")).find(Ve.existsSync);if(!o||!i)return __(e);t=o,r=[i]}try{let{stdout:n}=await(0,x_.promisify)(b_.execFile)(t,[...r,"view",ps,"dist-tags","--json"],{timeout:5e3,maxBuffer:65536,windowsHide:!0});return JSON.parse(n)}catch(n){if(!(n&&typeof n=="object"&&"code"in n&&n.code==="ENOENT"))throw n;return __(e)}}function lc(e={}){let t=e.version??Nr(),r=nr(t),n=uc(e.entry??process.argv[1]??""),o=e.kind??nR(n),i=e.projectRoot??(o.endsWith("-project")?n.split("/node_modules/")[0]:void 0),s=e.platform??process.platform,a=e.arch??process.arch,c=e.directory??(0,st.join)((0,w_.homedir)(),".cache","godd","updates"),u=e.now??Date.now,p=e.fetcher??fetch,l,d,f=(0,v_.createHash)("sha256").update(`${t}/${o}/${s}/${a}/${i??""}`).digest("hex"),h=(0,st.join)(c,f+".json");async function g(){if(!r||t==="0.0.0"||o==="source")return"";let y=u();if(!l)try{let x=JSON.parse((0,Ve.readFileSync)(h,"utf8"));x&&typeof x=="object"&&"checked"in x&&typeof x.checked=="number"&&Number.isFinite(x.checked)&&"notice"in x&&typeof x.notice=="string"&&x.notice.length<2e3&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(x.notice)&&(l={checked:x.checked,notice:x.notice})}catch{}if(l&&l.checked<=y&&y-l.checked<rR)return l.notice;let v="";try{let x=e.fetcher?await p(`https://registry.npmjs.org/-/package/${ps}/dist-tags`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}}):void 0;if(x&&!x.ok)throw new Error("Package registry unavailable");let k=x?await x.json():await iR(p);if(!k||typeof k!="object")throw new Error("Invalid package tags");let P=k[r.channel];if(P!==void 0&&(typeof P!="string"||nr(P)?.channel!==r.channel))throw new Error("The published tag points at another release series");if(typeof P=="string"&&g_(P,t)>0)if(v=`GoDD\u306E\u66F4\u65B0: ${t} \u2192 ${P}\uFF08${r.channel}\uFF09
|
|
3
3
|
`,o==="binary"){let L=`godd-mcp-server-${s==="win32"?"win":s==="darwin"?"macos":"linux"}-${a}.zip`,Ue=await p(`https://api.github.com/repos/ripla-inc/GoDD/releases/tags/v${P}`,{signal:AbortSignal.timeout(5e3),headers:{Accept:"application/vnd.github+json"}}),we=Ue.ok?await Ue.json():void 0,qe=(we&&typeof we=="object"&&"assets"in we&&Array.isArray(we.assets)?we.assets:[]).find(Be=>Be&&typeof Be=="object"&&"name"in Be&&Be.name===L);qe&&typeof qe=="object"&&"browser_download_url"in qe&&typeof qe.browser_download_url=="string"&&qe.browser_download_url.startsWith(`https://github.com/ripla-inc/GoDD/releases/download/v${P}/`)?v+=`\u53D6\u5F97: ${qe.browser_download_url}
|
|
4
|
-
\u5C55\u958B\u3057\u305F\u30D5\u30A9\u30EB\u30C0\u30FC\u3067\u66F4\u65B0: ${y_(o,r.channel,s)}`:v+="\u540C\u3058\u7248\u30FB\u7CFB\u5217\u306E\u30D0\u30A4\u30CA\u30EA\u914D\u5E03\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3002\u73FE\u5728\u306E\u7248\u3092\u4FDD\u3061\u3001\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}else v+=`\u66F4\u65B0${s==="win32"&&i?"\uFF08PowerShell\uFF09":""}: ${y_(o,r.channel,s,i)}`}catch{v="GoDD\u306E\u66F4\u65B0\u78BA\u8A8D\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u901A\u4FE1\u3068\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3001\u5F8C\u3067\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u73FE\u5728\u306E\u51E6\u7406\u306F\u7D99\u7D9A\u3057\u307E\u3059\u3002"}l={checked:y,notice:v};let w;try{(0,Ve.mkdirSync)((0,st.dirname)(h),{recursive:!0}),w=h+`.${process.pid}.tmp`,(0,Ve.writeFileSync)(w,JSON.stringify(l),{mode:384}),(0,Ve.renameSync)(w,h)}catch{if(w)try{(0,Ve.unlinkSync)(w)}catch{}}return v}return()=>(d??=g().finally(()=>{d=void 0}),d)}var v_,Ve,st,w_,b_,x_,ps,rR,Np=b(()=>{"use strict";v_=require("node:crypto"),Ve=require("node:fs"),st=require("node:path"),w_=require("node:os"),b_=require("node:child_process"),x_=require("node:util");ri();ps="@ripla/godd-mcp",rR=3600*1e3});function S(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(let p in s.prototype)p in a||Object.defineProperty(a,p,{value:s.prototype[p].bind(a)});a._zod.constr=s,a._zod.def=c}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Mt(e){return e&&Object.assign(pc,e),pc}var dc,k_,rn,pc,ni=b(()=>{dc=Object.freeze({status:"aborted"});k_=Symbol("zod_brand"),rn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},pc={}});var pe={};tr(pe,{BIGINT_FORMAT_RANGES:()=>$_,Class:()=>Mp,NUMBER_FORMAT_RANGES:()=>Bp,aborted:()=>lo,allowsEval:()=>qp,assert:()=>lR,assertEqual:()=>sR,assertIs:()=>cR,assertNever:()=>uR,assertNotEqual:()=>aR,assignProp:()=>Up,cached:()=>hs,captureStackTrace:()=>hc,cleanEnum:()=>kR,cleanRegex:()=>gs,clone:()=>nr,createTransparentProxy:()=>gR,defineLazy:()=>Se,esc:()=>uo,escapeRegex:()=>Cn,extend:()=>vR,finalizeIssue:()=>vr,floatSafeRemainder:()=>Zp,getElementAtPath:()=>pR,getEnumValues:()=>fs,getLengthableOrigin:()=>ys,getParsedType:()=>mR,getSizableOrigin:()=>P_,isObject:()=>oi,isPlainObject:()=>ii,issue:()=>Vp,joinValues:()=>fc,jsonStringifyReplacer:()=>Lp,merge:()=>wR,normalizeParams:()=>j,nullish:()=>ms,numKeys:()=>hR,omit:()=>_R,optionalKeys:()=>Gp,partial:()=>bR,pick:()=>yR,prefixIssues:()=>jr,primitiveTypes:()=>S_,promiseAllObject:()=>dR,propertyKeyTypes:()=>Fp,randomString:()=>fR,required:()=>xR,stringifyPrimitive:()=>mc,unwrapMessage:()=>ds});function sR(e){return e}function aR(e){return e}function cR(e){}function uR(e){throw new Error}function lR(e){}function fs(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function fc(e,t="|"){return e.map(r=>mc(r)).join(t)}function Lp(e,t){return typeof t=="bigint"?t.toString():t}function hs(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ms(e){return e==null}function gs(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Zp(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Se(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Up(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function pR(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function dR(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function fR(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function uo(e){return JSON.stringify(e)}function oi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ii(e){if(oi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(oi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function hR(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Cn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function j(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gR(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function mc(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Gp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function yR(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return nr(e,{...e._zod.def,shape:r,checks:[]})}function _R(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return nr(e,{...e._zod.def,shape:r,checks:[]})}function vR(e,t){if(!ii(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Up(this,"shape",n),n},checks:[]};return nr(e,r)}function wR(e,t){return nr(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Up(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function bR(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=e?new e({type:"optional",innerType:n[i]}):n[i])}else for(let i in n)o[i]=e?new e({type:"optional",innerType:n[i]}):n[i];return nr(t,{...t._zod.def,shape:o,checks:[]})}function xR(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)o[i]=new e({type:"nonoptional",innerType:n[i]});return nr(t,{...t._zod.def,shape:o,checks:[]})}function lo(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function jr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ds(e){return typeof e=="string"?e:e?.message}function vr(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=ds(e.inst?._zod.def?.error?.(e))??ds(t?.error?.(e))??ds(r.customError?.(e))??ds(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function P_(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ys(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Vp(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function kR(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var hc,qp,mR,Fp,S_,Bp,$_,Mp,Mr=b(()=>{hc=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};qp=hs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});mR=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Fp=new Set(["string","number","symbol"]),S_=new Set(["string","number","bigint","boolean","symbol","undefined"]);Bp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Mp=class{constructor(...t){}}});function yc(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function _c(e,t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}var E_,gc,Hp,Wp=b(()=>{ni();Mr();E_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Lp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gc=S("$ZodError",E_),Hp=S("$ZodError",E_,{Parent:Error})});var C_,T_,Kp,_s,Jp,vc,Yp=b(()=>{ni();Wp();Mr();C_=e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new rn;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>vr(c,i,Mt())));throw hc(a,o?.callee),a}return s.value},T_=e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>vr(c,i,Mt())));throw hc(a,o?.callee),a}return s.value},Kp=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new rn;return i.issues.length?{success:!1,error:new(e??gc)(i.issues.map(s=>vr(s,o,Mt())))}:{success:!0,data:i.value}},_s=Kp(Hp),Jp=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>vr(s,o,Mt())))}:{success:!0,data:i.value}},vc=Jp(Hp)});function L_(){return new RegExp($R,"u")}function K_(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function J_(e){return new RegExp(`^${K_(e)}$`)}function Y_(e){let t=K_({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${H_}T(?:${n})$`)}var A_,R_,I_,z_,D_,O_,N_,j_,Qp,M_,$R,Z_,U_,q_,F_,G_,Xp,B_,V_,H_,W_,Q_,X_,ev,tv,rv,nv,ov,iv,wc=b(()=>{A_=/^[cC][^\s-]{8,}$/,R_=/^[0-9a-z]+$/,I_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,z_=/^[0-9a-vA-V]{20}$/,D_=/^[A-Za-z0-9]{27}$/,O_=/^[a-zA-Z0-9_-]{21}$/,N_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,M_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$R="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Z_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,U_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,q_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,F_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,G_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xp=/^[A-Za-z0-9_-]*$/,B_=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,V_=/^\+(?:[0-9]){6,14}[0-9]$/,H_="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",W_=new RegExp(`^${H_}$`);Q_=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},X_=/^\d+n?$/,ev=/^\d+$/,tv=/^-?\d+(?:\.\d+)?/i,rv=/true|false/i,nv=/null/i,ov=/^[^A-Z]*$/,iv=/^[^a-z]*$/});var _t,sv,ed,td,av,cv,uv,lv,pv,ws,dv,fv,hv,mv,gv,yv,_v,bc=b(()=>{ni();wc();Mr();_t=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),sv={number:"number",bigint:"bigint",object:"date"},ed=S("$ZodCheckLessThan",(e,t)=>{_t.init(e,t);let r=sv[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),td=S("$ZodCheckGreaterThan",(e,t)=>{_t.init(e,t);let r=sv[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),av=S("$ZodCheckMultipleOf",(e,t)=>{_t.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Zp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),cv=S("$ZodCheckNumberFormat",(e,t)=>{_t.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Bp[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,r&&(a.pattern=ev)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),uv=S("$ZodCheckMaxLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let s=ys(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lv=S("$ZodCheckMinLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=ys(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pv=S("$ZodCheckLengthEquals",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,i=o.length;if(i===t.length)return;let s=ys(o),a=i>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ws=S("$ZodCheckStringFormat",(e,t)=>{var r,n;_t.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),dv=S("$ZodCheckRegex",(e,t)=>{ws.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fv=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ov),ws.init(e,t)}),hv=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=iv),ws.init(e,t)}),mv=S("$ZodCheckIncludes",(e,t)=>{_t.init(e,t);let r=Cn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),gv=S("$ZodCheckStartsWith",(e,t)=>{_t.init(e,t);let r=new RegExp(`^${Cn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yv=S("$ZodCheckEndsWith",(e,t)=>{_t.init(e,t);let r=new RegExp(`.*${Cn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_v=S("$ZodCheckOverwrite",(e,t)=>{_t.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var xc,rd=b(()=>{xc=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
4
|
+
\u5C55\u958B\u3057\u305F\u30D5\u30A9\u30EB\u30C0\u30FC\u3067\u66F4\u65B0: ${y_(o,r.channel,s)}`:v+="\u540C\u3058\u7248\u30FB\u7CFB\u5217\u306E\u30D0\u30A4\u30CA\u30EA\u914D\u5E03\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093\u3002\u73FE\u5728\u306E\u7248\u3092\u4FDD\u3061\u3001\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}else v+=`\u66F4\u65B0${s==="win32"&&i?"\uFF08PowerShell\uFF09":""}: ${y_(o,r.channel,s,i)}`}catch{v="GoDD\u306E\u66F4\u65B0\u78BA\u8A8D\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u901A\u4FE1\u3068\u914D\u5E03\u5143\u3092\u78BA\u8A8D\u3057\u3001\u5F8C\u3067\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u73FE\u5728\u306E\u51E6\u7406\u306F\u7D99\u7D9A\u3057\u307E\u3059\u3002"}l={checked:y,notice:v};let w;try{(0,Ve.mkdirSync)((0,st.dirname)(h),{recursive:!0}),w=h+`.${process.pid}.tmp`,(0,Ve.writeFileSync)(w,JSON.stringify(l),{mode:384}),(0,Ve.renameSync)(w,h)}catch{if(w)try{(0,Ve.unlinkSync)(w)}catch{}}return v}return()=>(d??=g().finally(()=>{d=void 0}),d)}var v_,Ve,st,w_,b_,x_,ps,rR,Np=b(()=>{"use strict";v_=require("node:crypto"),Ve=require("node:fs"),st=require("node:path"),w_=require("node:os"),b_=require("node:child_process"),x_=require("node:util");ri();ps="@ripla/godd-mcp",rR=3600*1e3});function S(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(let p in s.prototype)p in a||Object.defineProperty(a,p,{value:s.prototype[p].bind(a)});a._zod.constr=s,a._zod.def=c}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Mt(e){return e&&Object.assign(pc,e),pc}var dc,k_,nn,pc,ni=b(()=>{dc=Object.freeze({status:"aborted"});k_=Symbol("zod_brand"),nn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},pc={}});var pe={};rr(pe,{BIGINT_FORMAT_RANGES:()=>$_,Class:()=>Mp,NUMBER_FORMAT_RANGES:()=>Bp,aborted:()=>lo,allowsEval:()=>qp,assert:()=>lR,assertEqual:()=>sR,assertIs:()=>cR,assertNever:()=>uR,assertNotEqual:()=>aR,assignProp:()=>Up,cached:()=>hs,captureStackTrace:()=>hc,cleanEnum:()=>kR,cleanRegex:()=>gs,clone:()=>or,createTransparentProxy:()=>gR,defineLazy:()=>Se,esc:()=>uo,escapeRegex:()=>Tn,extend:()=>vR,finalizeIssue:()=>vr,floatSafeRemainder:()=>Zp,getElementAtPath:()=>pR,getEnumValues:()=>fs,getLengthableOrigin:()=>ys,getParsedType:()=>mR,getSizableOrigin:()=>P_,isObject:()=>oi,isPlainObject:()=>ii,issue:()=>Vp,joinValues:()=>fc,jsonStringifyReplacer:()=>Lp,merge:()=>wR,normalizeParams:()=>j,nullish:()=>ms,numKeys:()=>hR,omit:()=>_R,optionalKeys:()=>Gp,partial:()=>bR,pick:()=>yR,prefixIssues:()=>jr,primitiveTypes:()=>S_,promiseAllObject:()=>dR,propertyKeyTypes:()=>Fp,randomString:()=>fR,required:()=>xR,stringifyPrimitive:()=>mc,unwrapMessage:()=>ds});function sR(e){return e}function aR(e){return e}function cR(e){}function uR(e){throw new Error}function lR(e){}function fs(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function fc(e,t="|"){return e.map(r=>mc(r)).join(t)}function Lp(e,t){return typeof t=="bigint"?t.toString():t}function hs(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ms(e){return e==null}function gs(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Zp(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Se(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Up(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function pR(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function dR(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function fR(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function uo(e){return JSON.stringify(e)}function oi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ii(e){if(oi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(oi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function hR(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Tn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function or(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function j(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gR(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function mc(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Gp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function yR(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return or(e,{...e._zod.def,shape:r,checks:[]})}function _R(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return or(e,{...e._zod.def,shape:r,checks:[]})}function vR(e,t){if(!ii(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Up(this,"shape",n),n},checks:[]};return or(e,r)}function wR(e,t){return or(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Up(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function bR(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=e?new e({type:"optional",innerType:n[i]}):n[i])}else for(let i in n)o[i]=e?new e({type:"optional",innerType:n[i]}):n[i];return or(t,{...t._zod.def,shape:o,checks:[]})}function xR(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)o[i]=new e({type:"nonoptional",innerType:n[i]});return or(t,{...t._zod.def,shape:o,checks:[]})}function lo(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function jr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ds(e){return typeof e=="string"?e:e?.message}function vr(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=ds(e.inst?._zod.def?.error?.(e))??ds(t?.error?.(e))??ds(r.customError?.(e))??ds(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function P_(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ys(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Vp(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function kR(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var hc,qp,mR,Fp,S_,Bp,$_,Mp,Mr=b(()=>{hc=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};qp=hs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});mR=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Fp=new Set(["string","number","symbol"]),S_=new Set(["string","number","bigint","boolean","symbol","undefined"]);Bp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Mp=class{constructor(...t){}}});function yc(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function _c(e,t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}var E_,gc,Hp,Wp=b(()=>{ni();Mr();E_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Lp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gc=S("$ZodError",E_),Hp=S("$ZodError",E_,{Parent:Error})});var C_,T_,Kp,_s,Jp,vc,Yp=b(()=>{ni();Wp();Mr();C_=e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new nn;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>vr(c,i,Mt())));throw hc(a,o?.callee),a}return s.value},T_=e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>vr(c,i,Mt())));throw hc(a,o?.callee),a}return s.value},Kp=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new nn;return i.issues.length?{success:!1,error:new(e??gc)(i.issues.map(s=>vr(s,o,Mt())))}:{success:!0,data:i.value}},_s=Kp(Hp),Jp=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>vr(s,o,Mt())))}:{success:!0,data:i.value}},vc=Jp(Hp)});function L_(){return new RegExp($R,"u")}function K_(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function J_(e){return new RegExp(`^${K_(e)}$`)}function Y_(e){let t=K_({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${H_}T(?:${n})$`)}var A_,R_,I_,z_,D_,O_,N_,j_,Qp,M_,$R,Z_,U_,q_,F_,G_,Xp,B_,V_,H_,W_,Q_,X_,ev,tv,rv,nv,ov,iv,wc=b(()=>{A_=/^[cC][^\s-]{8,}$/,R_=/^[0-9a-z]+$/,I_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,z_=/^[0-9a-vA-V]{20}$/,D_=/^[A-Za-z0-9]{27}$/,O_=/^[a-zA-Z0-9_-]{21}$/,N_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,M_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$R="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Z_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,U_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,q_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,F_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,G_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xp=/^[A-Za-z0-9_-]*$/,B_=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,V_=/^\+(?:[0-9]){6,14}[0-9]$/,H_="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",W_=new RegExp(`^${H_}$`);Q_=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},X_=/^\d+n?$/,ev=/^\d+$/,tv=/^-?\d+(?:\.\d+)?/i,rv=/true|false/i,nv=/null/i,ov=/^[^A-Z]*$/,iv=/^[^a-z]*$/});var _t,sv,ed,td,av,cv,uv,lv,pv,ws,dv,fv,hv,mv,gv,yv,_v,bc=b(()=>{ni();wc();Mr();_t=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),sv={number:"number",bigint:"bigint",object:"date"},ed=S("$ZodCheckLessThan",(e,t)=>{_t.init(e,t);let r=sv[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),td=S("$ZodCheckGreaterThan",(e,t)=>{_t.init(e,t);let r=sv[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),av=S("$ZodCheckMultipleOf",(e,t)=>{_t.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Zp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),cv=S("$ZodCheckNumberFormat",(e,t)=>{_t.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Bp[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,r&&(a.pattern=ev)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),uv=S("$ZodCheckMaxLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let s=ys(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lv=S("$ZodCheckMinLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=ys(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pv=S("$ZodCheckLengthEquals",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ms(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,i=o.length;if(i===t.length)return;let s=ys(o),a=i>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ws=S("$ZodCheckStringFormat",(e,t)=>{var r,n;_t.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),dv=S("$ZodCheckRegex",(e,t)=>{ws.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fv=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ov),ws.init(e,t)}),hv=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=iv),ws.init(e,t)}),mv=S("$ZodCheckIncludes",(e,t)=>{_t.init(e,t);let r=Tn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),gv=S("$ZodCheckStartsWith",(e,t)=>{_t.init(e,t);let r=new RegExp(`^${Tn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yv=S("$ZodCheckEndsWith",(e,t)=>{_t.init(e,t);let r=new RegExp(`.*${Tn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_v=S("$ZodCheckOverwrite",(e,t)=>{_t.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var xc,rd=b(()=>{xc=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
5
5
|
`).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
|
|
6
|
-
`))}}});var wv,nd=b(()=>{wv={major:4,minor:0,patch:0}});function Kv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function PR(e){if(!Xp.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Kv(r)}function ER(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function bv(e,t,r){e.issues.length&&t.issues.push(...jr(r,e.issues)),t.value[r]=e.value}function kc(e,t,r){e.issues.length&&t.issues.push(...jr(r,e.issues)),t.value[r]=e.value}function xv(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...jr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function kv(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>vr(i,n,Mt())))}),t}function od(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ii(e)&&ii(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(let i of n){let s=od(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=od(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Sv(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),lo(e))return e;let n=od(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}function $v(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Pv(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Ev(e,t,r){return lo(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}function Cv(e){return e.value=Object.freeze(e.value),e}function Tv(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Vp(o))}}var he,Sc,Ce,Av,Rv,Iv,zv,Dv,Ov,Nv,jv,Mv,Lv,Zv,Uv,qv,Fv,Gv,Bv,Vv,Hv,Wv,Jv,Yv,Qv,Xv,id,ew,tw,rw,nw,ow,iw,sw,aw,cw,uw,sd,lw,pw,dw,fw,hw,mw,gw,yw,_w,vw,ww,bw,xw,kw,Sw,$w=b(()=>{bc();ni();rd();Yp();wc();Mr();nd();Mr();he=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wv;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(i,s,a)=>{let c=lo(i),u;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(i))continue}else if(c)continue;let l=i.issues.length,d=p._zod.check(i);if(d instanceof Promise&&a?.async===!1)throw new rn;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,i.issues.length!==l&&(c||(c=lo(i,l)))});else{if(i.issues.length===l)continue;c||(c=lo(i,l))}}return u?u.then(()=>i):i};e._zod.run=(i,s)=>{let a=e._zod.parse(i,s);if(a instanceof Promise){if(s.async===!1)throw new rn;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=_s(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return vc(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Sc=S("$ZodString",(e,t)=>{he.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Q_(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ce=S("$ZodStringFormat",(e,t)=>{ws.init(e,t),Sc.init(e,t)}),Av=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=j_),Ce.init(e,t)}),Rv=S("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Qp(n))}else t.pattern??(t.pattern=Qp());Ce.init(e,t)}),Iv=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=M_),Ce.init(e,t)}),zv=S("$ZodURL",(e,t)=>{Ce.init(e,t),e._zod.check=r=>{try{let n=r.value,o=new URL(n),i=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:B_.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&i.endsWith("/")?r.value=i.slice(0,-1):r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Dv=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=L_()),Ce.init(e,t)}),Ov=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=O_),Ce.init(e,t)}),Nv=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=A_),Ce.init(e,t)}),jv=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=R_),Ce.init(e,t)}),Mv=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=I_),Ce.init(e,t)}),Lv=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=z_),Ce.init(e,t)}),Zv=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=D_),Ce.init(e,t)}),Uv=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Y_(t)),Ce.init(e,t)}),qv=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=W_),Ce.init(e,t)}),Fv=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=J_(t)),Ce.init(e,t)}),Gv=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=N_),Ce.init(e,t)}),Bv=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Z_),Ce.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Vv=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=U_),Ce.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Hv=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=q_),Ce.init(e,t)}),Wv=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=F_),Ce.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});Jv=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=G_),Ce.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Kv(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Yv=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xp),Ce.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{PR(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Qv=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=V_),Ce.init(e,t)});Xv=S("$ZodJWT",(e,t)=>{Ce.init(e,t),e._zod.check=r=>{ER(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),id=S("$ZodNumber",(e,t)=>{he.init(e,t),e._zod.pattern=e._zod.bag.pattern??tv,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),ew=S("$ZodNumber",(e,t)=>{cv.init(e,t),id.init(e,t)}),tw=S("$ZodBoolean",(e,t)=>{he.init(e,t),e._zod.pattern=rv,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),rw=S("$ZodBigInt",(e,t)=>{he.init(e,t),e._zod.pattern=X_,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),nw=S("$ZodNull",(e,t)=>{he.init(e,t),e._zod.pattern=nv,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),ow=S("$ZodAny",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),iw=S("$ZodUnknown",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),sw=S("$ZodNever",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),aw=S("$ZodDate",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});cw=S("$ZodArray",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let a=o[s],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?i.push(c.then(u=>bv(u,r,s))):bv(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});uw=S("$ZodObject",(e,t)=>{he.init(e,t);let r=hs(()=>{let l=Object.keys(t.shape);for(let f of l)if(!(t.shape[f]instanceof he))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);let d=Gp(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});Se(e._zod,"propValues",()=>{let l=t.shape,d={};for(let f in l){let h=l[f]._zod;if(h.values){d[f]??(d[f]=new Set);for(let g of h.values)d[f].add(g)}}return d});let n=l=>{let d=new xc(["shape","payload","ctx"]),f=r.value,h=w=>{let x=uo(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};d.write("const input = payload.value;");let g=Object.create(null),y=0;for(let w of f.keys)g[w]=`key_${y++}`;d.write("const newResult = {}");for(let w of f.keys)if(f.optionalKeys.has(w)){let x=g[w];d.write(`const ${x} = ${h(w)};`);let k=uo(w);d.write(`
|
|
6
|
+
`))}}});var wv,nd=b(()=>{wv={major:4,minor:0,patch:0}});function Kv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function PR(e){if(!Xp.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Kv(r)}function ER(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function bv(e,t,r){e.issues.length&&t.issues.push(...jr(r,e.issues)),t.value[r]=e.value}function kc(e,t,r){e.issues.length&&t.issues.push(...jr(r,e.issues)),t.value[r]=e.value}function xv(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...jr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function kv(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>vr(i,n,Mt())))}),t}function od(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ii(e)&&ii(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(let i of n){let s=od(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=od(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Sv(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),lo(e))return e;let n=od(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}function $v(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Pv(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Ev(e,t,r){return lo(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}function Cv(e){return e.value=Object.freeze(e.value),e}function Tv(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Vp(o))}}var he,Sc,Ce,Av,Rv,Iv,zv,Dv,Ov,Nv,jv,Mv,Lv,Zv,Uv,qv,Fv,Gv,Bv,Vv,Hv,Wv,Jv,Yv,Qv,Xv,id,ew,tw,rw,nw,ow,iw,sw,aw,cw,uw,sd,lw,pw,dw,fw,hw,mw,gw,yw,_w,vw,ww,bw,xw,kw,Sw,$w=b(()=>{bc();ni();rd();Yp();wc();Mr();nd();Mr();he=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wv;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(i,s,a)=>{let c=lo(i),u;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(i))continue}else if(c)continue;let l=i.issues.length,d=p._zod.check(i);if(d instanceof Promise&&a?.async===!1)throw new nn;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,i.issues.length!==l&&(c||(c=lo(i,l)))});else{if(i.issues.length===l)continue;c||(c=lo(i,l))}}return u?u.then(()=>i):i};e._zod.run=(i,s)=>{let a=e._zod.parse(i,s);if(a instanceof Promise){if(s.async===!1)throw new nn;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=_s(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return vc(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Sc=S("$ZodString",(e,t)=>{he.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Q_(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ce=S("$ZodStringFormat",(e,t)=>{ws.init(e,t),Sc.init(e,t)}),Av=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=j_),Ce.init(e,t)}),Rv=S("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Qp(n))}else t.pattern??(t.pattern=Qp());Ce.init(e,t)}),Iv=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=M_),Ce.init(e,t)}),zv=S("$ZodURL",(e,t)=>{Ce.init(e,t),e._zod.check=r=>{try{let n=r.value,o=new URL(n),i=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:B_.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&i.endsWith("/")?r.value=i.slice(0,-1):r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Dv=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=L_()),Ce.init(e,t)}),Ov=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=O_),Ce.init(e,t)}),Nv=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=A_),Ce.init(e,t)}),jv=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=R_),Ce.init(e,t)}),Mv=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=I_),Ce.init(e,t)}),Lv=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=z_),Ce.init(e,t)}),Zv=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=D_),Ce.init(e,t)}),Uv=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Y_(t)),Ce.init(e,t)}),qv=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=W_),Ce.init(e,t)}),Fv=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=J_(t)),Ce.init(e,t)}),Gv=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=N_),Ce.init(e,t)}),Bv=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Z_),Ce.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Vv=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=U_),Ce.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Hv=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=q_),Ce.init(e,t)}),Wv=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=F_),Ce.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});Jv=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=G_),Ce.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Kv(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Yv=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xp),Ce.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{PR(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Qv=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=V_),Ce.init(e,t)});Xv=S("$ZodJWT",(e,t)=>{Ce.init(e,t),e._zod.check=r=>{ER(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),id=S("$ZodNumber",(e,t)=>{he.init(e,t),e._zod.pattern=e._zod.bag.pattern??tv,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),ew=S("$ZodNumber",(e,t)=>{cv.init(e,t),id.init(e,t)}),tw=S("$ZodBoolean",(e,t)=>{he.init(e,t),e._zod.pattern=rv,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),rw=S("$ZodBigInt",(e,t)=>{he.init(e,t),e._zod.pattern=X_,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),nw=S("$ZodNull",(e,t)=>{he.init(e,t),e._zod.pattern=nv,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),ow=S("$ZodAny",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),iw=S("$ZodUnknown",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),sw=S("$ZodNever",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),aw=S("$ZodDate",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});cw=S("$ZodArray",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let a=o[s],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?i.push(c.then(u=>bv(u,r,s))):bv(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});uw=S("$ZodObject",(e,t)=>{he.init(e,t);let r=hs(()=>{let l=Object.keys(t.shape);for(let f of l)if(!(t.shape[f]instanceof he))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);let d=Gp(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});Se(e._zod,"propValues",()=>{let l=t.shape,d={};for(let f in l){let h=l[f]._zod;if(h.values){d[f]??(d[f]=new Set);for(let g of h.values)d[f].add(g)}}return d});let n=l=>{let d=new xc(["shape","payload","ctx"]),f=r.value,h=w=>{let x=uo(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};d.write("const input = payload.value;");let g=Object.create(null),y=0;for(let w of f.keys)g[w]=`key_${y++}`;d.write("const newResult = {}");for(let w of f.keys)if(f.optionalKeys.has(w)){let x=g[w];d.write(`const ${x} = ${h(w)};`);let k=uo(w);d.write(`
|
|
7
7
|
if (${x}.issues.length) {
|
|
8
8
|
if (input[${k}] === undefined) {
|
|
9
9
|
if (${k} in input) {
|
|
@@ -26,10 +26,10 @@ const __goddBundleUrl = require("node:url").pathToFileURL(__filename).href;
|
|
|
26
26
|
if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
27
27
|
...iss,
|
|
28
28
|
path: iss.path ? [${uo(w)}, ...iss.path] : [${uo(w)}]
|
|
29
|
-
})));`),d.write(`newResult[${uo(w)}] = ${x}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let v=d.compile();return(w,x)=>v(l,w,x)},o,i=oi,s=!pc.jitless,c=s&&qp.value,u=t.catchall,p;e._zod.parse=(l,d)=>{p??(p=r.value);let f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;let h=[];if(s&&c&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),l=o(l,d);else{l.value={};let x=p.shape;for(let k of p.keys){let P=x[k],q=P._zod.run({value:f[k],issues:[]},d),L=P._zod.optin==="optional"&&P._zod.optout==="optional";q instanceof Promise?h.push(q.then(Ue=>L?xv(Ue,l,k,f):kc(Ue,l,k))):L?xv(q,l,k,f):kc(q,l,k)}}if(!u)return h.length?Promise.all(h).then(()=>l):l;let g=[],y=p.keySet,v=u._zod,w=v.def.type;for(let x of Object.keys(f)){if(y.has(x))continue;if(w==="never"){g.push(x);continue}let k=v.run({value:f[x],issues:[]},d);k instanceof Promise?h.push(k.then(P=>kc(P,l,x))):kc(k,l,x)}return g.length&&l.issues.push({code:"unrecognized_keys",keys:g,input:f,inst:e}),h.length?Promise.all(h).then(()=>l):l}});sd=S("$ZodUnion",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Se(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Se(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Se(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>gs(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,i=[];for(let s of t.options){let a=s._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>kv(s,r,e,n)):kv(i,r,e,n)}}),lw=S("$ZodDiscriminatedUnion",(e,t)=>{sd.init(e,t);let r=e._zod.parse;Se(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=hs(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!oi(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),o)}}),pw=S("$ZodIntersection",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Sv(r,c,u)):Sv(r,i,s)}});dw=S("$ZodRecord",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ii(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&r.issues.push(...jr(c,p.issues)),r.value[c]=p.value})):(u.issues.length&&r.issues.push(...jr(c,u.issues)),r.value[c]=u.value)}let a;for(let c in o)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>vr(u,n,Mt())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[s],issues:[]},n);c instanceof Promise?i.push(c.then(u=>{u.issues.length&&r.issues.push(...jr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...jr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),fw=S("$ZodEnum",(e,t)=>{he.init(e,t);let r=fs(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Fp.has(typeof n)).map(n=>typeof n=="string"?Cn(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),hw=S("$ZodLiteral",(e,t)=>{he.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Cn(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),mw=S("$ZodTransform",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new rn;return r.value=o,r}}),gw=S("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),yw=S("$ZodNullable",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)}|null)$`):void 0}),Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),_w=S("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>$v(i,t)):$v(o,t)}});vw=S("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ww=S("$ZodNonOptional",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Pv(i,e)):Pv(o,e)}});bw=S("$ZodCatch",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>vr(s,n,Mt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>vr(i,n,Mt()))},input:r.value}),r.issues=[]),r)}}),xw=S("$ZodPipe",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>t.in._zod.values),Se(e._zod,"optin",()=>t.in._zod.optin),Se(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ev(i,t,n)):Ev(o,t,n)}});kw=S("$ZodReadonly",(e,t)=>{he.init(e,t),Se(e._zod,"propValues",()=>t.innerType._zod.propValues),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Cv):Cv(o)}});Sw=S("$ZodCustom",(e,t)=>{_t.init(e,t),he.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Tv(i,r,n,e));Tv(o,r,n,e)}})});function Pw(){return{localeError:TR()}}var CR,TR,Ew=b(()=>{Mr();CR=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},TR=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${CR(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${mc(n.values[0])}`:`Invalid option: expected one of ${fc(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${fc(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});var $c=b(()=>{});function cd(){return new bs}var Cw,Tw,bs,nn,ud=b(()=>{Cw=Symbol("ZodOutput"),Tw=Symbol("ZodInput"),bs=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};nn=cd()});function Aw(e,t){return new e({type:"string",...j(t)})}function Rw(e,t){return new e({type:"string",coerce:!0,...j(t)})}function Iw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function ld(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function zw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function Dw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function Ow(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Nw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function pd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function jw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function Mw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function Lw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function Zw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Uw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function qw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function Fw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Gw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Bw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Vw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Hw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function Ww(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Kw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Jw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function Yw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}function Qw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function Xw(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function eb(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function tb(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function rb(e,t){return new e({type:"number",checks:[],...j(t)})}function nb(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}function ob(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function ib(e,t){return new e({type:"boolean",...j(t)})}function sb(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}function ab(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}function cb(e,t){return new e({type:"null",...j(t)})}function ub(e){return new e({type:"any"})}function lb(e){return new e({type:"unknown"})}function pb(e,t){return new e({type:"never",...j(t)})}function db(e,t){return new e({type:"date",coerce:!0,...j(t)})}function si(e,t){return new ed({check:"less_than",...j(t),value:e,inclusive:!1})}function on(e,t){return new ed({check:"less_than",...j(t),value:e,inclusive:!0})}function ai(e,t){return new td({check:"greater_than",...j(t),value:e,inclusive:!1})}function wr(e,t){return new td({check:"greater_than",...j(t),value:e,inclusive:!0})}function xs(e,t){return new av({check:"multiple_of",...j(t),value:e})}function Pc(e,t){return new uv({check:"max_length",...j(t),maximum:e})}function ci(e,t){return new lv({check:"min_length",...j(t),minimum:e})}function Ec(e,t){return new pv({check:"length_equals",...j(t),length:e})}function dd(e,t){return new dv({check:"string_format",format:"regex",...j(t),pattern:e})}function fd(e){return new fv({check:"string_format",format:"lowercase",...j(e)})}function hd(e){return new hv({check:"string_format",format:"uppercase",...j(e)})}function md(e,t){return new mv({check:"string_format",format:"includes",...j(t),includes:e})}function gd(e,t){return new gv({check:"string_format",format:"starts_with",...j(t),prefix:e})}function yd(e,t){return new yv({check:"string_format",format:"ends_with",...j(t),suffix:e})}function po(e){return new _v({check:"overwrite",tx:e})}function _d(e){return po(t=>t.normalize(e))}function vd(){return po(e=>e.trim())}function wd(){return po(e=>e.toLowerCase())}function bd(){return po(e=>e.toUpperCase())}function fb(e,t,r){return new e({type:"array",element:t,...j(r)})}function hb(e,t,r){let n=j(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function mb(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}var gb=b(()=>{bc();Mr()});var yb=b(()=>{});function Tc(e,t){if(e instanceof bs){let n=new Cc(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new Cc(t);return r.process(e),r.emit(e,t)}function Qe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Qe(o.element,r);case"object":{for(let i in o.shape)if(Qe(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Qe(i,r))return!0;return!1}case"intersection":return Qe(o.left,r)||Qe(o.right,r);case"tuple":{for(let i of o.items)if(Qe(i,r))return!0;return!!(o.rest&&Qe(o.rest,r))}case"record":return Qe(o.keyType,r)||Qe(o.valueType,r);case"map":return Qe(o.keyType,r)||Qe(o.valueType,r);case"set":return Qe(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Qe(o.innerType,r);case"lazy":return Qe(o.getter(),r);case"default":return Qe(o.innerType,r);case"prefault":return Qe(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Qe(o.in,r)||Qe(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var Cc,_b=b(()=>{ud();Mr();Cc=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??nn,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)a.ref=d,this.process(d,l),this.seen.get(d).isParent=!0;else{let f=a.schema;switch(o.type){case"string":{let h=f;h.type="string";let{minimum:g,maximum:y,format:v,patterns:w,contentEncoding:x}=t._zod.bag;if(typeof g=="number"&&(h.minLength=g),typeof y=="number"&&(h.maxLength=y),v&&(h.format=i[v]??v,h.format===""&&delete h.format),x&&(h.contentEncoding=x),w&&w.size>0){let k=[...w];k.length===1?h.pattern=k[0].source:k.length>1&&(a.schema.allOf=[...k.map(P=>({...this.target==="draft-7"?{type:"string"}:{},pattern:P.source}))])}break}case"number":{let h=f,{minimum:g,maximum:y,format:v,multipleOf:w,exclusiveMaximum:x,exclusiveMinimum:k}=t._zod.bag;typeof v=="string"&&v.includes("int")?h.type="integer":h.type="number",typeof k=="number"&&(h.exclusiveMinimum=k),typeof g=="number"&&(h.minimum=g,typeof k=="number"&&(k>=g?delete h.minimum:delete h.exclusiveMinimum)),typeof x=="number"&&(h.exclusiveMaximum=x),typeof y=="number"&&(h.maximum=y,typeof x=="number"&&(x<=y?delete h.maximum:delete h.exclusiveMaximum)),typeof w=="number"&&(h.multipleOf=w);break}case"boolean":{let h=f;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{f.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{f.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let h=f,{minimum:g,maximum:y}=t._zod.bag;typeof g=="number"&&(h.minItems=g),typeof y=="number"&&(h.maxItems=y),h.type="array",h.items=this.process(o.element,{...l,path:[...l.path,"items"]});break}case"object":{let h=f;h.type="object",h.properties={};let g=o.shape;for(let w in g)h.properties[w]=this.process(g[w],{...l,path:[...l.path,"properties",w]});let y=new Set(Object.keys(g)),v=new Set([...y].filter(w=>{let x=o.shape[w]._zod;return this.io==="input"?x.optin===void 0:x.optout===void 0}));v.size>0&&(h.required=Array.from(v)),o.catchall?._zod.def.type==="never"?h.additionalProperties=!1:o.catchall?o.catchall&&(h.additionalProperties=this.process(o.catchall,{...l,path:[...l.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{let h=f;h.anyOf=o.options.map((g,y)=>this.process(g,{...l,path:[...l.path,"anyOf",y]}));break}case"intersection":{let h=f,g=this.process(o.left,{...l,path:[...l.path,"allOf",0]}),y=this.process(o.right,{...l,path:[...l.path,"allOf",1]}),v=x=>"allOf"in x&&Object.keys(x).length===1,w=[...v(g)?g.allOf:[g],...v(y)?y.allOf:[y]];h.allOf=w;break}case"tuple":{let h=f;h.type="array";let g=o.items.map((w,x)=>this.process(w,{...l,path:[...l.path,"prefixItems",x]}));if(this.target==="draft-2020-12"?h.prefixItems=g:h.items=g,o.rest){let w=this.process(o.rest,{...l,path:[...l.path,"items"]});this.target==="draft-2020-12"?h.items=w:h.additionalItems=w}o.rest&&(h.items=this.process(o.rest,{...l,path:[...l.path,"items"]}));let{minimum:y,maximum:v}=t._zod.bag;typeof y=="number"&&(h.minItems=y),typeof v=="number"&&(h.maxItems=v);break}case"record":{let h=f;h.type="object",h.propertyNames=this.process(o.keyType,{...l,path:[...l.path,"propertyNames"]}),h.additionalProperties=this.process(o.valueType,{...l,path:[...l.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let h=f,g=fs(o.entries);g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),h.enum=g;break}case"literal":{let h=f,g=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");g.push(Number(y))}else g.push(y);if(g.length!==0)if(g.length===1){let y=g[0];h.type=y===null?"null":typeof y,h.const=y}else g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),g.every(y=>typeof y=="boolean")&&(h.type="string"),g.every(y=>y===null)&&(h.type="null"),h.enum=g;break}case"file":{let h=f,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:v,mime:w}=t._zod.bag;y!==void 0&&(g.minLength=y),v!==void 0&&(g.maxLength=v),w?w.length===1?(g.contentMediaType=w[0],Object.assign(h,g)):h.anyOf=w.map(x=>({...g,contentMediaType:x})):Object.assign(h,g);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let h=this.process(o.innerType,l);f.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"success":{let h=f;h.type="boolean";break}case"default":{this.process(o.innerType,l),a.ref=o.innerType,f.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,l),a.ref=o.innerType,this.io==="input"&&(f._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,l),a.ref=o.innerType;let h;try{h=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}f.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let h=f,g=t._zod.pattern;if(!g)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=g.source;break}case"pipe":{let h=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(h,l),a.ref=h;break}case"readonly":{this.process(o.innerType,l),a.ref=o.innerType,f.readOnly=!0;break}case"promise":{this.process(o.innerType,l),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"lazy":{let h=t._zod.innerType;this.process(h,l),a.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&Qe(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=p=>{let l=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let g=n.external.registry.get(p[0])?.id,y=n.external.uri??(w=>w);if(g)return{ref:y(g)};let v=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=v,{defId:v,ref:`${y("__shared")}#/${l}/${v}`}}if(p[1]===o)return{ref:"#"};let f=`#/${l}/`,h=p[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:f+h}},s=p=>{if(p[1].schema.$ref)return;let l=p[1],{ref:d,defId:f}=i(p);l.def={...l.schema},f&&(l.defId=f);let h=l.schema;for(let g in h)delete h[g];h.$ref=d};if(n.cycles==="throw")for(let p of this.seen.entries()){let l=p[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
29
|
+
})));`),d.write(`newResult[${uo(w)}] = ${x}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let v=d.compile();return(w,x)=>v(l,w,x)},o,i=oi,s=!pc.jitless,c=s&&qp.value,u=t.catchall,p;e._zod.parse=(l,d)=>{p??(p=r.value);let f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;let h=[];if(s&&c&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),l=o(l,d);else{l.value={};let x=p.shape;for(let k of p.keys){let P=x[k],q=P._zod.run({value:f[k],issues:[]},d),L=P._zod.optin==="optional"&&P._zod.optout==="optional";q instanceof Promise?h.push(q.then(Ue=>L?xv(Ue,l,k,f):kc(Ue,l,k))):L?xv(q,l,k,f):kc(q,l,k)}}if(!u)return h.length?Promise.all(h).then(()=>l):l;let g=[],y=p.keySet,v=u._zod,w=v.def.type;for(let x of Object.keys(f)){if(y.has(x))continue;if(w==="never"){g.push(x);continue}let k=v.run({value:f[x],issues:[]},d);k instanceof Promise?h.push(k.then(P=>kc(P,l,x))):kc(k,l,x)}return g.length&&l.issues.push({code:"unrecognized_keys",keys:g,input:f,inst:e}),h.length?Promise.all(h).then(()=>l):l}});sd=S("$ZodUnion",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Se(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Se(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Se(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>gs(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,i=[];for(let s of t.options){let a=s._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>kv(s,r,e,n)):kv(i,r,e,n)}}),lw=S("$ZodDiscriminatedUnion",(e,t)=>{sd.init(e,t);let r=e._zod.parse;Se(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=hs(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!oi(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),o)}}),pw=S("$ZodIntersection",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Sv(r,c,u)):Sv(r,i,s)}});dw=S("$ZodRecord",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ii(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&r.issues.push(...jr(c,p.issues)),r.value[c]=p.value})):(u.issues.length&&r.issues.push(...jr(c,u.issues)),r.value[c]=u.value)}let a;for(let c in o)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>vr(u,n,Mt())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[s],issues:[]},n);c instanceof Promise?i.push(c.then(u=>{u.issues.length&&r.issues.push(...jr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...jr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}}),fw=S("$ZodEnum",(e,t)=>{he.init(e,t);let r=fs(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Fp.has(typeof n)).map(n=>typeof n=="string"?Tn(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),hw=S("$ZodLiteral",(e,t)=>{he.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Tn(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),mw=S("$ZodTransform",(e,t)=>{he.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new nn;return r.value=o,r}}),gw=S("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),yw=S("$ZodNullable",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gs(r.source)}|null)$`):void 0}),Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),_w=S("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>$v(i,t)):$v(o,t)}});vw=S("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ww=S("$ZodNonOptional",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Pv(i,e)):Pv(o,e)}});bw=S("$ZodCatch",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>vr(s,n,Mt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>vr(i,n,Mt()))},input:r.value}),r.issues=[]),r)}}),xw=S("$ZodPipe",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>t.in._zod.values),Se(e._zod,"optin",()=>t.in._zod.optin),Se(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ev(i,t,n)):Ev(o,t,n)}});kw=S("$ZodReadonly",(e,t)=>{he.init(e,t),Se(e._zod,"propValues",()=>t.innerType._zod.propValues),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Cv):Cv(o)}});Sw=S("$ZodCustom",(e,t)=>{_t.init(e,t),he.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Tv(i,r,n,e));Tv(o,r,n,e)}})});function Pw(){return{localeError:TR()}}var CR,TR,Ew=b(()=>{Mr();CR=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},TR=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${CR(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${mc(n.values[0])}`:`Invalid option: expected one of ${fc(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${fc(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});var $c=b(()=>{});function cd(){return new bs}var Cw,Tw,bs,on,ud=b(()=>{Cw=Symbol("ZodOutput"),Tw=Symbol("ZodInput"),bs=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};on=cd()});function Aw(e,t){return new e({type:"string",...j(t)})}function Rw(e,t){return new e({type:"string",coerce:!0,...j(t)})}function Iw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function ld(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function zw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function Dw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function Ow(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Nw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function pd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function jw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function Mw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function Lw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function Zw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Uw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function qw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function Fw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Gw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Bw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Vw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Hw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function Ww(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Kw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Jw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function Yw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}function Qw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function Xw(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function eb(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function tb(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function rb(e,t){return new e({type:"number",checks:[],...j(t)})}function nb(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}function ob(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function ib(e,t){return new e({type:"boolean",...j(t)})}function sb(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}function ab(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}function cb(e,t){return new e({type:"null",...j(t)})}function ub(e){return new e({type:"any"})}function lb(e){return new e({type:"unknown"})}function pb(e,t){return new e({type:"never",...j(t)})}function db(e,t){return new e({type:"date",coerce:!0,...j(t)})}function si(e,t){return new ed({check:"less_than",...j(t),value:e,inclusive:!1})}function sn(e,t){return new ed({check:"less_than",...j(t),value:e,inclusive:!0})}function ai(e,t){return new td({check:"greater_than",...j(t),value:e,inclusive:!1})}function wr(e,t){return new td({check:"greater_than",...j(t),value:e,inclusive:!0})}function xs(e,t){return new av({check:"multiple_of",...j(t),value:e})}function Pc(e,t){return new uv({check:"max_length",...j(t),maximum:e})}function ci(e,t){return new lv({check:"min_length",...j(t),minimum:e})}function Ec(e,t){return new pv({check:"length_equals",...j(t),length:e})}function dd(e,t){return new dv({check:"string_format",format:"regex",...j(t),pattern:e})}function fd(e){return new fv({check:"string_format",format:"lowercase",...j(e)})}function hd(e){return new hv({check:"string_format",format:"uppercase",...j(e)})}function md(e,t){return new mv({check:"string_format",format:"includes",...j(t),includes:e})}function gd(e,t){return new gv({check:"string_format",format:"starts_with",...j(t),prefix:e})}function yd(e,t){return new yv({check:"string_format",format:"ends_with",...j(t),suffix:e})}function po(e){return new _v({check:"overwrite",tx:e})}function _d(e){return po(t=>t.normalize(e))}function vd(){return po(e=>e.trim())}function wd(){return po(e=>e.toLowerCase())}function bd(){return po(e=>e.toUpperCase())}function fb(e,t,r){return new e({type:"array",element:t,...j(r)})}function hb(e,t,r){let n=j(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function mb(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}var gb=b(()=>{bc();Mr()});var yb=b(()=>{});function Tc(e,t){if(e instanceof bs){let n=new Cc(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new Cc(t);return r.process(e),r.emit(e,t)}function Qe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Qe(o.element,r);case"object":{for(let i in o.shape)if(Qe(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Qe(i,r))return!0;return!1}case"intersection":return Qe(o.left,r)||Qe(o.right,r);case"tuple":{for(let i of o.items)if(Qe(i,r))return!0;return!!(o.rest&&Qe(o.rest,r))}case"record":return Qe(o.keyType,r)||Qe(o.valueType,r);case"map":return Qe(o.keyType,r)||Qe(o.valueType,r);case"set":return Qe(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Qe(o.innerType,r);case"lazy":return Qe(o.getter(),r);case"default":return Qe(o.innerType,r);case"prefault":return Qe(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Qe(o.in,r)||Qe(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var Cc,_b=b(()=>{ud();Mr();Cc=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??on,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)a.ref=d,this.process(d,l),this.seen.get(d).isParent=!0;else{let f=a.schema;switch(o.type){case"string":{let h=f;h.type="string";let{minimum:g,maximum:y,format:v,patterns:w,contentEncoding:x}=t._zod.bag;if(typeof g=="number"&&(h.minLength=g),typeof y=="number"&&(h.maxLength=y),v&&(h.format=i[v]??v,h.format===""&&delete h.format),x&&(h.contentEncoding=x),w&&w.size>0){let k=[...w];k.length===1?h.pattern=k[0].source:k.length>1&&(a.schema.allOf=[...k.map(P=>({...this.target==="draft-7"?{type:"string"}:{},pattern:P.source}))])}break}case"number":{let h=f,{minimum:g,maximum:y,format:v,multipleOf:w,exclusiveMaximum:x,exclusiveMinimum:k}=t._zod.bag;typeof v=="string"&&v.includes("int")?h.type="integer":h.type="number",typeof k=="number"&&(h.exclusiveMinimum=k),typeof g=="number"&&(h.minimum=g,typeof k=="number"&&(k>=g?delete h.minimum:delete h.exclusiveMinimum)),typeof x=="number"&&(h.exclusiveMaximum=x),typeof y=="number"&&(h.maximum=y,typeof x=="number"&&(x<=y?delete h.maximum:delete h.exclusiveMaximum)),typeof w=="number"&&(h.multipleOf=w);break}case"boolean":{let h=f;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{f.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{f.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let h=f,{minimum:g,maximum:y}=t._zod.bag;typeof g=="number"&&(h.minItems=g),typeof y=="number"&&(h.maxItems=y),h.type="array",h.items=this.process(o.element,{...l,path:[...l.path,"items"]});break}case"object":{let h=f;h.type="object",h.properties={};let g=o.shape;for(let w in g)h.properties[w]=this.process(g[w],{...l,path:[...l.path,"properties",w]});let y=new Set(Object.keys(g)),v=new Set([...y].filter(w=>{let x=o.shape[w]._zod;return this.io==="input"?x.optin===void 0:x.optout===void 0}));v.size>0&&(h.required=Array.from(v)),o.catchall?._zod.def.type==="never"?h.additionalProperties=!1:o.catchall?o.catchall&&(h.additionalProperties=this.process(o.catchall,{...l,path:[...l.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{let h=f;h.anyOf=o.options.map((g,y)=>this.process(g,{...l,path:[...l.path,"anyOf",y]}));break}case"intersection":{let h=f,g=this.process(o.left,{...l,path:[...l.path,"allOf",0]}),y=this.process(o.right,{...l,path:[...l.path,"allOf",1]}),v=x=>"allOf"in x&&Object.keys(x).length===1,w=[...v(g)?g.allOf:[g],...v(y)?y.allOf:[y]];h.allOf=w;break}case"tuple":{let h=f;h.type="array";let g=o.items.map((w,x)=>this.process(w,{...l,path:[...l.path,"prefixItems",x]}));if(this.target==="draft-2020-12"?h.prefixItems=g:h.items=g,o.rest){let w=this.process(o.rest,{...l,path:[...l.path,"items"]});this.target==="draft-2020-12"?h.items=w:h.additionalItems=w}o.rest&&(h.items=this.process(o.rest,{...l,path:[...l.path,"items"]}));let{minimum:y,maximum:v}=t._zod.bag;typeof y=="number"&&(h.minItems=y),typeof v=="number"&&(h.maxItems=v);break}case"record":{let h=f;h.type="object",h.propertyNames=this.process(o.keyType,{...l,path:[...l.path,"propertyNames"]}),h.additionalProperties=this.process(o.valueType,{...l,path:[...l.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let h=f,g=fs(o.entries);g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),h.enum=g;break}case"literal":{let h=f,g=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");g.push(Number(y))}else g.push(y);if(g.length!==0)if(g.length===1){let y=g[0];h.type=y===null?"null":typeof y,h.const=y}else g.every(y=>typeof y=="number")&&(h.type="number"),g.every(y=>typeof y=="string")&&(h.type="string"),g.every(y=>typeof y=="boolean")&&(h.type="string"),g.every(y=>y===null)&&(h.type="null"),h.enum=g;break}case"file":{let h=f,g={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:v,mime:w}=t._zod.bag;y!==void 0&&(g.minLength=y),v!==void 0&&(g.maxLength=v),w?w.length===1?(g.contentMediaType=w[0],Object.assign(h,g)):h.anyOf=w.map(x=>({...g,contentMediaType:x})):Object.assign(h,g);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let h=this.process(o.innerType,l);f.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"success":{let h=f;h.type="boolean";break}case"default":{this.process(o.innerType,l),a.ref=o.innerType,f.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,l),a.ref=o.innerType,this.io==="input"&&(f._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,l),a.ref=o.innerType;let h;try{h=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}f.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let h=f,g=t._zod.pattern;if(!g)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=g.source;break}case"pipe":{let h=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(h,l),a.ref=h;break}case"readonly":{this.process(o.innerType,l),a.ref=o.innerType,f.readOnly=!0;break}case"promise":{this.process(o.innerType,l),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,l),a.ref=o.innerType;break}case"lazy":{let h=t._zod.innerType;this.process(h,l),a.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&Qe(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=p=>{let l=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let g=n.external.registry.get(p[0])?.id,y=n.external.uri??(w=>w);if(g)return{ref:y(g)};let v=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=v,{defId:v,ref:`${y("__shared")}#/${l}/${v}`}}if(p[1]===o)return{ref:"#"};let f=`#/${l}/`,h=p[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:f+h}},s=p=>{if(p[1].schema.$ref)return;let l=p[1],{ref:d,defId:f}=i(p);l.def={...l.schema},f&&(l.defId=f);let h=l.schema;for(let g in h)delete h[g];h.$ref=d};if(n.cycles==="throw")for(let p of this.seen.entries()){let l=p[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
30
30
|
|
|
31
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let l=p[1];if(t===p[0]){s(p);continue}if(n.external){let f=n.external.registry.get(p[0])?.id;if(t!==p[0]&&f){s(p);continue}}if(this.metadataRegistry.get(p[0])?.id){s(p);continue}if(l.cycle){s(p);continue}if(l.count>1&&n.reused==="ref"){s(p);continue}}let a=(p,l)=>{let d=this.seen.get(p),f=d.def??d.schema,h={...f};if(d.ref===null)return;let g=d.ref;if(d.ref=null,g){a(g,l);let y=this.seen.get(g).schema;y.$ref&&l.target==="draft-7"?(f.allOf=f.allOf??[],f.allOf.push(y)):(Object.assign(f,y),Object.assign(f,h))}d.isParent||this.override({zodSchema:p,jsonSchema:f,path:d.path??[]})};for(let p of[...this.seen.entries()].reverse())a(p[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let p=n.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let p of this.seen.entries()){let l=p[1];l.def&&l.defId&&(u[l.defId]=l.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var vb=b(()=>{});var Tt=b(()=>{ni();Yp();Wp();$w();bc();nd();Mr();wc();$c();ud();rd();yb();gb();_b();vb()});var xd=b(()=>{Tt()});var ks={};tr(ks,{ZodISODate:()=>bb,ZodISODateTime:()=>wb,ZodISODuration:()=>kb,ZodISOTime:()=>xb,date:()=>Sd,datetime:()=>kd,duration:()=>Pd,time:()=>$d});function kd(e){return Qw(wb,e)}function Sd(e){return Xw(bb,e)}function $d(e){return eb(xb,e)}function Pd(e){return tb(kb,e)}var wb,bb,xb,kb,Ed=b(()=>{Tt();Ac();wb=S("ZodISODateTime",(e,t)=>{Uv.init(e,t),Ie.init(e,t)});bb=S("ZodISODate",(e,t)=>{qv.init(e,t),Ie.init(e,t)});xb=S("ZodISOTime",(e,t)=>{Fv.init(e,t),Ie.init(e,t)});kb=S("ZodISODuration",(e,t)=>{Gv.init(e,t),Ie.init(e,t)})});var $b,D7,Ss,Cd=b(()=>{Tt();Tt();$b=(e,t)=>{gc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>_c(e,r)},flatten:{value:r=>yc(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},D7=S("ZodError",$b),Ss=S("ZodError",$b,{Parent:Error})});var Pb,Eb,Cb,Tb,Td=b(()=>{Tt();Cd();Pb=C_(Ss),Eb=T_(Ss),Cb=Kp(Ss),Tb=Jp(Ss)});function _(e){return Aw(Id,e)}function Ob(e){return pd(Db,e)}function de(e){return rb(Ic,e)}function Rb(e){return ob(QR,e)}function be(e){return ib(zd,e)}function Dd(e){return cb(XR,e)}function jb(){return ub(eI)}function ze(){return lb(tI)}function nI(e){return pb(rI,e)}function T(e,t){return fb(oI,e,t)}function A(e,t){let r={type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},...pe.normalizeParams(t)};return new Lb(r)}function Xe(e,t){return new Lb({type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},catchall:ze(),...pe.normalizeParams(t)})}function Pe(e,t){return new Zb({type:"union",options:e,...pe.normalizeParams(t)})}function Od(e,t,r){return new iI({type:"union",options:t,discriminator:e,...pe.normalizeParams(r)})}function zc(e,t){return new sI({type:"intersection",left:e,right:t})}function De(e,t,r){return new aI({type:"record",keyType:e,valueType:t,...pe.normalizeParams(r)})}function Lt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ad({type:"enum",entries:r,...pe.normalizeParams(t)})}function O(e,t){return new cI({type:"literal",values:Array.isArray(e)?e:[e],...pe.normalizeParams(t)})}function Ub(e){return new uI({type:"transform",transform:e})}function Me(e){return new qb({type:"optional",innerType:e})}function Ib(e){return new lI({type:"nullable",innerType:e})}function dI(e,t){return new pI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function hI(e,t){return new fI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function mI(e,t){return new Fb({type:"nonoptional",innerType:e,...pe.normalizeParams(t)})}function yI(e,t){return new gI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Rd(e,t){return new _I({type:"pipe",in:e,out:t})}function wI(e){return new vI({type:"readonly",innerType:e})}function bI(e){let t=new _t({check:"custom"});return t._zod.check=e,t}function Bb(e,t){return hb(Gb,e??(()=>!0),t)}function xI(e,t={}){return mb(Gb,e,t)}function kI(e){let t=bI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(pe.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(pe.issue(o))}},e(r.value,r)));return t}function Nd(e,t){return Rd(Ub(e),t)}var $e,zb,Id,Ie,NR,Ab,Rc,Db,jR,MR,LR,ZR,UR,qR,FR,GR,BR,VR,HR,WR,KR,JR,YR,Ic,QR,zd,Nb,XR,eI,tI,rI,Mb,oI,Lb,Zb,iI,sI,aI,Ad,cI,uI,qb,lI,pI,fI,Fb,gI,_I,vI,Gb,Ac=b(()=>{Tt();Tt();xd();Ed();Td();$e=S("ZodType",(e,t)=>(he.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>nr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Pb(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Cb(e,r,n),e.parseAsync=async(r,n)=>Eb(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Tb(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(xI(r,n)),e.superRefine=r=>e.check(kI(r)),e.overwrite=r=>e.check(po(r)),e.optional=()=>Me(e),e.nullable=()=>Ib(e),e.nullish=()=>Me(Ib(e)),e.nonoptional=r=>mI(e,r),e.array=()=>T(e),e.or=r=>Pe([e,r]),e.and=r=>zc(e,r),e.transform=r=>Rd(e,Ub(r)),e.default=r=>dI(e,r),e.prefault=r=>hI(e,r),e.catch=r=>yI(e,r),e.pipe=r=>Rd(e,r),e.readonly=()=>wI(e),e.describe=r=>{let n=e.clone();return nn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return nn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return nn.get(e);let n=e.clone();return nn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),zb=S("_ZodString",(e,t)=>{Sc.init(e,t),$e.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(dd(...n)),e.includes=(...n)=>e.check(md(...n)),e.startsWith=(...n)=>e.check(gd(...n)),e.endsWith=(...n)=>e.check(yd(...n)),e.min=(...n)=>e.check(ci(...n)),e.max=(...n)=>e.check(Pc(...n)),e.length=(...n)=>e.check(Ec(...n)),e.nonempty=(...n)=>e.check(ci(1,...n)),e.lowercase=n=>e.check(fd(n)),e.uppercase=n=>e.check(hd(n)),e.trim=()=>e.check(vd()),e.normalize=(...n)=>e.check(_d(...n)),e.toLowerCase=()=>e.check(wd()),e.toUpperCase=()=>e.check(bd())}),Id=S("ZodString",(e,t)=>{Sc.init(e,t),zb.init(e,t),e.email=r=>e.check(Iw(NR,r)),e.url=r=>e.check(pd(Db,r)),e.jwt=r=>e.check(Yw(YR,r)),e.emoji=r=>e.check(jw(jR,r)),e.guid=r=>e.check(ld(Ab,r)),e.uuid=r=>e.check(zw(Rc,r)),e.uuidv4=r=>e.check(Dw(Rc,r)),e.uuidv6=r=>e.check(Ow(Rc,r)),e.uuidv7=r=>e.check(Nw(Rc,r)),e.nanoid=r=>e.check(Mw(MR,r)),e.guid=r=>e.check(ld(Ab,r)),e.cuid=r=>e.check(Lw(LR,r)),e.cuid2=r=>e.check(Zw(ZR,r)),e.ulid=r=>e.check(Uw(UR,r)),e.base64=r=>e.check(Ww(WR,r)),e.base64url=r=>e.check(Kw(KR,r)),e.xid=r=>e.check(qw(qR,r)),e.ksuid=r=>e.check(Fw(FR,r)),e.ipv4=r=>e.check(Gw(GR,r)),e.ipv6=r=>e.check(Bw(BR,r)),e.cidrv4=r=>e.check(Vw(VR,r)),e.cidrv6=r=>e.check(Hw(HR,r)),e.e164=r=>e.check(Jw(JR,r)),e.datetime=r=>e.check(kd(r)),e.date=r=>e.check(Sd(r)),e.time=r=>e.check($d(r)),e.duration=r=>e.check(Pd(r))});Ie=S("ZodStringFormat",(e,t)=>{Ce.init(e,t),zb.init(e,t)}),NR=S("ZodEmail",(e,t)=>{Iv.init(e,t),Ie.init(e,t)}),Ab=S("ZodGUID",(e,t)=>{Av.init(e,t),Ie.init(e,t)}),Rc=S("ZodUUID",(e,t)=>{Rv.init(e,t),Ie.init(e,t)}),Db=S("ZodURL",(e,t)=>{zv.init(e,t),Ie.init(e,t)});jR=S("ZodEmoji",(e,t)=>{Dv.init(e,t),Ie.init(e,t)}),MR=S("ZodNanoID",(e,t)=>{Ov.init(e,t),Ie.init(e,t)}),LR=S("ZodCUID",(e,t)=>{Nv.init(e,t),Ie.init(e,t)}),ZR=S("ZodCUID2",(e,t)=>{jv.init(e,t),Ie.init(e,t)}),UR=S("ZodULID",(e,t)=>{Mv.init(e,t),Ie.init(e,t)}),qR=S("ZodXID",(e,t)=>{Lv.init(e,t),Ie.init(e,t)}),FR=S("ZodKSUID",(e,t)=>{Zv.init(e,t),Ie.init(e,t)}),GR=S("ZodIPv4",(e,t)=>{Bv.init(e,t),Ie.init(e,t)}),BR=S("ZodIPv6",(e,t)=>{Vv.init(e,t),Ie.init(e,t)}),VR=S("ZodCIDRv4",(e,t)=>{Hv.init(e,t),Ie.init(e,t)}),HR=S("ZodCIDRv6",(e,t)=>{Wv.init(e,t),Ie.init(e,t)}),WR=S("ZodBase64",(e,t)=>{Jv.init(e,t),Ie.init(e,t)}),KR=S("ZodBase64URL",(e,t)=>{Yv.init(e,t),Ie.init(e,t)}),JR=S("ZodE164",(e,t)=>{Qv.init(e,t),Ie.init(e,t)}),YR=S("ZodJWT",(e,t)=>{Xv.init(e,t),Ie.init(e,t)}),Ic=S("ZodNumber",(e,t)=>{id.init(e,t),$e.init(e,t),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(on(n,o)),e.max=(n,o)=>e.check(on(n,o)),e.int=n=>e.check(Rb(n)),e.safe=n=>e.check(Rb(n)),e.positive=n=>e.check(ai(0,n)),e.nonnegative=n=>e.check(wr(0,n)),e.negative=n=>e.check(si(0,n)),e.nonpositive=n=>e.check(on(0,n)),e.multipleOf=(n,o)=>e.check(xs(n,o)),e.step=(n,o)=>e.check(xs(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});QR=S("ZodNumberFormat",(e,t)=>{ew.init(e,t),Ic.init(e,t)});zd=S("ZodBoolean",(e,t)=>{tw.init(e,t),$e.init(e,t)});Nb=S("ZodBigInt",(e,t)=>{rw.init(e,t),$e.init(e,t),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(on(n,o)),e.max=(n,o)=>e.check(on(n,o)),e.positive=n=>e.check(ai(BigInt(0),n)),e.negative=n=>e.check(si(BigInt(0),n)),e.nonpositive=n=>e.check(on(BigInt(0),n)),e.nonnegative=n=>e.check(wr(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(xs(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),XR=S("ZodNull",(e,t)=>{nw.init(e,t),$e.init(e,t)});eI=S("ZodAny",(e,t)=>{ow.init(e,t),$e.init(e,t)});tI=S("ZodUnknown",(e,t)=>{iw.init(e,t),$e.init(e,t)});rI=S("ZodNever",(e,t)=>{sw.init(e,t),$e.init(e,t)});Mb=S("ZodDate",(e,t)=>{aw.init(e,t),$e.init(e,t),e.min=(n,o)=>e.check(wr(n,o)),e.max=(n,o)=>e.check(on(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),oI=S("ZodArray",(e,t)=>{cw.init(e,t),$e.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ci(r,n)),e.nonempty=r=>e.check(ci(1,r)),e.max=(r,n)=>e.check(Pc(r,n)),e.length=(r,n)=>e.check(Ec(r,n)),e.unwrap=()=>e.element});Lb=S("ZodObject",(e,t)=>{uw.init(e,t),$e.init(e,t),pe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Lt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ze()}),e.loose=()=>e.clone({...e._zod.def,catchall:ze()}),e.strict=()=>e.clone({...e._zod.def,catchall:nI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pe.extend(e,r),e.merge=r=>pe.merge(e,r),e.pick=r=>pe.pick(e,r),e.omit=r=>pe.omit(e,r),e.partial=(...r)=>pe.partial(qb,e,r[0]),e.required=(...r)=>pe.required(Fb,e,r[0])});Zb=S("ZodUnion",(e,t)=>{sd.init(e,t),$e.init(e,t),e.options=t.options});iI=S("ZodDiscriminatedUnion",(e,t)=>{Zb.init(e,t),lw.init(e,t)});sI=S("ZodIntersection",(e,t)=>{pw.init(e,t),$e.init(e,t)});aI=S("ZodRecord",(e,t)=>{dw.init(e,t),$e.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});Ad=S("ZodEnum",(e,t)=>{fw.init(e,t),$e.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})}});cI=S("ZodLiteral",(e,t)=>{hw.init(e,t),$e.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});uI=S("ZodTransform",(e,t)=>{mw.init(e,t),$e.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(pe.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(pe.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});qb=S("ZodOptional",(e,t)=>{gw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});lI=S("ZodNullable",(e,t)=>{yw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});pI=S("ZodDefault",(e,t)=>{_w.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});fI=S("ZodPrefault",(e,t)=>{vw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});Fb=S("ZodNonOptional",(e,t)=>{ww.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});gI=S("ZodCatch",(e,t)=>{bw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});_I=S("ZodPipe",(e,t)=>{xw.init(e,t),$e.init(e,t),e.in=t.in,e.out=t.out});vI=S("ZodReadonly",(e,t)=>{kw.init(e,t),$e.init(e,t)});Gb=S("ZodCustom",(e,t)=>{Sw.init(e,t),$e.init(e,t)})});var Vb,Hb=b(()=>{Vb={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var Dc={};tr(Dc,{bigint:()=>EI,boolean:()=>PI,date:()=>CI,number:()=>$I,string:()=>SI});function SI(e){return Rw(Id,e)}function $I(e){return nb(Ic,e)}function PI(e){return sb(zd,e)}function EI(e){return ab(Nb,e)}function CI(e){return db(Mb,e)}var Wb=b(()=>{Tt();Ac()});var Kb=b(()=>{Tt();Ac();xd();Cd();Td();Hb();Tt();Ew();Tt();$c();Ed();Wb();Mt(Pw())});var Jb=b(()=>{Kb()});var jd=b(()=>{Jb()});var li,Qb,Tn,Nc,at,Xb,e0,PB,zI,DI,Ld,Wt,$s,t0,ct,or,ir,ut,jc,r0,ho,n0,o0,Zd,mo,ee,Ud,i0,pi,EB,Mc,OI,Lc,NI,Ps,ui,s0,jI,MI,LI,ZI,UI,qI,qd,FI,GI,Zc,a0,Uc,BI,VI,qc,HI,Es,Cs,WI,Ts,di,KI,As,Fc,Gc,Bc,CB,Vc,Hc,Wc,c0,u0,l0,Fd,p0,Rs,fi,d0,JI,Gd,YI,QI,XI,Bd,ez,Vd,tz,rz,nz,oz,iz,sz,az,cz,uz,lz,Hd,pz,dz,Wd,Kd,Jd,Yd,fz,hz,mz,Qd,gz,yz,_z,vz,wz,f0,Xd,bz,Kc,TB,xz,Is,kz,AB,zs,Sz,ef,$z,Pz,Ez,Cz,Tz,Az,Rz,Oc,Iz,zz,Dz,tf,rf,Oz,Nz,jz,Mz,Lz,Zz,Uz,qz,Fz,Gz,Bz,Vz,Hz,Wz,Kz,Jz,Yz,Qz,Jc,Xz,eD,tD,rD,nD,oD,iD,nf,sD,RB,IB,zB,DB,OB,NB,V,Md,An=b(()=>{jd();li="2025-11-25",Qb=[li,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Tn="io.modelcontextprotocol/related-task",Nc="2.0",at=Bb(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Xb=Pe([_(),de().int()]),e0=_(),PB=Xe({ttl:Pe([de(),Dd()]).optional(),pollInterval:de().optional()}),zI=A({ttl:de().optional()}),DI=A({taskId:_()}),Ld=Xe({progressToken:Xb.optional(),[Tn]:DI.optional()}),Wt=A({_meta:Ld.optional()}),$s=Wt.extend({task:zI.optional()}),t0=e=>$s.safeParse(e).success,ct=A({method:_(),params:Wt.loose().optional()}),or=A({_meta:Ld.optional()}),ir=A({method:_(),params:or.loose().optional()}),ut=Xe({_meta:Ld.optional()}),jc=Pe([_(),de().int()]),r0=A({jsonrpc:O(Nc),id:jc,...ct.shape}).strict(),ho=e=>r0.safeParse(e).success,n0=A({jsonrpc:O(Nc),...ir.shape}).strict(),o0=e=>n0.safeParse(e).success,Zd=A({jsonrpc:O(Nc),id:jc,result:ut}).strict(),mo=e=>Zd.safeParse(e).success;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ee||(ee={}));Ud=A({jsonrpc:O(Nc),id:jc.optional(),error:A({code:de().int(),message:_(),data:ze().optional()})}).strict(),i0=e=>Ud.safeParse(e).success,pi=Pe([r0,n0,Zd,Ud]),EB=Pe([Zd,Ud]),Mc=ut.strict(),OI=or.extend({requestId:jc.optional(),reason:_().optional()}),Lc=ir.extend({method:O("notifications/cancelled"),params:OI}),NI=A({src:_(),mimeType:_().optional(),sizes:T(_()).optional(),theme:Lt(["light","dark"]).optional()}),Ps=A({icons:T(NI).optional()}),ui=A({name:_(),title:_().optional()}),s0=ui.extend({...ui.shape,...Ps.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),jI=zc(A({applyDefaults:be().optional()}),De(_(),ze())),MI=Nd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,zc(A({form:jI.optional(),url:at.optional()}),De(_(),ze()).optional())),LI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({sampling:Xe({createMessage:at.optional()}).optional(),elicitation:Xe({create:at.optional()}).optional()}).optional()}),ZI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({tools:Xe({call:at.optional()}).optional()}).optional()}),UI=A({experimental:De(_(),at).optional(),sampling:A({context:at.optional(),tools:at.optional()}).optional(),elicitation:MI.optional(),roots:A({listChanged:be().optional()}).optional(),tasks:LI.optional()}),qI=Wt.extend({protocolVersion:_(),capabilities:UI,clientInfo:s0}),qd=ct.extend({method:O("initialize"),params:qI}),FI=A({experimental:De(_(),at).optional(),logging:at.optional(),completions:at.optional(),prompts:A({listChanged:be().optional()}).optional(),resources:A({subscribe:be().optional(),listChanged:be().optional()}).optional(),tools:A({listChanged:be().optional()}).optional(),tasks:ZI.optional()}),GI=ut.extend({protocolVersion:_(),capabilities:FI,serverInfo:s0,instructions:_().optional()}),Zc=ir.extend({method:O("notifications/initialized"),params:or.optional()}),a0=e=>Zc.safeParse(e).success,Uc=ct.extend({method:O("ping"),params:Wt.optional()}),BI=A({progress:de(),total:Me(de()),message:Me(_())}),VI=A({...or.shape,...BI.shape,progressToken:Xb}),qc=ir.extend({method:O("notifications/progress"),params:VI}),HI=Wt.extend({cursor:e0.optional()}),Es=ct.extend({params:HI.optional()}),Cs=ut.extend({nextCursor:e0.optional()}),WI=Lt(["working","input_required","completed","failed","cancelled"]),Ts=A({taskId:_(),status:WI,ttl:Pe([de(),Dd()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:Me(de()),statusMessage:Me(_())}),di=ut.extend({task:Ts}),KI=or.merge(Ts),As=ir.extend({method:O("notifications/tasks/status"),params:KI}),Fc=ct.extend({method:O("tasks/get"),params:Wt.extend({taskId:_()})}),Gc=ut.merge(Ts),Bc=ct.extend({method:O("tasks/result"),params:Wt.extend({taskId:_()})}),CB=ut.loose(),Vc=Es.extend({method:O("tasks/list")}),Hc=Cs.extend({tasks:T(Ts)}),Wc=ct.extend({method:O("tasks/cancel"),params:Wt.extend({taskId:_()})}),c0=ut.merge(Ts),u0=A({uri:_(),mimeType:Me(_()),_meta:De(_(),ze()).optional()}),l0=u0.extend({text:_()}),Fd=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),p0=u0.extend({blob:Fd}),Rs=Lt(["user","assistant"]),fi=A({audience:T(Rs).optional(),priority:de().min(0).max(1).optional(),lastModified:ks.datetime({offset:!0}).optional()}),d0=A({...ui.shape,...Ps.shape,uri:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),JI=A({...ui.shape,...Ps.shape,uriTemplate:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),Gd=Es.extend({method:O("resources/list")}),YI=Cs.extend({resources:T(d0)}),QI=Es.extend({method:O("resources/templates/list")}),XI=Cs.extend({resourceTemplates:T(JI)}),Bd=Wt.extend({uri:_()}),ez=Bd,Vd=ct.extend({method:O("resources/read"),params:ez}),tz=ut.extend({contents:T(Pe([l0,p0]))}),rz=ir.extend({method:O("notifications/resources/list_changed"),params:or.optional()}),nz=Bd,oz=ct.extend({method:O("resources/subscribe"),params:nz}),iz=Bd,sz=ct.extend({method:O("resources/unsubscribe"),params:iz}),az=or.extend({uri:_()}),cz=ir.extend({method:O("notifications/resources/updated"),params:az}),uz=A({name:_(),description:Me(_()),required:Me(be())}),lz=A({...ui.shape,...Ps.shape,description:Me(_()),arguments:Me(T(uz)),_meta:Me(Xe({}))}),Hd=Es.extend({method:O("prompts/list")}),pz=Cs.extend({prompts:T(lz)}),dz=Wt.extend({name:_(),arguments:De(_(),_()).optional()}),Wd=ct.extend({method:O("prompts/get"),params:dz}),Kd=A({type:O("text"),text:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Jd=A({type:O("image"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Yd=A({type:O("audio"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),fz=A({type:O("tool_use"),name:_(),id:_(),input:De(_(),ze()),_meta:De(_(),ze()).optional()}),hz=A({type:O("resource"),resource:Pe([l0,p0]),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),mz=d0.extend({type:O("resource_link")}),Qd=Pe([Kd,Jd,Yd,mz,hz]),gz=A({role:Rs,content:Qd}),yz=ut.extend({description:_().optional(),messages:T(gz)}),_z=ir.extend({method:O("notifications/prompts/list_changed"),params:or.optional()}),vz=A({title:_().optional(),readOnlyHint:be().optional(),destructiveHint:be().optional(),idempotentHint:be().optional(),openWorldHint:be().optional()}),wz=A({taskSupport:Lt(["required","optional","forbidden"]).optional()}),f0=A({...ui.shape,...Ps.shape,description:_().optional(),inputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()),outputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()).optional(),annotations:vz.optional(),execution:wz.optional(),_meta:De(_(),ze()).optional()}),Xd=Es.extend({method:O("tools/list")}),bz=Cs.extend({tools:T(f0)}),Kc=ut.extend({content:T(Qd).default([]),structuredContent:De(_(),ze()).optional(),isError:be().optional()}),TB=Kc.or(ut.extend({toolResult:ze()})),xz=$s.extend({name:_(),arguments:De(_(),ze()).optional()}),Is=ct.extend({method:O("tools/call"),params:xz}),kz=ir.extend({method:O("notifications/tools/list_changed"),params:or.optional()}),AB=A({autoRefresh:be().default(!0),debounceMs:de().int().nonnegative().default(300)}),zs=Lt(["debug","info","notice","warning","error","critical","alert","emergency"]),Sz=Wt.extend({level:zs}),ef=ct.extend({method:O("logging/setLevel"),params:Sz}),$z=or.extend({level:zs,logger:_().optional(),data:ze()}),Pz=ir.extend({method:O("notifications/message"),params:$z}),Ez=A({name:_().optional()}),Cz=A({hints:T(Ez).optional(),costPriority:de().min(0).max(1).optional(),speedPriority:de().min(0).max(1).optional(),intelligencePriority:de().min(0).max(1).optional()}),Tz=A({mode:Lt(["auto","required","none"]).optional()}),Az=A({type:O("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:T(Qd).default([]),structuredContent:A({}).loose().optional(),isError:be().optional(),_meta:De(_(),ze()).optional()}),Rz=Od("type",[Kd,Jd,Yd]),Oc=Od("type",[Kd,Jd,Yd,fz,Az]),Iz=A({role:Rs,content:Pe([Oc,T(Oc)]),_meta:De(_(),ze()).optional()}),zz=$s.extend({messages:T(Iz),modelPreferences:Cz.optional(),systemPrompt:_().optional(),includeContext:Lt(["none","thisServer","allServers"]).optional(),temperature:de().optional(),maxTokens:de().int(),stopSequences:T(_()).optional(),metadata:at.optional(),tools:T(f0).optional(),toolChoice:Tz.optional()}),Dz=ct.extend({method:O("sampling/createMessage"),params:zz}),tf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens"]).or(_())),role:Rs,content:Rz}),rf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Rs,content:Pe([Oc,T(Oc)])}),Oz=A({type:O("boolean"),title:_().optional(),description:_().optional(),default:be().optional()}),Nz=A({type:O("string"),title:_().optional(),description:_().optional(),minLength:de().optional(),maxLength:de().optional(),format:Lt(["email","uri","date","date-time"]).optional(),default:_().optional()}),jz=A({type:Lt(["number","integer"]),title:_().optional(),description:_().optional(),minimum:de().optional(),maximum:de().optional(),default:de().optional()}),Mz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),default:_().optional()}),Lz=A({type:O("string"),title:_().optional(),description:_().optional(),oneOf:T(A({const:_(),title:_()})),default:_().optional()}),Zz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),enumNames:T(_()).optional(),default:_().optional()}),Uz=Pe([Mz,Lz]),qz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({type:O("string"),enum:T(_())}),default:T(_()).optional()}),Fz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({anyOf:T(A({const:_(),title:_()}))}),default:T(_()).optional()}),Gz=Pe([qz,Fz]),Bz=Pe([Zz,Uz,Gz]),Vz=Pe([Bz,Oz,Nz,jz]),Hz=$s.extend({mode:O("form").optional(),message:_(),requestedSchema:A({type:O("object"),properties:De(_(),Vz),required:T(_()).optional()})}),Wz=$s.extend({mode:O("url"),message:_(),elicitationId:_(),url:_().url()}),Kz=Pe([Hz,Wz]),Jz=ct.extend({method:O("elicitation/create"),params:Kz}),Yz=or.extend({elicitationId:_()}),Qz=ir.extend({method:O("notifications/elicitation/complete"),params:Yz}),Jc=ut.extend({action:Lt(["accept","decline","cancel"]),content:Nd(e=>e===null?void 0:e,De(_(),Pe([_(),de(),be(),T(_())])).optional())}),Xz=A({type:O("ref/resource"),uri:_()}),eD=A({type:O("ref/prompt"),name:_()}),tD=Wt.extend({ref:Pe([eD,Xz]),argument:A({name:_(),value:_()}),context:A({arguments:De(_(),_()).optional()}).optional()}),rD=ct.extend({method:O("completion/complete"),params:tD}),nD=ut.extend({completion:Xe({values:T(_()).max(100),total:Me(de().int()),hasMore:Me(be())})}),oD=A({uri:_().startsWith("file://"),name:_().optional(),_meta:De(_(),ze()).optional()}),iD=ct.extend({method:O("roots/list"),params:Wt.optional()}),nf=ut.extend({roots:T(oD)}),sD=ir.extend({method:O("notifications/roots/list_changed"),params:or.optional()}),RB=Pe([Uc,qd,rD,ef,Wd,Hd,Gd,QI,Vd,oz,sz,Is,Xd,Fc,Bc,Vc,Wc]),IB=Pe([Lc,qc,Zc,sD,As]),zB=Pe([Mc,tf,rf,Jc,nf,Gc,Hc,di]),DB=Pe([Uc,Dz,Jz,iD,Fc,Bc,Vc,Wc]),OB=Pe([Lc,qc,Pz,cz,rz,kz,_z,As,Qz]),NB=Pe([Mc,GI,nD,yz,pz,YI,XI,tz,Kc,bz,Gc,Hc,di]),V=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===ee.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Md(o.elicitations,r)}return new e(t,r,n)}},Md=class extends V{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(ee.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function aD(e){return pi.parse(JSON.parse(e))}function h0(e){return JSON.stringify(e)+`
|
|
32
|
-
`}var Yc,m0=b(()=>{
|
|
31
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let l=p[1];if(t===p[0]){s(p);continue}if(n.external){let f=n.external.registry.get(p[0])?.id;if(t!==p[0]&&f){s(p);continue}}if(this.metadataRegistry.get(p[0])?.id){s(p);continue}if(l.cycle){s(p);continue}if(l.count>1&&n.reused==="ref"){s(p);continue}}let a=(p,l)=>{let d=this.seen.get(p),f=d.def??d.schema,h={...f};if(d.ref===null)return;let g=d.ref;if(d.ref=null,g){a(g,l);let y=this.seen.get(g).schema;y.$ref&&l.target==="draft-7"?(f.allOf=f.allOf??[],f.allOf.push(y)):(Object.assign(f,y),Object.assign(f,h))}d.isParent||this.override({zodSchema:p,jsonSchema:f,path:d.path??[]})};for(let p of[...this.seen.entries()].reverse())a(p[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let p=n.external.registry.get(t)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let p of this.seen.entries()){let l=p[1];l.def&&l.defId&&(u[l.defId]=l.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var vb=b(()=>{});var Tt=b(()=>{ni();Yp();Wp();$w();bc();nd();Mr();wc();$c();ud();rd();yb();gb();_b();vb()});var xd=b(()=>{Tt()});var ks={};rr(ks,{ZodISODate:()=>bb,ZodISODateTime:()=>wb,ZodISODuration:()=>kb,ZodISOTime:()=>xb,date:()=>Sd,datetime:()=>kd,duration:()=>Pd,time:()=>$d});function kd(e){return Qw(wb,e)}function Sd(e){return Xw(bb,e)}function $d(e){return eb(xb,e)}function Pd(e){return tb(kb,e)}var wb,bb,xb,kb,Ed=b(()=>{Tt();Ac();wb=S("ZodISODateTime",(e,t)=>{Uv.init(e,t),Ie.init(e,t)});bb=S("ZodISODate",(e,t)=>{qv.init(e,t),Ie.init(e,t)});xb=S("ZodISOTime",(e,t)=>{Fv.init(e,t),Ie.init(e,t)});kb=S("ZodISODuration",(e,t)=>{Gv.init(e,t),Ie.init(e,t)})});var $b,O7,Ss,Cd=b(()=>{Tt();Tt();$b=(e,t)=>{gc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>_c(e,r)},flatten:{value:r=>yc(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},O7=S("ZodError",$b),Ss=S("ZodError",$b,{Parent:Error})});var Pb,Eb,Cb,Tb,Td=b(()=>{Tt();Cd();Pb=C_(Ss),Eb=T_(Ss),Cb=Kp(Ss),Tb=Jp(Ss)});function _(e){return Aw(Id,e)}function Ob(e){return pd(Db,e)}function de(e){return rb(Ic,e)}function Rb(e){return ob(QR,e)}function be(e){return ib(zd,e)}function Dd(e){return cb(XR,e)}function jb(){return ub(eI)}function ze(){return lb(tI)}function nI(e){return pb(rI,e)}function T(e,t){return fb(oI,e,t)}function A(e,t){let r={type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},...pe.normalizeParams(t)};return new Lb(r)}function Xe(e,t){return new Lb({type:"object",get shape(){return pe.assignProp(this,"shape",{...e}),this.shape},catchall:ze(),...pe.normalizeParams(t)})}function Pe(e,t){return new Zb({type:"union",options:e,...pe.normalizeParams(t)})}function Od(e,t,r){return new iI({type:"union",options:t,discriminator:e,...pe.normalizeParams(r)})}function zc(e,t){return new sI({type:"intersection",left:e,right:t})}function De(e,t,r){return new aI({type:"record",keyType:e,valueType:t,...pe.normalizeParams(r)})}function Lt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ad({type:"enum",entries:r,...pe.normalizeParams(t)})}function O(e,t){return new cI({type:"literal",values:Array.isArray(e)?e:[e],...pe.normalizeParams(t)})}function Ub(e){return new uI({type:"transform",transform:e})}function Me(e){return new qb({type:"optional",innerType:e})}function Ib(e){return new lI({type:"nullable",innerType:e})}function dI(e,t){return new pI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function hI(e,t){return new fI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function mI(e,t){return new Fb({type:"nonoptional",innerType:e,...pe.normalizeParams(t)})}function yI(e,t){return new gI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Rd(e,t){return new _I({type:"pipe",in:e,out:t})}function wI(e){return new vI({type:"readonly",innerType:e})}function bI(e){let t=new _t({check:"custom"});return t._zod.check=e,t}function Bb(e,t){return hb(Gb,e??(()=>!0),t)}function xI(e,t={}){return mb(Gb,e,t)}function kI(e){let t=bI(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(pe.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(pe.issue(o))}},e(r.value,r)));return t}function Nd(e,t){return Rd(Ub(e),t)}var $e,zb,Id,Ie,NR,Ab,Rc,Db,jR,MR,LR,ZR,UR,qR,FR,GR,BR,VR,HR,WR,KR,JR,YR,Ic,QR,zd,Nb,XR,eI,tI,rI,Mb,oI,Lb,Zb,iI,sI,aI,Ad,cI,uI,qb,lI,pI,fI,Fb,gI,_I,vI,Gb,Ac=b(()=>{Tt();Tt();xd();Ed();Td();$e=S("ZodType",(e,t)=>(he.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>or(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Pb(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Cb(e,r,n),e.parseAsync=async(r,n)=>Eb(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Tb(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(xI(r,n)),e.superRefine=r=>e.check(kI(r)),e.overwrite=r=>e.check(po(r)),e.optional=()=>Me(e),e.nullable=()=>Ib(e),e.nullish=()=>Me(Ib(e)),e.nonoptional=r=>mI(e,r),e.array=()=>T(e),e.or=r=>Pe([e,r]),e.and=r=>zc(e,r),e.transform=r=>Rd(e,Ub(r)),e.default=r=>dI(e,r),e.prefault=r=>hI(e,r),e.catch=r=>yI(e,r),e.pipe=r=>Rd(e,r),e.readonly=()=>wI(e),e.describe=r=>{let n=e.clone();return on.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return on.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return on.get(e);let n=e.clone();return on.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),zb=S("_ZodString",(e,t)=>{Sc.init(e,t),$e.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(dd(...n)),e.includes=(...n)=>e.check(md(...n)),e.startsWith=(...n)=>e.check(gd(...n)),e.endsWith=(...n)=>e.check(yd(...n)),e.min=(...n)=>e.check(ci(...n)),e.max=(...n)=>e.check(Pc(...n)),e.length=(...n)=>e.check(Ec(...n)),e.nonempty=(...n)=>e.check(ci(1,...n)),e.lowercase=n=>e.check(fd(n)),e.uppercase=n=>e.check(hd(n)),e.trim=()=>e.check(vd()),e.normalize=(...n)=>e.check(_d(...n)),e.toLowerCase=()=>e.check(wd()),e.toUpperCase=()=>e.check(bd())}),Id=S("ZodString",(e,t)=>{Sc.init(e,t),zb.init(e,t),e.email=r=>e.check(Iw(NR,r)),e.url=r=>e.check(pd(Db,r)),e.jwt=r=>e.check(Yw(YR,r)),e.emoji=r=>e.check(jw(jR,r)),e.guid=r=>e.check(ld(Ab,r)),e.uuid=r=>e.check(zw(Rc,r)),e.uuidv4=r=>e.check(Dw(Rc,r)),e.uuidv6=r=>e.check(Ow(Rc,r)),e.uuidv7=r=>e.check(Nw(Rc,r)),e.nanoid=r=>e.check(Mw(MR,r)),e.guid=r=>e.check(ld(Ab,r)),e.cuid=r=>e.check(Lw(LR,r)),e.cuid2=r=>e.check(Zw(ZR,r)),e.ulid=r=>e.check(Uw(UR,r)),e.base64=r=>e.check(Ww(WR,r)),e.base64url=r=>e.check(Kw(KR,r)),e.xid=r=>e.check(qw(qR,r)),e.ksuid=r=>e.check(Fw(FR,r)),e.ipv4=r=>e.check(Gw(GR,r)),e.ipv6=r=>e.check(Bw(BR,r)),e.cidrv4=r=>e.check(Vw(VR,r)),e.cidrv6=r=>e.check(Hw(HR,r)),e.e164=r=>e.check(Jw(JR,r)),e.datetime=r=>e.check(kd(r)),e.date=r=>e.check(Sd(r)),e.time=r=>e.check($d(r)),e.duration=r=>e.check(Pd(r))});Ie=S("ZodStringFormat",(e,t)=>{Ce.init(e,t),zb.init(e,t)}),NR=S("ZodEmail",(e,t)=>{Iv.init(e,t),Ie.init(e,t)}),Ab=S("ZodGUID",(e,t)=>{Av.init(e,t),Ie.init(e,t)}),Rc=S("ZodUUID",(e,t)=>{Rv.init(e,t),Ie.init(e,t)}),Db=S("ZodURL",(e,t)=>{zv.init(e,t),Ie.init(e,t)});jR=S("ZodEmoji",(e,t)=>{Dv.init(e,t),Ie.init(e,t)}),MR=S("ZodNanoID",(e,t)=>{Ov.init(e,t),Ie.init(e,t)}),LR=S("ZodCUID",(e,t)=>{Nv.init(e,t),Ie.init(e,t)}),ZR=S("ZodCUID2",(e,t)=>{jv.init(e,t),Ie.init(e,t)}),UR=S("ZodULID",(e,t)=>{Mv.init(e,t),Ie.init(e,t)}),qR=S("ZodXID",(e,t)=>{Lv.init(e,t),Ie.init(e,t)}),FR=S("ZodKSUID",(e,t)=>{Zv.init(e,t),Ie.init(e,t)}),GR=S("ZodIPv4",(e,t)=>{Bv.init(e,t),Ie.init(e,t)}),BR=S("ZodIPv6",(e,t)=>{Vv.init(e,t),Ie.init(e,t)}),VR=S("ZodCIDRv4",(e,t)=>{Hv.init(e,t),Ie.init(e,t)}),HR=S("ZodCIDRv6",(e,t)=>{Wv.init(e,t),Ie.init(e,t)}),WR=S("ZodBase64",(e,t)=>{Jv.init(e,t),Ie.init(e,t)}),KR=S("ZodBase64URL",(e,t)=>{Yv.init(e,t),Ie.init(e,t)}),JR=S("ZodE164",(e,t)=>{Qv.init(e,t),Ie.init(e,t)}),YR=S("ZodJWT",(e,t)=>{Xv.init(e,t),Ie.init(e,t)}),Ic=S("ZodNumber",(e,t)=>{id.init(e,t),$e.init(e,t),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(sn(n,o)),e.max=(n,o)=>e.check(sn(n,o)),e.int=n=>e.check(Rb(n)),e.safe=n=>e.check(Rb(n)),e.positive=n=>e.check(ai(0,n)),e.nonnegative=n=>e.check(wr(0,n)),e.negative=n=>e.check(si(0,n)),e.nonpositive=n=>e.check(sn(0,n)),e.multipleOf=(n,o)=>e.check(xs(n,o)),e.step=(n,o)=>e.check(xs(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});QR=S("ZodNumberFormat",(e,t)=>{ew.init(e,t),Ic.init(e,t)});zd=S("ZodBoolean",(e,t)=>{tw.init(e,t),$e.init(e,t)});Nb=S("ZodBigInt",(e,t)=>{rw.init(e,t),$e.init(e,t),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.gt=(n,o)=>e.check(ai(n,o)),e.gte=(n,o)=>e.check(wr(n,o)),e.min=(n,o)=>e.check(wr(n,o)),e.lt=(n,o)=>e.check(si(n,o)),e.lte=(n,o)=>e.check(sn(n,o)),e.max=(n,o)=>e.check(sn(n,o)),e.positive=n=>e.check(ai(BigInt(0),n)),e.negative=n=>e.check(si(BigInt(0),n)),e.nonpositive=n=>e.check(sn(BigInt(0),n)),e.nonnegative=n=>e.check(wr(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(xs(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),XR=S("ZodNull",(e,t)=>{nw.init(e,t),$e.init(e,t)});eI=S("ZodAny",(e,t)=>{ow.init(e,t),$e.init(e,t)});tI=S("ZodUnknown",(e,t)=>{iw.init(e,t),$e.init(e,t)});rI=S("ZodNever",(e,t)=>{sw.init(e,t),$e.init(e,t)});Mb=S("ZodDate",(e,t)=>{aw.init(e,t),$e.init(e,t),e.min=(n,o)=>e.check(wr(n,o)),e.max=(n,o)=>e.check(sn(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),oI=S("ZodArray",(e,t)=>{cw.init(e,t),$e.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ci(r,n)),e.nonempty=r=>e.check(ci(1,r)),e.max=(r,n)=>e.check(Pc(r,n)),e.length=(r,n)=>e.check(Ec(r,n)),e.unwrap=()=>e.element});Lb=S("ZodObject",(e,t)=>{uw.init(e,t),$e.init(e,t),pe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Lt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ze()}),e.loose=()=>e.clone({...e._zod.def,catchall:ze()}),e.strict=()=>e.clone({...e._zod.def,catchall:nI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pe.extend(e,r),e.merge=r=>pe.merge(e,r),e.pick=r=>pe.pick(e,r),e.omit=r=>pe.omit(e,r),e.partial=(...r)=>pe.partial(qb,e,r[0]),e.required=(...r)=>pe.required(Fb,e,r[0])});Zb=S("ZodUnion",(e,t)=>{sd.init(e,t),$e.init(e,t),e.options=t.options});iI=S("ZodDiscriminatedUnion",(e,t)=>{Zb.init(e,t),lw.init(e,t)});sI=S("ZodIntersection",(e,t)=>{pw.init(e,t),$e.init(e,t)});aI=S("ZodRecord",(e,t)=>{dw.init(e,t),$e.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});Ad=S("ZodEnum",(e,t)=>{fw.init(e,t),$e.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Ad({...t,checks:[],...pe.normalizeParams(o),entries:i})}});cI=S("ZodLiteral",(e,t)=>{hw.init(e,t),$e.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});uI=S("ZodTransform",(e,t)=>{mw.init(e,t),$e.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(pe.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(pe.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});qb=S("ZodOptional",(e,t)=>{gw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});lI=S("ZodNullable",(e,t)=>{yw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});pI=S("ZodDefault",(e,t)=>{_w.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});fI=S("ZodPrefault",(e,t)=>{vw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});Fb=S("ZodNonOptional",(e,t)=>{ww.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType});gI=S("ZodCatch",(e,t)=>{bw.init(e,t),$e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});_I=S("ZodPipe",(e,t)=>{xw.init(e,t),$e.init(e,t),e.in=t.in,e.out=t.out});vI=S("ZodReadonly",(e,t)=>{kw.init(e,t),$e.init(e,t)});Gb=S("ZodCustom",(e,t)=>{Sw.init(e,t),$e.init(e,t)})});var Vb,Hb=b(()=>{Vb={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var Dc={};rr(Dc,{bigint:()=>EI,boolean:()=>PI,date:()=>CI,number:()=>$I,string:()=>SI});function SI(e){return Rw(Id,e)}function $I(e){return nb(Ic,e)}function PI(e){return sb(zd,e)}function EI(e){return ab(Nb,e)}function CI(e){return db(Mb,e)}var Wb=b(()=>{Tt();Ac()});var Kb=b(()=>{Tt();Ac();xd();Cd();Td();Hb();Tt();Ew();Tt();$c();Ed();Wb();Mt(Pw())});var Jb=b(()=>{Kb()});var jd=b(()=>{Jb()});var li,Qb,An,Nc,at,Xb,e0,EB,zI,DI,Ld,Wt,$s,t0,ct,ir,sr,ut,jc,r0,ho,n0,o0,Zd,mo,ee,Ud,i0,pi,CB,Mc,OI,Lc,NI,Ps,ui,s0,jI,MI,LI,ZI,UI,qI,qd,FI,GI,Zc,a0,Uc,BI,VI,qc,HI,Es,Cs,WI,Ts,di,KI,As,Fc,Gc,Bc,TB,Vc,Hc,Wc,c0,u0,l0,Fd,p0,Rs,fi,d0,JI,Gd,YI,QI,XI,Bd,ez,Vd,tz,rz,nz,oz,iz,sz,az,cz,uz,lz,Hd,pz,dz,Wd,Kd,Jd,Yd,fz,hz,mz,Qd,gz,yz,_z,vz,wz,f0,Xd,bz,Kc,AB,xz,Is,kz,RB,zs,Sz,ef,$z,Pz,Ez,Cz,Tz,Az,Rz,Oc,Iz,zz,Dz,tf,rf,Oz,Nz,jz,Mz,Lz,Zz,Uz,qz,Fz,Gz,Bz,Vz,Hz,Wz,Kz,Jz,Yz,Qz,Jc,Xz,eD,tD,rD,nD,oD,iD,nf,sD,IB,zB,DB,OB,NB,jB,V,Md,Rn=b(()=>{jd();li="2025-11-25",Qb=[li,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],An="io.modelcontextprotocol/related-task",Nc="2.0",at=Bb(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Xb=Pe([_(),de().int()]),e0=_(),EB=Xe({ttl:Pe([de(),Dd()]).optional(),pollInterval:de().optional()}),zI=A({ttl:de().optional()}),DI=A({taskId:_()}),Ld=Xe({progressToken:Xb.optional(),[An]:DI.optional()}),Wt=A({_meta:Ld.optional()}),$s=Wt.extend({task:zI.optional()}),t0=e=>$s.safeParse(e).success,ct=A({method:_(),params:Wt.loose().optional()}),ir=A({_meta:Ld.optional()}),sr=A({method:_(),params:ir.loose().optional()}),ut=Xe({_meta:Ld.optional()}),jc=Pe([_(),de().int()]),r0=A({jsonrpc:O(Nc),id:jc,...ct.shape}).strict(),ho=e=>r0.safeParse(e).success,n0=A({jsonrpc:O(Nc),...sr.shape}).strict(),o0=e=>n0.safeParse(e).success,Zd=A({jsonrpc:O(Nc),id:jc,result:ut}).strict(),mo=e=>Zd.safeParse(e).success;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ee||(ee={}));Ud=A({jsonrpc:O(Nc),id:jc.optional(),error:A({code:de().int(),message:_(),data:ze().optional()})}).strict(),i0=e=>Ud.safeParse(e).success,pi=Pe([r0,n0,Zd,Ud]),CB=Pe([Zd,Ud]),Mc=ut.strict(),OI=ir.extend({requestId:jc.optional(),reason:_().optional()}),Lc=sr.extend({method:O("notifications/cancelled"),params:OI}),NI=A({src:_(),mimeType:_().optional(),sizes:T(_()).optional(),theme:Lt(["light","dark"]).optional()}),Ps=A({icons:T(NI).optional()}),ui=A({name:_(),title:_().optional()}),s0=ui.extend({...ui.shape,...Ps.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),jI=zc(A({applyDefaults:be().optional()}),De(_(),ze())),MI=Nd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,zc(A({form:jI.optional(),url:at.optional()}),De(_(),ze()).optional())),LI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({sampling:Xe({createMessage:at.optional()}).optional(),elicitation:Xe({create:at.optional()}).optional()}).optional()}),ZI=Xe({list:at.optional(),cancel:at.optional(),requests:Xe({tools:Xe({call:at.optional()}).optional()}).optional()}),UI=A({experimental:De(_(),at).optional(),sampling:A({context:at.optional(),tools:at.optional()}).optional(),elicitation:MI.optional(),roots:A({listChanged:be().optional()}).optional(),tasks:LI.optional()}),qI=Wt.extend({protocolVersion:_(),capabilities:UI,clientInfo:s0}),qd=ct.extend({method:O("initialize"),params:qI}),FI=A({experimental:De(_(),at).optional(),logging:at.optional(),completions:at.optional(),prompts:A({listChanged:be().optional()}).optional(),resources:A({subscribe:be().optional(),listChanged:be().optional()}).optional(),tools:A({listChanged:be().optional()}).optional(),tasks:ZI.optional()}),GI=ut.extend({protocolVersion:_(),capabilities:FI,serverInfo:s0,instructions:_().optional()}),Zc=sr.extend({method:O("notifications/initialized"),params:ir.optional()}),a0=e=>Zc.safeParse(e).success,Uc=ct.extend({method:O("ping"),params:Wt.optional()}),BI=A({progress:de(),total:Me(de()),message:Me(_())}),VI=A({...ir.shape,...BI.shape,progressToken:Xb}),qc=sr.extend({method:O("notifications/progress"),params:VI}),HI=Wt.extend({cursor:e0.optional()}),Es=ct.extend({params:HI.optional()}),Cs=ut.extend({nextCursor:e0.optional()}),WI=Lt(["working","input_required","completed","failed","cancelled"]),Ts=A({taskId:_(),status:WI,ttl:Pe([de(),Dd()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:Me(de()),statusMessage:Me(_())}),di=ut.extend({task:Ts}),KI=ir.merge(Ts),As=sr.extend({method:O("notifications/tasks/status"),params:KI}),Fc=ct.extend({method:O("tasks/get"),params:Wt.extend({taskId:_()})}),Gc=ut.merge(Ts),Bc=ct.extend({method:O("tasks/result"),params:Wt.extend({taskId:_()})}),TB=ut.loose(),Vc=Es.extend({method:O("tasks/list")}),Hc=Cs.extend({tasks:T(Ts)}),Wc=ct.extend({method:O("tasks/cancel"),params:Wt.extend({taskId:_()})}),c0=ut.merge(Ts),u0=A({uri:_(),mimeType:Me(_()),_meta:De(_(),ze()).optional()}),l0=u0.extend({text:_()}),Fd=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),p0=u0.extend({blob:Fd}),Rs=Lt(["user","assistant"]),fi=A({audience:T(Rs).optional(),priority:de().min(0).max(1).optional(),lastModified:ks.datetime({offset:!0}).optional()}),d0=A({...ui.shape,...Ps.shape,uri:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),JI=A({...ui.shape,...Ps.shape,uriTemplate:_(),description:Me(_()),mimeType:Me(_()),annotations:fi.optional(),_meta:Me(Xe({}))}),Gd=Es.extend({method:O("resources/list")}),YI=Cs.extend({resources:T(d0)}),QI=Es.extend({method:O("resources/templates/list")}),XI=Cs.extend({resourceTemplates:T(JI)}),Bd=Wt.extend({uri:_()}),ez=Bd,Vd=ct.extend({method:O("resources/read"),params:ez}),tz=ut.extend({contents:T(Pe([l0,p0]))}),rz=sr.extend({method:O("notifications/resources/list_changed"),params:ir.optional()}),nz=Bd,oz=ct.extend({method:O("resources/subscribe"),params:nz}),iz=Bd,sz=ct.extend({method:O("resources/unsubscribe"),params:iz}),az=ir.extend({uri:_()}),cz=sr.extend({method:O("notifications/resources/updated"),params:az}),uz=A({name:_(),description:Me(_()),required:Me(be())}),lz=A({...ui.shape,...Ps.shape,description:Me(_()),arguments:Me(T(uz)),_meta:Me(Xe({}))}),Hd=Es.extend({method:O("prompts/list")}),pz=Cs.extend({prompts:T(lz)}),dz=Wt.extend({name:_(),arguments:De(_(),_()).optional()}),Wd=ct.extend({method:O("prompts/get"),params:dz}),Kd=A({type:O("text"),text:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Jd=A({type:O("image"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),Yd=A({type:O("audio"),data:Fd,mimeType:_(),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),fz=A({type:O("tool_use"),name:_(),id:_(),input:De(_(),ze()),_meta:De(_(),ze()).optional()}),hz=A({type:O("resource"),resource:Pe([l0,p0]),annotations:fi.optional(),_meta:De(_(),ze()).optional()}),mz=d0.extend({type:O("resource_link")}),Qd=Pe([Kd,Jd,Yd,mz,hz]),gz=A({role:Rs,content:Qd}),yz=ut.extend({description:_().optional(),messages:T(gz)}),_z=sr.extend({method:O("notifications/prompts/list_changed"),params:ir.optional()}),vz=A({title:_().optional(),readOnlyHint:be().optional(),destructiveHint:be().optional(),idempotentHint:be().optional(),openWorldHint:be().optional()}),wz=A({taskSupport:Lt(["required","optional","forbidden"]).optional()}),f0=A({...ui.shape,...Ps.shape,description:_().optional(),inputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()),outputSchema:A({type:O("object"),properties:De(_(),at).optional(),required:T(_()).optional()}).catchall(ze()).optional(),annotations:vz.optional(),execution:wz.optional(),_meta:De(_(),ze()).optional()}),Xd=Es.extend({method:O("tools/list")}),bz=Cs.extend({tools:T(f0)}),Kc=ut.extend({content:T(Qd).default([]),structuredContent:De(_(),ze()).optional(),isError:be().optional()}),AB=Kc.or(ut.extend({toolResult:ze()})),xz=$s.extend({name:_(),arguments:De(_(),ze()).optional()}),Is=ct.extend({method:O("tools/call"),params:xz}),kz=sr.extend({method:O("notifications/tools/list_changed"),params:ir.optional()}),RB=A({autoRefresh:be().default(!0),debounceMs:de().int().nonnegative().default(300)}),zs=Lt(["debug","info","notice","warning","error","critical","alert","emergency"]),Sz=Wt.extend({level:zs}),ef=ct.extend({method:O("logging/setLevel"),params:Sz}),$z=ir.extend({level:zs,logger:_().optional(),data:ze()}),Pz=sr.extend({method:O("notifications/message"),params:$z}),Ez=A({name:_().optional()}),Cz=A({hints:T(Ez).optional(),costPriority:de().min(0).max(1).optional(),speedPriority:de().min(0).max(1).optional(),intelligencePriority:de().min(0).max(1).optional()}),Tz=A({mode:Lt(["auto","required","none"]).optional()}),Az=A({type:O("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:T(Qd).default([]),structuredContent:A({}).loose().optional(),isError:be().optional(),_meta:De(_(),ze()).optional()}),Rz=Od("type",[Kd,Jd,Yd]),Oc=Od("type",[Kd,Jd,Yd,fz,Az]),Iz=A({role:Rs,content:Pe([Oc,T(Oc)]),_meta:De(_(),ze()).optional()}),zz=$s.extend({messages:T(Iz),modelPreferences:Cz.optional(),systemPrompt:_().optional(),includeContext:Lt(["none","thisServer","allServers"]).optional(),temperature:de().optional(),maxTokens:de().int(),stopSequences:T(_()).optional(),metadata:at.optional(),tools:T(f0).optional(),toolChoice:Tz.optional()}),Dz=ct.extend({method:O("sampling/createMessage"),params:zz}),tf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens"]).or(_())),role:Rs,content:Rz}),rf=ut.extend({model:_(),stopReason:Me(Lt(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Rs,content:Pe([Oc,T(Oc)])}),Oz=A({type:O("boolean"),title:_().optional(),description:_().optional(),default:be().optional()}),Nz=A({type:O("string"),title:_().optional(),description:_().optional(),minLength:de().optional(),maxLength:de().optional(),format:Lt(["email","uri","date","date-time"]).optional(),default:_().optional()}),jz=A({type:Lt(["number","integer"]),title:_().optional(),description:_().optional(),minimum:de().optional(),maximum:de().optional(),default:de().optional()}),Mz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),default:_().optional()}),Lz=A({type:O("string"),title:_().optional(),description:_().optional(),oneOf:T(A({const:_(),title:_()})),default:_().optional()}),Zz=A({type:O("string"),title:_().optional(),description:_().optional(),enum:T(_()),enumNames:T(_()).optional(),default:_().optional()}),Uz=Pe([Mz,Lz]),qz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({type:O("string"),enum:T(_())}),default:T(_()).optional()}),Fz=A({type:O("array"),title:_().optional(),description:_().optional(),minItems:de().optional(),maxItems:de().optional(),items:A({anyOf:T(A({const:_(),title:_()}))}),default:T(_()).optional()}),Gz=Pe([qz,Fz]),Bz=Pe([Zz,Uz,Gz]),Vz=Pe([Bz,Oz,Nz,jz]),Hz=$s.extend({mode:O("form").optional(),message:_(),requestedSchema:A({type:O("object"),properties:De(_(),Vz),required:T(_()).optional()})}),Wz=$s.extend({mode:O("url"),message:_(),elicitationId:_(),url:_().url()}),Kz=Pe([Hz,Wz]),Jz=ct.extend({method:O("elicitation/create"),params:Kz}),Yz=ir.extend({elicitationId:_()}),Qz=sr.extend({method:O("notifications/elicitation/complete"),params:Yz}),Jc=ut.extend({action:Lt(["accept","decline","cancel"]),content:Nd(e=>e===null?void 0:e,De(_(),Pe([_(),de(),be(),T(_())])).optional())}),Xz=A({type:O("ref/resource"),uri:_()}),eD=A({type:O("ref/prompt"),name:_()}),tD=Wt.extend({ref:Pe([eD,Xz]),argument:A({name:_(),value:_()}),context:A({arguments:De(_(),_()).optional()}).optional()}),rD=ct.extend({method:O("completion/complete"),params:tD}),nD=ut.extend({completion:Xe({values:T(_()).max(100),total:Me(de().int()),hasMore:Me(be())})}),oD=A({uri:_().startsWith("file://"),name:_().optional(),_meta:De(_(),ze()).optional()}),iD=ct.extend({method:O("roots/list"),params:Wt.optional()}),nf=ut.extend({roots:T(oD)}),sD=sr.extend({method:O("notifications/roots/list_changed"),params:ir.optional()}),IB=Pe([Uc,qd,rD,ef,Wd,Hd,Gd,QI,Vd,oz,sz,Is,Xd,Fc,Bc,Vc,Wc]),zB=Pe([Lc,qc,Zc,sD,As]),DB=Pe([Mc,tf,rf,Jc,nf,Gc,Hc,di]),OB=Pe([Uc,Dz,Jz,iD,Fc,Bc,Vc,Wc]),NB=Pe([Lc,qc,Pz,cz,rz,kz,_z,As,Qz]),jB=Pe([Mc,GI,nD,yz,pz,YI,XI,tz,Kc,bz,Gc,Hc,di]),V=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===ee.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Md(o.elicitations,r)}return new e(t,r,n)}},Md=class extends V{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(ee.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function aD(e){return pi.parse(JSON.parse(e))}function h0(e){return JSON.stringify(e)+`
|
|
32
|
+
`}var Yc,m0=b(()=>{Rn();Yc=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
33
33
|
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),aD(r)}clear(){this._buffer=void 0}}});var of,hi,sf=b(()=>{of=yt(require("node:process"),1);m0();hi=class{constructor(t=of.default.stdin,r=of.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new Yc,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=h0(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}}});function R0(e){return typeof e>"u"||e===null}function cD(e){return typeof e=="object"&&e!==null}function uD(e){return Array.isArray(e)?e:R0(e)?[]:[e]}function lD(e,t){var r,n,o,i;if(t)for(i=Object.keys(t),r=0,n=i.length;r<n;r+=1)o=i[r],e[o]=t[o];return e}function pD(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function dD(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}function I0(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
34
34
|
|
|
35
35
|
`+e.mark.snippet),n+" "+r):n}function Os(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=I0(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}function af(e,t,r,n,o){var i="",s="",a=Math.floor(o/2)-1;return n-t>a&&(i=" ... ",t=n-a+i.length),r-n>a&&(s=" ...",r=n+a-s.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+s,pos:n-t+i.length}}function cf(e,t){return et.repeat(" ",t-e.length)+e}function vD(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],i,s=-1;i=r.exec(e.buffer);)o.push(i.index),n.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var a="",c,u,p=Math.min(e.line+t.linesAfter,o.length).toString().length,l=t.maxLength-(t.indent+p+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)u=af(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),l),a=et.repeat(" ",t.indent)+cf((e.line-c+1).toString(),p)+" | "+u.str+`
|
|
@@ -37,14 +37,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
37
37
|
`,a+=et.repeat("-",t.indent+p+3+u.pos)+`^
|
|
38
38
|
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)u=af(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),l),a+=et.repeat(" ",t.indent)+cf((e.line+c+1).toString(),p)+" | "+u.str+`
|
|
39
39
|
`;return a.replace(/\n$/,"")}function kD(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function SD(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(bD.indexOf(r)===-1)throw new At('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=kD(t.styleAliases||null),xD.indexOf(this.kind)===-1)throw new At('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}function g0(e,t){var r=[];return e[t].forEach(function(n){var o=r.length;r.forEach(function(i,s){i.tag===n.tag&&i.kind===n.kind&&i.multi===n.multi&&(o=s)}),r[o]=n}),r}function $D(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function lf(e){return this.extend(e)}function PD(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function ED(){return null}function CD(e){return e===null}function TD(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function AD(e){return e==="true"||e==="True"||e==="TRUE"}function RD(e){return Object.prototype.toString.call(e)==="[object Boolean]"}function ID(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function zD(e){return 48<=e&&e<=55}function DD(e){return 48<=e&&e<=57}function OD(e){if(e===null)return!1;var t=e.length,r=0,n=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!ID(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!zD(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!DD(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function ND(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function jD(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!et.isNegativeZero(e)}function LD(e){return!(e===null||!MD.test(e)||e[e.length-1]==="_")}function ZD(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}function qD(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(et.isNegativeZero(e))return"-0.0";return r=e.toString(10),UD.test(r)?r.replace("e",".e"):r}function FD(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||et.isNegativeZero(e))}function GD(e){return e===null?!1:G0.exec(e)!==null||B0.exec(e)!==null}function BD(e){var t,r,n,o,i,s,a,c=0,u=null,p,l,d;if(t=G0.exec(e),t===null&&(t=B0.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,o));if(i=+t[4],s=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(p=+t[10],l=+(t[11]||0),u=(p*60+l)*6e4,t[9]==="-"&&(u=-u)),d=new Date(Date.UTC(r,n,o,i,s,a,c)),u&&d.setTime(d.getTime()-u),d}function VD(e){return e.toISOString()}function HD(e){return e==="<<"||e===null}function WD(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=mf;for(r=0;r<o;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function KD(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=mf,s=0,a=[];for(t=0;t<o;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|i.indexOf(n.charAt(t));return r=o%4*6,r===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):r===18?(a.push(s>>10&255),a.push(s>>2&255)):r===12&&a.push(s>>4&255),new Uint8Array(a)}function JD(e){var t="",r=0,n,o,i=e.length,s=mf;for(n=0;n<i;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return o=i%3,o===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):o===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):o===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function YD(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function eO(e){if(e===null)return!0;var t=[],r,n,o,i,s,a=e;for(r=0,n=a.length;r<n;r+=1){if(o=a[r],s=!1,XD.call(o)!=="[object Object]")return!1;for(i in o)if(QD.call(o,i))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function tO(e){return e!==null?e:[]}function nO(e){if(e===null)return!0;var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],rO.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function oO(e){if(e===null)return[];var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],o=Object.keys(n),i[t]=[o[0],n[o[0]]];return i}function sO(e){if(e===null)return!0;var t,r=e;for(t in r)if(iO.call(r,t)&&r[t]!==null)return!1;return!0}function aO(e){return e!==null?e:{}}function _0(e){return Object.prototype.toString.call(e)}function Lr(e){return e===10||e===13}function yo(e){return e===9||e===32}function Zt(e){return e===9||e===32||e===10||e===13}function gi(e){return e===44||e===91||e===93||e===123||e===125}function dO(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function fO(e){return e===120?2:e===117?4:e===85?8:0}function hO(e){return 48<=e&&e<=57?e-48:-1}function v0(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
40
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function mO(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function rx(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}function gO(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||gf,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ix(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=wD(r),new At(t,r)}function M(e,t){throw ix(e,t)}function eu(e,t){e.onWarning&&e.onWarning.call(null,ix(e,t))}function
|
|
41
|
-
`,t-1))}function yO(e,t,r){var n,o,i,s,a,c,u,p,l=e.kind,d=e.result,f;if(f=e.input.charCodeAt(e.position),Zt(f)||gi(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(o=e.input.charCodeAt(e.position+1),Zt(o)||r&&gi(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;f!==0;){if(f===58){if(o=e.input.charCodeAt(e.position+1),Zt(o)||r&&gi(o))break}else if(f===35){if(n=e.input.charCodeAt(e.position-1),Zt(n))break}else{if(e.position===e.lineStart&&nu(e)||r&&gi(f))break;if(Lr(f))if(c=e.line,u=e.lineStart,p=e.lineIndent,He(e,!1,-1),e.lineIndent>=t){a=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=p;break}}a&&(
|
|
40
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function mO(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function rx(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}function gO(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||gf,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ix(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=wD(r),new At(t,r)}function M(e,t){throw ix(e,t)}function eu(e,t){e.onWarning&&e.onWarning.call(null,ix(e,t))}function In(e,t,r,n){var o,i,s,a;if(t<r){if(a=e.input.slice(t,r),n)for(o=0,i=a.length;o<i;o+=1)s=a.charCodeAt(o),s===9||32<=s&&s<=1114111||M(e,"expected valid JSON character");else uO.test(a)&&M(e,"the stream contains non-printable characters");e.result+=a}}function b0(e,t,r,n){var o,i,s,a;for(et.isObject(r)||M(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),s=0,a=o.length;s<a;s+=1)i=o[s],zn.call(t,i)||(rx(t,i,r[i]),n[i]=!0)}function yi(e,t,r,n,o,i,s,a,c){var u,p;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),u=0,p=o.length;u<p;u+=1)Array.isArray(o[u])&&M(e,"nested arrays are not supported inside keys"),typeof o=="object"&&_0(o[u])==="[object Object]"&&(o[u]="[object Object]");if(typeof o=="object"&&_0(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(u=0,p=i.length;u<p;u+=1)b0(e,t,i[u],r);else b0(e,t,i,r);else!e.json&&!zn.call(r,o)&&zn.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,M(e,"duplicated mapping key")),rx(t,o,i),delete r[o];return t}function yf(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):M(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function He(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;yo(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Lr(o))for(yf(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&eu(e,"deficient indentation"),n}function nu(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Zt(r)))}function _f(e,t){t===1?e.result+=" ":t>1&&(e.result+=et.repeat(`
|
|
41
|
+
`,t-1))}function yO(e,t,r){var n,o,i,s,a,c,u,p,l=e.kind,d=e.result,f;if(f=e.input.charCodeAt(e.position),Zt(f)||gi(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(o=e.input.charCodeAt(e.position+1),Zt(o)||r&&gi(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;f!==0;){if(f===58){if(o=e.input.charCodeAt(e.position+1),Zt(o)||r&&gi(o))break}else if(f===35){if(n=e.input.charCodeAt(e.position-1),Zt(n))break}else{if(e.position===e.lineStart&&nu(e)||r&&gi(f))break;if(Lr(f))if(c=e.line,u=e.lineStart,p=e.lineIndent,He(e,!1,-1),e.lineIndent>=t){a=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=p;break}}a&&(In(e,i,s,!1),_f(e,e.line-c),i=s=e.position,a=!1),yo(f)||(s=e.position+1),f=e.input.charCodeAt(++e.position)}return In(e,i,s,!1),e.result?!0:(e.kind=l,e.result=d,!1)}function _O(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(In(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else Lr(r)?(In(e,n,o,!0),_f(e,He(e,!1,t)),n=o=e.position):e.position===e.lineStart&&nu(e)?M(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);M(e,"unexpected end of the stream within a single quoted scalar")}function vO(e,t){var r,n,o,i,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return In(e,r,e.position,!0),e.position++,!0;if(a===92){if(In(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Lr(a))He(e,!1,t);else if(a<256&&nx[a])e.result+=ox[a],e.position++;else if((s=fO(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=dO(a))>=0?i=(i<<4)+s:M(e,"expected hexadecimal character");e.result+=mO(i),e.position++}else M(e,"unknown escape sequence");r=n=e.position}else Lr(a)?(In(e,r,n,!0),_f(e,He(e,!1,t)),r=n=e.position):e.position===e.lineStart&&nu(e)?M(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}M(e,"unexpected end of the stream within a double quoted scalar")}function wO(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,u,p,l,d,f,h=Object.create(null),g,y,v,w;if(w=e.input.charCodeAt(e.position),w===91)p=93,f=!1,a=[];else if(w===123)p=125,f=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),w=e.input.charCodeAt(++e.position);w!==0;){if(He(e,!0,t),w=e.input.charCodeAt(e.position),w===p)return e.position++,e.tag=s,e.anchor=c,e.kind=f?"mapping":"sequence",e.result=a,!0;r?w===44&&M(e,"expected the node content, but found ','"):M(e,"missed comma between flow collection entries"),y=g=v=null,l=d=!1,w===63&&(u=e.input.charCodeAt(e.position+1),Zt(u)&&(l=d=!0,e.position++,He(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,_i(e,t,Qc,!1,!0),y=e.tag,g=e.result,He(e,!0,t),w=e.input.charCodeAt(e.position),(d||e.line===n)&&w===58&&(l=!0,w=e.input.charCodeAt(++e.position),He(e,!0,t),_i(e,t,Qc,!1,!0),v=e.result),f?yi(e,a,h,y,g,v,n,o,i):l?a.push(yi(e,null,h,y,g,v,n,o,i)):a.push(g),He(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(r=!0,w=e.input.charCodeAt(++e.position)):r=!1}M(e,"unexpected end of the stream within a flow collection")}function bO(e,t){var r,n,o=uf,i=!1,s=!1,a=t,c=0,u=!1,p,l;if(l=e.input.charCodeAt(e.position),l===124)n=!1;else if(l===62)n=!0;else return!1;for(e.kind="scalar",e.result="";l!==0;)if(l=e.input.charCodeAt(++e.position),l===43||l===45)uf===o?o=l===43?y0:cO:M(e,"repeat of a chomping mode identifier");else if((p=hO(l))>=0)p===0?M(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?M(e,"repeat of an indentation width identifier"):(a=t+p-1,s=!0);else break;if(yo(l)){do l=e.input.charCodeAt(++e.position);while(yo(l));if(l===35)do l=e.input.charCodeAt(++e.position);while(!Lr(l)&&l!==0)}for(;l!==0;){for(yf(e),e.lineIndent=0,l=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Lr(l)){c++;continue}if(e.lineIndent<a){o===y0?e.result+=et.repeat(`
|
|
42
42
|
`,i?1+c:c):o===uf&&i&&(e.result+=`
|
|
43
43
|
`);break}for(n?yo(l)?(u=!0,e.result+=et.repeat(`
|
|
44
44
|
`,i?1+c:c)):u?(u=!1,e.result+=et.repeat(`
|
|
45
45
|
`,c+1)):c===0?i&&(e.result+=" "):e.result+=et.repeat(`
|
|
46
46
|
`,c):e.result+=et.repeat(`
|
|
47
|
-
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Lr(l)&&l!==0;)l=e.input.charCodeAt(++e.position);
|
|
47
|
+
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Lr(l)&&l!==0;)l=e.input.charCodeAt(++e.position);In(e,r,e.position,!1)}return!0}function x0(e,t){var r,n=e.tag,o=e.anchor,i=[],s,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,M(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!Zt(s))));){if(a=!0,e.position++,He(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,_i(e,t,X0,!1,!0),i.push(e.result),He(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)M(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function xO(e,t,r){var n,o,i,s,a,c,u=e.tag,p=e.anchor,l={},d=Object.create(null),f=null,h=null,g=null,y=!1,v=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),w=e.input.charCodeAt(e.position);w!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,M(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(w===63||w===58)&&Zt(n))w===63?(y&&(yi(e,l,d,f,h,null,s,a,c),f=h=g=null),v=!0,y=!0,o=!0):y?(y=!1,o=!0):M(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=n;else{if(s=e.line,a=e.lineStart,c=e.position,!_i(e,r,Q0,!1,!0))break;if(e.line===i){for(w=e.input.charCodeAt(e.position);yo(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),Zt(w)||M(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(yi(e,l,d,f,h,null,s,a,c),f=h=g=null),v=!0,y=!1,o=!1,f=e.tag,h=e.result;else if(v)M(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=p,!0}else if(v)M(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=p,!0}if((e.line===i||e.lineIndent>t)&&(y&&(s=e.line,a=e.lineStart,c=e.position),_i(e,t,Xc,!0,o)&&(y?h=e.result:g=e.result),y||(yi(e,l,d,f,h,g,s,a,c),f=h=g=null),He(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&w!==0)M(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&yi(e,l,d,f,h,null,s,a,c),v&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=l),v}function kO(e){var t,r=!1,n=!1,o,i,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&M(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,o="!!",s=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(i=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):M(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Zt(s);)s===33&&(n?M(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),ex.test(o)||M(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),pO.test(i)&&M(e,"tag suffix cannot contain flow indicator characters")}i&&!tx.test(i)&&M(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{M(e,"tag name is malformed: "+i)}return r?e.tag=i:zn.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:M(e,'undeclared tag handle "'+o+'"'),!0}function SO(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&M(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Zt(r)&&!gi(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&M(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function $O(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Zt(n)&&!gi(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&M(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),zn.call(e.anchorMap,r)||M(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],He(e,!0,-1),!0}function _i(e,t,r,n,o){var i,s,a,c=1,u=!1,p=!1,l,d,f,h,g,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=Xc===r||X0===r,n&&He(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;kO(e)||SO(e);)He(e,!0,-1)?(u=!0,a=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=u||o),(c===1||Xc===r)&&(Qc===r||Q0===r?g=t:g=t+1,y=e.position-e.lineStart,c===1?a&&(x0(e,y)||xO(e,y,g))||wO(e,g)?p=!0:(s&&bO(e,g)||_O(e,g)||vO(e,g)?p=!0:$O(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&M(e,"alias node should not have any properties")):yO(e,g,Qc===r)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=a&&x0(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&M(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,d=e.implicitTypes.length;l<d;l+=1)if(h=e.implicitTypes[l],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(zn.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,f=e.typeMap.multi[e.kind||"fallback"],l=0,d=f.length;l<d;l+=1)if(e.tag.slice(0,f[l].tag.length)===f[l].tag){h=f[l];break}h||M(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&M(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):M(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function PO(e){var t=e.position,r,n,o,i=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(He(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(i=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!Zt(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&M(e,"directive name must not be less than one character in length");s!==0;){for(;yo(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Lr(s));break}if(Lr(s))break;for(r=e.position;s!==0&&!Zt(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&yf(e),zn.call(w0,n)?w0[n](e,n,o):eu(e,'unknown document directive "'+n+'"')}if(He(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,He(e,!0,-1)):i&&M(e,"directives end mark is expected"),_i(e,e.lineIndent-1,Xc,!1,!0),He(e,!0,-1),e.checkLineBreaks&&lO.test(e.input.slice(t,e.position))&&eu(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&nu(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,He(e,!0,-1));return}if(e.position<e.length-1)M(e,"end of the stream or a document separator is expected");else return}function sx(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
48
48
|
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new gO(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,M(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)PO(r);return r.documents}function EO(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=sx(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function CO(e,t){var r=sx(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new At("expected a single document in the stream, but found more")}}function KO(e,t){var r,n,o,i,s,a,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,i=n.length;o<i;o+=1)s=n[o],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),c=e.compiledTypeMap.fallback[s],c&&ux.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function JO(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new At("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+et.repeat("0",n-t.length)+t}function QO(e){this.schema=e.schema||gf,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=et.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=KO(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?js:YO,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function k0(e,t){for(var r=et.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
|
|
49
49
|
`,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
|
|
50
50
|
`&&(i+=r),i+=s;return i}function df(e,t){return`
|
|
@@ -59,24 +59,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
59
59
|
`:"")+C0(c,t),o=i}return n}function C0(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,i,s=0,a=0,c="";n=r.exec(e);)a=n.index,a-o>t&&(i=s>o?s:a,c+=`
|
|
60
60
|
`+e.slice(o,i),o=i+1),s=a;return c+=`
|
|
61
61
|
`,e.length-o>t&&s>o?c+=e.slice(o,s)+`
|
|
62
|
-
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function iN(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=Ds(e,o),n=vt[r],!n&&Ms(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||JO(r);return t}function sN(e,t,r){var n="",o=e.tag,i,s,a;for(i=0,s=r.length;i<s;i+=1)a=r[i],e.replacer&&(a=e.replacer.call(r,String(i),a)),(
|
|
63
|
-
`:""}function wf(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var fD,hD,mD,gD,yD,_D,et,At,wD,bD,xD,lt,z0,D0,O0,N0,j0,M0,L0,Z0,MD,UD,U0,q0,F0,G0,B0,V0,H0,mf,W0,QD,XD,K0,rO,J0,iO,Y0,gf,
|
|
64
|
-
\r`;W0=new lt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:WD,construct:KD,predicate:YD,represent:JD}),QD=Object.prototype.hasOwnProperty,XD=Object.prototype.toString;K0=new lt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:eO,construct:tO}),rO=Object.prototype.toString;J0=new lt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:nO,construct:oO}),iO=Object.prototype.hasOwnProperty;Y0=new lt("tag:yaml.org,2002:set",{kind:"mapping",resolve:sO,construct:aO}),gf=F0.extend({implicit:[V0,H0],explicit:[W0,K0,J0,Y0]}),In=Object.prototype.hasOwnProperty,Qc=1,Q0=2,X0=3,Xc=4,uf=1,cO=2,y0=3,uO=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lO=/[\x85\u2028\u2029]/,pO=/[,\[\]\{\}]/,ex=/^(?:!|!!|![a-z\-]+!)$/i,tx=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;nx=new Array(256),ox=new Array(256);for(go=0;go<256;go++)nx[go]=v0(go)?1:0,ox[go]=v0(go);w0={YAML:function(t,r,n){var o,i,s;t.version!==null&&M(t,"duplication of %YAML directive"),n.length!==1&&M(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&M(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&M(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&eu(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&M(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],ex.test(o)||M(t,"ill-formed tag handle (first argument) of the TAG directive"),In.call(t.tagMap,o)&&M(t,'there is a previously declared suffix for "'+o+'" tag handle'),tx.test(i)||M(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{M(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};TO=EO,AO=CO,ax={loadAll:TO,load:AO},cx=Object.prototype.toString,ux=Object.prototype.hasOwnProperty,vf=65279,RO=9,Ns=10,IO=13,zO=32,DO=33,OO=34,pf=35,NO=37,jO=38,MO=39,LO=42,lx=44,ZO=45,tu=58,UO=61,qO=62,FO=63,GO=64,px=91,dx=93,BO=96,fx=123,VO=124,hx=125,vt={};vt[0]="\\0";vt[7]="\\a";vt[8]="\\b";vt[9]="\\t";vt[10]="\\n";vt[11]="\\v";vt[12]="\\f";vt[13]="\\r";vt[27]="\\e";vt[34]='\\"';vt[92]="\\\\";vt[133]="\\N";vt[160]="\\_";vt[8232]="\\L";vt[8233]="\\P";HO=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],WO=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;YO=1,js=2;gx=1,ff=2,yx=3,_x=4,mi=5;pN=lN,dN={dump:pN};fN=lt,hN=z0,mN=j0,gN=q0,yN=F0,_N=gf,vN=ax.load,wN=ax.loadAll,bN=dN.dump,xN=At,kN={binary:W0,float:U0,map:N0,null:M0,pairs:J0,set:Y0,timestamp:V0,bool:L0,int:Z0,merge:H0,omap:K0,seq:O0,str:D0},SN=wf("safeLoad","load"),$N=wf("safeLoadAll","loadAll"),PN=wf("safeDump","dump"),br={Type:fN,Schema:hN,FAILSAFE_SCHEMA:mN,JSON_SCHEMA:gN,CORE_SCHEMA:yN,DEFAULT_SCHEMA:_N,load:vN,loadAll:wN,dump:bN,YAMLException:xN,types:kN,safeLoad:SN,safeLoadAll:$N,safeDump:PN}});var re,bf,I,Zr,Zs=b(()=>{(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(re||(re={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(bf||(bf={}));I=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zr=e=>{switch(typeof e){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(e)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(e)?I.array:e===null?I.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?I.promise:typeof Map<"u"&&e instanceof Map?I.map:typeof Set<"u"&&e instanceof Set?I.set:typeof Date<"u"&&e instanceof Date?I.date:I.object;default:return I.unknown}}});var E,EN,Ut,ou=b(()=>{Zs();E=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),EN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Ut=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ut.create=e=>new Ut(e)});var CN,an,xf=b(()=>{ou();Zs();CN=(e,t)=>{let r;switch(e.code){case E.invalid_type:e.received===I.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:re.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case E.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case E.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},an=CN});function TN(e){vx=e}function vi(){return vx}var vx,iu=b(()=>{xf();vx=an});function R(e,t){let r=vi(),n=Us({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===an?void 0:an].filter(o=>!!o)});e.common.issues.push(n)}var Us,AN,pt,Z,_o,wt,su,au,zn,wi,kf=b(()=>{iu();xf();Us=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},AN=[];pt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Z;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Z;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},Z=Object.freeze({status:"aborted"}),_o=e=>({status:"dirty",value:e}),wt=e=>({status:"valid",value:e}),su=e=>e.status==="aborted",au=e=>e.status==="dirty",zn=e=>e.status==="valid",wi=e=>typeof Promise<"u"&&e instanceof Promise});var wx=b(()=>{});var D,bx=b(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(D||(D={}))});function B(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}function $x(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function HN(e){return new RegExp(`^${$x(e)}$`)}function Px(e){let t=`${Sx}T${$x(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function WN(e,t){return!!((t==="v4"||!t)&&ZN.test(e)||(t==="v6"||!t)&&qN.test(e))}function KN(e,t){if(!NN.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function JN(e,t){return!!((t==="v4"||!t)&&UN.test(e)||(t==="v6"||!t)&&FN.test(e))}function YN(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function bi(e){if(e instanceof qt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=sr.create(bi(n))}return new qt({...e._def,shape:()=>t})}else return e instanceof ln?new ln({...e._def,type:bi(e.element)}):e instanceof sr?sr.create(bi(e.unwrap())):e instanceof qr?qr.create(bi(e.unwrap())):e instanceof Ur?Ur.create(e.items.map(t=>bi(t))):e}function $f(e,t){let r=Zr(e),n=Zr(t);if(e===t)return{valid:!0,data:e};if(r===I.object&&n===I.object){let o=re.objectKeys(t),i=re.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=$f(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===I.array&&n===I.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=$f(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===I.date&&n===I.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function Ex(e,t){return new To({values:e,typeName:C.ZodEnum,...B(t)})}function kx(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Cx(e,t={},r){return e?On.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=kx(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=kx(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):On.create()}var ar,xx,J,RN,IN,zN,DN,ON,NN,jN,MN,LN,Sf,ZN,UN,qN,FN,GN,BN,Sx,VN,Dn,vo,wo,bo,xo,xi,ko,So,On,un,xr,ki,ln,qt,$o,cn,cu,Po,Ur,uu,Si,$i,lu,Eo,Co,To,Ao,Nn,cr,sr,qr,Ro,Io,Pi,QN,qs,Fs,zo,XN,C,ej,Tx,Ax,tj,rj,Rx,nj,oj,ij,sj,aj,cj,uj,lj,pj,dj,fj,hj,mj,gj,yj,_j,vj,wj,bj,xj,kj,Sj,$j,Pj,Ej,Cj,Tj,Aj,Rj,Ij,zj,Dj,Oj,Nj,Ix=b(()=>{ou();iu();bx();kf();Zs();ar=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},xx=(e,t)=>{if(zn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ut(e.common.issues);return this._error=r,this._error}}};J=class{get description(){return this._def.description}_getType(t){return Zr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Zr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new pt,ctx:{common:t.parent.common,data:t.data,parsedType:Zr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(wi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return xx(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return zn(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>zn(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zr(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(wi(o)?o:Promise.resolve(o));return xx(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:E.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new cr({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return sr.create(this,this._def)}nullable(){return qr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ln.create(this)}promise(){return Nn.create(this,this._def)}or(t){return $o.create([this,t],this._def)}and(t){return Po.create(this,t,this._def)}transform(t){return new cr({...B(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ro({...B(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new qs({typeName:C.ZodBranded,type:this,...B(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Io({...B(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Fs.create(this,t)}readonly(){return zo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RN=/^c[^\s-]{8,}$/i,IN=/^[0-9a-z]+$/,zN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,DN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ON=/^[a-z0-9_-]{21}$/i,NN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ZN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,UN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,FN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",VN=new RegExp(`^${Sx}$`);Dn=class e extends J{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==I.string){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_type,expected:I.string,received:i.parsedType}),Z}let n=new pt,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?R(o,{code:E.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&R(o,{code:E.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")MN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"email",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Sf||(Sf=new RegExp(LN,"u")),Sf.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"emoji",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")DN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"uuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")ON.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"nanoid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")RN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")IN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cuid2",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")zN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"ulid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),R(o,{validation:"url",code:E.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"regex",code:E.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Px(i).test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?VN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?HN(i).test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?jN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"duration",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?WN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"ip",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?KN(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"jwt",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?JN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cidr",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?GN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"base64",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?BN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"base64url",code:E.invalid_string,message:i.message}),n.dirty()):re.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:E.invalid_string,...D.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...D.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...D.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...D.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...D.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...D.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...D.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...D.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...D.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...D.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...D.errToObj(r)})}nonempty(t){return this.min(1,D.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Dn.create=e=>new Dn({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...B(e)});vo=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==I.number){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_type,expected:I.number,received:i.parsedType}),Z}let n,o=new pt;for(let i of this._def.checks)i.kind==="int"?re.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),R(n,{code:E.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?YN(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),R(n,{code:E.not_finite,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:D.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&re.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};vo.create=e=>new vo({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...B(e)});wo=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==I.bigint)return this._getInvalidInput(t);let n,o=new pt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return R(r,{code:E.invalid_type,expected:I.bigint,received:r.parsedType}),Z}gte(t,r){return this.setLimit("min",t,!0,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};wo.create=e=>new wo({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...B(e)});bo=class extends J{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==I.boolean){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.boolean,received:n.parsedType}),Z}return wt(t.data)}};bo.create=e=>new bo({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...B(e)});xo=class e extends J{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==I.date){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_type,expected:I.date,received:i.parsedType}),Z}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_date}),Z}let n=new pt,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):re.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:D.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:D.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};xo.create=e=>new xo({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...B(e)});xi=class extends J{_parse(t){if(this._getType(t)!==I.symbol){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.symbol,received:n.parsedType}),Z}return wt(t.data)}};xi.create=e=>new xi({typeName:C.ZodSymbol,...B(e)});ko=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.undefined,received:n.parsedType}),Z}return wt(t.data)}};ko.create=e=>new ko({typeName:C.ZodUndefined,...B(e)});So=class extends J{_parse(t){if(this._getType(t)!==I.null){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.null,received:n.parsedType}),Z}return wt(t.data)}};So.create=e=>new So({typeName:C.ZodNull,...B(e)});On=class extends J{constructor(){super(...arguments),this._any=!0}_parse(t){return wt(t.data)}};On.create=e=>new On({typeName:C.ZodAny,...B(e)});un=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(t){return wt(t.data)}};un.create=e=>new un({typeName:C.ZodUnknown,...B(e)});xr=class extends J{_parse(t){let r=this._getOrReturnCtx(t);return R(r,{code:E.invalid_type,expected:I.never,received:r.parsedType}),Z}};xr.create=e=>new xr({typeName:C.ZodNever,...B(e)});ki=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.void,received:n.parsedType}),Z}return wt(t.data)}};ki.create=e=>new ki({typeName:C.ZodVoid,...B(e)});ln=class e extends J{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==I.array)return R(r,{code:E.invalid_type,expected:I.array,received:r.parsedType}),Z;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(R(r,{code:s?E.too_big:E.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(R(r,{code:E.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(R(r,{code:E.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new ar(r,s,r.path,a)))).then(s=>pt.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new ar(r,s,r.path,a)));return pt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:D.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:D.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:D.toString(r)}})}nonempty(t){return this.min(1,t)}};ln.create=(e,t)=>new ln({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...B(t)});qt=class e extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=re.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==I.object){let u=this._getOrReturnCtx(t);return R(u,{code:E.invalid_type,expected:I.object,received:u.parsedType}),Z}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof xr&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let p=i[u],l=o.data[u];c.push({key:{status:"valid",value:u},value:p._parse(new ar(o,l,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof xr){let u=this._def.unknownKeys;if(u==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(u==="strict")a.length>0&&(R(o,{code:E.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let p of a){let l=o.data[p];c.push({key:{status:"valid",value:p},value:u._parse(new ar(o,l,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let p of c){let l=await p.key,d=await p.value;u.push({key:l,value:d,alwaysSet:p.alwaysSet})}return u}).then(u=>pt.mergeObjectSync(n,u)):pt.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return D.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:D.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:C.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of re.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of re.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return bi(this)}partial(t){let r={};for(let n of re.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of re.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof sr;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Ex(re.objectKeys(this.shape))}};qt.create=(e,t)=>new qt({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:C.ZodObject,...B(t)});qt.strictCreate=(e,t)=>new qt({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:C.ZodObject,...B(t)});qt.lazycreate=(e,t)=>new qt({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:C.ZodObject,...B(t)});$o=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new Ut(a.ctx.common.issues));return R(r,{code:E.invalid_union,unionErrors:s}),Z}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new Ut(c));return R(r,{code:E.invalid_union,unionErrors:a}),Z}}get options(){return this._def.options}};$o.create=(e,t)=>new $o({options:e,typeName:C.ZodUnion,...B(t)});cn=e=>e instanceof Eo?cn(e.schema):e instanceof cr?cn(e.innerType()):e instanceof Co?[e.value]:e instanceof To?e.options:e instanceof Ao?re.objectValues(e.enum):e instanceof Ro?cn(e._def.innerType):e instanceof ko?[void 0]:e instanceof So?[null]:e instanceof sr?[void 0,...cn(e.unwrap())]:e instanceof qr?[null,...cn(e.unwrap())]:e instanceof qs||e instanceof zo?cn(e.unwrap()):e instanceof Io?cn(e._def.innerType):[],cu=class e extends J{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.object)return R(r,{code:E.invalid_type,expected:I.object,received:r.parsedType}),Z;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(R(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=cn(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:C.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...B(n)})}};Po=class extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(su(i)||su(s))return Z;let a=$f(i.value,s.value);return a.valid?((au(i)||au(s))&&r.dirty(),{status:r.value,value:a.data}):(R(n,{code:E.invalid_intersection_types}),Z)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Po.create=(e,t,r)=>new Po({left:e,right:t,typeName:C.ZodIntersection,...B(r)});Ur=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.array)return R(n,{code:E.invalid_type,expected:I.array,received:n.parsedType}),Z;if(n.data.length<this._def.items.length)return R(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Z;!this._def.rest&&n.data.length>this._def.items.length&&(R(n,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ar(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>pt.mergeArray(r,s)):pt.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:e,typeName:C.ZodTuple,rest:null,...B(t)})};uu=class e extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.object)return R(n,{code:E.invalid_type,expected:I.object,received:n.parsedType}),Z;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new ar(n,a,n.path,a)),value:s._parse(new ar(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?pt.mergeObjectAsync(r,o):pt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof J?new e({keyType:t,valueType:r,typeName:C.ZodRecord,...B(n)}):new e({keyType:Dn.create(),valueType:t,typeName:C.ZodRecord,...B(r)})}},Si=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.map)return R(n,{code:E.invalid_type,expected:I.map,received:n.parsedType}),Z;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new ar(n,a,n.path,[u,"key"])),value:i._parse(new ar(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,p=await c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,p=c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}}}};Si.create=(e,t,r)=>new Si({valueType:t,keyType:e,typeName:C.ZodMap,...B(r)});$i=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.set)return R(n,{code:E.invalid_type,expected:I.set,received:n.parsedType}),Z;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(R(n,{code:E.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(R(n,{code:E.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let p of c){if(p.status==="aborted")return Z;p.status==="dirty"&&r.dirty(),u.add(p.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new ar(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:D.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:D.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};$i.create=(e,t)=>new $i({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...B(t)});lu=class e extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.function)return R(r,{code:E.invalid_type,expected:I.function,received:r.parsedType}),Z;function n(a,c){return Us({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vi(),an].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return Us({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vi(),an].filter(u=>!!u),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Nn){let a=this;return wt(async function(...c){let u=new Ut([]),p=await a._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(n(c,f)),u}),l=await Reflect.apply(s,this,p);return await a._def.returns._def.type.parseAsync(l,i).catch(f=>{throw u.addIssue(o(l,f)),u})})}else{let a=this;return wt(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new Ut([n(c,u.error)]);let p=Reflect.apply(s,this,u.data),l=a._def.returns.safeParse(p,i);if(!l.success)throw new Ut([o(p,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ur.create(t).rest(un.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Ur.create([]).rest(un.create()),returns:r||un.create(),typeName:C.ZodFunction,...B(n)})}},Eo=class extends J{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Eo.create=(e,t)=>new Eo({getter:e,typeName:C.ZodLazy,...B(t)});Co=class extends J{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return R(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),Z}return{status:"valid",value:t.data}}get value(){return this._def.value}};Co.create=(e,t)=>new Co({value:e,typeName:C.ZodLiteral,...B(t)});To=class e extends J{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return R(r,{expected:re.joinValues(n),received:r.parsedType,code:E.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return R(r,{received:r.data,code:E.invalid_enum_value,options:n}),Z}return wt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};To.create=Ex;Ao=class extends J{_parse(t){let r=re.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==I.string&&n.parsedType!==I.number){let o=re.objectValues(r);return R(n,{expected:re.joinValues(o),received:n.parsedType,code:E.invalid_type}),Z}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=re.objectValues(r);return R(n,{received:n.data,code:E.invalid_enum_value,options:o}),Z}return wt(t.data)}get enum(){return this._def.values}};Ao.create=(e,t)=>new Ao({values:e,typeName:C.ZodNativeEnum,...B(t)});Nn=class extends J{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.promise&&r.common.async===!1)return R(r,{code:E.invalid_type,expected:I.promise,received:r.parsedType}),Z;let n=r.parsedType===I.promise?r.data:Promise.resolve(r.data);return wt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Nn.create=(e,t)=>new Nn({type:e,typeName:C.ZodPromise,...B(t)});cr=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{R(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return Z;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Z:c.status==="dirty"?_o(c.value):r.value==="dirty"?_o(c.value):c});{if(r.value==="aborted")return Z;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Z:a.status==="dirty"?_o(a.value):r.value==="dirty"?_o(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!zn(s))return Z;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>zn(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):Z);re.assertNever(o)}};cr.create=(e,t,r)=>new cr({schema:e,typeName:C.ZodEffects,effect:t,...B(r)});cr.createWithPreprocess=(e,t,r)=>new cr({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...B(r)});sr=class extends J{_parse(t){return this._getType(t)===I.undefined?wt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};sr.create=(e,t)=>new sr({innerType:e,typeName:C.ZodOptional,...B(t)});qr=class extends J{_parse(t){return this._getType(t)===I.null?wt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};qr.create=(e,t)=>new qr({innerType:e,typeName:C.ZodNullable,...B(t)});Ro=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===I.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ro.create=(e,t)=>new Ro({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...B(t)});Io=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return wi(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ut(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ut(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Io.create=(e,t)=>new Io({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...B(t)});Pi=class extends J{_parse(t){if(this._getType(t)!==I.nan){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.nan,received:n.parsedType}),Z}return{status:"valid",value:t.data}}};Pi.create=e=>new Pi({typeName:C.ZodNaN,...B(e)});QN=Symbol("zod_brand"),qs=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Fs=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Z:i.status==="dirty"?(r.dirty(),_o(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Z:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:C.ZodPipeline})}},zo=class extends J{_parse(t){let r=this._def.innerType._parse(t),n=o=>(zn(o)&&(o.value=Object.freeze(o.value)),o);return wi(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};zo.create=(e,t)=>new zo({innerType:e,typeName:C.ZodReadonly,...B(t)});XN={object:qt.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(C||(C={}));ej=(e,t={message:`Input not instance of ${e.name}`})=>Cx(r=>r instanceof e,t),Tx=Dn.create,Ax=vo.create,tj=Pi.create,rj=wo.create,Rx=bo.create,nj=xo.create,oj=xi.create,ij=ko.create,sj=So.create,aj=On.create,cj=un.create,uj=xr.create,lj=ki.create,pj=ln.create,dj=qt.create,fj=qt.strictCreate,hj=$o.create,mj=cu.create,gj=Po.create,yj=Ur.create,_j=uu.create,vj=Si.create,wj=$i.create,bj=lu.create,xj=Eo.create,kj=Co.create,Sj=To.create,$j=Ao.create,Pj=Nn.create,Ej=cr.create,Cj=sr.create,Tj=qr.create,Aj=cr.createWithPreprocess,Rj=Fs.create,Ij=()=>Tx().optional(),zj=()=>Ax().optional(),Dj=()=>Rx().optional(),Oj={string:(e=>Dn.create({...e,coerce:!0})),number:(e=>vo.create({...e,coerce:!0})),boolean:(e=>bo.create({...e,coerce:!0})),bigint:(e=>wo.create({...e,coerce:!0})),date:(e=>xo.create({...e,coerce:!0}))},Nj=Z});var m={};tr(m,{BRAND:()=>QN,DIRTY:()=>_o,EMPTY_PATH:()=>AN,INVALID:()=>Z,NEVER:()=>Nj,OK:()=>wt,ParseStatus:()=>pt,Schema:()=>J,ZodAny:()=>On,ZodArray:()=>ln,ZodBigInt:()=>wo,ZodBoolean:()=>bo,ZodBranded:()=>qs,ZodCatch:()=>Io,ZodDate:()=>xo,ZodDefault:()=>Ro,ZodDiscriminatedUnion:()=>cu,ZodEffects:()=>cr,ZodEnum:()=>To,ZodError:()=>Ut,ZodFirstPartyTypeKind:()=>C,ZodFunction:()=>lu,ZodIntersection:()=>Po,ZodIssueCode:()=>E,ZodLazy:()=>Eo,ZodLiteral:()=>Co,ZodMap:()=>Si,ZodNaN:()=>Pi,ZodNativeEnum:()=>Ao,ZodNever:()=>xr,ZodNull:()=>So,ZodNullable:()=>qr,ZodNumber:()=>vo,ZodObject:()=>qt,ZodOptional:()=>sr,ZodParsedType:()=>I,ZodPipeline:()=>Fs,ZodPromise:()=>Nn,ZodReadonly:()=>zo,ZodRecord:()=>uu,ZodSchema:()=>J,ZodSet:()=>$i,ZodString:()=>Dn,ZodSymbol:()=>xi,ZodTransformer:()=>cr,ZodTuple:()=>Ur,ZodType:()=>J,ZodUndefined:()=>ko,ZodUnion:()=>$o,ZodUnknown:()=>un,ZodVoid:()=>ki,addIssueToContext:()=>R,any:()=>aj,array:()=>pj,bigint:()=>rj,boolean:()=>Rx,coerce:()=>Oj,custom:()=>Cx,date:()=>nj,datetimeRegex:()=>Px,defaultErrorMap:()=>an,discriminatedUnion:()=>mj,effect:()=>Ej,enum:()=>Sj,function:()=>bj,getErrorMap:()=>vi,getParsedType:()=>Zr,instanceof:()=>ej,intersection:()=>gj,isAborted:()=>su,isAsync:()=>wi,isDirty:()=>au,isValid:()=>zn,late:()=>XN,lazy:()=>xj,literal:()=>kj,makeIssue:()=>Us,map:()=>vj,nan:()=>tj,nativeEnum:()=>$j,never:()=>uj,null:()=>sj,nullable:()=>Tj,number:()=>Ax,object:()=>dj,objectUtil:()=>bf,oboolean:()=>Dj,onumber:()=>zj,optional:()=>Cj,ostring:()=>Ij,pipeline:()=>Rj,preprocess:()=>Aj,promise:()=>Pj,quotelessJson:()=>EN,record:()=>_j,set:()=>wj,setErrorMap:()=>TN,strictObject:()=>fj,string:()=>Tx,symbol:()=>oj,transformer:()=>Ej,tuple:()=>yj,undefined:()=>ij,union:()=>hj,unknown:()=>cj,util:()=>re,void:()=>lj});var pu=b(()=>{iu();kf();wx();Zs();Ix();ou()});var tt=b(()=>{pu();pu()});var jj,Mj,Lj,Zj,Uj,qj,Fj,Gj,zx,Dx=b(()=>{"use strict";tt();jj=m.object({id:m.string(),label:m.string(),name:m.string(),mindset_template:m.string().optional()}),Mj=m.object({name:m.string(),root_dir:m.string().default("frontend"),build_command:m.string(),package_manager:m.string().default("pnpm"),mindset_template:m.string().optional()}),Lj=m.object({name:m.string(),root_dir:m.string().default("backend"),architecture:m.string(),dependency_direction:m.string(),package_manager:m.string().default("uv"),mindset_template:m.string().optional()}),Zj=m.object({frontend:m.string().optional(),backend:m.string().optional(),preflight_command:m.string().default("pnpm preflight"),summary:m.string().default("format/lint/typecheck/build")}),Uj=m.object({name:m.string(),description:m.string(),runtime:m.enum(["python","node","unknown"]).default("unknown"),setup_hint:m.string().optional(),enabled:m.boolean().default(!0)}),qj=m.object({id:m.string(),label:m.string(),category:m.enum(["frontend","backend","testing","infra","devtool","monitoring"]),description:m.string(),url:m.string().optional(),guidance:m.string().optional()}),Fj=m.object({name:m.string(),description:m.string().optional(),stacks:m.array(jj),frontend:Mj.optional(),backend:Lj.optional(),quality_gate:Zj.optional(),vendor:m.array(Uj).optional(),tools:m.array(qj).optional()}),Gj=m.object({enabled:m.boolean().optional(),tool:m.string().optional(),question_channel:m.string().optional(),permalink_tool:m.string().optional()}),zx=m.object({license_key:m.string().min(1).optional(),stack_profile:m.string().optional(),components:m.array(m.string().min(1,"\u7A7A\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u306F\u7121\u52B9\u3067\u3059")).optional(),language:m.string().optional(),registry_url:m.string().optional(),slack:Gj.optional()}).refine(e=>e.stack_profile!==void 0||e.components!==void 0&&e.components.length>0,{message:"Either 'stack_profile' or 'components' must be provided"})});function ot(e){return e.trim().replace(/\/+$/,"")}function jn(e=process.env){let t=e.XDG_CONFIG_HOME?.trim(),r=t||(0,Ei.join)((0,Pf.homedir)(),".config");return(0,Ei.join)(r,"godd","credentials.json")}function kr(e=process.env){let t=[jn(e),(0,Ei.join)((0,Pf.homedir)(),".config","godd","credentials.json")];return[...new Set(t)]}function du(e){if(!(0,rt.existsSync)(e))return{};let t;try{t=JSON.parse((0,rt.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e}
|
|
62
|
+
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function iN(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=Ds(e,o),n=vt[r],!n&&Ms(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||JO(r);return t}function sN(e,t,r){var n="",o=e.tag,i,s,a;for(i=0,s=r.length;i<s;i+=1)a=r[i],e.replacer&&(a=e.replacer.call(r,String(i),a)),(an(e,t,a,!1,!1)||typeof a>"u"&&an(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function T0(e,t,r,n){var o="",i=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(an(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&an(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=df(e,t)),e.dump&&Ns===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function aN(e,t,r){var n="",o=e.tag,i=Object.keys(r),s,a,c,u,p;for(s=0,a=i.length;s<a;s+=1)p="",n!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[s],u=r[c],e.replacer&&(u=e.replacer.call(r,c,u)),an(e,t,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),an(e,t,u,!1,!1)&&(p+=e.dump,n+=p));e.tag=o,e.dump="{"+n+"}"}function cN(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,u,p,l,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new At("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=df(e,t)),u=s[a],p=r[u],e.replacer&&(p=e.replacer.call(r,u,p)),an(e,t+1,u,!0,!0,!0)&&(l=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,l&&(e.dump&&Ns===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,l&&(d+=df(e,t)),an(e,t+1,p,!0,l)&&(e.dump&&Ns===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function A0(e,t,r){var n,o,i,s,a,c;for(o=r?e.explicitTypes:e.implicitTypes,i=0,s=o.length;i<s;i+=1)if(a=o[i],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(r?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,cx.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(ux.call(a.represent,c))n=a.represent[c](t,c);else throw new At("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function an(e,t,r,n,o,i,s){e.tag=null,e.dump=r,A0(e,r,!1)||A0(e,r,!0);var a=cx.call(e.dump),c=n,u;n&&(n=e.flowLevel<0||e.flowLevel>t);var p=a==="[object Object]"||a==="[object Array]",l,d;if(p&&(l=e.duplicates.indexOf(r),d=l!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(o=!1),d&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(p&&d&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),a==="[object Object]")n&&Object.keys(e.dump).length!==0?(cN(e,t,e.dump,o),d&&(e.dump="&ref_"+l+e.dump)):(aN(e,t,e.dump),d&&(e.dump="&ref_"+l+" "+e.dump));else if(a==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?T0(e,t-1,e.dump,o):T0(e,t,e.dump,o),d&&(e.dump="&ref_"+l+e.dump)):(sN(e,t,e.dump),d&&(e.dump="&ref_"+l+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&nN(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new At("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function uN(e,t){var r=[],n=[],o,i;for(hf(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function hf(e,t,r){var n,o,i;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,i=e.length;o<i;o+=1)hf(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)hf(e[n[o]],t,r)}function lN(e,t){t=t||{};var r=new QO(t);r.noRefs||uN(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),an(r,0,n,!0,!0)?r.dump+`
|
|
63
|
+
`:""}function wf(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var fD,hD,mD,gD,yD,_D,et,At,wD,bD,xD,lt,z0,D0,O0,N0,j0,M0,L0,Z0,MD,UD,U0,q0,F0,G0,B0,V0,H0,mf,W0,QD,XD,K0,rO,J0,iO,Y0,gf,zn,Qc,Q0,X0,Xc,uf,cO,y0,uO,lO,pO,ex,tx,nx,ox,go,w0,TO,AO,ax,cx,ux,vf,RO,Ns,IO,zO,DO,OO,pf,NO,jO,MO,LO,lx,ZO,tu,UO,qO,FO,GO,px,dx,BO,fx,VO,hx,vt,HO,WO,YO,js,gx,ff,yx,_x,mi,pN,dN,fN,hN,mN,gN,yN,_N,vN,wN,bN,xN,kN,SN,$N,PN,br,Ls=b(()=>{fD=R0,hD=cD,mD=uD,gD=pD,yD=dD,_D=lD,et={isNothing:fD,isObject:hD,toArray:mD,repeat:gD,isNegativeZero:yD,extend:_D};Os.prototype=Object.create(Error.prototype);Os.prototype.constructor=Os;Os.prototype.toString=function(t){return this.name+": "+I0(this,t)};At=Os;wD=vD,bD=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],xD=["scalar","sequence","mapping"];lt=SD;lf.prototype.extend=function(t){var r=[],n=[];if(t instanceof lt)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new At("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof lt))throw new At("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new At("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new At("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(i){if(!(i instanceof lt))throw new At("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(lf.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=g0(o,"implicit"),o.compiledExplicit=g0(o,"explicit"),o.compiledTypeMap=$D(o.compiledImplicit,o.compiledExplicit),o};z0=lf,D0=new lt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),O0=new lt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),N0=new lt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),j0=new z0({explicit:[D0,O0,N0]});M0=new lt("tag:yaml.org,2002:null",{kind:"scalar",resolve:PD,construct:ED,predicate:CD,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});L0=new lt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:TD,construct:AD,predicate:RD,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});Z0=new lt("tag:yaml.org,2002:int",{kind:"scalar",resolve:OD,construct:ND,predicate:jD,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),MD=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");UD=/^[-+]?[0-9]+e/;U0=new lt("tag:yaml.org,2002:float",{kind:"scalar",resolve:LD,construct:ZD,predicate:FD,represent:qD,defaultStyle:"lowercase"}),q0=j0.extend({implicit:[M0,L0,Z0,U0]}),F0=q0,G0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),B0=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");V0=new lt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:GD,construct:BD,instanceOf:Date,represent:VD});H0=new lt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:HD}),mf=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
64
|
+
\r`;W0=new lt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:WD,construct:KD,predicate:YD,represent:JD}),QD=Object.prototype.hasOwnProperty,XD=Object.prototype.toString;K0=new lt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:eO,construct:tO}),rO=Object.prototype.toString;J0=new lt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:nO,construct:oO}),iO=Object.prototype.hasOwnProperty;Y0=new lt("tag:yaml.org,2002:set",{kind:"mapping",resolve:sO,construct:aO}),gf=F0.extend({implicit:[V0,H0],explicit:[W0,K0,J0,Y0]}),zn=Object.prototype.hasOwnProperty,Qc=1,Q0=2,X0=3,Xc=4,uf=1,cO=2,y0=3,uO=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lO=/[\x85\u2028\u2029]/,pO=/[,\[\]\{\}]/,ex=/^(?:!|!!|![a-z\-]+!)$/i,tx=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;nx=new Array(256),ox=new Array(256);for(go=0;go<256;go++)nx[go]=v0(go)?1:0,ox[go]=v0(go);w0={YAML:function(t,r,n){var o,i,s;t.version!==null&&M(t,"duplication of %YAML directive"),n.length!==1&&M(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&M(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&M(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&eu(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&M(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],ex.test(o)||M(t,"ill-formed tag handle (first argument) of the TAG directive"),zn.call(t.tagMap,o)&&M(t,'there is a previously declared suffix for "'+o+'" tag handle'),tx.test(i)||M(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{M(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};TO=EO,AO=CO,ax={loadAll:TO,load:AO},cx=Object.prototype.toString,ux=Object.prototype.hasOwnProperty,vf=65279,RO=9,Ns=10,IO=13,zO=32,DO=33,OO=34,pf=35,NO=37,jO=38,MO=39,LO=42,lx=44,ZO=45,tu=58,UO=61,qO=62,FO=63,GO=64,px=91,dx=93,BO=96,fx=123,VO=124,hx=125,vt={};vt[0]="\\0";vt[7]="\\a";vt[8]="\\b";vt[9]="\\t";vt[10]="\\n";vt[11]="\\v";vt[12]="\\f";vt[13]="\\r";vt[27]="\\e";vt[34]='\\"';vt[92]="\\\\";vt[133]="\\N";vt[160]="\\_";vt[8232]="\\L";vt[8233]="\\P";HO=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],WO=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;YO=1,js=2;gx=1,ff=2,yx=3,_x=4,mi=5;pN=lN,dN={dump:pN};fN=lt,hN=z0,mN=j0,gN=q0,yN=F0,_N=gf,vN=ax.load,wN=ax.loadAll,bN=dN.dump,xN=At,kN={binary:W0,float:U0,map:N0,null:M0,pairs:J0,set:Y0,timestamp:V0,bool:L0,int:Z0,merge:H0,omap:K0,seq:O0,str:D0},SN=wf("safeLoad","load"),$N=wf("safeLoadAll","loadAll"),PN=wf("safeDump","dump"),br={Type:fN,Schema:hN,FAILSAFE_SCHEMA:mN,JSON_SCHEMA:gN,CORE_SCHEMA:yN,DEFAULT_SCHEMA:_N,load:vN,loadAll:wN,dump:bN,YAMLException:xN,types:kN,safeLoad:SN,safeLoadAll:$N,safeDump:PN}});var re,bf,I,Zr,Zs=b(()=>{(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(re||(re={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(bf||(bf={}));I=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zr=e=>{switch(typeof e){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(e)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(e)?I.array:e===null?I.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?I.promise:typeof Map<"u"&&e instanceof Map?I.map:typeof Set<"u"&&e instanceof Set?I.set:typeof Date<"u"&&e instanceof Date?I.date:I.object;default:return I.unknown}}});var E,EN,Ut,ou=b(()=>{Zs();E=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),EN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Ut=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ut.create=e=>new Ut(e)});var CN,cn,xf=b(()=>{ou();Zs();CN=(e,t)=>{let r;switch(e.code){case E.invalid_type:e.received===I.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:re.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case E.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case E.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},cn=CN});function TN(e){vx=e}function vi(){return vx}var vx,iu=b(()=>{xf();vx=cn});function R(e,t){let r=vi(),n=Us({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===cn?void 0:cn].filter(o=>!!o)});e.common.issues.push(n)}var Us,AN,pt,Z,_o,wt,su,au,Dn,wi,kf=b(()=>{iu();xf();Us=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},AN=[];pt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Z;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Z;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},Z=Object.freeze({status:"aborted"}),_o=e=>({status:"dirty",value:e}),wt=e=>({status:"valid",value:e}),su=e=>e.status==="aborted",au=e=>e.status==="dirty",Dn=e=>e.status==="valid",wi=e=>typeof Promise<"u"&&e instanceof Promise});var wx=b(()=>{});var D,bx=b(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(D||(D={}))});function B(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}function $x(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function HN(e){return new RegExp(`^${$x(e)}$`)}function Px(e){let t=`${Sx}T${$x(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function WN(e,t){return!!((t==="v4"||!t)&&ZN.test(e)||(t==="v6"||!t)&&qN.test(e))}function KN(e,t){if(!NN.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function JN(e,t){return!!((t==="v4"||!t)&&UN.test(e)||(t==="v6"||!t)&&FN.test(e))}function YN(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function bi(e){if(e instanceof qt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ar.create(bi(n))}return new qt({...e._def,shape:()=>t})}else return e instanceof pn?new pn({...e._def,type:bi(e.element)}):e instanceof ar?ar.create(bi(e.unwrap())):e instanceof qr?qr.create(bi(e.unwrap())):e instanceof Ur?Ur.create(e.items.map(t=>bi(t))):e}function $f(e,t){let r=Zr(e),n=Zr(t);if(e===t)return{valid:!0,data:e};if(r===I.object&&n===I.object){let o=re.objectKeys(t),i=re.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=$f(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===I.array&&n===I.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=$f(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===I.date&&n===I.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function Ex(e,t){return new To({values:e,typeName:C.ZodEnum,...B(t)})}function kx(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Cx(e,t={},r){return e?Nn.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=kx(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=kx(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Nn.create()}var cr,xx,J,RN,IN,zN,DN,ON,NN,jN,MN,LN,Sf,ZN,UN,qN,FN,GN,BN,Sx,VN,On,vo,wo,bo,xo,xi,ko,So,Nn,ln,xr,ki,pn,qt,$o,un,cu,Po,Ur,uu,Si,$i,lu,Eo,Co,To,Ao,jn,ur,ar,qr,Ro,Io,Pi,QN,qs,Fs,zo,XN,C,ej,Tx,Ax,tj,rj,Rx,nj,oj,ij,sj,aj,cj,uj,lj,pj,dj,fj,hj,mj,gj,yj,_j,vj,wj,bj,xj,kj,Sj,$j,Pj,Ej,Cj,Tj,Aj,Rj,Ij,zj,Dj,Oj,Nj,Ix=b(()=>{ou();iu();bx();kf();Zs();cr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},xx=(e,t)=>{if(Dn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ut(e.common.issues);return this._error=r,this._error}}};J=class{get description(){return this._def.description}_getType(t){return Zr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Zr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new pt,ctx:{common:t.parent.common,data:t.data,parsedType:Zr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(wi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return xx(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Dn(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Dn(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zr(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(wi(o)?o:Promise.resolve(o));return xx(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:E.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new ur({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ar.create(this,this._def)}nullable(){return qr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pn.create(this)}promise(){return jn.create(this,this._def)}or(t){return $o.create([this,t],this._def)}and(t){return Po.create(this,t,this._def)}transform(t){return new ur({...B(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ro({...B(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new qs({typeName:C.ZodBranded,type:this,...B(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Io({...B(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Fs.create(this,t)}readonly(){return zo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RN=/^c[^\s-]{8,}$/i,IN=/^[0-9a-z]+$/,zN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,DN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ON=/^[a-z0-9_-]{21}$/i,NN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ZN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,UN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,FN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",VN=new RegExp(`^${Sx}$`);On=class e extends J{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==I.string){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_type,expected:I.string,received:i.parsedType}),Z}let n=new pt,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?R(o,{code:E.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&R(o,{code:E.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")MN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"email",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Sf||(Sf=new RegExp(LN,"u")),Sf.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"emoji",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")DN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"uuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")ON.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"nanoid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")RN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cuid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")IN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cuid2",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")zN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"ulid",code:E.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),R(o,{validation:"url",code:E.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"regex",code:E.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Px(i).test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?VN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?HN(i).test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{code:E.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?jN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"duration",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?WN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"ip",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?KN(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"jwt",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?JN(t.data,i.version)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"cidr",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?GN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"base64",code:E.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?BN.test(t.data)||(o=this._getOrReturnCtx(t,o),R(o,{validation:"base64url",code:E.invalid_string,message:i.message}),n.dirty()):re.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:E.invalid_string,...D.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...D.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...D.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...D.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...D.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...D.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...D.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...D.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...D.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...D.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...D.errToObj(r)})}nonempty(t){return this.min(1,D.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};On.create=e=>new On({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...B(e)});vo=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==I.number){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_type,expected:I.number,received:i.parsedType}),Z}let n,o=new pt;for(let i of this._def.checks)i.kind==="int"?re.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),R(n,{code:E.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?YN(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),R(n,{code:E.not_finite,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:D.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&re.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};vo.create=e=>new vo({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...B(e)});wo=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==I.bigint)return this._getInvalidInput(t);let n,o=new pt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),R(n,{code:E.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return R(r,{code:E.invalid_type,expected:I.bigint,received:r.parsedType}),Z}gte(t,r){return this.setLimit("min",t,!0,D.toString(r))}gt(t,r){return this.setLimit("min",t,!1,D.toString(r))}lte(t,r){return this.setLimit("max",t,!0,D.toString(r))}lt(t,r){return this.setLimit("max",t,!1,D.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:D.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};wo.create=e=>new wo({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...B(e)});bo=class extends J{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==I.boolean){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.boolean,received:n.parsedType}),Z}return wt(t.data)}};bo.create=e=>new bo({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...B(e)});xo=class e extends J{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==I.date){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_type,expected:I.date,received:i.parsedType}),Z}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return R(i,{code:E.invalid_date}),Z}let n=new pt,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),R(o,{code:E.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):re.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:D.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:D.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};xo.create=e=>new xo({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...B(e)});xi=class extends J{_parse(t){if(this._getType(t)!==I.symbol){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.symbol,received:n.parsedType}),Z}return wt(t.data)}};xi.create=e=>new xi({typeName:C.ZodSymbol,...B(e)});ko=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.undefined,received:n.parsedType}),Z}return wt(t.data)}};ko.create=e=>new ko({typeName:C.ZodUndefined,...B(e)});So=class extends J{_parse(t){if(this._getType(t)!==I.null){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.null,received:n.parsedType}),Z}return wt(t.data)}};So.create=e=>new So({typeName:C.ZodNull,...B(e)});Nn=class extends J{constructor(){super(...arguments),this._any=!0}_parse(t){return wt(t.data)}};Nn.create=e=>new Nn({typeName:C.ZodAny,...B(e)});ln=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(t){return wt(t.data)}};ln.create=e=>new ln({typeName:C.ZodUnknown,...B(e)});xr=class extends J{_parse(t){let r=this._getOrReturnCtx(t);return R(r,{code:E.invalid_type,expected:I.never,received:r.parsedType}),Z}};xr.create=e=>new xr({typeName:C.ZodNever,...B(e)});ki=class extends J{_parse(t){if(this._getType(t)!==I.undefined){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.void,received:n.parsedType}),Z}return wt(t.data)}};ki.create=e=>new ki({typeName:C.ZodVoid,...B(e)});pn=class e extends J{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==I.array)return R(r,{code:E.invalid_type,expected:I.array,received:r.parsedType}),Z;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(R(r,{code:s?E.too_big:E.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(R(r,{code:E.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(R(r,{code:E.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new cr(r,s,r.path,a)))).then(s=>pt.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new cr(r,s,r.path,a)));return pt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:D.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:D.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:D.toString(r)}})}nonempty(t){return this.min(1,t)}};pn.create=(e,t)=>new pn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...B(t)});qt=class e extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=re.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==I.object){let u=this._getOrReturnCtx(t);return R(u,{code:E.invalid_type,expected:I.object,received:u.parsedType}),Z}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof xr&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let p=i[u],l=o.data[u];c.push({key:{status:"valid",value:u},value:p._parse(new cr(o,l,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof xr){let u=this._def.unknownKeys;if(u==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(u==="strict")a.length>0&&(R(o,{code:E.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let p of a){let l=o.data[p];c.push({key:{status:"valid",value:p},value:u._parse(new cr(o,l,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let p of c){let l=await p.key,d=await p.value;u.push({key:l,value:d,alwaysSet:p.alwaysSet})}return u}).then(u=>pt.mergeObjectSync(n,u)):pt.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return D.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:D.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:C.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of re.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of re.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return bi(this)}partial(t){let r={};for(let n of re.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of re.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ar;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Ex(re.objectKeys(this.shape))}};qt.create=(e,t)=>new qt({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:C.ZodObject,...B(t)});qt.strictCreate=(e,t)=>new qt({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:C.ZodObject,...B(t)});qt.lazycreate=(e,t)=>new qt({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:C.ZodObject,...B(t)});$o=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new Ut(a.ctx.common.issues));return R(r,{code:E.invalid_union,unionErrors:s}),Z}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new Ut(c));return R(r,{code:E.invalid_union,unionErrors:a}),Z}}get options(){return this._def.options}};$o.create=(e,t)=>new $o({options:e,typeName:C.ZodUnion,...B(t)});un=e=>e instanceof Eo?un(e.schema):e instanceof ur?un(e.innerType()):e instanceof Co?[e.value]:e instanceof To?e.options:e instanceof Ao?re.objectValues(e.enum):e instanceof Ro?un(e._def.innerType):e instanceof ko?[void 0]:e instanceof So?[null]:e instanceof ar?[void 0,...un(e.unwrap())]:e instanceof qr?[null,...un(e.unwrap())]:e instanceof qs||e instanceof zo?un(e.unwrap()):e instanceof Io?un(e._def.innerType):[],cu=class e extends J{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.object)return R(r,{code:E.invalid_type,expected:I.object,received:r.parsedType}),Z;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(R(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Z)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=un(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:C.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...B(n)})}};Po=class extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(su(i)||su(s))return Z;let a=$f(i.value,s.value);return a.valid?((au(i)||au(s))&&r.dirty(),{status:r.value,value:a.data}):(R(n,{code:E.invalid_intersection_types}),Z)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Po.create=(e,t,r)=>new Po({left:e,right:t,typeName:C.ZodIntersection,...B(r)});Ur=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.array)return R(n,{code:E.invalid_type,expected:I.array,received:n.parsedType}),Z;if(n.data.length<this._def.items.length)return R(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Z;!this._def.rest&&n.data.length>this._def.items.length&&(R(n,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new cr(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>pt.mergeArray(r,s)):pt.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:e,typeName:C.ZodTuple,rest:null,...B(t)})};uu=class e extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.object)return R(n,{code:E.invalid_type,expected:I.object,received:n.parsedType}),Z;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new cr(n,a,n.path,a)),value:s._parse(new cr(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?pt.mergeObjectAsync(r,o):pt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof J?new e({keyType:t,valueType:r,typeName:C.ZodRecord,...B(n)}):new e({keyType:On.create(),valueType:t,typeName:C.ZodRecord,...B(r)})}},Si=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.map)return R(n,{code:E.invalid_type,expected:I.map,received:n.parsedType}),Z;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new cr(n,a,n.path,[u,"key"])),value:i._parse(new cr(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,p=await c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,p=c.value;if(u.status==="aborted"||p.status==="aborted")return Z;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}}}};Si.create=(e,t,r)=>new Si({valueType:t,keyType:e,typeName:C.ZodMap,...B(r)});$i=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==I.set)return R(n,{code:E.invalid_type,expected:I.set,received:n.parsedType}),Z;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(R(n,{code:E.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(R(n,{code:E.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let p of c){if(p.status==="aborted")return Z;p.status==="dirty"&&r.dirty(),u.add(p.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new cr(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:D.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:D.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};$i.create=(e,t)=>new $i({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...B(t)});lu=class e extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.function)return R(r,{code:E.invalid_type,expected:I.function,received:r.parsedType}),Z;function n(a,c){return Us({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vi(),cn].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return Us({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vi(),cn].filter(u=>!!u),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof jn){let a=this;return wt(async function(...c){let u=new Ut([]),p=await a._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(n(c,f)),u}),l=await Reflect.apply(s,this,p);return await a._def.returns._def.type.parseAsync(l,i).catch(f=>{throw u.addIssue(o(l,f)),u})})}else{let a=this;return wt(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new Ut([n(c,u.error)]);let p=Reflect.apply(s,this,u.data),l=a._def.returns.safeParse(p,i);if(!l.success)throw new Ut([o(p,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ur.create(t).rest(ln.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Ur.create([]).rest(ln.create()),returns:r||ln.create(),typeName:C.ZodFunction,...B(n)})}},Eo=class extends J{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Eo.create=(e,t)=>new Eo({getter:e,typeName:C.ZodLazy,...B(t)});Co=class extends J{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return R(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),Z}return{status:"valid",value:t.data}}get value(){return this._def.value}};Co.create=(e,t)=>new Co({value:e,typeName:C.ZodLiteral,...B(t)});To=class e extends J{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return R(r,{expected:re.joinValues(n),received:r.parsedType,code:E.invalid_type}),Z}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return R(r,{received:r.data,code:E.invalid_enum_value,options:n}),Z}return wt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};To.create=Ex;Ao=class extends J{_parse(t){let r=re.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==I.string&&n.parsedType!==I.number){let o=re.objectValues(r);return R(n,{expected:re.joinValues(o),received:n.parsedType,code:E.invalid_type}),Z}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=re.objectValues(r);return R(n,{received:n.data,code:E.invalid_enum_value,options:o}),Z}return wt(t.data)}get enum(){return this._def.values}};Ao.create=(e,t)=>new Ao({values:e,typeName:C.ZodNativeEnum,...B(t)});jn=class extends J{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==I.promise&&r.common.async===!1)return R(r,{code:E.invalid_type,expected:I.promise,received:r.parsedType}),Z;let n=r.parsedType===I.promise?r.data:Promise.resolve(r.data);return wt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};jn.create=(e,t)=>new jn({type:e,typeName:C.ZodPromise,...B(t)});ur=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{R(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return Z;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Z:c.status==="dirty"?_o(c.value):r.value==="dirty"?_o(c.value):c});{if(r.value==="aborted")return Z;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Z:a.status==="dirty"?_o(a.value):r.value==="dirty"?_o(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Z:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Dn(s))return Z;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Dn(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):Z);re.assertNever(o)}};ur.create=(e,t,r)=>new ur({schema:e,typeName:C.ZodEffects,effect:t,...B(r)});ur.createWithPreprocess=(e,t,r)=>new ur({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...B(r)});ar=class extends J{_parse(t){return this._getType(t)===I.undefined?wt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ar.create=(e,t)=>new ar({innerType:e,typeName:C.ZodOptional,...B(t)});qr=class extends J{_parse(t){return this._getType(t)===I.null?wt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};qr.create=(e,t)=>new qr({innerType:e,typeName:C.ZodNullable,...B(t)});Ro=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===I.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ro.create=(e,t)=>new Ro({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...B(t)});Io=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return wi(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ut(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ut(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Io.create=(e,t)=>new Io({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...B(t)});Pi=class extends J{_parse(t){if(this._getType(t)!==I.nan){let n=this._getOrReturnCtx(t);return R(n,{code:E.invalid_type,expected:I.nan,received:n.parsedType}),Z}return{status:"valid",value:t.data}}};Pi.create=e=>new Pi({typeName:C.ZodNaN,...B(e)});QN=Symbol("zod_brand"),qs=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Fs=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Z:i.status==="dirty"?(r.dirty(),_o(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Z:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:C.ZodPipeline})}},zo=class extends J{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Dn(o)&&(o.value=Object.freeze(o.value)),o);return wi(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};zo.create=(e,t)=>new zo({innerType:e,typeName:C.ZodReadonly,...B(t)});XN={object:qt.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(C||(C={}));ej=(e,t={message:`Input not instance of ${e.name}`})=>Cx(r=>r instanceof e,t),Tx=On.create,Ax=vo.create,tj=Pi.create,rj=wo.create,Rx=bo.create,nj=xo.create,oj=xi.create,ij=ko.create,sj=So.create,aj=Nn.create,cj=ln.create,uj=xr.create,lj=ki.create,pj=pn.create,dj=qt.create,fj=qt.strictCreate,hj=$o.create,mj=cu.create,gj=Po.create,yj=Ur.create,_j=uu.create,vj=Si.create,wj=$i.create,bj=lu.create,xj=Eo.create,kj=Co.create,Sj=To.create,$j=Ao.create,Pj=jn.create,Ej=ur.create,Cj=ar.create,Tj=qr.create,Aj=ur.createWithPreprocess,Rj=Fs.create,Ij=()=>Tx().optional(),zj=()=>Ax().optional(),Dj=()=>Rx().optional(),Oj={string:(e=>On.create({...e,coerce:!0})),number:(e=>vo.create({...e,coerce:!0})),boolean:(e=>bo.create({...e,coerce:!0})),bigint:(e=>wo.create({...e,coerce:!0})),date:(e=>xo.create({...e,coerce:!0}))},Nj=Z});var m={};rr(m,{BRAND:()=>QN,DIRTY:()=>_o,EMPTY_PATH:()=>AN,INVALID:()=>Z,NEVER:()=>Nj,OK:()=>wt,ParseStatus:()=>pt,Schema:()=>J,ZodAny:()=>Nn,ZodArray:()=>pn,ZodBigInt:()=>wo,ZodBoolean:()=>bo,ZodBranded:()=>qs,ZodCatch:()=>Io,ZodDate:()=>xo,ZodDefault:()=>Ro,ZodDiscriminatedUnion:()=>cu,ZodEffects:()=>ur,ZodEnum:()=>To,ZodError:()=>Ut,ZodFirstPartyTypeKind:()=>C,ZodFunction:()=>lu,ZodIntersection:()=>Po,ZodIssueCode:()=>E,ZodLazy:()=>Eo,ZodLiteral:()=>Co,ZodMap:()=>Si,ZodNaN:()=>Pi,ZodNativeEnum:()=>Ao,ZodNever:()=>xr,ZodNull:()=>So,ZodNullable:()=>qr,ZodNumber:()=>vo,ZodObject:()=>qt,ZodOptional:()=>ar,ZodParsedType:()=>I,ZodPipeline:()=>Fs,ZodPromise:()=>jn,ZodReadonly:()=>zo,ZodRecord:()=>uu,ZodSchema:()=>J,ZodSet:()=>$i,ZodString:()=>On,ZodSymbol:()=>xi,ZodTransformer:()=>ur,ZodTuple:()=>Ur,ZodType:()=>J,ZodUndefined:()=>ko,ZodUnion:()=>$o,ZodUnknown:()=>ln,ZodVoid:()=>ki,addIssueToContext:()=>R,any:()=>aj,array:()=>pj,bigint:()=>rj,boolean:()=>Rx,coerce:()=>Oj,custom:()=>Cx,date:()=>nj,datetimeRegex:()=>Px,defaultErrorMap:()=>cn,discriminatedUnion:()=>mj,effect:()=>Ej,enum:()=>Sj,function:()=>bj,getErrorMap:()=>vi,getParsedType:()=>Zr,instanceof:()=>ej,intersection:()=>gj,isAborted:()=>su,isAsync:()=>wi,isDirty:()=>au,isValid:()=>Dn,late:()=>XN,lazy:()=>xj,literal:()=>kj,makeIssue:()=>Us,map:()=>vj,nan:()=>tj,nativeEnum:()=>$j,never:()=>uj,null:()=>sj,nullable:()=>Tj,number:()=>Ax,object:()=>dj,objectUtil:()=>bf,oboolean:()=>Dj,onumber:()=>zj,optional:()=>Cj,ostring:()=>Ij,pipeline:()=>Rj,preprocess:()=>Aj,promise:()=>Pj,quotelessJson:()=>EN,record:()=>_j,set:()=>wj,setErrorMap:()=>TN,strictObject:()=>fj,string:()=>Tx,symbol:()=>oj,transformer:()=>Ej,tuple:()=>yj,undefined:()=>ij,union:()=>hj,unknown:()=>cj,util:()=>re,void:()=>lj});var pu=b(()=>{iu();kf();wx();Zs();Ix();ou()});var tt=b(()=>{pu();pu()});var jj,Mj,Lj,Zj,Uj,qj,Fj,Gj,zx,Dx=b(()=>{"use strict";tt();jj=m.object({id:m.string(),label:m.string(),name:m.string(),mindset_template:m.string().optional()}),Mj=m.object({name:m.string(),root_dir:m.string().default("frontend"),build_command:m.string(),package_manager:m.string().default("pnpm"),mindset_template:m.string().optional()}),Lj=m.object({name:m.string(),root_dir:m.string().default("backend"),architecture:m.string(),dependency_direction:m.string(),package_manager:m.string().default("uv"),mindset_template:m.string().optional()}),Zj=m.object({frontend:m.string().optional(),backend:m.string().optional(),preflight_command:m.string().default("pnpm preflight"),summary:m.string().default("format/lint/typecheck/build")}),Uj=m.object({name:m.string(),description:m.string(),runtime:m.enum(["python","node","unknown"]).default("unknown"),setup_hint:m.string().optional(),enabled:m.boolean().default(!0)}),qj=m.object({id:m.string(),label:m.string(),category:m.enum(["frontend","backend","testing","infra","devtool","monitoring"]),description:m.string(),url:m.string().optional(),guidance:m.string().optional()}),Fj=m.object({name:m.string(),description:m.string().optional(),stacks:m.array(jj),frontend:Mj.optional(),backend:Lj.optional(),quality_gate:Zj.optional(),vendor:m.array(Uj).optional(),tools:m.array(qj).optional()}),Gj=m.object({enabled:m.boolean().optional(),tool:m.string().optional(),question_channel:m.string().optional(),permalink_tool:m.string().optional()}),zx=m.object({license_key:m.string().min(1).optional(),stack_profile:m.string().optional(),components:m.array(m.string().min(1,"\u7A7A\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u306F\u7121\u52B9\u3067\u3059")).optional(),language:m.string().optional(),registry_url:m.string().optional(),slack:Gj.optional()}).refine(e=>e.stack_profile!==void 0||e.components!==void 0&&e.components.length>0,{message:"Either 'stack_profile' or 'components' must be provided"})});function ot(e){return e.trim().replace(/\/+$/,"")}function Mn(e=process.env){let t=e.XDG_CONFIG_HOME?.trim(),r=t||(0,Ei.join)((0,Pf.homedir)(),".config");return(0,Ei.join)(r,"godd","credentials.json")}function kr(e=process.env){let t=[Mn(e),(0,Ei.join)((0,Pf.homedir)(),".config","godd","credentials.json")];return[...new Set(t)]}function du(e){if(!(0,rt.existsSync)(e))return{};let t;try{t=JSON.parse((0,rt.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e}
|
|
65
65
|
godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}let r=Vj.safeParse(t);if(r.success){let o={};for(let i of Object.values(r.data.logins))o[ot(i.registry_url)]=i;return o}let n=Bj.safeParse(t);if(n.success){let{version:o,...i}=n.data;return{[ot(i.registry_url)]:i}}throw new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306E\u5F62\u5F0F\u304C\u4E0D\u6B63\u3067\u3059: ${e}
|
|
66
|
-
godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}function Do(e,t=kr()){let r=ot(e);for(let n of t){let o=du(n)[r];if(o)return{credentials:o,path:n}}return null}function
|
|
67
|
-
`,o=`${t}.${process.pid}.${(0,Ox.randomBytes)(6).toString("hex")}.tmp`,i=(0,rt.openSync)(o,"wx",384);try{try{(0,rt.writeSync)(i,n,null,"utf-8")}finally{(0,rt.closeSync)(i)}(0,rt.renameSync)(o,t)}catch(s){throw(0,rt.rmSync)(o,{force:!0}),s}}function Lx(e,t=
|
|
68
|
-
GODD_CONFIG \u74B0\u5883\u5909\u6570\u307E\u305F\u306F .cursor/mcp.json \u306E env.GODD_CONFIG \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let r=(0,hu.readFileSync)(t,"utf-8"),n=br.load(r),o=zx.parse(n),i=process.env.GODD_REGISTRY_URL??o.registry_url??dn,s={stack_profile:o.stack_profile,components:o.components??[],language:process.env.GODD_LANGUAGE??o.language??Hj,registry_url:i},a=process.env.GODD_LICENSE_KEY??o.license_key;return a?{license_key:a,auth_source:"license_key",...s}:{license_key:Cf(i),auth_source:"device_token",...s}}function Cf(e,t={}){let r=t.paths??kr(),n=t.warn??(s=>console.error(s)),o=Do(e,r);if(!o){let s=pn(r);throw s.length>0?new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u5225\u306E Registry\uFF08${s.map(a=>a.registry_url).join(", ")}\uFF09\u5411\u3051\u3067\u3059\u3002godd login --registry-url ${ot(e)} \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):new Error("license_key \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002GODD_LICENSE_KEY \u74B0\u5883\u5909\u6570\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001.env \u306B\u8A18\u8F09\u3057\u3066\u304F\u3060\u3055\u3044\u3002Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u4F7F\u3046\u5834\u5408\u306F godd login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}let{credentials:i}=o;return fu(i)&&n(`[GoDD] \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${i.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),i.access_token}var hu,Kt,dn,Hj,Mn=b(()=>{"use strict";hu=require("node:fs");Ls();Dx();Ci();Kt="config.godd",dn="https://dev.api.godd.ripla-inc.com",Hj="en"});function mu(e,t,r){if(e.__GODD_CLI__)return!1;if(!r)return!0;if(!t)return!1;let n;try{n=(0,Fx.fileURLToPath)(r)}catch{return!0}return t===n?!0:Ux(t)===Ux(n)}function Ux(e){try{return(0,qx.realpathSync)(e)}catch{return e}}var qx,Fx,Tf=b(()=>{"use strict";qx=require("node:fs"),Fx=require("node:url")});var gu=b(()=>{pu()});var Gx=b(()=>{Tt()});var Bx=b(()=>{});var Vx=b(()=>{});var Hx=b(()=>{});var Wx=b(()=>{});var Kx=b(()=>{Tt();Gx();Bx();Vx();Tt();$c();Hx();Wx()});var Jx=b(()=>{Kx()});var Af=b(()=>{Jx()});function Oo(e){return!!e._zod}function Ln(e,t){return Oo(e)?_s(e,t):e.safeParse(t)}function yu(e){if(!e)return;let t;if(Oo(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Qx(e){if(Oo(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var _u=b(()=>{Af()});function Zn(e){return e==="completed"||e==="failed"||e==="cancelled"}var Xx=b(()=>{});var tk,ek,rk,vu=b(()=>{tk=Symbol("Let zodToJsonSchema decide on which parser to use"),ek={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},rk=e=>typeof e=="string"?{...ek,name:e}:{...ek,...e}});var nk,Rf=b(()=>{vu();nk=e=>{let t=rk(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}}});function If(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function se(e,t,r,n,o){e[t]=r,If(e,t,n,o)}var Un=b(()=>{});var wu,bu=b(()=>{wu=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")}});function Oe(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?wu(t,e.currentPath):t.join("/")}}var ur=b(()=>{bu()});function ok(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==C.ZodAny&&(r.items=U(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&se(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&se(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(se(r,"minItems",e.exactLength.value,e.exactLength.message,t),se(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}var zf=b(()=>{gu();Un();We()});function ik(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Df=b(()=>{Un()});function sk(){return{type:"boolean"}}var Of=b(()=>{});function xu(e,t){return U(e.type._def,t)}var ku=b(()=>{We()});var ak,Nf=b(()=>{We();ak=(e,t)=>U(e.innerType._def,t)});function jf(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>jf(e,t,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Jj(e,t)}}var Jj,Mf=b(()=>{Un();Jj=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":se(r,"minimum",n.value,n.message,t);break;case"max":se(r,"maximum",n.value,n.message,t);break}return r}});function ck(e,t){return{...U(e.innerType._def,t),default:e.defaultValue()}}var Lf=b(()=>{We()});function uk(e,t){return t.effectStrategy==="input"?U(e.schema._def,t):Oe(t)}var Zf=b(()=>{We();ur()});function lk(e){return{type:"string",enum:Array.from(e.values)}}var Uf=b(()=>{});function pk(e,t){let r=[U(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),U(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(Yj(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:a,...c}=i;s=c}else n=void 0;o.push(s)}}),o.length?{allOf:o,...n}:void 0}var Yj,qf=b(()=>{We();Yj=e=>"type"in e&&e.type==="string"?!1:"allOf"in e});function dk(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var Ff=b(()=>{});function Su(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":$r(r,"email",n.message,t);break;case"format:idn-email":$r(r,"idn-email",n.message,t);break;case"pattern:zod":Rt(r,Sr.email,n.message,t);break}break;case"url":$r(r,"uri",n.message,t);break;case"uuid":$r(r,"uuid",n.message,t);break;case"regex":Rt(r,n.regex,n.message,t);break;case"cuid":Rt(r,Sr.cuid,n.message,t);break;case"cuid2":Rt(r,Sr.cuid2,n.message,t);break;case"startsWith":Rt(r,RegExp(`^${Bf(n.value,t)}`),n.message,t);break;case"endsWith":Rt(r,RegExp(`${Bf(n.value,t)}$`),n.message,t);break;case"datetime":$r(r,"date-time",n.message,t);break;case"date":$r(r,"date",n.message,t);break;case"time":$r(r,"time",n.message,t);break;case"duration":$r(r,"duration",n.message,t);break;case"length":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{Rt(r,RegExp(Bf(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&$r(r,"ipv4",n.message,t),n.version!=="v4"&&$r(r,"ipv6",n.message,t);break}case"base64url":Rt(r,Sr.base64url,n.message,t);break;case"jwt":Rt(r,Sr.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Rt(r,Sr.ipv4Cidr,n.message,t),n.version!=="v4"&&Rt(r,Sr.ipv6Cidr,n.message,t);break}case"emoji":Rt(r,Sr.emoji(),n.message,t);break;case"ulid":{Rt(r,Sr.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{$r(r,"binary",n.message,t);break}case"contentEncoding:base64":{se(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{Rt(r,Sr.base64,n.message,t);break}}break}case"nanoid":Rt(r,Sr.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Bf(e,t){return t.patternStrategy==="escape"?Xj(e):e}function Xj(e){let t="";for(let r=0;r<e.length;r++)Qj.has(e[r])||(t+="\\"),t+=e[r];return t}function $r(e,t,r,n){e.format||e.anyOf?.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):se(e,"format",t,r,n)}function Rt(e,t,r,n){e.pattern||e.allOf?.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:fk(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):se(e,"pattern",fk(t,n),r,n)}function fk(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,o="",i=!1,s=!1,a=!1;for(let c=0;c<n.length;c++){if(i){o+=n[c],i=!1;continue}if(r.i){if(s){if(n[c].match(/[a-z]/)){a?(o+=n[c],o+=`${n[c-2]}-${n[c]}`.toUpperCase(),a=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(o+=n[c],a=!0):o+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){o+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){o+=`(^|(?<=[\r
|
|
66
|
+
godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}function Do(e,t=kr()){let r=ot(e);for(let n of t){let o=du(n)[r];if(o)return{credentials:o,path:n}}return null}function dn(e=kr()){let t=new Map;for(let r of e)for(let[n,o]of Object.entries(du(r)))t.has(n)||t.set(n,o);return[...t.values()]}function Mx(e,t){let r=(0,Ei.dirname)(t);(0,rt.mkdirSync)(r,{recursive:!0,mode:448}),process.platform!=="win32"&&(0,rt.chmodSync)(r,448);let n=`${JSON.stringify({version:Nx,logins:e},null,2)}
|
|
67
|
+
`,o=`${t}.${process.pid}.${(0,Ox.randomBytes)(6).toString("hex")}.tmp`,i=(0,rt.openSync)(o,"wx",384);try{try{(0,rt.writeSync)(i,n,null,"utf-8")}finally{(0,rt.closeSync)(i)}(0,rt.renameSync)(o,t)}catch(s){throw(0,rt.rmSync)(o,{force:!0}),s}}function Lx(e,t=Mn()){let r={};try{r=du(t)}catch{}r[ot(e.registry_url)]=e,Mx(r,t)}function Ef(e,t=Mn()){let r=du(t),n=ot(e);return n in r?(delete r[n],Object.keys(r).length===0?(0,rt.rmSync)(t,{force:!0}):Mx(r,t),!0):!1}function fu(e,t=new Date){if(!e.expires_at)return!1;let r=new Date(e.expires_at);return Number.isNaN(r.getTime())?!0:r.getTime()<=t.getTime()}var Ox,rt,Pf,Ei,Nx,jx,Bj,Vj,Ci=b(()=>{"use strict";Ox=require("node:crypto"),rt=require("node:fs"),Pf=require("node:os"),Ei=require("node:path");tt();Nx=2,jx=m.object({registry_url:m.string().min(1),access_token:m.string().min(1),expires_at:m.string().nullable(),email:m.string().nullable(),license_id:m.string().nullable(),device_name:m.string(),drive_authorized:m.boolean(),saved_at:m.string()}),Bj=jx.extend({version:m.literal(1)}),Vj=m.object({version:m.literal(Nx),logins:m.record(m.string(),jx)})});function Zx(e){let t=e??process.env.GODD_CONFIG;if(!t)throw new Error(`${Kt} \u306E\u30D1\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002GODD_CONFIG \u74B0\u5883\u5909\u6570\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001\u660E\u793A\u7684\u306B\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);if(!(0,hu.existsSync)(t))throw new Error(`${Kt} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${t}
|
|
68
|
+
GODD_CONFIG \u74B0\u5883\u5909\u6570\u307E\u305F\u306F .cursor/mcp.json \u306E env.GODD_CONFIG \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let r=(0,hu.readFileSync)(t,"utf-8"),n=br.load(r),o=zx.parse(n),i=process.env.GODD_REGISTRY_URL??o.registry_url??fn,s={stack_profile:o.stack_profile,components:o.components??[],language:process.env.GODD_LANGUAGE??o.language??Hj,registry_url:i},a=process.env.GODD_LICENSE_KEY??o.license_key;return a?{license_key:a,auth_source:"license_key",...s}:{license_key:Cf(i),auth_source:"device_token",...s}}function Cf(e,t={}){let r=t.paths??kr(),n=t.warn??(s=>console.error(s)),o=Do(e,r);if(!o){let s=dn(r);throw s.length>0?new Error(`\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u5225\u306E Registry\uFF08${s.map(a=>a.registry_url).join(", ")}\uFF09\u5411\u3051\u3067\u3059\u3002godd login --registry-url ${ot(e)} \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):new Error("license_key \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002GODD_LICENSE_KEY \u74B0\u5883\u5909\u6570\u3092\u8A2D\u5B9A\u3059\u308B\u304B\u3001.env \u306B\u8A18\u8F09\u3057\u3066\u304F\u3060\u3055\u3044\u3002Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u4F7F\u3046\u5834\u5408\u306F godd login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}let{credentials:i}=o;return fu(i)&&n(`[GoDD] \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${i.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),i.access_token}var hu,Kt,fn,Hj,Ln=b(()=>{"use strict";hu=require("node:fs");Ls();Dx();Ci();Kt="config.godd",fn="https://dev.api.godd.ripla-inc.com",Hj="en"});function mu(e,t,r){if(e.__GODD_CLI__)return!1;if(!r)return!0;if(!t)return!1;let n;try{n=(0,Fx.fileURLToPath)(r)}catch{return!0}return t===n?!0:Ux(t)===Ux(n)}function Ux(e){try{return(0,qx.realpathSync)(e)}catch{return e}}var qx,Fx,Tf=b(()=>{"use strict";qx=require("node:fs"),Fx=require("node:url")});var gu=b(()=>{pu()});var Gx=b(()=>{Tt()});var Bx=b(()=>{});var Vx=b(()=>{});var Hx=b(()=>{});var Wx=b(()=>{});var Kx=b(()=>{Tt();Gx();Bx();Vx();Tt();$c();Hx();Wx()});var Jx=b(()=>{Kx()});var Af=b(()=>{Jx()});function Oo(e){return!!e._zod}function Zn(e,t){return Oo(e)?_s(e,t):e.safeParse(t)}function yu(e){if(!e)return;let t;if(Oo(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Qx(e){if(Oo(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var _u=b(()=>{Af()});function Un(e){return e==="completed"||e==="failed"||e==="cancelled"}var Xx=b(()=>{});var tk,ek,rk,vu=b(()=>{tk=Symbol("Let zodToJsonSchema decide on which parser to use"),ek={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},rk=e=>typeof e=="string"?{...ek,name:e}:{...ek,...e}});var nk,Rf=b(()=>{vu();nk=e=>{let t=rk(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}}});function If(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function se(e,t,r,n,o){e[t]=r,If(e,t,n,o)}var qn=b(()=>{});var wu,bu=b(()=>{wu=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")}});function Oe(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?wu(t,e.currentPath):t.join("/")}}var lr=b(()=>{bu()});function ok(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==C.ZodAny&&(r.items=U(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&se(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&se(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(se(r,"minItems",e.exactLength.value,e.exactLength.message,t),se(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}var zf=b(()=>{gu();qn();We()});function ik(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Df=b(()=>{qn()});function sk(){return{type:"boolean"}}var Of=b(()=>{});function xu(e,t){return U(e.type._def,t)}var ku=b(()=>{We()});var ak,Nf=b(()=>{We();ak=(e,t)=>U(e.innerType._def,t)});function jf(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>jf(e,t,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Jj(e,t)}}var Jj,Mf=b(()=>{qn();Jj=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":se(r,"minimum",n.value,n.message,t);break;case"max":se(r,"maximum",n.value,n.message,t);break}return r}});function ck(e,t){return{...U(e.innerType._def,t),default:e.defaultValue()}}var Lf=b(()=>{We()});function uk(e,t){return t.effectStrategy==="input"?U(e.schema._def,t):Oe(t)}var Zf=b(()=>{We();lr()});function lk(e){return{type:"string",enum:Array.from(e.values)}}var Uf=b(()=>{});function pk(e,t){let r=[U(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),U(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(Yj(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:a,...c}=i;s=c}else n=void 0;o.push(s)}}),o.length?{allOf:o,...n}:void 0}var Yj,qf=b(()=>{We();Yj=e=>"type"in e&&e.type==="string"?!1:"allOf"in e});function dk(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var Ff=b(()=>{});function Su(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":$r(r,"email",n.message,t);break;case"format:idn-email":$r(r,"idn-email",n.message,t);break;case"pattern:zod":Rt(r,Sr.email,n.message,t);break}break;case"url":$r(r,"uri",n.message,t);break;case"uuid":$r(r,"uuid",n.message,t);break;case"regex":Rt(r,n.regex,n.message,t);break;case"cuid":Rt(r,Sr.cuid,n.message,t);break;case"cuid2":Rt(r,Sr.cuid2,n.message,t);break;case"startsWith":Rt(r,RegExp(`^${Bf(n.value,t)}`),n.message,t);break;case"endsWith":Rt(r,RegExp(`${Bf(n.value,t)}$`),n.message,t);break;case"datetime":$r(r,"date-time",n.message,t);break;case"date":$r(r,"date",n.message,t);break;case"time":$r(r,"time",n.message,t);break;case"duration":$r(r,"duration",n.message,t);break;case"length":se(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),se(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{Rt(r,RegExp(Bf(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&$r(r,"ipv4",n.message,t),n.version!=="v4"&&$r(r,"ipv6",n.message,t);break}case"base64url":Rt(r,Sr.base64url,n.message,t);break;case"jwt":Rt(r,Sr.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Rt(r,Sr.ipv4Cidr,n.message,t),n.version!=="v4"&&Rt(r,Sr.ipv6Cidr,n.message,t);break}case"emoji":Rt(r,Sr.emoji(),n.message,t);break;case"ulid":{Rt(r,Sr.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{$r(r,"binary",n.message,t);break}case"contentEncoding:base64":{se(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{Rt(r,Sr.base64,n.message,t);break}}break}case"nanoid":Rt(r,Sr.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Bf(e,t){return t.patternStrategy==="escape"?Xj(e):e}function Xj(e){let t="";for(let r=0;r<e.length;r++)Qj.has(e[r])||(t+="\\"),t+=e[r];return t}function $r(e,t,r,n){e.format||e.anyOf?.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):se(e,"format",t,r,n)}function Rt(e,t,r,n){e.pattern||e.allOf?.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:fk(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):se(e,"pattern",fk(t,n),r,n)}function fk(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,o="",i=!1,s=!1,a=!1;for(let c=0;c<n.length;c++){if(i){o+=n[c],i=!1;continue}if(r.i){if(s){if(n[c].match(/[a-z]/)){a?(o+=n[c],o+=`${n[c-2]}-${n[c]}`.toUpperCase(),a=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(o+=n[c],a=!0):o+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){o+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){o+=`(^|(?<=[\r
|
|
69
69
|
]))`;continue}else if(n[c]==="$"){o+=`($|(?=[\r
|
|
70
70
|
]))`;continue}}if(r.s&&n[c]==="."){o+=s?`${n[c]}\r
|
|
71
71
|
`:`[${n[c]}\r
|
|
72
|
-
]`;continue}o+=n[c],n[c]==="\\"?i=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}var Gf,Sr,Qj,$u=b(()=>{Un();Sr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Gf===void 0&&(Gf=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Gf),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};Qj=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function Pu(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===C.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,o)=>({...n,[o]:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??Oe(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===C.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=Su(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===C.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===C.ZodBranded&&e.keyType._def.type._def.typeName===C.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=xu(e.keyType._def,t);return{...r,propertyNames:o}}}return r}var Eu=b(()=>{gu();We();$u();ku();ur()});function hk(e,t){if(t.mapStrategy==="record")return Pu(e,t);let r=U(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Oe(t),n=U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Oe(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var Vf=b(()=>{We();Eu();ur()});function mk(e){let t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}var Hf=b(()=>{});function gk(e){return e.target==="openAi"?void 0:{not:Oe({...e,currentPath:[...e.currentPath,"not"]})}}var Wf=b(()=>{ur()});function yk(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Kf=b(()=>{});function vk(e,t){if(t.target==="openApi3")return _k(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Gs&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=Gs[i._def.typeName];return s&&!o.includes(s)?[...o,s]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...o,s];case"bigint":return[...o,"integer"];case"object":if(i._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((i,s,a)=>a.indexOf(i)===s);return{type:o.length>1?o:o[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return _k(e,t)}var Gs,_k,Cu=b(()=>{We();Gs={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};_k=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>U(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function wk(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Gs[e.innerType._def.typeName],nullable:!0}:{type:[Gs[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=U(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=U(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var Jf=b(()=>{We();Cu()});function bk(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",If(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Yf=b(()=>{Un()});function xk(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},o=[],i=e.shape();for(let a in i){let c=i[a];if(c===void 0||c._def===void 0)continue;let u=t4(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let p=U(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});p!==void 0&&(n.properties[a]=p,u||o.push(a))}o.length&&(n.required=o);let s=e4(e,t);return s!==void 0&&(n.additionalProperties=s),n}function e4(e,t){if(e.catchall._def.typeName!=="ZodNever")return U(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function t4(e){try{return e.isOptional()}catch{return!0}}var Qf=b(()=>{We()});var kk,Xf=b(()=>{We();ur();kk=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return U(e.innerType._def,t);let r=U(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Oe(t)},r]}:Oe(t)}});var Sk,eh=b(()=>{We();Sk=(e,t)=>{if(t.pipeStrategy==="input")return U(e.in._def,t);if(t.pipeStrategy==="output")return U(e.out._def,t);let r=U(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=U(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}}});function $k(e,t){return U(e.type._def,t)}var th=b(()=>{We()});function Pk(e,t){let n={type:"array",uniqueItems:!0,items:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&se(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&se(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}var rh=b(()=>{Un();We()});function Ek(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>U(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:U(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>U(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var nh=b(()=>{We()});function Ck(e){return{not:Oe(e)}}var oh=b(()=>{ur()});function Tk(e){return Oe(e)}var ih=b(()=>{ur()});var Ak,sh=b(()=>{We();Ak=(e,t)=>U(e.innerType._def,t)});var Rk,ah=b(()=>{gu();ur();zf();Df();Of();ku();Nf();Mf();Lf();Zf();Uf();qf();Ff();Vf();Hf();Wf();Kf();Jf();Yf();Qf();Xf();eh();th();Eu();rh();$u();nh();oh();Cu();ih();sh();Rk=(e,t,r)=>{switch(t){case C.ZodString:return Su(e,r);case C.ZodNumber:return bk(e,r);case C.ZodObject:return xk(e,r);case C.ZodBigInt:return ik(e,r);case C.ZodBoolean:return sk();case C.ZodDate:return jf(e,r);case C.ZodUndefined:return Ck(r);case C.ZodNull:return yk(r);case C.ZodArray:return ok(e,r);case C.ZodUnion:case C.ZodDiscriminatedUnion:return vk(e,r);case C.ZodIntersection:return pk(e,r);case C.ZodTuple:return Ek(e,r);case C.ZodRecord:return Pu(e,r);case C.ZodLiteral:return dk(e,r);case C.ZodEnum:return lk(e);case C.ZodNativeEnum:return mk(e);case C.ZodNullable:return wk(e,r);case C.ZodOptional:return kk(e,r);case C.ZodMap:return hk(e,r);case C.ZodSet:return Pk(e,r);case C.ZodLazy:return()=>e.getter()._def;case C.ZodPromise:return $k(e,r);case C.ZodNaN:case C.ZodNever:return gk(r);case C.ZodEffects:return uk(e,r);case C.ZodAny:return Oe(r);case C.ZodUnknown:return Tk(r);case C.ZodDefault:return ck(e,r);case C.ZodBranded:return xu(e,r);case C.ZodReadonly:return Ak(e,r);case C.ZodCatch:return ak(e,r);case C.ZodPipeline:return Sk(e,r);case C.ZodFunction:case C.ZodVoid:case C.ZodSymbol:return;default:return(n=>{})(t)}}});function U(e,t,r=!1){let n=t.seen.get(e);if(t.override){let a=t.override?.(e,t,n,r);if(a!==tk)return a}if(n&&!r){let a=r4(n,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=Rk(e,e.typeName,t),s=typeof i=="function"?U(i(),t):i;if(s&&n4(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var r4,n4,We=b(()=>{vu();ah();bu();ur();r4=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:wu(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Oe(t)):t.$refStrategy==="seen"?Oe(t):void 0}},n4=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)});var Ik=b(()=>{});var ch,uh=b(()=>{We();Rf();ur();ch=(e,t)=>{let r=nk(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,p])=>({...c,[u]:U(p._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Oe(r)}),{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=U(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??Oe(r),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=o===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var zk=b(()=>{vu();Rf();Un();bu();We();Ik();ur();zf();Df();Of();ku();Nf();Mf();Lf();Zf();Uf();qf();Ff();Vf();Hf();Wf();Kf();Jf();Yf();Qf();Xf();eh();th();sh();Eu();rh();$u();nh();oh();Cu();ih();ah();uh();uh()});function o4(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function Dk(e,t){return Oo(e)?Tc(e,{target:o4(t?.target),io:t?.pipeStrategy??"input"}):ch(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function lh(e){let r=yu(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Qx(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function ph(e,t){let r=Ln(e,t);if(!r.success)throw r.error;return r.data}var dh=b(()=>{Af();_u();zk()});function Ok(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Nk(e,t){let r={...e};for(let n in t){let o=n,i=t[o];if(i===void 0)continue;let s=r[o];Ok(s)&&Ok(i)?r[o]={...s,...i}:r[o]=i}return r}var i4,Tu,jk=b(()=>{_u();An();Xx();dh();i4=6e4,Tu=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Lc,r=>{this._oncancel(r)}),this.setNotificationHandler(qc,r=>{this._onprogress(r)}),this.setRequestHandler(Uc,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Fc,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new V(ee.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Bc,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,p=this._requestResolvers.get(u);if(p)if(this._requestResolvers.delete(u),a.type==="response")p(c);else{let l=c,d=new V(l.error.code,l.error.message,l.error.data);p(d)}else{let l=a.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(i,n.sessionId);if(!s)throw new V(ee.InvalidParams,`Task not found: ${i}`);if(!Zn(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(Zn(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Tn]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(Vc,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new V(ee.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Wc,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new V(ee.InvalidParams,`Task not found: ${r.params.taskId}`);if(Zn(o.status))throw new V(ee.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new V(ee.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof V?o:new V(ee.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,o,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:o})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),V.fromError(ee.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{o?.(i,s),mo(i)||i0(i)?this._onresponse(i):ho(i)?this._onrequest(i,s):o0(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=V.fromError(ee.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,o=this._transport,i=t.params?._meta?.[Tn]?.taskId;if(n===void 0){let p={jsonrpc:"2.0",id:t.id,error:{code:ee.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},o?.sessionId).catch(l=>this._onerror(new Error(`Failed to enqueue error response: ${l}`))):o?.send(p).catch(l=>this._onerror(new Error(`Failed to send an error response: ${l}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let a=t0(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,u={signal:s.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async p=>{if(s.signal.aborted)return;let l={relatedRequestId:t.id};i&&(l.relatedTask={taskId:i}),await this.notification(p,l)},sendRequest:async(p,l,d)=>{if(s.signal.aborted)throw new V(ee.ConnectionClosed,"Request was cancelled");let f={...d,relatedRequestId:t.id};i&&!f.relatedTask&&(f.relatedTask={taskId:i});let h=f.relatedTask?.taskId??i;return h&&c&&await c.updateTaskStatus(h,"input_required"),await this.request(p,l,f)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async p=>{if(s.signal.aborted)return;let l={result:p,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)},async p=>{if(s.signal.aborted)return;let l={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(p.code)?p.code:ee.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)}).catch(p=>this._onerror(new Error(`Failed to send response: ${p}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,o=Number(r),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}i(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),mo(t))n(t);else{let s=new V(t.error.code,t.error.message,t.error.data);n(s)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(mo(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),mo(t))o(t);else{let s=V.fromError(t.error.code,t.error.message,t.error.data);o(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(t,r,n)}}catch(s){yield{type:"error",error:s instanceof V?s:new V(ee.InternalError,String(s))}}return}let i;try{let s=await this.request(t,di,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new V(ee.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},Zn(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new V(ee.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new V(ee.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof V?s:new V(ee.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((u,p)=>{let l=w=>{p(w)};if(!this._transport){l(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(w){l(w);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...t,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...t.params,_meta:{...t.params?._meta||{},progressToken:d}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Tn]:c}});let h=w=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(w)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));let x=w instanceof V?w:new V(ee.RequestTimeout,String(w));p(x)};this._responseHandlers.set(d,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return p(w);try{let x=Ln(r,w.result);x.success?u(x.data):p(x.error)}catch(x){p(x)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let g=n?.timeout??i4,y=()=>h(V.fromError(ee.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let w=x=>{let k=this._responseHandlers.get(d);k?k(x):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,w),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(d),p(x)})}else this._transport.send(f,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(w=>{this._cleanupTimeout(d),p(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Gc,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Hc,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},c0,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Tn]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Tn]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Tn]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=lh(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=ph(t,o);return Promise.resolve(r(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=lh(t);this._notificationHandlers.set(n,o=>{let i=ph(t,o);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,o)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let o of n)if(o.type==="request"&&ho(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new V(ee.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,i)=>{if(r.aborted){i(new V(ee.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new V(ee.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await n.createTask(o,t.id,{method:t.method,params:t.params},r)},getTask:async o=>{let i=await n.getTask(o,r);if(!i)throw new V(ee.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,s)=>{await n.storeTaskResult(o,i,s,r);let a=await n.getTask(o,r);if(a){let c=As.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Zn(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,s)=>{let a=await n.getTask(o,r);if(!a)throw new V(ee.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Zn(a.status))throw new V(ee.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,s,r);let c=await n.getTask(o,r);if(c){let u=As.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Zn(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}}});var Hs=$(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.regexpCode=ue.getEsmExportName=ue.getProperty=ue.safeStringify=ue.stringify=ue.strConcat=ue.addCodeArg=ue.str=ue._=ue.nil=ue._Code=ue.Name=ue.IDENTIFIER=ue._CodeOrName=void 0;var Bs=class{};ue._CodeOrName=Bs;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var No=class extends Bs{constructor(t){if(super(),!ue.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ue.Name=No;var lr=class extends Bs{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof No&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ue._Code=lr;ue.nil=new lr("");function Mk(e,...t){let r=[e[0]],n=0;for(;n<t.length;)hh(r,t[n]),r.push(e[++n]);return new lr(r)}ue._=Mk;var fh=new lr("+");function Lk(e,...t){let r=[Vs(e[0])],n=0;for(;n<t.length;)r.push(fh),hh(r,t[n]),r.push(fh,Vs(e[++n]));return s4(r),new lr(r)}ue.str=Lk;function hh(e,t){t instanceof lr?e.push(...t._items):t instanceof No?e.push(t):e.push(u4(t))}ue.addCodeArg=hh;function s4(e){let t=1;for(;t<e.length-1;){if(e[t]===fh){let r=a4(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function a4(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof No||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof No))return`"${e}${t.slice(1)}`}function c4(e,t){return t.emptyStr()?e:e.emptyStr()?t:Lk`${e}${t}`}ue.strConcat=c4;function u4(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Vs(Array.isArray(e)?e.join(","):e)}function l4(e){return new lr(Vs(e))}ue.stringify=l4;function Vs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=Vs;function p4(e){return typeof e=="string"&&ue.IDENTIFIER.test(e)?new lr(`.${e}`):Mk`[${e}]`}ue.getProperty=p4;function d4(e){if(typeof e=="string"&&ue.IDENTIFIER.test(e))return new lr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ue.getEsmExportName=d4;function f4(e){return new lr(e.toString())}ue.regexpCode=f4});var yh=$(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ValueScope=Gt.ValueScopeName=Gt.Scope=Gt.varKinds=Gt.UsedValueState=void 0;var Ft=Hs(),mh=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Au;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Au||(Gt.UsedValueState=Au={}));Gt.varKinds={const:new Ft.Name("const"),let:new Ft.Name("let"),var:new Ft.Name("var")};var Ru=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ft.Name?t:this.name(t)}name(t){return new Ft.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Gt.Scope=Ru;var Iu=class extends Ft.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ft._)`.${new Ft.Name(r)}[${n}]`}};Gt.ValueScopeName=Iu;var h4=(0,Ft._)`\n`,gh=class extends Ru{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?h4:Ft.nil}}get(){return this._scope}name(t){return new Iu(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let p=a.get(s);if(p)return p}else a=this._values[i]=new Map;a.set(s,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ft._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=Ft.nil;for(let s in t){let a=t[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Au.Started);let p=r(u);if(p){let l=this.opts.es5?Gt.varKinds.var:Gt.varKinds.const;i=(0,Ft._)`${i}${l} ${u} = ${p};${this.opts._n}`}else if(p=o?.(u))i=(0,Ft._)`${i}${p}${this.opts._n}`;else throw new mh(u);c.set(u,Au.Completed)})}return i}};Gt.ValueScope=gh});var Y=$(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var ae=Hs(),Pr=yh(),qn=Hs();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return qn._}});Object.defineProperty(X,"str",{enumerable:!0,get:function(){return qn.str}});Object.defineProperty(X,"strConcat",{enumerable:!0,get:function(){return qn.strConcat}});Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return qn.nil}});Object.defineProperty(X,"getProperty",{enumerable:!0,get:function(){return qn.getProperty}});Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return qn.stringify}});Object.defineProperty(X,"regexpCode",{enumerable:!0,get:function(){return qn.regexpCode}});Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return qn.Name}});var Nu=yh();Object.defineProperty(X,"Scope",{enumerable:!0,get:function(){return Nu.Scope}});Object.defineProperty(X,"ValueScope",{enumerable:!0,get:function(){return Nu.ValueScope}});Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:function(){return Nu.ValueScopeName}});Object.defineProperty(X,"varKinds",{enumerable:!0,get:function(){return Nu.varKinds}});X.operators={GT:new ae._Code(">"),GTE:new ae._Code(">="),LT:new ae._Code("<"),LTE:new ae._Code("<="),EQ:new ae._Code("==="),NEQ:new ae._Code("!=="),NOT:new ae._Code("!"),OR:new ae._Code("||"),AND:new ae._Code("&&"),ADD:new ae._Code("+")};var fn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},_h=class extends fn{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Pr.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Ai(this.rhs,t,r)),this}get names(){return this.rhs instanceof ae._CodeOrName?this.rhs.names:{}}},zu=class extends fn{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ae.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Ai(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ae.Name?{}:{...this.lhs.names};return Ou(t,this.rhs)}},vh=class extends zu{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},wh=class extends fn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},bh=class extends fn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},xh=class extends fn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},kh=class extends fn{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Ai(this.code,t,r),this}get names(){return this.code instanceof ae._CodeOrName?this.code.names:{}}},Ws=class extends fn{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(m4(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Lo(t,r.names),{})}},hn=class extends Ws{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Sh=class extends Ws{},Ti=class extends hn{};Ti.kind="else";var jo=class e extends hn{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ti(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Zk(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Ai(this.condition,t,r),this}get names(){let t=super.names;return Ou(t,this.condition),this.else&&Lo(t,this.else.names),t}};jo.kind="if";var Mo=class extends hn{};Mo.kind="for";var $h=class extends Mo{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Ai(this.iteration,t,r),this}get names(){return Lo(super.names,this.iteration.names)}},Ph=class extends Mo{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Pr.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=Ou(super.names,this.from);return Ou(t,this.to)}},Du=class extends Mo{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Ai(this.iterable,t,r),this}get names(){return Lo(super.names,this.iterable.names)}},Ks=class extends hn{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Ks.kind="func";var Js=class extends Ws{render(t){return"return "+super.render(t)}};Js.kind="return";var Eh=class extends hn{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Lo(t,this.catch.names),this.finally&&Lo(t,this.finally.names),t}},Ys=class extends hn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Ys.kind="catch";var Qs=class extends hn{render(t){return"finally"+super.render(t)}};Qs.kind="finally";var Ch=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
73
|
-
`:""},this._extScope=t,this._scope=new Pr.Scope({parent:t}),this._nodes=[new Sh]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new _h(t,i,n)),i}const(t,r,n){return this._def(Pr.varKinds.const,t,r,n)}let(t,r,n){return this._def(Pr.varKinds.let,t,r,n)}var(t,r,n){return this._def(Pr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new zu(t,r,n))}add(t,r){return this._leafNode(new vh(t,X.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new kh(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ae.addCodeArg)(r,o));return r.push("}"),new ae._Code(r)}if(t,r,n){if(this._blockNode(new jo(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new jo(t))}else(){return this._elseNode(new Ti)}endIf(){return this._endBlockNode(jo,Ti)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new $h(t),r)}forRange(t,r,n,o,i=this.opts.es5?Pr.varKinds.var:Pr.varKinds.let){let s=this._scope.toName(t);return this._for(new Ph(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Pr.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ae.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ae._)`${s}.length`,a=>{this.var(i,(0,ae._)`${s}[${a}]`),n(i)})}return this._for(new Du("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Pr.varKinds.var:Pr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ae._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new Du("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Mo)}label(t){return this._leafNode(new wh(t))}break(t){return this._leafNode(new bh(t))}return(t){let r=new Js;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Js)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Eh;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ys(i),r(i)}return n&&(this._currNode=o.finally=new Qs,this.code(n)),this._endBlockNode(Ys,Qs)}throw(t){return this._leafNode(new xh(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ae.nil,n,o){return this._blockNode(new Ks(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Ks)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof jo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};X.CodeGen=Ch;function Lo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ou(e,t){return t instanceof ae._CodeOrName?Lo(e,t.names):e}function Ai(e,t,r){if(e instanceof ae.Name)return n(e);if(!o(e))return e;return new ae._Code(e._items.reduce((i,s)=>(s instanceof ae.Name&&(s=n(s)),s instanceof ae._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof ae._Code&&i._items.some(s=>s instanceof ae.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function m4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Zk(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${Th(e)}`}X.not=Zk;var g4=Uk(X.operators.AND);function y4(...e){return e.reduce(g4)}X.and=y4;var _4=Uk(X.operators.OR);function v4(...e){return e.reduce(_4)}X.or=v4;function Uk(e){return(t,r)=>t===ae.nil?r:r===ae.nil?t:(0,ae._)`${Th(t)} ${e} ${Th(r)}`}function Th(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var le=$(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.checkStrictMode=te.getErrorPath=te.Type=te.useFunc=te.setEvaluated=te.evaluatedPropsToName=te.mergeEvaluated=te.eachItem=te.unescapeJsonPointer=te.escapeJsonPointer=te.escapeFragment=te.unescapeFragment=te.schemaRefOrVal=te.schemaHasRulesButRef=te.schemaHasRules=te.checkUnknownRules=te.alwaysValidSchema=te.toHash=void 0;var xe=Y(),w4=Hs();function b4(e){let t={};for(let r of e)t[r]=!0;return t}te.toHash=b4;function x4(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Gk(e,t),!Bk(t,e.self.RULES.all))}te.alwaysValidSchema=x4;function Gk(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||Wk(e,`unknown keyword: "${i}"`)}te.checkUnknownRules=Gk;function Bk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}te.schemaHasRules=Bk;function k4(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}te.schemaHasRulesButRef=k4;function S4({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,xe._)`${r}`}return(0,xe._)`${e}${t}${(0,xe.getProperty)(n)}`}te.schemaRefOrVal=S4;function $4(e){return Vk(decodeURIComponent(e))}te.unescapeFragment=$4;function P4(e){return encodeURIComponent(Rh(e))}te.escapeFragment=P4;function Rh(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}te.escapeJsonPointer=Rh;function Vk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}te.unescapeJsonPointer=Vk;function E4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}te.eachItem=E4;function qk({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof xe.Name?(i instanceof xe.Name?e(o,i,s):t(o,i,s),s):i instanceof xe.Name?(t(o,s,i),i):r(i,s);return a===xe.Name&&!(c instanceof xe.Name)?n(o,c):c}}te.mergeEvaluated={props:qk({mergeNames:(e,t,r)=>e.if((0,xe._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,xe._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,xe._)`${r} || {}`).code((0,xe._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,xe._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,xe._)`${r} || {}`),Ih(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Hk}),items:qk({mergeNames:(e,t,r)=>e.if((0,xe._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,xe._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,xe._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,xe._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Hk(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,xe._)`{}`);return t!==void 0&&Ih(e,r,t),r}te.evaluatedPropsToName=Hk;function Ih(e,t,r){Object.keys(r).forEach(n=>e.assign((0,xe._)`${t}${(0,xe.getProperty)(n)}`,!0))}te.setEvaluated=Ih;var Fk={};function C4(e,t){return e.scopeValue("func",{ref:t,code:Fk[t.code]||(Fk[t.code]=new w4._Code(t.code))})}te.useFunc=C4;var Ah;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ah||(te.Type=Ah={}));function T4(e,t,r){if(e instanceof xe.Name){let n=t===Ah.Num;return r?n?(0,xe._)`"[" + ${e} + "]"`:(0,xe._)`"['" + ${e} + "']"`:n?(0,xe._)`"/" + ${e}`:(0,xe._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,xe.getProperty)(e).toString():"/"+Rh(e)}te.getErrorPath=T4;function Wk(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}te.checkStrictMode=Wk});var mn=$(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});var bt=Y(),A4={data:new bt.Name("data"),valCxt:new bt.Name("valCxt"),instancePath:new bt.Name("instancePath"),parentData:new bt.Name("parentData"),parentDataProperty:new bt.Name("parentDataProperty"),rootData:new bt.Name("rootData"),dynamicAnchors:new bt.Name("dynamicAnchors"),vErrors:new bt.Name("vErrors"),errors:new bt.Name("errors"),this:new bt.Name("this"),self:new bt.Name("self"),scope:new bt.Name("scope"),json:new bt.Name("json"),jsonPos:new bt.Name("jsonPos"),jsonLen:new bt.Name("jsonLen"),jsonPart:new bt.Name("jsonPart")};zh.default=A4});var Xs=$(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.extendErrors=xt.resetErrorsCount=xt.reportExtraError=xt.reportError=xt.keyword$DataError=xt.keywordError=void 0;var ce=Y(),ju=le(),It=mn();xt.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};xt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ce.str)`"${e}" keyword must be ${t} ($data)`:(0,ce.str)`"${e}" keyword is invalid ($data)`};function R4(e,t=xt.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=Yk(e,t,r);n??(s||a)?Kk(i,c):Jk(o,(0,ce._)`[${c}]`)}xt.reportError=R4;function I4(e,t=xt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=Yk(e,t,r);Kk(o,a),i||s||Jk(n,It.default.vErrors)}xt.reportExtraError=I4;function z4(e,t){e.assign(It.default.errors,t),e.if((0,ce._)`${It.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${It.default.vErrors}.length`,t),()=>e.assign(It.default.vErrors,null)))}xt.resetErrorsCount=z4;function D4({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,It.default.errors,a=>{e.const(s,(0,ce._)`${It.default.vErrors}[${a}]`),e.if((0,ce._)`${s}.instancePath === undefined`,()=>e.assign((0,ce._)`${s}.instancePath`,(0,ce.strConcat)(It.default.instancePath,i.errorPath))),e.assign((0,ce._)`${s}.schemaPath`,(0,ce.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ce._)`${s}.schema`,r),e.assign((0,ce._)`${s}.data`,n))})}xt.extendErrors=D4;function Kk(e,t){let r=e.const("err",t);e.if((0,ce._)`${It.default.vErrors} === null`,()=>e.assign(It.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${It.default.vErrors}.push(${r})`),e.code((0,ce._)`${It.default.errors}++`)}function Jk(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ce._)`new ${e.ValidationError}(${t})`):(r.assign((0,ce._)`${n}.errors`,t),r.return(!1))}var Zo={keyword:new ce.Name("keyword"),schemaPath:new ce.Name("schemaPath"),params:new ce.Name("params"),propertyName:new ce.Name("propertyName"),message:new ce.Name("message"),schema:new ce.Name("schema"),parentSchema:new ce.Name("parentSchema")};function Yk(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ce._)`{}`:O4(e,t,r)}function O4(e,t,r={}){let{gen:n,it:o}=e,i=[N4(o,r),j4(e,r)];return M4(e,t,i),n.object(...i)}function N4({errorPath:e},{instancePath:t}){let r=t?(0,ce.str)`${e}${(0,ju.getErrorPath)(t,ju.Type.Str)}`:e;return[It.default.instancePath,(0,ce.strConcat)(It.default.instancePath,r)]}function j4({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ce.str)`${t}/${e}`;return r&&(o=(0,ce.str)`${o}${(0,ju.getErrorPath)(r,ju.Type.Str)}`),[Zo.schemaPath,o]}function M4(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:p,schemaPath:l}=a;n.push([Zo.keyword,o],[Zo.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&n.push([Zo.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Zo.schema,s],[Zo.parentSchema,(0,ce._)`${p}${l}`],[It.default.data,i]),u&&n.push([Zo.propertyName,u])}});var Xk=$(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.boolOrEmptySchema=Ri.topBoolOrEmptySchema=void 0;var L4=Xs(),Z4=Y(),U4=mn(),q4={message:"boolean schema is false"};function F4(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Qk(e,!1):typeof r=="object"&&r.$async===!0?t.return(U4.default.data):(t.assign((0,Z4._)`${n}.errors`,null),t.return(!0))}Ri.topBoolOrEmptySchema=F4;function G4(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Qk(e)):r.var(t,!0)}Ri.boolOrEmptySchema=G4;function Qk(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,L4.reportError)(o,q4,void 0,t)}});var Dh=$(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.getRules=Ii.isJSONType=void 0;var B4=["string","number","integer","boolean","null","object","array"],V4=new Set(B4);function H4(e){return typeof e=="string"&&V4.has(e)}Ii.isJSONType=H4;function W4(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Ii.getRules=W4});var Oh=$(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.shouldUseRule=Fn.shouldUseGroup=Fn.schemaHasRulesForType=void 0;function K4({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&eS(e,n)}Fn.schemaHasRulesForType=K4;function eS(e,t){return t.rules.some(r=>tS(e,r))}Fn.shouldUseGroup=eS;function tS(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Fn.shouldUseRule=tS});var ea=$(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.reportTypeError=kt.checkDataTypes=kt.checkDataType=kt.coerceAndCheckDataType=kt.getJSONTypes=kt.getSchemaTypes=kt.DataType=void 0;var J4=Dh(),Y4=Oh(),Q4=Xs(),H=Y(),rS=le(),zi;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(zi||(kt.DataType=zi={}));function X4(e){let t=nS(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}kt.getSchemaTypes=X4;function nS(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(J4.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}kt.getJSONTypes=nS;function eM(e,t){let{gen:r,data:n,opts:o}=e,i=tM(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,Y4.schemaHasRulesForType)(e,t[0]));if(s){let a=jh(t,n,o.strictNumbers,zi.Wrong);r.if(a,()=>{i.length?rM(e,t,i):Mh(e)})}return s}kt.coerceAndCheckDataType=eM;var oS=new Set(["string","number","integer","boolean","null"]);function tM(e,t){return t?e.filter(r=>oS.has(r)||t==="array"&&r==="array"):[]}function rM(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,H._)`typeof ${o}`),a=n.let("coerced",(0,H._)`undefined`);i.coerceTypes==="array"&&n.if((0,H._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,H._)`${o}[0]`).assign(s,(0,H._)`typeof ${o}`).if(jh(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,H._)`${a} !== undefined`);for(let u of r)(oS.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Mh(e),n.endIf(),n.if((0,H._)`${a} !== undefined`,()=>{n.assign(o,a),nM(e,a)});function c(u){switch(u){case"string":n.elseIf((0,H._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,H._)`"" + ${o}`).elseIf((0,H._)`${o} === null`).assign(a,(0,H._)`""`);return;case"number":n.elseIf((0,H._)`${s} == "boolean" || ${o} === null
|
|
72
|
+
]`;continue}o+=n[c],n[c]==="\\"?i=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}var Gf,Sr,Qj,$u=b(()=>{qn();Sr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Gf===void 0&&(Gf=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Gf),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};Qj=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function Pu(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===C.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,o)=>({...n,[o]:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??Oe(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===C.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=Su(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===C.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===C.ZodBranded&&e.keyType._def.type._def.typeName===C.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=xu(e.keyType._def,t);return{...r,propertyNames:o}}}return r}var Eu=b(()=>{gu();We();$u();ku();lr()});function hk(e,t){if(t.mapStrategy==="record")return Pu(e,t);let r=U(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Oe(t),n=U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Oe(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var Vf=b(()=>{We();Eu();lr()});function mk(e){let t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}var Hf=b(()=>{});function gk(e){return e.target==="openAi"?void 0:{not:Oe({...e,currentPath:[...e.currentPath,"not"]})}}var Wf=b(()=>{lr()});function yk(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Kf=b(()=>{});function vk(e,t){if(t.target==="openApi3")return _k(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Gs&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=Gs[i._def.typeName];return s&&!o.includes(s)?[...o,s]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...o,s];case"bigint":return[...o,"integer"];case"object":if(i._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((i,s,a)=>a.indexOf(i)===s);return{type:o.length>1?o:o[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return _k(e,t)}var Gs,_k,Cu=b(()=>{We();Gs={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};_k=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>U(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function wk(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Gs[e.innerType._def.typeName],nullable:!0}:{type:[Gs[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=U(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=U(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var Jf=b(()=>{We();Cu()});function bk(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",If(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?se(r,"minimum",n.value,n.message,t):se(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),se(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?se(r,"maximum",n.value,n.message,t):se(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),se(r,"maximum",n.value,n.message,t));break;case"multipleOf":se(r,"multipleOf",n.value,n.message,t);break}return r}var Yf=b(()=>{qn()});function xk(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},o=[],i=e.shape();for(let a in i){let c=i[a];if(c===void 0||c._def===void 0)continue;let u=t4(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let p=U(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});p!==void 0&&(n.properties[a]=p,u||o.push(a))}o.length&&(n.required=o);let s=e4(e,t);return s!==void 0&&(n.additionalProperties=s),n}function e4(e,t){if(e.catchall._def.typeName!=="ZodNever")return U(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function t4(e){try{return e.isOptional()}catch{return!0}}var Qf=b(()=>{We()});var kk,Xf=b(()=>{We();lr();kk=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return U(e.innerType._def,t);let r=U(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Oe(t)},r]}:Oe(t)}});var Sk,eh=b(()=>{We();Sk=(e,t)=>{if(t.pipeStrategy==="input")return U(e.in._def,t);if(t.pipeStrategy==="output")return U(e.out._def,t);let r=U(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=U(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}}});function $k(e,t){return U(e.type._def,t)}var th=b(()=>{We()});function Pk(e,t){let n={type:"array",uniqueItems:!0,items:U(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&se(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&se(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}var rh=b(()=>{qn();We()});function Ek(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>U(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:U(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>U(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var nh=b(()=>{We()});function Ck(e){return{not:Oe(e)}}var oh=b(()=>{lr()});function Tk(e){return Oe(e)}var ih=b(()=>{lr()});var Ak,sh=b(()=>{We();Ak=(e,t)=>U(e.innerType._def,t)});var Rk,ah=b(()=>{gu();lr();zf();Df();Of();ku();Nf();Mf();Lf();Zf();Uf();qf();Ff();Vf();Hf();Wf();Kf();Jf();Yf();Qf();Xf();eh();th();Eu();rh();$u();nh();oh();Cu();ih();sh();Rk=(e,t,r)=>{switch(t){case C.ZodString:return Su(e,r);case C.ZodNumber:return bk(e,r);case C.ZodObject:return xk(e,r);case C.ZodBigInt:return ik(e,r);case C.ZodBoolean:return sk();case C.ZodDate:return jf(e,r);case C.ZodUndefined:return Ck(r);case C.ZodNull:return yk(r);case C.ZodArray:return ok(e,r);case C.ZodUnion:case C.ZodDiscriminatedUnion:return vk(e,r);case C.ZodIntersection:return pk(e,r);case C.ZodTuple:return Ek(e,r);case C.ZodRecord:return Pu(e,r);case C.ZodLiteral:return dk(e,r);case C.ZodEnum:return lk(e);case C.ZodNativeEnum:return mk(e);case C.ZodNullable:return wk(e,r);case C.ZodOptional:return kk(e,r);case C.ZodMap:return hk(e,r);case C.ZodSet:return Pk(e,r);case C.ZodLazy:return()=>e.getter()._def;case C.ZodPromise:return $k(e,r);case C.ZodNaN:case C.ZodNever:return gk(r);case C.ZodEffects:return uk(e,r);case C.ZodAny:return Oe(r);case C.ZodUnknown:return Tk(r);case C.ZodDefault:return ck(e,r);case C.ZodBranded:return xu(e,r);case C.ZodReadonly:return Ak(e,r);case C.ZodCatch:return ak(e,r);case C.ZodPipeline:return Sk(e,r);case C.ZodFunction:case C.ZodVoid:case C.ZodSymbol:return;default:return(n=>{})(t)}}});function U(e,t,r=!1){let n=t.seen.get(e);if(t.override){let a=t.override?.(e,t,n,r);if(a!==tk)return a}if(n&&!r){let a=r4(n,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=Rk(e,e.typeName,t),s=typeof i=="function"?U(i(),t):i;if(s&&n4(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var r4,n4,We=b(()=>{vu();ah();bu();lr();r4=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:wu(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Oe(t)):t.$refStrategy==="seen"?Oe(t):void 0}},n4=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)});var Ik=b(()=>{});var ch,uh=b(()=>{We();Rf();lr();ch=(e,t)=>{let r=nk(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,p])=>({...c,[u]:U(p._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Oe(r)}),{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=U(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??Oe(r),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=o===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var zk=b(()=>{vu();Rf();qn();bu();We();Ik();lr();zf();Df();Of();ku();Nf();Mf();Lf();Zf();Uf();qf();Ff();Vf();Hf();Wf();Kf();Jf();Yf();Qf();Xf();eh();th();sh();Eu();rh();$u();nh();oh();Cu();ih();ah();uh();uh()});function o4(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function Dk(e,t){return Oo(e)?Tc(e,{target:o4(t?.target),io:t?.pipeStrategy??"input"}):ch(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function lh(e){let r=yu(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Qx(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function ph(e,t){let r=Zn(e,t);if(!r.success)throw r.error;return r.data}var dh=b(()=>{Af();_u();zk()});function Ok(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Nk(e,t){let r={...e};for(let n in t){let o=n,i=t[o];if(i===void 0)continue;let s=r[o];Ok(s)&&Ok(i)?r[o]={...s,...i}:r[o]=i}return r}var i4,Tu,jk=b(()=>{_u();Rn();Xx();dh();i4=6e4,Tu=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Lc,r=>{this._oncancel(r)}),this.setNotificationHandler(qc,r=>{this._onprogress(r)}),this.setRequestHandler(Uc,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Fc,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new V(ee.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Bc,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,p=this._requestResolvers.get(u);if(p)if(this._requestResolvers.delete(u),a.type==="response")p(c);else{let l=c,d=new V(l.error.code,l.error.message,l.error.data);p(d)}else{let l=a.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(i,n.sessionId);if(!s)throw new V(ee.InvalidParams,`Task not found: ${i}`);if(!Un(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(Un(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[An]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(Vc,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new V(ee.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Wc,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new V(ee.InvalidParams,`Task not found: ${r.params.taskId}`);if(Un(o.status))throw new V(ee.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new V(ee.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof V?o:new V(ee.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,o,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:o})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),V.fromError(ee.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{o?.(i,s),mo(i)||i0(i)?this._onresponse(i):ho(i)?this._onrequest(i,s):o0(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=V.fromError(ee.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,o=this._transport,i=t.params?._meta?.[An]?.taskId;if(n===void 0){let p={jsonrpc:"2.0",id:t.id,error:{code:ee.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},o?.sessionId).catch(l=>this._onerror(new Error(`Failed to enqueue error response: ${l}`))):o?.send(p).catch(l=>this._onerror(new Error(`Failed to send an error response: ${l}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let a=t0(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,u={signal:s.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async p=>{if(s.signal.aborted)return;let l={relatedRequestId:t.id};i&&(l.relatedTask={taskId:i}),await this.notification(p,l)},sendRequest:async(p,l,d)=>{if(s.signal.aborted)throw new V(ee.ConnectionClosed,"Request was cancelled");let f={...d,relatedRequestId:t.id};i&&!f.relatedTask&&(f.relatedTask={taskId:i});let h=f.relatedTask?.taskId??i;return h&&c&&await c.updateTaskStatus(h,"input_required"),await this.request(p,l,f)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async p=>{if(s.signal.aborted)return;let l={result:p,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)},async p=>{if(s.signal.aborted)return;let l={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(p.code)?p.code:ee.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},o?.sessionId):await o?.send(l)}).catch(p=>this._onerror(new Error(`Failed to send response: ${p}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,o=Number(r),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}i(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),mo(t))n(t);else{let s=new V(t.error.code,t.error.message,t.error.data);n(s)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(mo(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),mo(t))o(t);else{let s=V.fromError(t.error.code,t.error.message,t.error.data);o(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(t,r,n)}}catch(s){yield{type:"error",error:s instanceof V?s:new V(ee.InternalError,String(s))}}return}let i;try{let s=await this.request(t,di,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new V(ee.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},Un(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new V(ee.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new V(ee.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof V?s:new V(ee.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((u,p)=>{let l=w=>{p(w)};if(!this._transport){l(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(w){l(w);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...t,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...t.params,_meta:{...t.params?._meta||{},progressToken:d}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[An]:c}});let h=w=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(w)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));let x=w instanceof V?w:new V(ee.RequestTimeout,String(w));p(x)};this._responseHandlers.set(d,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return p(w);try{let x=Zn(r,w.result);x.success?u(x.data):p(x.error)}catch(x){p(x)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let g=n?.timeout??i4,y=()=>h(V.fromError(ee.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let w=x=>{let k=this._responseHandlers.get(d);k?k(x):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,w),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(d),p(x)})}else this._transport.send(f,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(w=>{this._cleanupTimeout(d),p(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Gc,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Hc,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},c0,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[An]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[An]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[An]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=lh(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=ph(t,o);return Promise.resolve(r(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=lh(t);this._notificationHandlers.set(n,o=>{let i=ph(t,o);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,o)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let o of n)if(o.type==="request"&&ho(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new V(ee.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,i)=>{if(r.aborted){i(new V(ee.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new V(ee.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await n.createTask(o,t.id,{method:t.method,params:t.params},r)},getTask:async o=>{let i=await n.getTask(o,r);if(!i)throw new V(ee.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,s)=>{await n.storeTaskResult(o,i,s,r);let a=await n.getTask(o,r);if(a){let c=As.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Un(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,s)=>{let a=await n.getTask(o,r);if(!a)throw new V(ee.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Un(a.status))throw new V(ee.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,s,r);let c=await n.getTask(o,r);if(c){let u=As.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Un(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}}});var Hs=$(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.regexpCode=ue.getEsmExportName=ue.getProperty=ue.safeStringify=ue.stringify=ue.strConcat=ue.addCodeArg=ue.str=ue._=ue.nil=ue._Code=ue.Name=ue.IDENTIFIER=ue._CodeOrName=void 0;var Bs=class{};ue._CodeOrName=Bs;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var No=class extends Bs{constructor(t){if(super(),!ue.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ue.Name=No;var pr=class extends Bs{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof No&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ue._Code=pr;ue.nil=new pr("");function Mk(e,...t){let r=[e[0]],n=0;for(;n<t.length;)hh(r,t[n]),r.push(e[++n]);return new pr(r)}ue._=Mk;var fh=new pr("+");function Lk(e,...t){let r=[Vs(e[0])],n=0;for(;n<t.length;)r.push(fh),hh(r,t[n]),r.push(fh,Vs(e[++n]));return s4(r),new pr(r)}ue.str=Lk;function hh(e,t){t instanceof pr?e.push(...t._items):t instanceof No?e.push(t):e.push(u4(t))}ue.addCodeArg=hh;function s4(e){let t=1;for(;t<e.length-1;){if(e[t]===fh){let r=a4(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function a4(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof No||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof No))return`"${e}${t.slice(1)}`}function c4(e,t){return t.emptyStr()?e:e.emptyStr()?t:Lk`${e}${t}`}ue.strConcat=c4;function u4(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Vs(Array.isArray(e)?e.join(","):e)}function l4(e){return new pr(Vs(e))}ue.stringify=l4;function Vs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=Vs;function p4(e){return typeof e=="string"&&ue.IDENTIFIER.test(e)?new pr(`.${e}`):Mk`[${e}]`}ue.getProperty=p4;function d4(e){if(typeof e=="string"&&ue.IDENTIFIER.test(e))return new pr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ue.getEsmExportName=d4;function f4(e){return new pr(e.toString())}ue.regexpCode=f4});var yh=$(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ValueScope=Gt.ValueScopeName=Gt.Scope=Gt.varKinds=Gt.UsedValueState=void 0;var Ft=Hs(),mh=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Au;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Au||(Gt.UsedValueState=Au={}));Gt.varKinds={const:new Ft.Name("const"),let:new Ft.Name("let"),var:new Ft.Name("var")};var Ru=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ft.Name?t:this.name(t)}name(t){return new Ft.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Gt.Scope=Ru;var Iu=class extends Ft.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ft._)`.${new Ft.Name(r)}[${n}]`}};Gt.ValueScopeName=Iu;var h4=(0,Ft._)`\n`,gh=class extends Ru{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?h4:Ft.nil}}get(){return this._scope}name(t){return new Iu(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let p=a.get(s);if(p)return p}else a=this._values[i]=new Map;a.set(s,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ft._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=Ft.nil;for(let s in t){let a=t[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Au.Started);let p=r(u);if(p){let l=this.opts.es5?Gt.varKinds.var:Gt.varKinds.const;i=(0,Ft._)`${i}${l} ${u} = ${p};${this.opts._n}`}else if(p=o?.(u))i=(0,Ft._)`${i}${p}${this.opts._n}`;else throw new mh(u);c.set(u,Au.Completed)})}return i}};Gt.ValueScope=gh});var Y=$(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var ae=Hs(),Pr=yh(),Fn=Hs();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return Fn._}});Object.defineProperty(X,"str",{enumerable:!0,get:function(){return Fn.str}});Object.defineProperty(X,"strConcat",{enumerable:!0,get:function(){return Fn.strConcat}});Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return Fn.nil}});Object.defineProperty(X,"getProperty",{enumerable:!0,get:function(){return Fn.getProperty}});Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return Fn.stringify}});Object.defineProperty(X,"regexpCode",{enumerable:!0,get:function(){return Fn.regexpCode}});Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return Fn.Name}});var Nu=yh();Object.defineProperty(X,"Scope",{enumerable:!0,get:function(){return Nu.Scope}});Object.defineProperty(X,"ValueScope",{enumerable:!0,get:function(){return Nu.ValueScope}});Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:function(){return Nu.ValueScopeName}});Object.defineProperty(X,"varKinds",{enumerable:!0,get:function(){return Nu.varKinds}});X.operators={GT:new ae._Code(">"),GTE:new ae._Code(">="),LT:new ae._Code("<"),LTE:new ae._Code("<="),EQ:new ae._Code("==="),NEQ:new ae._Code("!=="),NOT:new ae._Code("!"),OR:new ae._Code("||"),AND:new ae._Code("&&"),ADD:new ae._Code("+")};var hn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},_h=class extends hn{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Pr.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Ai(this.rhs,t,r)),this}get names(){return this.rhs instanceof ae._CodeOrName?this.rhs.names:{}}},zu=class extends hn{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ae.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Ai(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ae.Name?{}:{...this.lhs.names};return Ou(t,this.rhs)}},vh=class extends zu{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},wh=class extends hn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},bh=class extends hn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},xh=class extends hn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},kh=class extends hn{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Ai(this.code,t,r),this}get names(){return this.code instanceof ae._CodeOrName?this.code.names:{}}},Ws=class extends hn{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(m4(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Lo(t,r.names),{})}},mn=class extends Ws{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Sh=class extends Ws{},Ti=class extends mn{};Ti.kind="else";var jo=class e extends mn{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ti(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Zk(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Ai(this.condition,t,r),this}get names(){let t=super.names;return Ou(t,this.condition),this.else&&Lo(t,this.else.names),t}};jo.kind="if";var Mo=class extends mn{};Mo.kind="for";var $h=class extends Mo{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Ai(this.iteration,t,r),this}get names(){return Lo(super.names,this.iteration.names)}},Ph=class extends Mo{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Pr.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=Ou(super.names,this.from);return Ou(t,this.to)}},Du=class extends Mo{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Ai(this.iterable,t,r),this}get names(){return Lo(super.names,this.iterable.names)}},Ks=class extends mn{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Ks.kind="func";var Js=class extends Ws{render(t){return"return "+super.render(t)}};Js.kind="return";var Eh=class extends mn{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Lo(t,this.catch.names),this.finally&&Lo(t,this.finally.names),t}},Ys=class extends mn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Ys.kind="catch";var Qs=class extends mn{render(t){return"finally"+super.render(t)}};Qs.kind="finally";var Ch=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
73
|
+
`:""},this._extScope=t,this._scope=new Pr.Scope({parent:t}),this._nodes=[new Sh]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new _h(t,i,n)),i}const(t,r,n){return this._def(Pr.varKinds.const,t,r,n)}let(t,r,n){return this._def(Pr.varKinds.let,t,r,n)}var(t,r,n){return this._def(Pr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new zu(t,r,n))}add(t,r){return this._leafNode(new vh(t,X.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ae.nil&&this._leafNode(new kh(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ae.addCodeArg)(r,o));return r.push("}"),new ae._Code(r)}if(t,r,n){if(this._blockNode(new jo(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new jo(t))}else(){return this._elseNode(new Ti)}endIf(){return this._endBlockNode(jo,Ti)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new $h(t),r)}forRange(t,r,n,o,i=this.opts.es5?Pr.varKinds.var:Pr.varKinds.let){let s=this._scope.toName(t);return this._for(new Ph(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Pr.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ae.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ae._)`${s}.length`,a=>{this.var(i,(0,ae._)`${s}[${a}]`),n(i)})}return this._for(new Du("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Pr.varKinds.var:Pr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ae._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new Du("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Mo)}label(t){return this._leafNode(new wh(t))}break(t){return this._leafNode(new bh(t))}return(t){let r=new Js;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Js)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Eh;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ys(i),r(i)}return n&&(this._currNode=o.finally=new Qs,this.code(n)),this._endBlockNode(Ys,Qs)}throw(t){return this._leafNode(new xh(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ae.nil,n,o){return this._blockNode(new Ks(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Ks)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof jo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};X.CodeGen=Ch;function Lo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ou(e,t){return t instanceof ae._CodeOrName?Lo(e,t.names):e}function Ai(e,t,r){if(e instanceof ae.Name)return n(e);if(!o(e))return e;return new ae._Code(e._items.reduce((i,s)=>(s instanceof ae.Name&&(s=n(s)),s instanceof ae._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof ae._Code&&i._items.some(s=>s instanceof ae.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function m4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Zk(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ae._)`!${Th(e)}`}X.not=Zk;var g4=Uk(X.operators.AND);function y4(...e){return e.reduce(g4)}X.and=y4;var _4=Uk(X.operators.OR);function v4(...e){return e.reduce(_4)}X.or=v4;function Uk(e){return(t,r)=>t===ae.nil?r:r===ae.nil?t:(0,ae._)`${Th(t)} ${e} ${Th(r)}`}function Th(e){return e instanceof ae.Name?e:(0,ae._)`(${e})`}});var le=$(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.checkStrictMode=te.getErrorPath=te.Type=te.useFunc=te.setEvaluated=te.evaluatedPropsToName=te.mergeEvaluated=te.eachItem=te.unescapeJsonPointer=te.escapeJsonPointer=te.escapeFragment=te.unescapeFragment=te.schemaRefOrVal=te.schemaHasRulesButRef=te.schemaHasRules=te.checkUnknownRules=te.alwaysValidSchema=te.toHash=void 0;var xe=Y(),w4=Hs();function b4(e){let t={};for(let r of e)t[r]=!0;return t}te.toHash=b4;function x4(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Gk(e,t),!Bk(t,e.self.RULES.all))}te.alwaysValidSchema=x4;function Gk(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||Wk(e,`unknown keyword: "${i}"`)}te.checkUnknownRules=Gk;function Bk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}te.schemaHasRules=Bk;function k4(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}te.schemaHasRulesButRef=k4;function S4({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,xe._)`${r}`}return(0,xe._)`${e}${t}${(0,xe.getProperty)(n)}`}te.schemaRefOrVal=S4;function $4(e){return Vk(decodeURIComponent(e))}te.unescapeFragment=$4;function P4(e){return encodeURIComponent(Rh(e))}te.escapeFragment=P4;function Rh(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}te.escapeJsonPointer=Rh;function Vk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}te.unescapeJsonPointer=Vk;function E4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}te.eachItem=E4;function qk({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof xe.Name?(i instanceof xe.Name?e(o,i,s):t(o,i,s),s):i instanceof xe.Name?(t(o,s,i),i):r(i,s);return a===xe.Name&&!(c instanceof xe.Name)?n(o,c):c}}te.mergeEvaluated={props:qk({mergeNames:(e,t,r)=>e.if((0,xe._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,xe._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,xe._)`${r} || {}`).code((0,xe._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,xe._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,xe._)`${r} || {}`),Ih(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Hk}),items:qk({mergeNames:(e,t,r)=>e.if((0,xe._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,xe._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,xe._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,xe._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Hk(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,xe._)`{}`);return t!==void 0&&Ih(e,r,t),r}te.evaluatedPropsToName=Hk;function Ih(e,t,r){Object.keys(r).forEach(n=>e.assign((0,xe._)`${t}${(0,xe.getProperty)(n)}`,!0))}te.setEvaluated=Ih;var Fk={};function C4(e,t){return e.scopeValue("func",{ref:t,code:Fk[t.code]||(Fk[t.code]=new w4._Code(t.code))})}te.useFunc=C4;var Ah;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ah||(te.Type=Ah={}));function T4(e,t,r){if(e instanceof xe.Name){let n=t===Ah.Num;return r?n?(0,xe._)`"[" + ${e} + "]"`:(0,xe._)`"['" + ${e} + "']"`:n?(0,xe._)`"/" + ${e}`:(0,xe._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,xe.getProperty)(e).toString():"/"+Rh(e)}te.getErrorPath=T4;function Wk(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}te.checkStrictMode=Wk});var gn=$(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});var bt=Y(),A4={data:new bt.Name("data"),valCxt:new bt.Name("valCxt"),instancePath:new bt.Name("instancePath"),parentData:new bt.Name("parentData"),parentDataProperty:new bt.Name("parentDataProperty"),rootData:new bt.Name("rootData"),dynamicAnchors:new bt.Name("dynamicAnchors"),vErrors:new bt.Name("vErrors"),errors:new bt.Name("errors"),this:new bt.Name("this"),self:new bt.Name("self"),scope:new bt.Name("scope"),json:new bt.Name("json"),jsonPos:new bt.Name("jsonPos"),jsonLen:new bt.Name("jsonLen"),jsonPart:new bt.Name("jsonPart")};zh.default=A4});var Xs=$(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.extendErrors=xt.resetErrorsCount=xt.reportExtraError=xt.reportError=xt.keyword$DataError=xt.keywordError=void 0;var ce=Y(),ju=le(),It=gn();xt.keywordError={message:({keyword:e})=>(0,ce.str)`must pass "${e}" keyword validation`};xt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ce.str)`"${e}" keyword must be ${t} ($data)`:(0,ce.str)`"${e}" keyword is invalid ($data)`};function R4(e,t=xt.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=Yk(e,t,r);n??(s||a)?Kk(i,c):Jk(o,(0,ce._)`[${c}]`)}xt.reportError=R4;function I4(e,t=xt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=Yk(e,t,r);Kk(o,a),i||s||Jk(n,It.default.vErrors)}xt.reportExtraError=I4;function z4(e,t){e.assign(It.default.errors,t),e.if((0,ce._)`${It.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ce._)`${It.default.vErrors}.length`,t),()=>e.assign(It.default.vErrors,null)))}xt.resetErrorsCount=z4;function D4({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,It.default.errors,a=>{e.const(s,(0,ce._)`${It.default.vErrors}[${a}]`),e.if((0,ce._)`${s}.instancePath === undefined`,()=>e.assign((0,ce._)`${s}.instancePath`,(0,ce.strConcat)(It.default.instancePath,i.errorPath))),e.assign((0,ce._)`${s}.schemaPath`,(0,ce.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ce._)`${s}.schema`,r),e.assign((0,ce._)`${s}.data`,n))})}xt.extendErrors=D4;function Kk(e,t){let r=e.const("err",t);e.if((0,ce._)`${It.default.vErrors} === null`,()=>e.assign(It.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${It.default.vErrors}.push(${r})`),e.code((0,ce._)`${It.default.errors}++`)}function Jk(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ce._)`new ${e.ValidationError}(${t})`):(r.assign((0,ce._)`${n}.errors`,t),r.return(!1))}var Zo={keyword:new ce.Name("keyword"),schemaPath:new ce.Name("schemaPath"),params:new ce.Name("params"),propertyName:new ce.Name("propertyName"),message:new ce.Name("message"),schema:new ce.Name("schema"),parentSchema:new ce.Name("parentSchema")};function Yk(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ce._)`{}`:O4(e,t,r)}function O4(e,t,r={}){let{gen:n,it:o}=e,i=[N4(o,r),j4(e,r)];return M4(e,t,i),n.object(...i)}function N4({errorPath:e},{instancePath:t}){let r=t?(0,ce.str)`${e}${(0,ju.getErrorPath)(t,ju.Type.Str)}`:e;return[It.default.instancePath,(0,ce.strConcat)(It.default.instancePath,r)]}function j4({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ce.str)`${t}/${e}`;return r&&(o=(0,ce.str)`${o}${(0,ju.getErrorPath)(r,ju.Type.Str)}`),[Zo.schemaPath,o]}function M4(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:p,schemaPath:l}=a;n.push([Zo.keyword,o],[Zo.params,typeof t=="function"?t(e):t||(0,ce._)`{}`]),c.messages&&n.push([Zo.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Zo.schema,s],[Zo.parentSchema,(0,ce._)`${p}${l}`],[It.default.data,i]),u&&n.push([Zo.propertyName,u])}});var Xk=$(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.boolOrEmptySchema=Ri.topBoolOrEmptySchema=void 0;var L4=Xs(),Z4=Y(),U4=gn(),q4={message:"boolean schema is false"};function F4(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Qk(e,!1):typeof r=="object"&&r.$async===!0?t.return(U4.default.data):(t.assign((0,Z4._)`${n}.errors`,null),t.return(!0))}Ri.topBoolOrEmptySchema=F4;function G4(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Qk(e)):r.var(t,!0)}Ri.boolOrEmptySchema=G4;function Qk(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,L4.reportError)(o,q4,void 0,t)}});var Dh=$(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.getRules=Ii.isJSONType=void 0;var B4=["string","number","integer","boolean","null","object","array"],V4=new Set(B4);function H4(e){return typeof e=="string"&&V4.has(e)}Ii.isJSONType=H4;function W4(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Ii.getRules=W4});var Oh=$(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.shouldUseRule=Gn.shouldUseGroup=Gn.schemaHasRulesForType=void 0;function K4({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&eS(e,n)}Gn.schemaHasRulesForType=K4;function eS(e,t){return t.rules.some(r=>tS(e,r))}Gn.shouldUseGroup=eS;function tS(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Gn.shouldUseRule=tS});var ea=$(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.reportTypeError=kt.checkDataTypes=kt.checkDataType=kt.coerceAndCheckDataType=kt.getJSONTypes=kt.getSchemaTypes=kt.DataType=void 0;var J4=Dh(),Y4=Oh(),Q4=Xs(),H=Y(),rS=le(),zi;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(zi||(kt.DataType=zi={}));function X4(e){let t=nS(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}kt.getSchemaTypes=X4;function nS(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(J4.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}kt.getJSONTypes=nS;function eM(e,t){let{gen:r,data:n,opts:o}=e,i=tM(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,Y4.schemaHasRulesForType)(e,t[0]));if(s){let a=jh(t,n,o.strictNumbers,zi.Wrong);r.if(a,()=>{i.length?rM(e,t,i):Mh(e)})}return s}kt.coerceAndCheckDataType=eM;var oS=new Set(["string","number","integer","boolean","null"]);function tM(e,t){return t?e.filter(r=>oS.has(r)||t==="array"&&r==="array"):[]}function rM(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,H._)`typeof ${o}`),a=n.let("coerced",(0,H._)`undefined`);i.coerceTypes==="array"&&n.if((0,H._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,H._)`${o}[0]`).assign(s,(0,H._)`typeof ${o}`).if(jh(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,H._)`${a} !== undefined`);for(let u of r)(oS.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Mh(e),n.endIf(),n.if((0,H._)`${a} !== undefined`,()=>{n.assign(o,a),nM(e,a)});function c(u){switch(u){case"string":n.elseIf((0,H._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,H._)`"" + ${o}`).elseIf((0,H._)`${o} === null`).assign(a,(0,H._)`""`);return;case"number":n.elseIf((0,H._)`${s} == "boolean" || ${o} === null
|
|
74
74
|
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,H._)`+${o}`);return;case"integer":n.elseIf((0,H._)`${s} === "boolean" || ${o} === null
|
|
75
75
|
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,H._)`+${o}`);return;case"boolean":n.elseIf((0,H._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,H._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,H._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,H._)`${s} === "string" || ${s} === "number"
|
|
76
|
-
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,H._)`[${o}]`)}}}function nM({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,H._)`${t} !== undefined`,()=>e.assign((0,H._)`${t}[${r}]`,n))}function Nh(e,t,r,n=zi.Correct){let o=n===zi.Correct?H.operators.EQ:H.operators.NEQ,i;switch(e){case"null":return(0,H._)`${t} ${o} null`;case"array":i=(0,H._)`Array.isArray(${t})`;break;case"object":i=(0,H._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,H._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,H._)`typeof ${t} ${o} ${e}`}return n===zi.Correct?i:(0,H.not)(i);function s(a=H.nil){return(0,H.and)((0,H._)`typeof ${t} == "number"`,a,r?(0,H._)`isFinite(${t})`:H.nil)}}kt.checkDataType=Nh;function jh(e,t,r,n){if(e.length===1)return Nh(e[0],t,r,n);let o,i=(0,rS.toHash)(e);if(i.array&&i.object){let s=(0,H._)`typeof ${t} != "object"`;o=i.null?s:(0,H._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=H.nil;i.number&&delete i.integer;for(let s in i)o=(0,H.and)(o,Nh(s,t,r,n));return o}kt.checkDataTypes=jh;var oM={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,H._)`{type: ${e}}`:(0,H._)`{type: ${t}}`};function Mh(e){let t=iM(e);(0,Q4.reportError)(t,oM)}kt.reportTypeError=Mh;function iM(e){let{gen:t,data:r,schema:n}=e,o=(0,rS.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var sS=$(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.assignDefaults=void 0;var Di=Y(),sM=le();function aM(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)iS(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>iS(e,i,o.default))}Mu.assignDefaults=aM;function iS(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Di._)`${i}${(0,Di.getProperty)(t)}`;if(o){(0,sM.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Di._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Di._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Di._)`${a} = ${(0,Di.stringify)(r)}`)}});var pr=$(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.validateUnion=ge.validateArray=ge.usePattern=ge.callValidateCode=ge.schemaProperties=ge.allSchemaProperties=ge.noPropertyInData=ge.propertyInData=ge.isOwnProperty=ge.hasPropFunc=ge.reportMissingProp=ge.checkMissingProp=ge.checkReportMissingProp=void 0;var Te=Y(),Lh=le(),Gn=mn(),cM=le();function uM(e,t){let{gen:r,data:n,it:o}=e;r.if(Uh(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Te._)`${t}`},!0),e.error()})}ge.checkReportMissingProp=uM;function lM({gen:e,data:t,it:{opts:r}},n,o){return(0,Te.or)(...n.map(i=>(0,Te.and)(Uh(e,t,i,r.ownProperties),(0,Te._)`${o} = ${i}`)))}ge.checkMissingProp=lM;function pM(e,t){e.setParams({missingProperty:t},!0),e.error()}ge.reportMissingProp=pM;function aS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Te._)`Object.prototype.hasOwnProperty`})}ge.hasPropFunc=aS;function Zh(e,t,r){return(0,Te._)`${aS(e)}.call(${t}, ${r})`}ge.isOwnProperty=Zh;function dM(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} !== undefined`;return n?(0,Te._)`${o} && ${Zh(e,t,r)}`:o}ge.propertyInData=dM;function Uh(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} === undefined`;return n?(0,Te.or)(o,(0,Te.not)(Zh(e,t,r))):o}ge.noPropertyInData=Uh;function cS(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ge.allSchemaProperties=cS;function fM(e,t){return cS(t).filter(r=>!(0,Lh.alwaysValidSchema)(e,t[r]))}ge.schemaProperties=fM;function hM({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let p=u?(0,Te._)`${e}, ${t}, ${n}${o}`:t,l=[[Gn.default.instancePath,(0,Te.strConcat)(Gn.default.instancePath,i)],[Gn.default.parentData,s.parentData],[Gn.default.parentDataProperty,s.parentDataProperty],[Gn.default.rootData,Gn.default.rootData]];s.opts.dynamicRef&&l.push([Gn.default.dynamicAnchors,Gn.default.dynamicAnchors]);let d=(0,Te._)`${p}, ${r.object(...l)}`;return c!==Te.nil?(0,Te._)`${a}.call(${c}, ${d})`:(0,Te._)`${a}(${d})`}ge.callValidateCode=hM;var mM=(0,Te._)`new RegExp`;function gM({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Te._)`${o.code==="new RegExp"?mM:(0,cM.useFunc)(e,o)}(${r}, ${n})`})}ge.usePattern=gM;function yM(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,Te._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Lh.Type.Num},i),t.if((0,Te.not)(i),a)})}}ge.validateArray=yM;function _M(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Lh.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let p=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,Te._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,Te.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ge.validateUnion=_M});var pS=$(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.validateKeywordUsage=Fr.validSchemaType=Fr.funcKeywordCode=Fr.macroKeywordCode=void 0;var zt=Y(),Uo=mn(),vM=pr(),wM=Xs();function bM(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=lS(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:zt.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Fr.macroKeywordCode=bM;function xM(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;SM(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=lS(n,o,u),l=n.let("valid");e.block$data(l,d),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function d(){if(t.errors===!1)g(),t.modifying&&uS(e),y(()=>e.error());else{let v=t.async?f():h();t.modifying&&uS(e),y(()=>kM(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>g((0,zt._)`await `),w=>n.assign(l,!1).if((0,zt._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(v,(0,zt._)`${w}.errors`),()=>n.throw(w))),v}function h(){let v=(0,zt._)`${p}.errors`;return n.assign(v,null),g(zt.nil),v}function g(v=t.async?(0,zt._)`await `:zt.nil){let w=c.opts.passContext?Uo.default.this:Uo.default.self,x=!("compile"in t&&!a||t.schema===!1);n.assign(l,(0,zt._)`${v}${(0,vM.callValidateCode)(e,p,w,x)}`,t.modifying)}function y(v){var w;n.if((0,zt.not)((w=t.valid)!==null&&w!==void 0?w:l),v)}}Fr.funcKeywordCode=xM;function uS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,zt._)`${n.parentData}[${n.parentDataProperty}]`))}function kM(e,t){let{gen:r}=e;r.if((0,zt._)`Array.isArray(${t})`,()=>{r.assign(Uo.default.vErrors,(0,zt._)`${Uo.default.vErrors} === null ? ${t} : ${Uo.default.vErrors}.concat(${t})`).assign(Uo.default.errors,(0,zt._)`${Uo.default.vErrors}.length`),(0,wM.extendErrors)(e)},()=>e.error())}function SM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function lS(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,zt.stringify)(r)})}function $M(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Fr.validSchemaType=$M;function PM({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Fr.validateKeywordUsage=PM});var fS=$(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.extendSubschemaMode=Bn.extendSubschemaData=Bn.getSubschema=void 0;var Gr=Y(),dS=le();function EM(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}${(0,Gr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,dS.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Bn.getSubschema=EM;function CM(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:p,opts:l}=t,d=a.let("data",(0,Gr._)`${t.data}${(0,Gr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Gr.str)`${u}${(0,dS.getErrorPath)(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=(0,Gr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Gr.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Bn.extendSubschemaData=CM;function TM(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Bn.extendSubschemaMode=TM});var qh=$((rJ,hS)=>{"use strict";hS.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var gS=$((nJ,mS)=>{"use strict";var Vn=mS.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Lu(t,n,o,e,"",e)};Vn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Vn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Vn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Vn.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Lu(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var p in n){var l=n[p];if(Array.isArray(l)){if(p in Vn.arrayKeywords)for(var d=0;d<l.length;d++)Lu(e,t,r,l[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in Vn.propsKeywords){if(l&&typeof l=="object")for(var f in l)Lu(e,t,r,l[f],o+"/"+p+"/"+AM(f),i,o,p,n,f)}else(p in Vn.keywords||e.allKeys&&!(p in Vn.skipKeywords))&&Lu(e,t,r,l,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,u)}}function AM(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ta=$(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getSchemaRefs=Bt.resolveUrl=Bt.normalizeId=Bt._getFullPath=Bt.getFullPath=Bt.inlineRef=void 0;var RM=le(),IM=qh(),zM=gS(),DM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function OM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Fh(e):t?yS(e)<=t:!1}Bt.inlineRef=OM;var NM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Fh(e){for(let t in e){if(NM.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Fh)||typeof r=="object"&&Fh(r))return!0}return!1}function yS(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!DM.has(r)&&(typeof e[r]=="object"&&(0,RM.eachItem)(e[r],n=>t+=yS(n)),t===1/0))return 1/0}return t}function _S(e,t="",r){r!==!1&&(t=Oi(t));let n=e.parse(t);return vS(e,n)}Bt.getFullPath=_S;function vS(e,t){return e.serialize(t).split("#")[0]+"#"}Bt._getFullPath=vS;var jM=/#\/?$/;function Oi(e){return e?e.replace(jM,""):""}Bt.normalizeId=Oi;function MM(e,t,r){return r=Oi(r),e.resolve(t,r)}Bt.resolveUrl=MM;var LM=/^[a-z_][-a-z0-9._]*$/i;function ZM(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Oi(e[r]||t),i={"":o},s=_S(n,o,!1),a={},c=new Set;return zM(e,{allKeys:!0},(l,d,f,h)=>{if(h===void 0)return;let g=s+d,y=i[h];typeof l[r]=="string"&&(y=v.call(this,l[r])),w.call(this,l.$anchor),w.call(this,l.$dynamicAnchor),i[d]=y;function v(x){let k=this.opts.uriResolver.resolve;if(x=Oi(y?k(y,x):x),c.has(x))throw p(x);c.add(x);let P=this.refs[x];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?u(l,P.schema,x):x!==Oi(g)&&(x[0]==="#"?(u(l,a[x],x),a[x]=l):this.refs[x]=g),x}function w(x){if(typeof x=="string"){if(!LM.test(x))throw new Error(`invalid anchor "${x}"`);v.call(this,`#${x}`)}}}),a;function u(l,d,f){if(d!==void 0&&!IM(l,d))throw p(f)}function p(l){return new Error(`reference "${l}" resolves to more than one schema`)}}Bt.getSchemaRefs=ZM});var oa=$(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.getData=Hn.KeywordCxt=Hn.validateFunctionCode=void 0;var SS=Xk(),wS=ea(),Bh=Oh(),Zu=ea(),UM=sS(),na=pS(),Gh=fS(),N=Y(),F=mn(),qM=ta(),gn=le(),ra=Xs();function FM(e){if(ES(e)&&(CS(e),PS(e))){VM(e);return}$S(e,()=>(0,SS.topBoolOrEmptySchema)(e))}Hn.validateFunctionCode=FM;function $S({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,N._)`${F.default.data}, ${F.default.valCxt}`,n.$async,()=>{e.code((0,N._)`"use strict"; ${bS(r,o)}`),BM(e,o),e.code(i)}):e.func(t,(0,N._)`${F.default.data}, ${GM(o)}`,n.$async,()=>e.code(bS(r,o)).code(i))}function GM(e){return(0,N._)`{${F.default.instancePath}="", ${F.default.parentData}, ${F.default.parentDataProperty}, ${F.default.rootData}=${F.default.data}${e.dynamicRef?(0,N._)`, ${F.default.dynamicAnchors}={}`:N.nil}}={}`}function BM(e,t){e.if(F.default.valCxt,()=>{e.var(F.default.instancePath,(0,N._)`${F.default.valCxt}.${F.default.instancePath}`),e.var(F.default.parentData,(0,N._)`${F.default.valCxt}.${F.default.parentData}`),e.var(F.default.parentDataProperty,(0,N._)`${F.default.valCxt}.${F.default.parentDataProperty}`),e.var(F.default.rootData,(0,N._)`${F.default.valCxt}.${F.default.rootData}`),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`${F.default.valCxt}.${F.default.dynamicAnchors}`)},()=>{e.var(F.default.instancePath,(0,N._)`""`),e.var(F.default.parentData,(0,N._)`undefined`),e.var(F.default.parentDataProperty,(0,N._)`undefined`),e.var(F.default.rootData,F.default.data),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`{}`)})}function VM(e){let{schema:t,opts:r,gen:n}=e;$S(e,()=>{r.$comment&&t.$comment&&AS(e),YM(e),n.let(F.default.vErrors,null),n.let(F.default.errors,0),r.unevaluated&&HM(e),TS(e),eL(e)})}function HM(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,N._)`${r}.evaluated`),t.if((0,N._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,N._)`${e.evaluated}.props`,(0,N._)`undefined`)),t.if((0,N._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,N._)`${e.evaluated}.items`,(0,N._)`undefined`))}function bS(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,N._)`/*# sourceURL=${r} */`:N.nil}function WM(e,t){if(ES(e)&&(CS(e),PS(e))){KM(e,t);return}(0,SS.boolOrEmptySchema)(e,t)}function PS({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function ES(e){return typeof e.schema!="boolean"}function KM(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&AS(e),QM(e),XM(e);let i=n.const("_errs",F.default.errors);TS(e,i),n.var(t,(0,N._)`${i} === ${F.default.errors}`)}function CS(e){(0,gn.checkUnknownRules)(e),JM(e)}function TS(e,t){if(e.opts.jtd)return xS(e,[],!1,t);let r=(0,wS.getSchemaTypes)(e.schema),n=(0,wS.coerceAndCheckDataType)(e,r);xS(e,r,!n,t)}function JM(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,gn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function YM(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,gn.checkStrictMode)(e,"default is ignored in the schema root")}function QM(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,qM.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function XM(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function AS({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,N._)`${F.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,N.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,N._)`${F.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function eL(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,N._)`${F.default.errors} === 0`,()=>t.return(F.default.data),()=>t.throw((0,N._)`new ${o}(${F.default.vErrors})`)):(t.assign((0,N._)`${n}.errors`,F.default.vErrors),i.unevaluated&&tL(e),t.return((0,N._)`${F.default.errors} === 0`))}function tL({gen:e,evaluated:t,props:r,items:n}){r instanceof N.Name&&e.assign((0,N._)`${t}.props`,r),n instanceof N.Name&&e.assign((0,N._)`${t}.items`,n)}function xS(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:p}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,gn.schemaHasRulesButRef)(i,p))){o.block(()=>IS(e,"$ref",p.all.$ref.definition));return}c.jtd||rL(e,t),o.block(()=>{for(let d of p.rules)l(d);l(p.post)});function l(d){(0,Bh.shouldUseGroup)(i,d)&&(d.type?(o.if((0,Zu.checkDataType)(d.type,s,c.strictNumbers)),kS(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Zu.reportTypeError)(e)),o.endIf()):kS(e,d),a||o.if((0,N._)`${F.default.errors} === ${n||0}`))}}function kS(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,UM.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Bh.shouldUseRule)(n,i)&&IS(e,i.keyword,i.definition,t.type)})}function rL(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(nL(e,t),e.opts.allowUnionTypes||oL(e,t),iL(e,e.dataTypes))}function nL(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{RS(e.dataTypes,r)||Vh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),aL(e,t)}}function oL(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Vh(e,"use allowUnionTypes to allow union type keyword")}function iL(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Bh.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>sL(t,s))&&Vh(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function sL(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function RS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function aL(e,t){let r=[];for(let n of e.dataTypes)RS(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Vh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,gn.checkStrictMode)(e,t,e.opts.strictTypes)}var Uu=class{constructor(t,r,n){if((0,na.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",zS(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,na.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",F.default.errors))}result(t,r,n){this.failResult((0,N.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,N.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,N._)`${r} !== undefined && (${(0,N.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ra.reportExtraError:ra.reportError)(this,this.def.error,r)}$dataError(){(0,ra.reportError)(this,this.def.$dataError||ra.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ra.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=N.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=N.nil,r=N.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,N.or)((0,N._)`${o} === undefined`,r)),t!==N.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==N.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,N.or)(s(),a());function s(){if(n.length){if(!(r instanceof N.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,N._)`${(0,Zu.checkDataTypes)(c,r,i.opts.strictNumbers,Zu.DataType.Wrong)}`}return N.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,N._)`!${c}(${r})`}return N.nil}}subschema(t,r){let n=(0,Gh.getSubschema)(this.it,t);(0,Gh.extendSubschemaData)(n,this.it,t),(0,Gh.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return WM(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=gn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=gn.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,N.Name)),!0}};Hn.KeywordCxt=Uu;function IS(e,t,r,n){let o=new Uu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,na.funcKeywordCode)(o,r):"macro"in r?(0,na.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,na.funcKeywordCode)(o,r)}var cL=/^\/(?:[^~]|~0|~1)*$/,uL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function zS(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return F.default.rootData;if(e[0]==="/"){if(!cL.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=F.default.rootData}else{let u=uL.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+u[1];if(o=u[2],o==="#"){if(p>=t)throw new Error(c("property/index",p));return n[t-p]}if(p>t)throw new Error(c("data",p));if(i=r[t-p],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,N._)`${i}${(0,N.getProperty)((0,gn.unescapeJsonPointer)(u))}`,s=(0,N._)`${s} && ${i}`);return s;function c(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}Hn.getData=zS});var qu=$(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var Hh=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Wh.default=Hh});var ia=$(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});var Kh=ta(),Jh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Kh.resolveUrl)(t,r,n),this.missingSchema=(0,Kh.normalizeId)((0,Kh.getFullPath)(t,this.missingRef))}};Yh.default=Jh});var Gu=$(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.resolveSchema=dr.getCompilingSchema=dr.resolveRef=dr.compileSchema=dr.SchemaEnv=void 0;var Er=Y(),lL=qu(),qo=mn(),Cr=ta(),DS=le(),pL=oa(),Ni=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Cr.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};dr.SchemaEnv=Ni;function Xh(e){let t=OS.call(this,e);if(t)return t;let r=(0,Cr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Er.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:lL.default,code:(0,Er._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:qo.default.data,parentData:qo.default.parentData,parentDataProperty:qo.default.parentDataProperty,dataNames:[qo.default.data],dataPathArr:[Er.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Er.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Er.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Er._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,pL.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let l=s.toString();p=`${s.scopeRefs(qo.default.scope)}return ${l}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let f=new Function(`${qo.default.self}`,`${qo.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:l,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:g}=u;f.evaluated={props:h instanceof Er.Name?void 0:h,items:g instanceof Er.Name?void 0:g,dynamicProps:h instanceof Er.Name,dynamicItems:g instanceof Er.Name},f.source&&(f.source.evaluated=(0,Er.stringify)(f.evaluated))}return e.validate=f,e}catch(l){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),l}finally{this._compilations.delete(e)}}dr.compileSchema=Xh;function dL(e,t,r){var n;r=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=mL.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new Ni({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=fL.call(this,i)}dr.resolveRef=dL;function fL(e){return(0,Cr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Xh.call(this,e)}function OS(e){for(let t of this._compilations)if(hL(t,e))return t}dr.getCompilingSchema=OS;function hL(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function mL(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Fu.call(this,e,t)}function Fu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Cr._getFullPath)(this.opts.uriResolver,r),o=(0,Cr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Qh.call(this,r,e);let i=(0,Cr.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Fu.call(this,e,s);return typeof a?.schema!="object"?void 0:Qh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Xh.call(this,s),i===(0,Cr.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Cr.resolveUrl)(this.opts.uriResolver,o,u)),new Ni({schema:a,schemaId:c,root:e,baseId:o})}return Qh.call(this,r,s)}}dr.resolveSchema=Fu;var gL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qh(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,DS.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!gL.has(a)&&u&&(t=(0,Cr.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,DS.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Fu.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Ni({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var NS=$((uJ,yL)=>{yL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var tm=$((lJ,ZS)=>{"use strict";var _L=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),MS=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function em(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var vL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function jS(e){return e.length=0,!0}function wL(e,t,r){if(e.length){let n=em(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function bL(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=wL;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=jS}else{o.push(u);continue}}return o.length&&(a===jS?r.zone=o.join(""):s?n.push(o.join("")):n.push(em(o))),r.address=n.join(""),r}function LS(e){if(xL(e,":")<2)return{host:e,isIPV6:!1};let t=bL(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function xL(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function kL(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function SL(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function $L(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!MS(r)){let n=LS(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}ZS.exports={nonSimpleDomain:vL,recomposeAuthority:$L,normalizeComponentEncoding:SL,removeDotSegments:kL,isIPv4:MS,isUUID:_L,normalizeIPv6:LS,stringArrayToHexStripped:em}});var BS=$((pJ,GS)=>{"use strict";var{isUUID:PL}=tm(),EL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,CL=["http","https","ws","wss","urn","urn:uuid"];function TL(e){return CL.indexOf(e)!==-1}function rm(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function US(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function qS(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function AL(e){return e.secure=rm(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function RL(e){if((e.port===(rm(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function IL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(EL);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=nm(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function zL(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=nm(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function DL(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!PL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function OL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var FS={scheme:"http",domainHost:!0,parse:US,serialize:qS},NL={scheme:"https",domainHost:FS.domainHost,parse:US,serialize:qS},Bu={scheme:"ws",domainHost:!0,parse:AL,serialize:RL},jL={scheme:"wss",domainHost:Bu.domainHost,parse:Bu.parse,serialize:Bu.serialize},ML={scheme:"urn",parse:IL,serialize:zL,skipNormalize:!0},LL={scheme:"urn:uuid",parse:DL,serialize:OL,skipNormalize:!0},Vu={http:FS,https:NL,ws:Bu,wss:jL,urn:ML,"urn:uuid":LL};Object.setPrototypeOf(Vu,null);function nm(e){return e&&(Vu[e]||Vu[e.toLowerCase()])||void 0}GS.exports={wsIsSecure:rm,SCHEMES:Vu,isValidSchemeName:TL,getSchemeHandler:nm}});var WS=$((dJ,Wu)=>{"use strict";var{normalizeIPv6:ZL,removeDotSegments:sa,recomposeAuthority:UL,normalizeComponentEncoding:Hu,isIPv4:qL,nonSimpleDomain:FL}=tm(),{SCHEMES:GL,getSchemeHandler:VS}=BS();function BL(e,t){return typeof e=="string"?e=Br(yn(e,t),t):typeof e=="object"&&(e=yn(Br(e,t),t)),e}function VL(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=HS(yn(e,n),yn(t,n),n,!0);return n.skipEscape=!0,Br(o,n)}function HS(e,t,r,n){let o={};return n||(e=yn(Br(e,r),r),t=yn(Br(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=sa(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=sa(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function HL(e,t,r){return typeof e=="string"?(e=unescape(e),e=Br(Hu(yn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Br(Hu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Br(Hu(yn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Br(Hu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Br(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=VS(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=UL(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=sa(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var WL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yn(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let i=e.match(WL);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(qL(n.host)===!1){let c=ZL(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=VS(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&FL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var om={SCHEMES:GL,normalize:BL,resolve:VL,resolveComponent:HS,equal:HL,serialize:Br,parse:yn};Wu.exports=om;Wu.exports.default=om;Wu.exports.fastUri=om});var JS=$(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var KS=WS();KS.code='require("ajv/dist/runtime/uri").default';im.default=KS});var o$=$(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CodeGen=dt.Name=dt.nil=dt.stringify=dt.str=dt._=dt.KeywordCxt=void 0;var KL=oa();Object.defineProperty(dt,"KeywordCxt",{enumerable:!0,get:function(){return KL.KeywordCxt}});var ji=Y();Object.defineProperty(dt,"_",{enumerable:!0,get:function(){return ji._}});Object.defineProperty(dt,"str",{enumerable:!0,get:function(){return ji.str}});Object.defineProperty(dt,"stringify",{enumerable:!0,get:function(){return ji.stringify}});Object.defineProperty(dt,"nil",{enumerable:!0,get:function(){return ji.nil}});Object.defineProperty(dt,"Name",{enumerable:!0,get:function(){return ji.Name}});Object.defineProperty(dt,"CodeGen",{enumerable:!0,get:function(){return ji.CodeGen}});var JL=qu(),t$=ia(),YL=Dh(),aa=Gu(),QL=Y(),ca=ta(),Ku=ea(),am=le(),YS=NS(),XL=JS(),r$=(e,t)=>new RegExp(e,t);r$.code="new RegExp";var e3=["removeAdditional","useDefaults","coerceTypes"],t3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),r3={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},n3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},QS=200;function o3(e){var t,r,n,o,i,s,a,c,u,p,l,d,f,h,g,y,v,w,x,k,P,q,L,Ue,we;let Q=e.strict,qe=(t=e.code)===null||t===void 0?void 0:t.optimize,Be=qe===!0||qe===void 0?1:qe||0,En=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:r$,ao=(o=e.uriResolver)!==null&&o!==void 0?o:XL.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:Q)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Q)!==null&&c!==void 0?c:!0,strictTypes:(p=(u=e.strictTypes)!==null&&u!==void 0?u:Q)!==null&&p!==void 0?p:"log",strictTuples:(d=(l=e.strictTuples)!==null&&l!==void 0?l:Q)!==null&&d!==void 0?d:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:Q)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Be,regExp:En}:{optimize:Be,regExp:En},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:QS,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:QS,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(q=e.validateSchema)!==null&&q!==void 0?q:!0,validateFormats:(L=e.validateFormats)!==null&&L!==void 0?L:!0,unicodeRegExp:(Ue=e.unicodeRegExp)!==null&&Ue!==void 0?Ue:!0,int32range:(we=e.int32range)!==null&&we!==void 0?we:!0,uriResolver:ao}}var ua=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...o3(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new QL.ValueScope({scope:{},prefixes:t3,es5:r,lines:n}),this.logger=l3(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,YL.getRules)(),XS.call(this,r3,t,"NOT SUPPORTED"),XS.call(this,n3,t,"DEPRECATED","warn"),this._metaOpts=c3.call(this),t.formats&&s3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&a3.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),i3.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=YS;n==="id"&&(o={...YS},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(p,l){await i.call(this,p.$schema);let d=this._addSchema(p,l);return d.validate||s.call(this,d)}async function i(p){p&&!this.getSchema(p)&&await o.call(this,{$ref:p},!0)}async function s(p){try{return this._compileSchemaEnv(p)}catch(l){if(!(l instanceof t$.default))throw l;return a.call(this,l),await c.call(this,l.missingSchema),s.call(this,p)}}function a({missingSchema:p,missingRef:l}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${l} cannot be resolved`)}async function c(p){let l=await u.call(this,p);this.refs[p]||await i.call(this,l.$schema),this.refs[p]||this.addSchema(l,p,r)}async function u(p){let l=this._loading[p];if(l)return l;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,ca.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=e$.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new aa.SchemaEnv({schema:{},schemaId:n});if(r=aa.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=e$.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ca.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(d3.call(this,n,r),!r)return(0,am.eachItem)(n,i=>sm.call(this,i)),this;h3.call(this,r);let o={...r,type:(0,Ku.getJSONTypes)(r.type),schemaType:(0,Ku.getJSONTypes)(r.schemaType)};return(0,am.eachItem)(n,o.type.length===0?i=>sm.call(this,i,o):i=>o.type.forEach(s=>sm.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,p=s[a];u&&p&&(s[a]=n$(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,ca.normalizeId)(s||n);let u=ca.getSchemaRefs.call(this,t,n);return c=new aa.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):aa.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{aa.compileSchema.call(this,t)}finally{this.opts=r}}};ua.ValidationError=JL.default;ua.MissingRefError=t$.default;dt.default=ua;function XS(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function e$(e){return e=(0,ca.normalizeId)(e),this.schemas[e]||this.refs[e]}function i3(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function s3(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function a3(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function c3(){let e={...this.opts};for(let t of e3)delete e[t];return e}var u3={log(){},warn(){},error(){}};function l3(e){if(e===!1)return u3;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var p3=/^[a-z_$][a-z0-9_$:-]*$/i;function d3(e,t){let{RULES:r}=this;if((0,am.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!p3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function sm(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Ku.getJSONTypes)(t.type),schemaType:(0,Ku.getJSONTypes)(t.schemaType)}};t.before?f3.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function f3(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function h3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=n$(t)),e.validateSchema=this.compile(t,!0))}var m3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function n$(e){return{anyOf:[e,m3]}}});var i$=$(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var g3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cm.default=g3});var u$=$(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.callRef=Fo.getValidate=void 0;var y3=ia(),s$=pr(),Vt=Y(),Mi=mn(),a$=Gu(),Ju=le(),_3={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return l();let p=a$.resolveRef.call(c,u,o,r);if(p===void 0)throw new y3.default(n.opts.uriResolver,o,r);if(p instanceof a$.SchemaEnv)return d(p);return f(p);function l(){if(i===u)return Yu(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return Yu(e,(0,Vt._)`${h}.validate`,u,u.$async)}function d(h){let g=c$(e,h);Yu(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,Vt.stringify)(h)}:{ref:h}),y=t.name("valid"),v=e.subschema({schema:h,dataTypes:[],schemaPath:Vt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function c$(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Vt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Fo.getValidate=c$;function Yu(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Mi.default.this:Vt.nil;n?p():l();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{o.code((0,Vt._)`await ${(0,s$.callValidateCode)(e,t,u)}`),f(t),s||o.assign(h,!0)},g=>{o.if((0,Vt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(h,!1)}),e.ok(h)}function l(){e.result((0,s$.callValidateCode)(e,t,u),()=>f(t),()=>d(t))}function d(h){let g=(0,Vt._)`${h}.errors`;o.assign(Mi.default.vErrors,(0,Vt._)`${Mi.default.vErrors} === null ? ${g} : ${Mi.default.vErrors}.concat(${g})`),o.assign(Mi.default.errors,(0,Vt._)`${Mi.default.vErrors}.length`)}function f(h){var g;if(!i.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=Ju.mergeEvaluated.props(o,y.props,i.props));else{let v=o.var("props",(0,Vt._)`${h}.evaluated.props`);i.props=Ju.mergeEvaluated.props(o,v,i.props,Vt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Ju.mergeEvaluated.items(o,y.items,i.items));else{let v=o.var("items",(0,Vt._)`${h}.evaluated.items`);i.items=Ju.mergeEvaluated.items(o,v,i.items,Vt.Name)}}}Fo.callRef=Yu;Fo.default=_3});var l$=$(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var v3=i$(),w3=u$(),b3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",v3.default,w3.default];um.default=b3});var p$=$(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var Qu=Y(),Wn=Qu.operators,Xu={maximum:{okStr:"<=",ok:Wn.LTE,fail:Wn.GT},minimum:{okStr:">=",ok:Wn.GTE,fail:Wn.LT},exclusiveMaximum:{okStr:"<",ok:Wn.LT,fail:Wn.GTE},exclusiveMinimum:{okStr:">",ok:Wn.GT,fail:Wn.LTE}},x3={message:({keyword:e,schemaCode:t})=>(0,Qu.str)`must be ${Xu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Qu._)`{comparison: ${Xu[e].okStr}, limit: ${t}}`},k3={keyword:Object.keys(Xu),type:"number",schemaType:"number",$data:!0,error:x3,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Qu._)`${r} ${Xu[t].fail} ${n} || isNaN(${r})`)}};lm.default=k3});var d$=$(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var la=Y(),S3={message:({schemaCode:e})=>(0,la.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,la._)`{multipleOf: ${e}}`},$3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:S3,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,la._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,la._)`${s} !== parseInt(${s})`;e.fail$data((0,la._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};pm.default=$3});var h$=$(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});function f$(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}dm.default=f$;f$.code='require("ajv/dist/runtime/ucs2length").default'});var m$=$(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var Go=Y(),P3=le(),E3=h$(),C3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Go.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Go._)`{limit: ${e}}`},T3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:C3,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Go.operators.GT:Go.operators.LT,s=o.opts.unicode===!1?(0,Go._)`${r}.length`:(0,Go._)`${(0,P3.useFunc)(e.gen,E3.default)}(${r})`;e.fail$data((0,Go._)`${s} ${i} ${n}`)}};fm.default=T3});var g$=$(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var A3=pr(),el=Y(),R3={message:({schemaCode:e})=>(0,el.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,el._)`{pattern: ${e}}`},I3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:R3,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,el._)`(new RegExp(${o}, ${s}))`:(0,A3.usePattern)(e,n);e.fail$data((0,el._)`!${a}.test(${t})`)}};hm.default=I3});var y$=$(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var pa=Y(),z3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,pa.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,pa._)`{limit: ${e}}`},D3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:z3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?pa.operators.GT:pa.operators.LT;e.fail$data((0,pa._)`Object.keys(${r}).length ${o} ${n}`)}};mm.default=D3});var _$=$(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});var da=pr(),fa=Y(),O3=le(),N3={message:({params:{missingProperty:e}})=>(0,fa.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,fa._)`{missingProperty: ${e}}`},j3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:N3,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():p(),a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let g of r)if(f?.[g]===void 0&&!h.has(g)){let y=s.schemaEnv.baseId+s.errSchemaPath,v=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,O3.checkStrictMode)(s,v,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(fa.nil,l);else for(let f of r)(0,da.checkReportMissingProp)(e,f)}function p(){let f=t.let("missing");if(c||i){let h=t.let("valid",!0);e.block$data(h,()=>d(f,h)),e.ok(h)}else t.if((0,da.checkMissingProp)(e,r,f)),(0,da.reportMissingProp)(e,f),t.else()}function l(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,da.noPropertyInData)(t,o,f,a.ownProperties),()=>e.error())})}function d(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,da.propertyInData)(t,o,f,a.ownProperties)),t.if((0,fa.not)(h),()=>{e.error(),t.break()})},fa.nil)}}};gm.default=j3});var v$=$(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var ha=Y(),M3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ha.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,ha._)`{limit: ${e}}`},L3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:M3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?ha.operators.GT:ha.operators.LT;e.fail$data((0,ha._)`${r}.length ${o} ${n}`)}};ym.default=L3});var tl=$(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var w$=qh();w$.code='require("ajv/dist/runtime/equal").default';_m.default=w$});var b$=$(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var vm=ea(),ft=Y(),Z3=le(),U3=tl(),q3={message:({params:{i:e,j:t}})=>(0,ft.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,ft._)`{i: ${e}, j: ${t}}`},F3={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:q3,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,vm.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,ft._)`${s} === false`),e.ok(c);function p(){let h=t.let("i",(0,ft._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,ft._)`${h} > 1`,()=>(l()?d:f)(h,g))}function l(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function d(h,g){let y=t.name("item"),v=(0,vm.checkDataTypes)(u,y,a.opts.strictNumbers,vm.DataType.Wrong),w=t.const("indices",(0,ft._)`{}`);t.for((0,ft._)`;${h}--;`,()=>{t.let(y,(0,ft._)`${r}[${h}]`),t.if(v,(0,ft._)`continue`),u.length>1&&t.if((0,ft._)`typeof ${y} == "string"`,(0,ft._)`${y} += "_"`),t.if((0,ft._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(g,(0,ft._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,ft._)`${w}[${y}] = ${h}`)})}function f(h,g){let y=(0,Z3.useFunc)(t,U3.default),v=t.name("outer");t.label(v).for((0,ft._)`;${h}--;`,()=>t.for((0,ft._)`${g} = ${h}; ${g}--;`,()=>t.if((0,ft._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};wm.default=F3});var x$=$(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var bm=Y(),G3=le(),B3=tl(),V3={message:"must be equal to constant",params:({schemaCode:e})=>(0,bm._)`{allowedValue: ${e}}`},H3={keyword:"const",$data:!0,error:V3,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,bm._)`!${(0,G3.useFunc)(t,B3.default)}(${r}, ${o})`):e.fail((0,bm._)`${i} !== ${r}`)}};xm.default=H3});var k$=$(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var ma=Y(),W3=le(),K3=tl(),J3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ma._)`{allowedValues: ${e}}`},Y3={keyword:"enum",schemaType:"array",$data:!0,error:J3,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,W3.useFunc)(t,K3.default)),p;if(a||n)p=t.let("valid"),e.block$data(p,l);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=t.const("vSchema",i);p=(0,ma.or)(...o.map((h,g)=>d(f,g)))}e.pass(p);function l(){t.assign(p,!1),t.forOf("v",i,f=>t.if((0,ma._)`${u()}(${r}, ${f})`,()=>t.assign(p,!0).break()))}function d(f,h){let g=o[h];return typeof g=="object"&&g!==null?(0,ma._)`${u()}(${r}, ${f}[${h}])`:(0,ma._)`${r} === ${g}`}}};km.default=Y3});var S$=$(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var Q3=p$(),X3=d$(),e5=m$(),t5=g$(),r5=y$(),n5=_$(),o5=v$(),i5=b$(),s5=x$(),a5=k$(),c5=[Q3.default,X3.default,e5.default,t5.default,r5.default,n5.default,o5.default,i5.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s5.default,a5.default];Sm.default=c5});var Pm=$(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.validateAdditionalItems=void 0;var Bo=Y(),$m=le(),u5={message:({params:{len:e}})=>(0,Bo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Bo._)`{limit: ${e}}`},l5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:u5,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,$m.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}$$(e,n)}};function $$(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,Bo._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Bo._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,$m.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,Bo._)`${a} <= ${t.length}`);r.if((0,Bo.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:$m.Type.Num},u),s.allErrors||r.if((0,Bo.not)(u),()=>r.break())})}}ga.validateAdditionalItems=$$;ga.default=l5});var Em=$(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.validateTuple=void 0;var P$=Y(),rl=le(),p5=pr(),d5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return E$(e,"additionalItems",t);r.items=!0,!(0,rl.alwaysValidSchema)(r,t)&&e.ok((0,p5.validateArray)(e))}};function E$(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;p(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=rl.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,P$._)`${i}.length`);r.forEach((l,d)=>{(0,rl.alwaysValidSchema)(a,l)||(n.if((0,P$._)`${u} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function p(l){let{opts:d,errSchemaPath:f}=a,h=r.length,g=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(d.strictTuples&&!g){let y=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,rl.checkStrictMode)(a,y,d.strictTuples)}}}ya.validateTuple=E$;ya.default=d5});var C$=$(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var f5=Em(),h5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,f5.validateTuple)(e,"items")};Cm.default=h5});var A$=$(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var T$=Y(),m5=le(),g5=pr(),y5=Pm(),_5={message:({params:{len:e}})=>(0,T$.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,T$._)`{limit: ${e}}`},v5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_5,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,m5.alwaysValidSchema)(n,t)&&(o?(0,y5.validateAdditionalItems)(e,o):e.ok((0,g5.validateArray)(e)))}};Tm.default=v5});var R$=$(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var fr=Y(),nl=le(),w5={message:({params:{min:e,max:t}})=>t===void 0?(0,fr.str)`must contain at least ${e} valid item(s)`:(0,fr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,fr._)`{minContains: ${e}}`:(0,fr._)`{minContains: ${e}, maxContains: ${t}}`},b5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:w5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let p=t.const("len",(0,fr._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,nl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,nl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,nl.alwaysValidSchema)(i,r)){let g=(0,fr._)`${p} >= ${s}`;a!==void 0&&(g=(0,fr._)`${g} && ${p} <= ${a}`),e.pass(g);return}i.items=!0;let l=t.name("valid");a===void 0&&s===1?f(l,()=>t.if(l,()=>t.break())):s===0?(t.let(l,!0),a!==void 0&&t.if((0,fr._)`${o}.length > 0`,d)):(t.let(l,!1),d()),e.result(l,()=>e.reset());function d(){let g=t.name("_valid"),y=t.let("count",0);f(g,()=>t.if(g,()=>h(y)))}function f(g,y){t.forRange("i",0,p,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:nl.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,fr._)`${g}++`),a===void 0?t.if((0,fr._)`${g} >= ${s}`,()=>t.assign(l,!0).break()):(t.if((0,fr._)`${g} > ${a}`,()=>t.assign(l,!1).break()),s===1?t.assign(l,!0):t.if((0,fr._)`${g} >= ${s}`,()=>t.assign(l,!0)))}}};Am.default=b5});var D$=$(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.validateSchemaDeps=Vr.validatePropertyDeps=Vr.error=void 0;var Rm=Y(),x5=le(),_a=pr();Vr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Rm.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Rm._)`{property: ${e},
|
|
76
|
+
|| ${s} === "boolean" || ${o} === null`).assign(a,(0,H._)`[${o}]`)}}}function nM({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,H._)`${t} !== undefined`,()=>e.assign((0,H._)`${t}[${r}]`,n))}function Nh(e,t,r,n=zi.Correct){let o=n===zi.Correct?H.operators.EQ:H.operators.NEQ,i;switch(e){case"null":return(0,H._)`${t} ${o} null`;case"array":i=(0,H._)`Array.isArray(${t})`;break;case"object":i=(0,H._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,H._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,H._)`typeof ${t} ${o} ${e}`}return n===zi.Correct?i:(0,H.not)(i);function s(a=H.nil){return(0,H.and)((0,H._)`typeof ${t} == "number"`,a,r?(0,H._)`isFinite(${t})`:H.nil)}}kt.checkDataType=Nh;function jh(e,t,r,n){if(e.length===1)return Nh(e[0],t,r,n);let o,i=(0,rS.toHash)(e);if(i.array&&i.object){let s=(0,H._)`typeof ${t} != "object"`;o=i.null?s:(0,H._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=H.nil;i.number&&delete i.integer;for(let s in i)o=(0,H.and)(o,Nh(s,t,r,n));return o}kt.checkDataTypes=jh;var oM={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,H._)`{type: ${e}}`:(0,H._)`{type: ${t}}`};function Mh(e){let t=iM(e);(0,Q4.reportError)(t,oM)}kt.reportTypeError=Mh;function iM(e){let{gen:t,data:r,schema:n}=e,o=(0,rS.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var sS=$(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.assignDefaults=void 0;var Di=Y(),sM=le();function aM(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)iS(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>iS(e,i,o.default))}Mu.assignDefaults=aM;function iS(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Di._)`${i}${(0,Di.getProperty)(t)}`;if(o){(0,sM.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Di._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Di._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Di._)`${a} = ${(0,Di.stringify)(r)}`)}});var dr=$(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.validateUnion=ge.validateArray=ge.usePattern=ge.callValidateCode=ge.schemaProperties=ge.allSchemaProperties=ge.noPropertyInData=ge.propertyInData=ge.isOwnProperty=ge.hasPropFunc=ge.reportMissingProp=ge.checkMissingProp=ge.checkReportMissingProp=void 0;var Te=Y(),Lh=le(),Bn=gn(),cM=le();function uM(e,t){let{gen:r,data:n,it:o}=e;r.if(Uh(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Te._)`${t}`},!0),e.error()})}ge.checkReportMissingProp=uM;function lM({gen:e,data:t,it:{opts:r}},n,o){return(0,Te.or)(...n.map(i=>(0,Te.and)(Uh(e,t,i,r.ownProperties),(0,Te._)`${o} = ${i}`)))}ge.checkMissingProp=lM;function pM(e,t){e.setParams({missingProperty:t},!0),e.error()}ge.reportMissingProp=pM;function aS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Te._)`Object.prototype.hasOwnProperty`})}ge.hasPropFunc=aS;function Zh(e,t,r){return(0,Te._)`${aS(e)}.call(${t}, ${r})`}ge.isOwnProperty=Zh;function dM(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} !== undefined`;return n?(0,Te._)`${o} && ${Zh(e,t,r)}`:o}ge.propertyInData=dM;function Uh(e,t,r,n){let o=(0,Te._)`${t}${(0,Te.getProperty)(r)} === undefined`;return n?(0,Te.or)(o,(0,Te.not)(Zh(e,t,r))):o}ge.noPropertyInData=Uh;function cS(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ge.allSchemaProperties=cS;function fM(e,t){return cS(t).filter(r=>!(0,Lh.alwaysValidSchema)(e,t[r]))}ge.schemaProperties=fM;function hM({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let p=u?(0,Te._)`${e}, ${t}, ${n}${o}`:t,l=[[Bn.default.instancePath,(0,Te.strConcat)(Bn.default.instancePath,i)],[Bn.default.parentData,s.parentData],[Bn.default.parentDataProperty,s.parentDataProperty],[Bn.default.rootData,Bn.default.rootData]];s.opts.dynamicRef&&l.push([Bn.default.dynamicAnchors,Bn.default.dynamicAnchors]);let d=(0,Te._)`${p}, ${r.object(...l)}`;return c!==Te.nil?(0,Te._)`${a}.call(${c}, ${d})`:(0,Te._)`${a}(${d})`}ge.callValidateCode=hM;var mM=(0,Te._)`new RegExp`;function gM({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Te._)`${o.code==="new RegExp"?mM:(0,cM.useFunc)(e,o)}(${r}, ${n})`})}ge.usePattern=gM;function yM(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,Te._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Lh.Type.Num},i),t.if((0,Te.not)(i),a)})}}ge.validateArray=yM;function _M(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Lh.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let p=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,Te._)`${s} || ${a}`),e.mergeValidEvaluated(p,a)||t.if((0,Te.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ge.validateUnion=_M});var pS=$(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.validateKeywordUsage=Fr.validSchemaType=Fr.funcKeywordCode=Fr.macroKeywordCode=void 0;var zt=Y(),Uo=gn(),vM=dr(),wM=Xs();function bM(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=lS(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:zt.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Fr.macroKeywordCode=bM;function xM(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;SM(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,p=lS(n,o,u),l=n.let("valid");e.block$data(l,d),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function d(){if(t.errors===!1)g(),t.modifying&&uS(e),y(()=>e.error());else{let v=t.async?f():h();t.modifying&&uS(e),y(()=>kM(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>g((0,zt._)`await `),w=>n.assign(l,!1).if((0,zt._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(v,(0,zt._)`${w}.errors`),()=>n.throw(w))),v}function h(){let v=(0,zt._)`${p}.errors`;return n.assign(v,null),g(zt.nil),v}function g(v=t.async?(0,zt._)`await `:zt.nil){let w=c.opts.passContext?Uo.default.this:Uo.default.self,x=!("compile"in t&&!a||t.schema===!1);n.assign(l,(0,zt._)`${v}${(0,vM.callValidateCode)(e,p,w,x)}`,t.modifying)}function y(v){var w;n.if((0,zt.not)((w=t.valid)!==null&&w!==void 0?w:l),v)}}Fr.funcKeywordCode=xM;function uS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,zt._)`${n.parentData}[${n.parentDataProperty}]`))}function kM(e,t){let{gen:r}=e;r.if((0,zt._)`Array.isArray(${t})`,()=>{r.assign(Uo.default.vErrors,(0,zt._)`${Uo.default.vErrors} === null ? ${t} : ${Uo.default.vErrors}.concat(${t})`).assign(Uo.default.errors,(0,zt._)`${Uo.default.vErrors}.length`),(0,wM.extendErrors)(e)},()=>e.error())}function SM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function lS(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,zt.stringify)(r)})}function $M(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Fr.validSchemaType=$M;function PM({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Fr.validateKeywordUsage=PM});var fS=$(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.extendSubschemaMode=Vn.extendSubschemaData=Vn.getSubschema=void 0;var Gr=Y(),dS=le();function EM(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Gr._)`${e.schemaPath}${(0,Gr.getProperty)(t)}${(0,Gr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,dS.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Vn.getSubschema=EM;function CM(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:p,opts:l}=t,d=a.let("data",(0,Gr._)`${t.data}${(0,Gr.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Gr.str)`${u}${(0,dS.getErrorPath)(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=(0,Gr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Gr.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Vn.extendSubschemaData=CM;function TM(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Vn.extendSubschemaMode=TM});var qh=$((nJ,hS)=>{"use strict";hS.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var gS=$((oJ,mS)=>{"use strict";var Hn=mS.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Lu(t,n,o,e,"",e)};Hn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Hn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Hn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Hn.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Lu(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var p in n){var l=n[p];if(Array.isArray(l)){if(p in Hn.arrayKeywords)for(var d=0;d<l.length;d++)Lu(e,t,r,l[d],o+"/"+p+"/"+d,i,o,p,n,d)}else if(p in Hn.propsKeywords){if(l&&typeof l=="object")for(var f in l)Lu(e,t,r,l[f],o+"/"+p+"/"+AM(f),i,o,p,n,f)}else(p in Hn.keywords||e.allKeys&&!(p in Hn.skipKeywords))&&Lu(e,t,r,l,o+"/"+p,i,o,p,n)}r(n,o,i,s,a,c,u)}}function AM(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ta=$(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getSchemaRefs=Bt.resolveUrl=Bt.normalizeId=Bt._getFullPath=Bt.getFullPath=Bt.inlineRef=void 0;var RM=le(),IM=qh(),zM=gS(),DM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function OM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Fh(e):t?yS(e)<=t:!1}Bt.inlineRef=OM;var NM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Fh(e){for(let t in e){if(NM.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Fh)||typeof r=="object"&&Fh(r))return!0}return!1}function yS(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!DM.has(r)&&(typeof e[r]=="object"&&(0,RM.eachItem)(e[r],n=>t+=yS(n)),t===1/0))return 1/0}return t}function _S(e,t="",r){r!==!1&&(t=Oi(t));let n=e.parse(t);return vS(e,n)}Bt.getFullPath=_S;function vS(e,t){return e.serialize(t).split("#")[0]+"#"}Bt._getFullPath=vS;var jM=/#\/?$/;function Oi(e){return e?e.replace(jM,""):""}Bt.normalizeId=Oi;function MM(e,t,r){return r=Oi(r),e.resolve(t,r)}Bt.resolveUrl=MM;var LM=/^[a-z_][-a-z0-9._]*$/i;function ZM(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Oi(e[r]||t),i={"":o},s=_S(n,o,!1),a={},c=new Set;return zM(e,{allKeys:!0},(l,d,f,h)=>{if(h===void 0)return;let g=s+d,y=i[h];typeof l[r]=="string"&&(y=v.call(this,l[r])),w.call(this,l.$anchor),w.call(this,l.$dynamicAnchor),i[d]=y;function v(x){let k=this.opts.uriResolver.resolve;if(x=Oi(y?k(y,x):x),c.has(x))throw p(x);c.add(x);let P=this.refs[x];return typeof P=="string"&&(P=this.refs[P]),typeof P=="object"?u(l,P.schema,x):x!==Oi(g)&&(x[0]==="#"?(u(l,a[x],x),a[x]=l):this.refs[x]=g),x}function w(x){if(typeof x=="string"){if(!LM.test(x))throw new Error(`invalid anchor "${x}"`);v.call(this,`#${x}`)}}}),a;function u(l,d,f){if(d!==void 0&&!IM(l,d))throw p(f)}function p(l){return new Error(`reference "${l}" resolves to more than one schema`)}}Bt.getSchemaRefs=ZM});var oa=$(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.getData=Wn.KeywordCxt=Wn.validateFunctionCode=void 0;var SS=Xk(),wS=ea(),Bh=Oh(),Zu=ea(),UM=sS(),na=pS(),Gh=fS(),N=Y(),F=gn(),qM=ta(),yn=le(),ra=Xs();function FM(e){if(ES(e)&&(CS(e),PS(e))){VM(e);return}$S(e,()=>(0,SS.topBoolOrEmptySchema)(e))}Wn.validateFunctionCode=FM;function $S({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,N._)`${F.default.data}, ${F.default.valCxt}`,n.$async,()=>{e.code((0,N._)`"use strict"; ${bS(r,o)}`),BM(e,o),e.code(i)}):e.func(t,(0,N._)`${F.default.data}, ${GM(o)}`,n.$async,()=>e.code(bS(r,o)).code(i))}function GM(e){return(0,N._)`{${F.default.instancePath}="", ${F.default.parentData}, ${F.default.parentDataProperty}, ${F.default.rootData}=${F.default.data}${e.dynamicRef?(0,N._)`, ${F.default.dynamicAnchors}={}`:N.nil}}={}`}function BM(e,t){e.if(F.default.valCxt,()=>{e.var(F.default.instancePath,(0,N._)`${F.default.valCxt}.${F.default.instancePath}`),e.var(F.default.parentData,(0,N._)`${F.default.valCxt}.${F.default.parentData}`),e.var(F.default.parentDataProperty,(0,N._)`${F.default.valCxt}.${F.default.parentDataProperty}`),e.var(F.default.rootData,(0,N._)`${F.default.valCxt}.${F.default.rootData}`),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`${F.default.valCxt}.${F.default.dynamicAnchors}`)},()=>{e.var(F.default.instancePath,(0,N._)`""`),e.var(F.default.parentData,(0,N._)`undefined`),e.var(F.default.parentDataProperty,(0,N._)`undefined`),e.var(F.default.rootData,F.default.data),t.dynamicRef&&e.var(F.default.dynamicAnchors,(0,N._)`{}`)})}function VM(e){let{schema:t,opts:r,gen:n}=e;$S(e,()=>{r.$comment&&t.$comment&&AS(e),YM(e),n.let(F.default.vErrors,null),n.let(F.default.errors,0),r.unevaluated&&HM(e),TS(e),eL(e)})}function HM(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,N._)`${r}.evaluated`),t.if((0,N._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,N._)`${e.evaluated}.props`,(0,N._)`undefined`)),t.if((0,N._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,N._)`${e.evaluated}.items`,(0,N._)`undefined`))}function bS(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,N._)`/*# sourceURL=${r} */`:N.nil}function WM(e,t){if(ES(e)&&(CS(e),PS(e))){KM(e,t);return}(0,SS.boolOrEmptySchema)(e,t)}function PS({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function ES(e){return typeof e.schema!="boolean"}function KM(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&AS(e),QM(e),XM(e);let i=n.const("_errs",F.default.errors);TS(e,i),n.var(t,(0,N._)`${i} === ${F.default.errors}`)}function CS(e){(0,yn.checkUnknownRules)(e),JM(e)}function TS(e,t){if(e.opts.jtd)return xS(e,[],!1,t);let r=(0,wS.getSchemaTypes)(e.schema),n=(0,wS.coerceAndCheckDataType)(e,r);xS(e,r,!n,t)}function JM(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,yn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function YM(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,yn.checkStrictMode)(e,"default is ignored in the schema root")}function QM(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,qM.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function XM(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function AS({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,N._)`${F.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,N.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,N._)`${F.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function eL(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,N._)`${F.default.errors} === 0`,()=>t.return(F.default.data),()=>t.throw((0,N._)`new ${o}(${F.default.vErrors})`)):(t.assign((0,N._)`${n}.errors`,F.default.vErrors),i.unevaluated&&tL(e),t.return((0,N._)`${F.default.errors} === 0`))}function tL({gen:e,evaluated:t,props:r,items:n}){r instanceof N.Name&&e.assign((0,N._)`${t}.props`,r),n instanceof N.Name&&e.assign((0,N._)`${t}.items`,n)}function xS(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:p}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,yn.schemaHasRulesButRef)(i,p))){o.block(()=>IS(e,"$ref",p.all.$ref.definition));return}c.jtd||rL(e,t),o.block(()=>{for(let d of p.rules)l(d);l(p.post)});function l(d){(0,Bh.shouldUseGroup)(i,d)&&(d.type?(o.if((0,Zu.checkDataType)(d.type,s,c.strictNumbers)),kS(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Zu.reportTypeError)(e)),o.endIf()):kS(e,d),a||o.if((0,N._)`${F.default.errors} === ${n||0}`))}}function kS(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,UM.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Bh.shouldUseRule)(n,i)&&IS(e,i.keyword,i.definition,t.type)})}function rL(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(nL(e,t),e.opts.allowUnionTypes||oL(e,t),iL(e,e.dataTypes))}function nL(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{RS(e.dataTypes,r)||Vh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),aL(e,t)}}function oL(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Vh(e,"use allowUnionTypes to allow union type keyword")}function iL(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Bh.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>sL(t,s))&&Vh(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function sL(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function RS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function aL(e,t){let r=[];for(let n of e.dataTypes)RS(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Vh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,yn.checkStrictMode)(e,t,e.opts.strictTypes)}var Uu=class{constructor(t,r,n){if((0,na.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,yn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",zS(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,na.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",F.default.errors))}result(t,r,n){this.failResult((0,N.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,N.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,N._)`${r} !== undefined && (${(0,N.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ra.reportExtraError:ra.reportError)(this,this.def.error,r)}$dataError(){(0,ra.reportError)(this,this.def.$dataError||ra.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ra.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=N.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=N.nil,r=N.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,N.or)((0,N._)`${o} === undefined`,r)),t!==N.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==N.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,N.or)(s(),a());function s(){if(n.length){if(!(r instanceof N.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,N._)`${(0,Zu.checkDataTypes)(c,r,i.opts.strictNumbers,Zu.DataType.Wrong)}`}return N.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,N._)`!${c}(${r})`}return N.nil}}subschema(t,r){let n=(0,Gh.getSubschema)(this.it,t);(0,Gh.extendSubschemaData)(n,this.it,t),(0,Gh.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return WM(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=yn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=yn.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,N.Name)),!0}};Wn.KeywordCxt=Uu;function IS(e,t,r,n){let o=new Uu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,na.funcKeywordCode)(o,r):"macro"in r?(0,na.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,na.funcKeywordCode)(o,r)}var cL=/^\/(?:[^~]|~0|~1)*$/,uL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function zS(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return F.default.rootData;if(e[0]==="/"){if(!cL.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=F.default.rootData}else{let u=uL.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+u[1];if(o=u[2],o==="#"){if(p>=t)throw new Error(c("property/index",p));return n[t-p]}if(p>t)throw new Error(c("data",p));if(i=r[t-p],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,N._)`${i}${(0,N.getProperty)((0,yn.unescapeJsonPointer)(u))}`,s=(0,N._)`${s} && ${i}`);return s;function c(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}Wn.getData=zS});var qu=$(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var Hh=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Wh.default=Hh});var ia=$(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});var Kh=ta(),Jh=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Kh.resolveUrl)(t,r,n),this.missingSchema=(0,Kh.normalizeId)((0,Kh.getFullPath)(t,this.missingRef))}};Yh.default=Jh});var Gu=$(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.resolveSchema=fr.getCompilingSchema=fr.resolveRef=fr.compileSchema=fr.SchemaEnv=void 0;var Er=Y(),lL=qu(),qo=gn(),Cr=ta(),DS=le(),pL=oa(),Ni=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Cr.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};fr.SchemaEnv=Ni;function Xh(e){let t=OS.call(this,e);if(t)return t;let r=(0,Cr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Er.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:lL.default,code:(0,Er._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:qo.default.data,parentData:qo.default.parentData,parentDataProperty:qo.default.parentDataProperty,dataNames:[qo.default.data],dataPathArr:[Er.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Er.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Er.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Er._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,pL.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let l=s.toString();p=`${s.scopeRefs(qo.default.scope)}return ${l}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let f=new Function(`${qo.default.self}`,`${qo.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:l,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:g}=u;f.evaluated={props:h instanceof Er.Name?void 0:h,items:g instanceof Er.Name?void 0:g,dynamicProps:h instanceof Er.Name,dynamicItems:g instanceof Er.Name},f.source&&(f.source.evaluated=(0,Er.stringify)(f.evaluated))}return e.validate=f,e}catch(l){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),l}finally{this._compilations.delete(e)}}fr.compileSchema=Xh;function dL(e,t,r){var n;r=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=mL.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new Ni({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=fL.call(this,i)}fr.resolveRef=dL;function fL(e){return(0,Cr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Xh.call(this,e)}function OS(e){for(let t of this._compilations)if(hL(t,e))return t}fr.getCompilingSchema=OS;function hL(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function mL(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Fu.call(this,e,t)}function Fu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Cr._getFullPath)(this.opts.uriResolver,r),o=(0,Cr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Qh.call(this,r,e);let i=(0,Cr.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Fu.call(this,e,s);return typeof a?.schema!="object"?void 0:Qh.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Xh.call(this,s),i===(0,Cr.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Cr.resolveUrl)(this.opts.uriResolver,o,u)),new Ni({schema:a,schemaId:c,root:e,baseId:o})}return Qh.call(this,r,s)}}fr.resolveSchema=Fu;var gL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qh(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,DS.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!gL.has(a)&&u&&(t=(0,Cr.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,DS.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Cr.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Fu.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Ni({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var NS=$((lJ,yL)=>{yL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var tm=$((pJ,ZS)=>{"use strict";var _L=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),MS=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function em(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var vL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function jS(e){return e.length=0,!0}function wL(e,t,r){if(e.length){let n=em(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function bL(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=wL;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=jS}else{o.push(u);continue}}return o.length&&(a===jS?r.zone=o.join(""):s?n.push(o.join("")):n.push(em(o))),r.address=n.join(""),r}function LS(e){if(xL(e,":")<2)return{host:e,isIPV6:!1};let t=bL(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function xL(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function kL(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function SL(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function $L(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!MS(r)){let n=LS(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}ZS.exports={nonSimpleDomain:vL,recomposeAuthority:$L,normalizeComponentEncoding:SL,removeDotSegments:kL,isIPv4:MS,isUUID:_L,normalizeIPv6:LS,stringArrayToHexStripped:em}});var BS=$((dJ,GS)=>{"use strict";var{isUUID:PL}=tm(),EL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,CL=["http","https","ws","wss","urn","urn:uuid"];function TL(e){return CL.indexOf(e)!==-1}function rm(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function US(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function qS(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function AL(e){return e.secure=rm(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function RL(e){if((e.port===(rm(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function IL(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(EL);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=nm(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function zL(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=nm(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function DL(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!PL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function OL(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var FS={scheme:"http",domainHost:!0,parse:US,serialize:qS},NL={scheme:"https",domainHost:FS.domainHost,parse:US,serialize:qS},Bu={scheme:"ws",domainHost:!0,parse:AL,serialize:RL},jL={scheme:"wss",domainHost:Bu.domainHost,parse:Bu.parse,serialize:Bu.serialize},ML={scheme:"urn",parse:IL,serialize:zL,skipNormalize:!0},LL={scheme:"urn:uuid",parse:DL,serialize:OL,skipNormalize:!0},Vu={http:FS,https:NL,ws:Bu,wss:jL,urn:ML,"urn:uuid":LL};Object.setPrototypeOf(Vu,null);function nm(e){return e&&(Vu[e]||Vu[e.toLowerCase()])||void 0}GS.exports={wsIsSecure:rm,SCHEMES:Vu,isValidSchemeName:TL,getSchemeHandler:nm}});var WS=$((fJ,Wu)=>{"use strict";var{normalizeIPv6:ZL,removeDotSegments:sa,recomposeAuthority:UL,normalizeComponentEncoding:Hu,isIPv4:qL,nonSimpleDomain:FL}=tm(),{SCHEMES:GL,getSchemeHandler:VS}=BS();function BL(e,t){return typeof e=="string"?e=Br(_n(e,t),t):typeof e=="object"&&(e=_n(Br(e,t),t)),e}function VL(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=HS(_n(e,n),_n(t,n),n,!0);return n.skipEscape=!0,Br(o,n)}function HS(e,t,r,n){let o={};return n||(e=_n(Br(e,r),r),t=_n(Br(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=sa(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=sa(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=sa(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function HL(e,t,r){return typeof e=="string"?(e=unescape(e),e=Br(Hu(_n(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Br(Hu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Br(Hu(_n(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Br(Hu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Br(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=VS(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=UL(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=sa(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var WL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _n(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let i=e.match(WL);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(qL(n.host)===!1){let c=ZL(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=VS(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&o===!1&&FL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var om={SCHEMES:GL,normalize:BL,resolve:VL,resolveComponent:HS,equal:HL,serialize:Br,parse:_n};Wu.exports=om;Wu.exports.default=om;Wu.exports.fastUri=om});var JS=$(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var KS=WS();KS.code='require("ajv/dist/runtime/uri").default';im.default=KS});var o$=$(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CodeGen=dt.Name=dt.nil=dt.stringify=dt.str=dt._=dt.KeywordCxt=void 0;var KL=oa();Object.defineProperty(dt,"KeywordCxt",{enumerable:!0,get:function(){return KL.KeywordCxt}});var ji=Y();Object.defineProperty(dt,"_",{enumerable:!0,get:function(){return ji._}});Object.defineProperty(dt,"str",{enumerable:!0,get:function(){return ji.str}});Object.defineProperty(dt,"stringify",{enumerable:!0,get:function(){return ji.stringify}});Object.defineProperty(dt,"nil",{enumerable:!0,get:function(){return ji.nil}});Object.defineProperty(dt,"Name",{enumerable:!0,get:function(){return ji.Name}});Object.defineProperty(dt,"CodeGen",{enumerable:!0,get:function(){return ji.CodeGen}});var JL=qu(),t$=ia(),YL=Dh(),aa=Gu(),QL=Y(),ca=ta(),Ku=ea(),am=le(),YS=NS(),XL=JS(),r$=(e,t)=>new RegExp(e,t);r$.code="new RegExp";var e3=["removeAdditional","useDefaults","coerceTypes"],t3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),r3={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},n3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},QS=200;function o3(e){var t,r,n,o,i,s,a,c,u,p,l,d,f,h,g,y,v,w,x,k,P,q,L,Ue,we;let Q=e.strict,qe=(t=e.code)===null||t===void 0?void 0:t.optimize,Be=qe===!0||qe===void 0?1:qe||0,Cn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:r$,ao=(o=e.uriResolver)!==null&&o!==void 0?o:XL.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:Q)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Q)!==null&&c!==void 0?c:!0,strictTypes:(p=(u=e.strictTypes)!==null&&u!==void 0?u:Q)!==null&&p!==void 0?p:"log",strictTuples:(d=(l=e.strictTuples)!==null&&l!==void 0?l:Q)!==null&&d!==void 0?d:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:Q)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Be,regExp:Cn}:{optimize:Be,regExp:Cn},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:QS,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:QS,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(q=e.validateSchema)!==null&&q!==void 0?q:!0,validateFormats:(L=e.validateFormats)!==null&&L!==void 0?L:!0,unicodeRegExp:(Ue=e.unicodeRegExp)!==null&&Ue!==void 0?Ue:!0,int32range:(we=e.int32range)!==null&&we!==void 0?we:!0,uriResolver:ao}}var ua=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...o3(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new QL.ValueScope({scope:{},prefixes:t3,es5:r,lines:n}),this.logger=l3(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,YL.getRules)(),XS.call(this,r3,t,"NOT SUPPORTED"),XS.call(this,n3,t,"DEPRECATED","warn"),this._metaOpts=c3.call(this),t.formats&&s3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&a3.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),i3.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=YS;n==="id"&&(o={...YS},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(p,l){await i.call(this,p.$schema);let d=this._addSchema(p,l);return d.validate||s.call(this,d)}async function i(p){p&&!this.getSchema(p)&&await o.call(this,{$ref:p},!0)}async function s(p){try{return this._compileSchemaEnv(p)}catch(l){if(!(l instanceof t$.default))throw l;return a.call(this,l),await c.call(this,l.missingSchema),s.call(this,p)}}function a({missingSchema:p,missingRef:l}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${l} cannot be resolved`)}async function c(p){let l=await u.call(this,p);this.refs[p]||await i.call(this,l.$schema),this.refs[p]||this.addSchema(l,p,r)}async function u(p){let l=this._loading[p];if(l)return l;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,ca.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=e$.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new aa.SchemaEnv({schema:{},schemaId:n});if(r=aa.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=e$.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ca.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(d3.call(this,n,r),!r)return(0,am.eachItem)(n,i=>sm.call(this,i)),this;h3.call(this,r);let o={...r,type:(0,Ku.getJSONTypes)(r.type),schemaType:(0,Ku.getJSONTypes)(r.schemaType)};return(0,am.eachItem)(n,o.type.length===0?i=>sm.call(this,i,o):i=>o.type.forEach(s=>sm.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,p=s[a];u&&p&&(s[a]=n$(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,ca.normalizeId)(s||n);let u=ca.getSchemaRefs.call(this,t,n);return c=new aa.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):aa.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{aa.compileSchema.call(this,t)}finally{this.opts=r}}};ua.ValidationError=JL.default;ua.MissingRefError=t$.default;dt.default=ua;function XS(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function e$(e){return e=(0,ca.normalizeId)(e),this.schemas[e]||this.refs[e]}function i3(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function s3(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function a3(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function c3(){let e={...this.opts};for(let t of e3)delete e[t];return e}var u3={log(){},warn(){},error(){}};function l3(e){if(e===!1)return u3;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var p3=/^[a-z_$][a-z0-9_$:-]*$/i;function d3(e,t){let{RULES:r}=this;if((0,am.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!p3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function sm(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Ku.getJSONTypes)(t.type),schemaType:(0,Ku.getJSONTypes)(t.schemaType)}};t.before?f3.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function f3(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function h3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=n$(t)),e.validateSchema=this.compile(t,!0))}var m3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function n$(e){return{anyOf:[e,m3]}}});var i$=$(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var g3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cm.default=g3});var u$=$(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.callRef=Fo.getValidate=void 0;var y3=ia(),s$=dr(),Vt=Y(),Mi=gn(),a$=Gu(),Ju=le(),_3={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return l();let p=a$.resolveRef.call(c,u,o,r);if(p===void 0)throw new y3.default(n.opts.uriResolver,o,r);if(p instanceof a$.SchemaEnv)return d(p);return f(p);function l(){if(i===u)return Yu(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return Yu(e,(0,Vt._)`${h}.validate`,u,u.$async)}function d(h){let g=c$(e,h);Yu(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,Vt.stringify)(h)}:{ref:h}),y=t.name("valid"),v=e.subschema({schema:h,dataTypes:[],schemaPath:Vt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function c$(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Vt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Fo.getValidate=c$;function Yu(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Mi.default.this:Vt.nil;n?p():l();function p(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{o.code((0,Vt._)`await ${(0,s$.callValidateCode)(e,t,u)}`),f(t),s||o.assign(h,!0)},g=>{o.if((0,Vt._)`!(${g} instanceof ${i.ValidationError})`,()=>o.throw(g)),d(g),s||o.assign(h,!1)}),e.ok(h)}function l(){e.result((0,s$.callValidateCode)(e,t,u),()=>f(t),()=>d(t))}function d(h){let g=(0,Vt._)`${h}.errors`;o.assign(Mi.default.vErrors,(0,Vt._)`${Mi.default.vErrors} === null ? ${g} : ${Mi.default.vErrors}.concat(${g})`),o.assign(Mi.default.errors,(0,Vt._)`${Mi.default.vErrors}.length`)}function f(h){var g;if(!i.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=Ju.mergeEvaluated.props(o,y.props,i.props));else{let v=o.var("props",(0,Vt._)`${h}.evaluated.props`);i.props=Ju.mergeEvaluated.props(o,v,i.props,Vt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Ju.mergeEvaluated.items(o,y.items,i.items));else{let v=o.var("items",(0,Vt._)`${h}.evaluated.items`);i.items=Ju.mergeEvaluated.items(o,v,i.items,Vt.Name)}}}Fo.callRef=Yu;Fo.default=_3});var l$=$(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var v3=i$(),w3=u$(),b3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",v3.default,w3.default];um.default=b3});var p$=$(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var Qu=Y(),Kn=Qu.operators,Xu={maximum:{okStr:"<=",ok:Kn.LTE,fail:Kn.GT},minimum:{okStr:">=",ok:Kn.GTE,fail:Kn.LT},exclusiveMaximum:{okStr:"<",ok:Kn.LT,fail:Kn.GTE},exclusiveMinimum:{okStr:">",ok:Kn.GT,fail:Kn.LTE}},x3={message:({keyword:e,schemaCode:t})=>(0,Qu.str)`must be ${Xu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Qu._)`{comparison: ${Xu[e].okStr}, limit: ${t}}`},k3={keyword:Object.keys(Xu),type:"number",schemaType:"number",$data:!0,error:x3,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Qu._)`${r} ${Xu[t].fail} ${n} || isNaN(${r})`)}};lm.default=k3});var d$=$(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var la=Y(),S3={message:({schemaCode:e})=>(0,la.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,la._)`{multipleOf: ${e}}`},$3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:S3,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,la._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,la._)`${s} !== parseInt(${s})`;e.fail$data((0,la._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};pm.default=$3});var h$=$(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});function f$(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}dm.default=f$;f$.code='require("ajv/dist/runtime/ucs2length").default'});var m$=$(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var Go=Y(),P3=le(),E3=h$(),C3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Go.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Go._)`{limit: ${e}}`},T3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:C3,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Go.operators.GT:Go.operators.LT,s=o.opts.unicode===!1?(0,Go._)`${r}.length`:(0,Go._)`${(0,P3.useFunc)(e.gen,E3.default)}(${r})`;e.fail$data((0,Go._)`${s} ${i} ${n}`)}};fm.default=T3});var g$=$(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});var A3=dr(),el=Y(),R3={message:({schemaCode:e})=>(0,el.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,el._)`{pattern: ${e}}`},I3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:R3,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,el._)`(new RegExp(${o}, ${s}))`:(0,A3.usePattern)(e,n);e.fail$data((0,el._)`!${a}.test(${t})`)}};hm.default=I3});var y$=$(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var pa=Y(),z3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,pa.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,pa._)`{limit: ${e}}`},D3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:z3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?pa.operators.GT:pa.operators.LT;e.fail$data((0,pa._)`Object.keys(${r}).length ${o} ${n}`)}};mm.default=D3});var _$=$(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});var da=dr(),fa=Y(),O3=le(),N3={message:({params:{missingProperty:e}})=>(0,fa.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,fa._)`{missingProperty: ${e}}`},j3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:N3,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():p(),a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let g of r)if(f?.[g]===void 0&&!h.has(g)){let y=s.schemaEnv.baseId+s.errSchemaPath,v=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,O3.checkStrictMode)(s,v,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(fa.nil,l);else for(let f of r)(0,da.checkReportMissingProp)(e,f)}function p(){let f=t.let("missing");if(c||i){let h=t.let("valid",!0);e.block$data(h,()=>d(f,h)),e.ok(h)}else t.if((0,da.checkMissingProp)(e,r,f)),(0,da.reportMissingProp)(e,f),t.else()}function l(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,da.noPropertyInData)(t,o,f,a.ownProperties),()=>e.error())})}function d(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,da.propertyInData)(t,o,f,a.ownProperties)),t.if((0,fa.not)(h),()=>{e.error(),t.break()})},fa.nil)}}};gm.default=j3});var v$=$(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var ha=Y(),M3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ha.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,ha._)`{limit: ${e}}`},L3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:M3,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?ha.operators.GT:ha.operators.LT;e.fail$data((0,ha._)`${r}.length ${o} ${n}`)}};ym.default=L3});var tl=$(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var w$=qh();w$.code='require("ajv/dist/runtime/equal").default';_m.default=w$});var b$=$(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var vm=ea(),ft=Y(),Z3=le(),U3=tl(),q3={message:({params:{i:e,j:t}})=>(0,ft.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,ft._)`{i: ${e}, j: ${t}}`},F3={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:q3,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,vm.getSchemaTypes)(i.items):[];e.block$data(c,p,(0,ft._)`${s} === false`),e.ok(c);function p(){let h=t.let("i",(0,ft._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,ft._)`${h} > 1`,()=>(l()?d:f)(h,g))}function l(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function d(h,g){let y=t.name("item"),v=(0,vm.checkDataTypes)(u,y,a.opts.strictNumbers,vm.DataType.Wrong),w=t.const("indices",(0,ft._)`{}`);t.for((0,ft._)`;${h}--;`,()=>{t.let(y,(0,ft._)`${r}[${h}]`),t.if(v,(0,ft._)`continue`),u.length>1&&t.if((0,ft._)`typeof ${y} == "string"`,(0,ft._)`${y} += "_"`),t.if((0,ft._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(g,(0,ft._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,ft._)`${w}[${y}] = ${h}`)})}function f(h,g){let y=(0,Z3.useFunc)(t,U3.default),v=t.name("outer");t.label(v).for((0,ft._)`;${h}--;`,()=>t.for((0,ft._)`${g} = ${h}; ${g}--;`,()=>t.if((0,ft._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};wm.default=F3});var x$=$(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var bm=Y(),G3=le(),B3=tl(),V3={message:"must be equal to constant",params:({schemaCode:e})=>(0,bm._)`{allowedValue: ${e}}`},H3={keyword:"const",$data:!0,error:V3,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,bm._)`!${(0,G3.useFunc)(t,B3.default)}(${r}, ${o})`):e.fail((0,bm._)`${i} !== ${r}`)}};xm.default=H3});var k$=$(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var ma=Y(),W3=le(),K3=tl(),J3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ma._)`{allowedValues: ${e}}`},Y3={keyword:"enum",schemaType:"array",$data:!0,error:J3,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,W3.useFunc)(t,K3.default)),p;if(a||n)p=t.let("valid"),e.block$data(p,l);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=t.const("vSchema",i);p=(0,ma.or)(...o.map((h,g)=>d(f,g)))}e.pass(p);function l(){t.assign(p,!1),t.forOf("v",i,f=>t.if((0,ma._)`${u()}(${r}, ${f})`,()=>t.assign(p,!0).break()))}function d(f,h){let g=o[h];return typeof g=="object"&&g!==null?(0,ma._)`${u()}(${r}, ${f}[${h}])`:(0,ma._)`${r} === ${g}`}}};km.default=Y3});var S$=$(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});var Q3=p$(),X3=d$(),e5=m$(),t5=g$(),r5=y$(),n5=_$(),o5=v$(),i5=b$(),s5=x$(),a5=k$(),c5=[Q3.default,X3.default,e5.default,t5.default,r5.default,n5.default,o5.default,i5.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},s5.default,a5.default];Sm.default=c5});var Pm=$(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.validateAdditionalItems=void 0;var Bo=Y(),$m=le(),u5={message:({params:{len:e}})=>(0,Bo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Bo._)`{limit: ${e}}`},l5={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:u5,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,$m.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}$$(e,n)}};function $$(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,Bo._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Bo._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,$m.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,Bo._)`${a} <= ${t.length}`);r.if((0,Bo.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:$m.Type.Num},u),s.allErrors||r.if((0,Bo.not)(u),()=>r.break())})}}ga.validateAdditionalItems=$$;ga.default=l5});var Em=$(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.validateTuple=void 0;var P$=Y(),rl=le(),p5=dr(),d5={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return E$(e,"additionalItems",t);r.items=!0,!(0,rl.alwaysValidSchema)(r,t)&&e.ok((0,p5.validateArray)(e))}};function E$(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;p(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=rl.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,P$._)`${i}.length`);r.forEach((l,d)=>{(0,rl.alwaysValidSchema)(a,l)||(n.if((0,P$._)`${u} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function p(l){let{opts:d,errSchemaPath:f}=a,h=r.length,g=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(d.strictTuples&&!g){let y=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,rl.checkStrictMode)(a,y,d.strictTuples)}}}ya.validateTuple=E$;ya.default=d5});var C$=$(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var f5=Em(),h5={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,f5.validateTuple)(e,"items")};Cm.default=h5});var A$=$(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var T$=Y(),m5=le(),g5=dr(),y5=Pm(),_5={message:({params:{len:e}})=>(0,T$.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,T$._)`{limit: ${e}}`},v5={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_5,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,m5.alwaysValidSchema)(n,t)&&(o?(0,y5.validateAdditionalItems)(e,o):e.ok((0,g5.validateArray)(e)))}};Tm.default=v5});var R$=$(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var hr=Y(),nl=le(),w5={message:({params:{min:e,max:t}})=>t===void 0?(0,hr.str)`must contain at least ${e} valid item(s)`:(0,hr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,hr._)`{minContains: ${e}}`:(0,hr._)`{minContains: ${e}, maxContains: ${t}}`},b5={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:w5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let p=t.const("len",(0,hr._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,nl.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,nl.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,nl.alwaysValidSchema)(i,r)){let g=(0,hr._)`${p} >= ${s}`;a!==void 0&&(g=(0,hr._)`${g} && ${p} <= ${a}`),e.pass(g);return}i.items=!0;let l=t.name("valid");a===void 0&&s===1?f(l,()=>t.if(l,()=>t.break())):s===0?(t.let(l,!0),a!==void 0&&t.if((0,hr._)`${o}.length > 0`,d)):(t.let(l,!1),d()),e.result(l,()=>e.reset());function d(){let g=t.name("_valid"),y=t.let("count",0);f(g,()=>t.if(g,()=>h(y)))}function f(g,y){t.forRange("i",0,p,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:nl.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,hr._)`${g}++`),a===void 0?t.if((0,hr._)`${g} >= ${s}`,()=>t.assign(l,!0).break()):(t.if((0,hr._)`${g} > ${a}`,()=>t.assign(l,!1).break()),s===1?t.assign(l,!0):t.if((0,hr._)`${g} >= ${s}`,()=>t.assign(l,!0)))}}};Am.default=b5});var D$=$(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.validateSchemaDeps=Vr.validatePropertyDeps=Vr.error=void 0;var Rm=Y(),x5=le(),_a=dr();Vr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Rm.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Rm._)`{property: ${e},
|
|
77
77
|
missingProperty: ${n},
|
|
78
78
|
depsCount: ${t},
|
|
79
|
-
deps: ${r}}`};var k5={keyword:"dependencies",type:"object",schemaType:"object",error:Vr.error,code(e){let[t,r]=S5(e);I$(e,t),z$(e,r)}};function S5({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function I$(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,_a.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,_a.checkReportMissingProp)(e,u)}):(r.if((0,Rm._)`${c} && (${(0,_a.checkMissingProp)(e,a,i)})`),(0,_a.reportMissingProp)(e,i),r.else())}}Vr.validatePropertyDeps=I$;function z$(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,x5.alwaysValidSchema)(i,t[a])||(r.if((0,_a.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}Vr.validateSchemaDeps=z$;Vr.default=k5});var N$=$(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var O$=Y(),$5=le(),P5={message:"property name must be valid",params:({params:e})=>(0,O$._)`{propertyName: ${e.propertyName}}`},E5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:P5,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,$5.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,O$.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Im.default=E5});var Dm=$(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var ol=pr(),Tr=Y(),C5=mn(),il=le(),T5={message:"must NOT have additional properties",params:({params:e})=>(0,Tr._)`{additionalProperty: ${e.additionalProperty}}`},A5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,il.alwaysValidSchema)(s,r))return;let u=(0,ol.allSchemaProperties)(n.properties),p=(0,ol.allSchemaProperties)(n.patternProperties);l(),e.ok((0,Tr._)`${i} === ${C5.default.errors}`);function l(){t.forIn("key",o,y=>{!u.length&&!p.length?h(y):t.if(d(y),()=>h(y))})}function d(y){let v;if(u.length>8){let w=(0,il.schemaRefOrVal)(s,n.properties,"properties");v=(0,ol.isOwnProperty)(t,w,y)}else u.length?v=(0,Tr.or)(...u.map(w=>(0,Tr._)`${y} === ${w}`)):v=Tr.nil;return p.length&&(v=(0,Tr.or)(v,...p.map(w=>(0,Tr._)`${(0,ol.usePattern)(e,w)}.test(${y})`))),(0,Tr.not)(v)}function f(y){t.code((0,Tr._)`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,il.alwaysValidSchema)(s,r)){let v=t.name("valid");c.removeAdditional==="failing"?(g(y,v,!1),t.if((0,Tr.not)(v),()=>{e.reset(),f(y)})):(g(y,v),a||t.if((0,Tr.not)(v),()=>t.break()))}}function g(y,v,w){let x={keyword:"additionalProperties",dataProp:y,dataPropType:il.Type.Str};w===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,v)}}};zm.default=A5});var L$=$(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var R5=oa(),j$=pr(),Om=le(),M$=Dm(),I5={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&M$.default.code(new R5.KeywordCxt(i,M$.default,"additionalProperties"));let s=(0,j$.allSchemaProperties)(r);for(let l of s)i.definedProperties.add(l);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Om.mergeEvaluated.props(t,(0,Om.toHash)(s),i.props));let a=s.filter(l=>!(0,Om.alwaysValidSchema)(i,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a)u(l)?p(l):(t.if((0,j$.propertyInData)(t,o,l,i.opts.ownProperties)),p(l),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(l),e.ok(c);function u(l){return i.opts.useDefaults&&!i.compositeRule&&r[l].default!==void 0}function p(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Nm.default=I5});var F$=$(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var Z$=pr(),sl=Y(),U$=le(),q$=le(),z5={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Z$.allSchemaProperties)(r),c=a.filter(g=>(0,U$.alwaysValidSchema)(i,r[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof sl.Name)&&(i.props=(0,q$.evaluatedPropsToName)(t,i.props));let{props:l}=i;d();function d(){for(let g of a)u&&f(g),i.allErrors?h(g):(t.var(p,!0),h(g),t.if(p))}function f(g){for(let y in u)new RegExp(g).test(y)&&(0,U$.checkStrictMode)(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,sl._)`${(0,Z$.usePattern)(e,g)}.test(${y})`,()=>{let v=c.includes(g);v||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:q$.Type.Str},p),i.opts.unevaluated&&l!==!0?t.assign((0,sl._)`${l}[${y}]`,!0):!v&&!i.allErrors&&t.if((0,sl.not)(p),()=>t.break())})})}}};jm.default=z5});var G$=$(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var D5=le(),O5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,D5.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Mm.default=O5});var B$=$(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var N5=pr(),j5={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:N5.validateUnion,error:{message:"must match a schema in anyOf"}};Lm.default=j5});var V$=$(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var al=Y(),M5=le(),L5={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,al._)`{passingSchemas: ${e.passing}}`},Z5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:L5,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((p,l)=>{let d;(0,M5.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,al._)`${c} && ${s}`).assign(s,!1).assign(a,(0,al._)`[${a}, ${l}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,l),d&&e.mergeEvaluated(d,al.Name)})})}}};Zm.default=Z5});var H$=$(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var U5=le(),q5={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,U5.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Um.default=q5});var J$=$(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var cl=Y(),K$=le(),F5={message:({params:e})=>(0,cl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,cl._)`{failingKeyword: ${e.ifClause}}`},G5={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:F5,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,K$.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=W$(n,"then"),i=W$(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let p=t.let("ifClause");e.setParams({ifClause:p}),t.if(a,u("then",p),u("else",p))}else o?t.if(a,u("then")):t.if((0,cl.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(p)}function u(p,l){return()=>{let d=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(d,s),l?t.assign(l,(0,cl._)`${p}`):e.setParams({ifClause:p})}}}};function W$(e,t){let r=e.schema[t];return r!==void 0&&!(0,K$.alwaysValidSchema)(e,r)}qm.default=G5});var Y$=$(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});var B5=le(),V5={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,B5.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Fm.default=V5});var Q$=$(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var H5=Pm(),W5=C$(),K5=Em(),J5=A$(),Y5=R$(),Q5=D$(),X5=N$(),e9=Dm(),t9=L$(),r9=F$(),n9=G$(),o9=B$(),i9=V$(),s9=H$(),a9=J$(),c9=Y$();function u9(e=!1){let t=[n9.default,o9.default,i9.default,s9.default,a9.default,c9.default,X5.default,e9.default,Q5.default,t9.default,r9.default];return e?t.push(W5.default,J5.default):t.push(H5.default,K5.default),t.push(Y5.default),t}Gm.default=u9});var X$=$(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var Fe=Y(),l9={message:({schemaCode:e})=>(0,Fe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Fe._)`{format: ${e}}`},p9={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:l9,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:p,self:l}=a;if(!c.validateFormats)return;o?d():f();function d(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=r.const("fDef",(0,Fe._)`${h}[${s}]`),y=r.let("fType"),v=r.let("format");r.if((0,Fe._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Fe._)`${g}.type || "string"`).assign(v,(0,Fe._)`${g}.validate`),()=>r.assign(y,(0,Fe._)`"string"`).assign(v,g)),e.fail$data((0,Fe.or)(w(),x()));function w(){return c.strictSchema===!1?Fe.nil:(0,Fe._)`${s} && !${v}`}function x(){let k=p.$async?(0,Fe._)`(${g}.async ? await ${v}(${n}) : ${v}(${n}))`:(0,Fe._)`${v}(${n})`,P=(0,Fe._)`(typeof ${v} == "function" ? ${k} : ${v}.test(${n}))`;return(0,Fe._)`${v} && ${v} !== true && ${y} === ${t} && !${P}`}}function f(){let h=l.formats[i];if(!h){w();return}if(h===!0)return;let[g,y,v]=x(h);g===t&&e.pass(k());function w(){if(c.strictSchema===!1){l.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function x(P){let q=P instanceof RegExp?(0,Fe.regexpCode)(P):c.code.formats?(0,Fe._)`${c.code.formats}${(0,Fe.getProperty)(i)}`:void 0,L=r.scopeValue("formats",{key:i,ref:P,code:q});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,Fe._)`${L}.validate`]:["string",P,L]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Fe._)`await ${v}(${n})`}return typeof y=="function"?(0,Fe._)`${v}(${n})`:(0,Fe._)`${v}.test(${n})`}}}};Bm.default=p9});var e1=$(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var d9=X$(),f9=[d9.default];Vm.default=f9});var t1=$(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.contentVocabulary=Li.metadataVocabulary=void 0;Li.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Li.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var n1=$(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});var h9=l$(),m9=S$(),g9=Q$(),y9=e1(),r1=t1(),_9=[h9.default,m9.default,(0,g9.default)(),y9.default,r1.metadataVocabulary,r1.contentVocabulary];Hm.default=_9});var i1=$(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.DiscrError=void 0;var o1;(function(e){e.Tag="tag",e.Mapping="mapping"})(o1||(ul.DiscrError=o1={}))});var a1=$(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var Zi=Y(),Wm=i1(),s1=Gu(),v9=ia(),w9=le(),b9={message:({params:{discrError:e,tagName:t}})=>e===Wm.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Zi._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},x9={keyword:"discriminator",type:"object",schemaType:"object",error:b9,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,Zi._)`${r}${(0,Zi.getProperty)(a)}`);t.if((0,Zi._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Wm.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function p(){let f=d();t.if(!1);for(let h in f)t.elseIf((0,Zi._)`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:Wm.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(g,Zi.Name),h}function d(){var f;let h={},g=v(o),y=!0;for(let k=0;k<s.length;k++){let P=s[k];if(P?.$ref&&!(0,w9.schemaHasRulesButRef)(P,i.self.RULES)){let L=P.$ref;if(P=s1.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,L),P instanceof s1.SchemaEnv&&(P=P.schema),P===void 0)throw new v9.default(i.opts.uriResolver,i.baseId,L)}let q=(f=P?.properties)===null||f===void 0?void 0:f[a];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||v(P)),w(q,k)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return h;function v({required:k}){return Array.isArray(k)&&k.includes(a)}function w(k,P){if(k.const)x(k.const,P);else if(k.enum)for(let q of k.enum)x(q,P);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(k,P){if(typeof k!="string"||k in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[k]=P}}}};Km.default=x9});var c1=$((eY,k9)=>{k9.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ym=$((Ae,Jm)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.MissingRefError=Ae.ValidationError=Ae.CodeGen=Ae.Name=Ae.nil=Ae.stringify=Ae.str=Ae._=Ae.KeywordCxt=Ae.Ajv=void 0;var S9=o$(),$9=n1(),P9=a1(),u1=c1(),E9=["/properties"],ll="http://json-schema.org/draft-07/schema",Ui=class extends S9.default{_addVocabularies(){super._addVocabularies(),$9.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(P9.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(u1,E9):u1;this.addMetaSchema(t,ll,!1),this.refs["http://json-schema.org/schema"]=ll}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ll)?ll:void 0)}};Ae.Ajv=Ui;Jm.exports=Ae=Ui;Jm.exports.Ajv=Ui;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.default=Ui;var C9=oa();Object.defineProperty(Ae,"KeywordCxt",{enumerable:!0,get:function(){return C9.KeywordCxt}});var qi=Y();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return qi._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return qi.str}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return qi.stringify}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return qi.nil}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return qi.Name}});Object.defineProperty(Ae,"CodeGen",{enumerable:!0,get:function(){return qi.CodeGen}});var T9=qu();Object.defineProperty(Ae,"ValidationError",{enumerable:!0,get:function(){return T9.default}});var A9=ia();Object.defineProperty(Ae,"MissingRefError",{enumerable:!0,get:function(){return A9.default}})});var y1=$(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.formatNames=Wr.fastFormats=Wr.fullFormats=void 0;function Hr(e,t){return{validate:e,compare:t}}Wr.fullFormats={date:Hr(f1,tg),time:Hr(Xm(!0),rg),"date-time":Hr(l1(!0),m1),"iso-time":Hr(Xm(),h1),"iso-date-time":Hr(l1(),g1),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:N9,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F9,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j9,int32:{type:"number",validate:Z9},int64:{type:"number",validate:U9},float:{type:"number",validate:d1},double:{type:"number",validate:d1},password:!0,binary:!0};Wr.fastFormats={...Wr.fullFormats,date:Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,tg),time:Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,rg),"date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m1),"iso-time":Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h1),"iso-date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g1),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Wr.formatNames=Object.keys(Wr.fullFormats);function R9(e){return e%4===0&&(e%100!==0||e%400===0)}var I9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,z9=[0,31,28,31,30,31,30,31,31,30,31,30,31];function f1(e){let t=I9.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&R9(r)?29:z9[n])}function tg(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Qm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Xm(e){return function(r){let n=Qm.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),p=+(n[7]||0);if(u>23||p>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let l=i-p*c,d=o-u*c-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&s<61}}function rg(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function h1(e,t){if(!(e&&t))return;let r=Qm.exec(e),n=Qm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var eg=/t|\s/i;function l1(e){let t=Xm(e);return function(n){let o=n.split(eg);return o.length===2&&f1(o[0])&&t(o[1])}}function m1(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function g1(e,t){if(!(e&&t))return;let[r,n]=e.split(eg),[o,i]=t.split(eg),s=tg(r,o);if(s!==void 0)return s||rg(n,i)}var D9=/\/|:/,O9=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function N9(e){return D9.test(e)&&O9.test(e)}var p1=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j9(e){return p1.lastIndex=0,p1.test(e)}var M9=-(2**31),L9=2**31-1;function Z9(e){return Number.isInteger(e)&&e<=L9&&e>=M9}function U9(e){return Number.isInteger(e)}function d1(){return!0}var q9=/[^\\]\\Z/;function F9(e){if(q9.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var _1=$(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.formatLimitDefinition=void 0;var G9=Ym(),Ar=Y(),Kn=Ar.operators,pl={formatMaximum:{okStr:"<=",ok:Kn.LTE,fail:Kn.GT},formatMinimum:{okStr:">=",ok:Kn.GTE,fail:Kn.LT},formatExclusiveMaximum:{okStr:"<",ok:Kn.LT,fail:Kn.GTE},formatExclusiveMinimum:{okStr:">",ok:Kn.GT,fail:Kn.LTE}},B9={message:({keyword:e,schemaCode:t})=>(0,Ar.str)`should be ${pl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ar._)`{comparison: ${pl[e].okStr}, limit: ${t}}`};Fi.formatLimitDefinition={keyword:Object.keys(pl),type:"string",schemaType:"string",$data:!0,error:B9,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new G9.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():p();function u(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=t.const("fmt",(0,Ar._)`${d}[${c.schemaCode}]`);e.fail$data((0,Ar.or)((0,Ar._)`typeof ${f} != "object"`,(0,Ar._)`${f} instanceof RegExp`,(0,Ar._)`typeof ${f}.compare != "function"`,l(f)))}function p(){let d=c.schema,f=a.formats[d];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let h=t.scopeValue("formats",{key:d,ref:f,code:s.code.formats?(0,Ar._)`${s.code.formats}${(0,Ar.getProperty)(d)}`:void 0});e.fail$data(l(h))}function l(d){return(0,Ar._)`${d}.compare(${r}, ${n}) ${pl[o].fail} 0`}},dependencies:["format"]};var V9=e=>(e.addKeyword(Fi.formatLimitDefinition),e);Fi.default=V9});var x1=$((va,b1)=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var Gi=y1(),H9=_1(),ng=Y(),v1=new ng.Name("fullFormats"),W9=new ng.Name("fastFormats"),og=(e,t={keywords:!0})=>{if(Array.isArray(t))return w1(e,t,Gi.fullFormats,v1),e;let[r,n]=t.mode==="fast"?[Gi.fastFormats,W9]:[Gi.fullFormats,v1],o=t.formats||Gi.formatNames;return w1(e,o,r,n),t.keywords&&(0,H9.default)(e),e};og.get=(e,t="full")=>{let n=(t==="fast"?Gi.fastFormats:Gi.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function w1(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,ng._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}b1.exports=va=og;Object.defineProperty(va,"__esModule",{value:!0});va.default=og});function K9(){let e=new k1.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,S1.default)(e),e}var k1,S1,Bi,ig=b(()=>{k1=yt(Ym(),1),S1=yt(x1(),1);Bi=class{constructor(t){this._ajv=t??K9()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var dl,$1=b(()=>{dl=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}}});function P1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function E1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var C1=b(()=>{});var fl,T1=b(()=>{jk();An();ig();_u();$1();C1();fl=class extends Tu{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(zs.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Bi,this.setRequestHandler(qd,n=>this._oninitialize(n)),this.setNotificationHandler(Zc,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(ef,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=zs.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new dl(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Nk(this._capabilities,t)}setRequestHandler(t,r){let o=yu(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Oo(o)){let a=o;i=a._zod?.def?.value??a.value}else{let a=o;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let p=Ln(Is,c);if(!p.success){let h=p.error instanceof Error?p.error.message:String(p.error);throw new V(ee.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:l}=p.data,d=await Promise.resolve(r(c,u));if(l.task){let h=Ln(di,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new V(ee.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=Ln(Kc,d);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new V(ee.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){E1(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&P1(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:Qb.includes(r)?r:li,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Mc)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],i=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(l=>l.type==="tool_use").map(l=>l.id)),p=new Set(o.filter(l=>l.type==="tool_result").map(l=>l.toolUseId));if(u.size!==p.size||![...u].every(l=>p.has(l)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},rf,r):this.request({method:"sampling/createMessage",params:t},tf,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=t;return this.request({method:"elicitation/create",params:o},Jc,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:o},Jc,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new V(ee.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof V?s:new V(ee.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},nf,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function J9(){let e=process.env.GODD_CONFIG;if(!e)throw new Error(`GODD_CONFIG \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${Kt} \u306E\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return e}function Y9(e){let t;try{t=br.load(e)}catch{return e}if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t;return typeof r.license_key=="string"&&r.license_key.length>0&&(r.license_key="****"),br.dump(r,{lineWidth:-1,quotingType:'"'})}return e}function R1(e){if(!(0,Jt.existsSync)(e))return{};let t={};try{let r=(0,Jt.readFileSync)(e,"utf-8");for(let n of r.split(`
|
|
79
|
+
deps: ${r}}`};var k5={keyword:"dependencies",type:"object",schemaType:"object",error:Vr.error,code(e){let[t,r]=S5(e);I$(e,t),z$(e,r)}};function S5({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function I$(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,_a.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,_a.checkReportMissingProp)(e,u)}):(r.if((0,Rm._)`${c} && (${(0,_a.checkMissingProp)(e,a,i)})`),(0,_a.reportMissingProp)(e,i),r.else())}}Vr.validatePropertyDeps=I$;function z$(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,x5.alwaysValidSchema)(i,t[a])||(r.if((0,_a.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}Vr.validateSchemaDeps=z$;Vr.default=k5});var N$=$(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var O$=Y(),$5=le(),P5={message:"property name must be valid",params:({params:e})=>(0,O$._)`{propertyName: ${e.propertyName}}`},E5={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:P5,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,$5.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,O$.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Im.default=E5});var Dm=$(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var ol=dr(),Tr=Y(),C5=gn(),il=le(),T5={message:"must NOT have additional properties",params:({params:e})=>(0,Tr._)`{additionalProperty: ${e.additionalProperty}}`},A5={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T5,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,il.alwaysValidSchema)(s,r))return;let u=(0,ol.allSchemaProperties)(n.properties),p=(0,ol.allSchemaProperties)(n.patternProperties);l(),e.ok((0,Tr._)`${i} === ${C5.default.errors}`);function l(){t.forIn("key",o,y=>{!u.length&&!p.length?h(y):t.if(d(y),()=>h(y))})}function d(y){let v;if(u.length>8){let w=(0,il.schemaRefOrVal)(s,n.properties,"properties");v=(0,ol.isOwnProperty)(t,w,y)}else u.length?v=(0,Tr.or)(...u.map(w=>(0,Tr._)`${y} === ${w}`)):v=Tr.nil;return p.length&&(v=(0,Tr.or)(v,...p.map(w=>(0,Tr._)`${(0,ol.usePattern)(e,w)}.test(${y})`))),(0,Tr.not)(v)}function f(y){t.code((0,Tr._)`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,il.alwaysValidSchema)(s,r)){let v=t.name("valid");c.removeAdditional==="failing"?(g(y,v,!1),t.if((0,Tr.not)(v),()=>{e.reset(),f(y)})):(g(y,v),a||t.if((0,Tr.not)(v),()=>t.break()))}}function g(y,v,w){let x={keyword:"additionalProperties",dataProp:y,dataPropType:il.Type.Str};w===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,v)}}};zm.default=A5});var L$=$(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var R5=oa(),j$=dr(),Om=le(),M$=Dm(),I5={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&M$.default.code(new R5.KeywordCxt(i,M$.default,"additionalProperties"));let s=(0,j$.allSchemaProperties)(r);for(let l of s)i.definedProperties.add(l);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Om.mergeEvaluated.props(t,(0,Om.toHash)(s),i.props));let a=s.filter(l=>!(0,Om.alwaysValidSchema)(i,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a)u(l)?p(l):(t.if((0,j$.propertyInData)(t,o,l,i.opts.ownProperties)),p(l),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(l),e.ok(c);function u(l){return i.opts.useDefaults&&!i.compositeRule&&r[l].default!==void 0}function p(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Nm.default=I5});var F$=$(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var Z$=dr(),sl=Y(),U$=le(),q$=le(),z5={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Z$.allSchemaProperties)(r),c=a.filter(g=>(0,U$.alwaysValidSchema)(i,r[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof sl.Name)&&(i.props=(0,q$.evaluatedPropsToName)(t,i.props));let{props:l}=i;d();function d(){for(let g of a)u&&f(g),i.allErrors?h(g):(t.var(p,!0),h(g),t.if(p))}function f(g){for(let y in u)new RegExp(g).test(y)&&(0,U$.checkStrictMode)(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,sl._)`${(0,Z$.usePattern)(e,g)}.test(${y})`,()=>{let v=c.includes(g);v||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:q$.Type.Str},p),i.opts.unevaluated&&l!==!0?t.assign((0,sl._)`${l}[${y}]`,!0):!v&&!i.allErrors&&t.if((0,sl.not)(p),()=>t.break())})})}}};jm.default=z5});var G$=$(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var D5=le(),O5={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,D5.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Mm.default=O5});var B$=$(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var N5=dr(),j5={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:N5.validateUnion,error:{message:"must match a schema in anyOf"}};Lm.default=j5});var V$=$(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var al=Y(),M5=le(),L5={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,al._)`{passingSchemas: ${e.passing}}`},Z5={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:L5,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((p,l)=>{let d;(0,M5.alwaysValidSchema)(o,p)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,al._)`${c} && ${s}`).assign(s,!1).assign(a,(0,al._)`[${a}, ${l}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,l),d&&e.mergeEvaluated(d,al.Name)})})}}};Zm.default=Z5});var H$=$(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});var U5=le(),q5={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,U5.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Um.default=q5});var J$=$(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var cl=Y(),K$=le(),F5={message:({params:e})=>(0,cl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,cl._)`{failingKeyword: ${e.ifClause}}`},G5={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:F5,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,K$.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=W$(n,"then"),i=W$(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let p=t.let("ifClause");e.setParams({ifClause:p}),t.if(a,u("then",p),u("else",p))}else o?t.if(a,u("then")):t.if((0,cl.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(p)}function u(p,l){return()=>{let d=e.subschema({keyword:p},a);t.assign(s,a),e.mergeValidEvaluated(d,s),l?t.assign(l,(0,cl._)`${p}`):e.setParams({ifClause:p})}}}};function W$(e,t){let r=e.schema[t];return r!==void 0&&!(0,K$.alwaysValidSchema)(e,r)}qm.default=G5});var Y$=$(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});var B5=le(),V5={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,B5.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Fm.default=V5});var Q$=$(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var H5=Pm(),W5=C$(),K5=Em(),J5=A$(),Y5=R$(),Q5=D$(),X5=N$(),e9=Dm(),t9=L$(),r9=F$(),n9=G$(),o9=B$(),i9=V$(),s9=H$(),a9=J$(),c9=Y$();function u9(e=!1){let t=[n9.default,o9.default,i9.default,s9.default,a9.default,c9.default,X5.default,e9.default,Q5.default,t9.default,r9.default];return e?t.push(W5.default,J5.default):t.push(H5.default,K5.default),t.push(Y5.default),t}Gm.default=u9});var X$=$(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var Fe=Y(),l9={message:({schemaCode:e})=>(0,Fe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Fe._)`{format: ${e}}`},p9={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:l9,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:p,self:l}=a;if(!c.validateFormats)return;o?d():f();function d(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=r.const("fDef",(0,Fe._)`${h}[${s}]`),y=r.let("fType"),v=r.let("format");r.if((0,Fe._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Fe._)`${g}.type || "string"`).assign(v,(0,Fe._)`${g}.validate`),()=>r.assign(y,(0,Fe._)`"string"`).assign(v,g)),e.fail$data((0,Fe.or)(w(),x()));function w(){return c.strictSchema===!1?Fe.nil:(0,Fe._)`${s} && !${v}`}function x(){let k=p.$async?(0,Fe._)`(${g}.async ? await ${v}(${n}) : ${v}(${n}))`:(0,Fe._)`${v}(${n})`,P=(0,Fe._)`(typeof ${v} == "function" ? ${k} : ${v}.test(${n}))`;return(0,Fe._)`${v} && ${v} !== true && ${y} === ${t} && !${P}`}}function f(){let h=l.formats[i];if(!h){w();return}if(h===!0)return;let[g,y,v]=x(h);g===t&&e.pass(k());function w(){if(c.strictSchema===!1){l.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function x(P){let q=P instanceof RegExp?(0,Fe.regexpCode)(P):c.code.formats?(0,Fe._)`${c.code.formats}${(0,Fe.getProperty)(i)}`:void 0,L=r.scopeValue("formats",{key:i,ref:P,code:q});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,Fe._)`${L}.validate`]:["string",P,L]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Fe._)`await ${v}(${n})`}return typeof y=="function"?(0,Fe._)`${v}(${n})`:(0,Fe._)`${v}.test(${n})`}}}};Bm.default=p9});var e1=$(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var d9=X$(),f9=[d9.default];Vm.default=f9});var t1=$(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.contentVocabulary=Li.metadataVocabulary=void 0;Li.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Li.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var n1=$(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});var h9=l$(),m9=S$(),g9=Q$(),y9=e1(),r1=t1(),_9=[h9.default,m9.default,(0,g9.default)(),y9.default,r1.metadataVocabulary,r1.contentVocabulary];Hm.default=_9});var i1=$(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.DiscrError=void 0;var o1;(function(e){e.Tag="tag",e.Mapping="mapping"})(o1||(ul.DiscrError=o1={}))});var a1=$(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var Zi=Y(),Wm=i1(),s1=Gu(),v9=ia(),w9=le(),b9={message:({params:{discrError:e,tagName:t}})=>e===Wm.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Zi._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},x9={keyword:"discriminator",type:"object",schemaType:"object",error:b9,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,Zi._)`${r}${(0,Zi.getProperty)(a)}`);t.if((0,Zi._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Wm.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function p(){let f=d();t.if(!1);for(let h in f)t.elseIf((0,Zi._)`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:Wm.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(g,Zi.Name),h}function d(){var f;let h={},g=v(o),y=!0;for(let k=0;k<s.length;k++){let P=s[k];if(P?.$ref&&!(0,w9.schemaHasRulesButRef)(P,i.self.RULES)){let L=P.$ref;if(P=s1.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,L),P instanceof s1.SchemaEnv&&(P=P.schema),P===void 0)throw new v9.default(i.opts.uriResolver,i.baseId,L)}let q=(f=P?.properties)===null||f===void 0?void 0:f[a];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||v(P)),w(q,k)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return h;function v({required:k}){return Array.isArray(k)&&k.includes(a)}function w(k,P){if(k.const)x(k.const,P);else if(k.enum)for(let q of k.enum)x(q,P);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(k,P){if(typeof k!="string"||k in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[k]=P}}}};Km.default=x9});var c1=$((tY,k9)=>{k9.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Ym=$((Ae,Jm)=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.MissingRefError=Ae.ValidationError=Ae.CodeGen=Ae.Name=Ae.nil=Ae.stringify=Ae.str=Ae._=Ae.KeywordCxt=Ae.Ajv=void 0;var S9=o$(),$9=n1(),P9=a1(),u1=c1(),E9=["/properties"],ll="http://json-schema.org/draft-07/schema",Ui=class extends S9.default{_addVocabularies(){super._addVocabularies(),$9.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(P9.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(u1,E9):u1;this.addMetaSchema(t,ll,!1),this.refs["http://json-schema.org/schema"]=ll}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ll)?ll:void 0)}};Ae.Ajv=Ui;Jm.exports=Ae=Ui;Jm.exports.Ajv=Ui;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.default=Ui;var C9=oa();Object.defineProperty(Ae,"KeywordCxt",{enumerable:!0,get:function(){return C9.KeywordCxt}});var qi=Y();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return qi._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return qi.str}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return qi.stringify}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return qi.nil}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return qi.Name}});Object.defineProperty(Ae,"CodeGen",{enumerable:!0,get:function(){return qi.CodeGen}});var T9=qu();Object.defineProperty(Ae,"ValidationError",{enumerable:!0,get:function(){return T9.default}});var A9=ia();Object.defineProperty(Ae,"MissingRefError",{enumerable:!0,get:function(){return A9.default}})});var y1=$(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.formatNames=Wr.fastFormats=Wr.fullFormats=void 0;function Hr(e,t){return{validate:e,compare:t}}Wr.fullFormats={date:Hr(f1,tg),time:Hr(Xm(!0),rg),"date-time":Hr(l1(!0),m1),"iso-time":Hr(Xm(),h1),"iso-date-time":Hr(l1(),g1),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:N9,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F9,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j9,int32:{type:"number",validate:Z9},int64:{type:"number",validate:U9},float:{type:"number",validate:d1},double:{type:"number",validate:d1},password:!0,binary:!0};Wr.fastFormats={...Wr.fullFormats,date:Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,tg),time:Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,rg),"date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,m1),"iso-time":Hr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h1),"iso-date-time":Hr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g1),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Wr.formatNames=Object.keys(Wr.fullFormats);function R9(e){return e%4===0&&(e%100!==0||e%400===0)}var I9=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,z9=[0,31,28,31,30,31,30,31,31,30,31,30,31];function f1(e){let t=I9.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&R9(r)?29:z9[n])}function tg(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Qm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Xm(e){return function(r){let n=Qm.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),p=+(n[7]||0);if(u>23||p>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let l=i-p*c,d=o-u*c-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&s<61}}function rg(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function h1(e,t){if(!(e&&t))return;let r=Qm.exec(e),n=Qm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var eg=/t|\s/i;function l1(e){let t=Xm(e);return function(n){let o=n.split(eg);return o.length===2&&f1(o[0])&&t(o[1])}}function m1(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function g1(e,t){if(!(e&&t))return;let[r,n]=e.split(eg),[o,i]=t.split(eg),s=tg(r,o);if(s!==void 0)return s||rg(n,i)}var D9=/\/|:/,O9=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function N9(e){return D9.test(e)&&O9.test(e)}var p1=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j9(e){return p1.lastIndex=0,p1.test(e)}var M9=-(2**31),L9=2**31-1;function Z9(e){return Number.isInteger(e)&&e<=L9&&e>=M9}function U9(e){return Number.isInteger(e)}function d1(){return!0}var q9=/[^\\]\\Z/;function F9(e){if(q9.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var _1=$(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.formatLimitDefinition=void 0;var G9=Ym(),Ar=Y(),Jn=Ar.operators,pl={formatMaximum:{okStr:"<=",ok:Jn.LTE,fail:Jn.GT},formatMinimum:{okStr:">=",ok:Jn.GTE,fail:Jn.LT},formatExclusiveMaximum:{okStr:"<",ok:Jn.LT,fail:Jn.GTE},formatExclusiveMinimum:{okStr:">",ok:Jn.GT,fail:Jn.LTE}},B9={message:({keyword:e,schemaCode:t})=>(0,Ar.str)`should be ${pl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ar._)`{comparison: ${pl[e].okStr}, limit: ${t}}`};Fi.formatLimitDefinition={keyword:Object.keys(pl),type:"string",schemaType:"string",$data:!0,error:B9,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new G9.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():p();function u(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=t.const("fmt",(0,Ar._)`${d}[${c.schemaCode}]`);e.fail$data((0,Ar.or)((0,Ar._)`typeof ${f} != "object"`,(0,Ar._)`${f} instanceof RegExp`,(0,Ar._)`typeof ${f}.compare != "function"`,l(f)))}function p(){let d=c.schema,f=a.formats[d];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let h=t.scopeValue("formats",{key:d,ref:f,code:s.code.formats?(0,Ar._)`${s.code.formats}${(0,Ar.getProperty)(d)}`:void 0});e.fail$data(l(h))}function l(d){return(0,Ar._)`${d}.compare(${r}, ${n}) ${pl[o].fail} 0`}},dependencies:["format"]};var V9=e=>(e.addKeyword(Fi.formatLimitDefinition),e);Fi.default=V9});var x1=$((va,b1)=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var Gi=y1(),H9=_1(),ng=Y(),v1=new ng.Name("fullFormats"),W9=new ng.Name("fastFormats"),og=(e,t={keywords:!0})=>{if(Array.isArray(t))return w1(e,t,Gi.fullFormats,v1),e;let[r,n]=t.mode==="fast"?[Gi.fastFormats,W9]:[Gi.fullFormats,v1],o=t.formats||Gi.formatNames;return w1(e,o,r,n),t.keywords&&(0,H9.default)(e),e};og.get=(e,t="full")=>{let n=(t==="fast"?Gi.fastFormats:Gi.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function w1(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,ng._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}b1.exports=va=og;Object.defineProperty(va,"__esModule",{value:!0});va.default=og});function K9(){let e=new k1.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,S1.default)(e),e}var k1,S1,Bi,ig=b(()=>{k1=yt(Ym(),1),S1=yt(x1(),1);Bi=class{constructor(t){this._ajv=t??K9()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var dl,$1=b(()=>{dl=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}}});function P1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function E1(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var C1=b(()=>{});var fl,T1=b(()=>{jk();Rn();ig();_u();$1();C1();fl=class extends Tu{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(zs.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Bi,this.setRequestHandler(qd,n=>this._oninitialize(n)),this.setNotificationHandler(Zc,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(ef,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=zs.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new dl(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Nk(this._capabilities,t)}setRequestHandler(t,r){let o=yu(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Oo(o)){let a=o;i=a._zod?.def?.value??a.value}else{let a=o;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let p=Zn(Is,c);if(!p.success){let h=p.error instanceof Error?p.error.message:String(p.error);throw new V(ee.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:l}=p.data,d=await Promise.resolve(r(c,u));if(l.task){let h=Zn(di,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new V(ee.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=Zn(Kc,d);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new V(ee.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){E1(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&P1(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:Qb.includes(r)?r:li,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Mc)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],i=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(l=>l.type==="tool_use").map(l=>l.id)),p=new Set(o.filter(l=>l.type==="tool_result").map(l=>l.toolUseId));if(u.size!==p.size||![...u].every(l=>p.has(l)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},rf,r):this.request({method:"sampling/createMessage",params:t},tf,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=t;return this.request({method:"elicitation/create",params:o},Jc,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:o},Jc,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new V(ee.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof V?s:new V(ee.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},nf,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function J9(){let e=process.env.GODD_CONFIG;if(!e)throw new Error(`GODD_CONFIG \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${Kt} \u306E\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return e}function Y9(e){let t;try{t=br.load(e)}catch{return e}if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let r=t;return typeof r.license_key=="string"&&r.license_key.length>0&&(r.license_key="****"),br.dump(r,{lineWidth:-1,quotingType:'"'})}return e}function R1(e){if(!(0,Jt.existsSync)(e))return{};let t={};try{let r=(0,Jt.readFileSync)(e,"utf-8");for(let n of r.split(`
|
|
80
80
|
`)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim();if(!A1.has(s))continue;let a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),t[s]=a}}catch{}return t}function Q9(e,t){let r=[];if((0,Jt.existsSync)(e)){let a=(0,Jt.readFileSync)(e,"utf-8");for(let c of a.split(`
|
|
81
81
|
`)){let u=c.trim(),p=u.indexOf("="),l=p>0?u.slice(0,p).trim():"";A1.has(l)||r.push(c)}for(;r.length>0&&r[r.length-1].trim()==="";)r.pop()}let o={...R1(e),...t},i=["","# GoDD MCP Server (managed by godd init)"];o.GODD_LICENSE_KEY&&i.push(`GODD_LICENSE_KEY="${o.GODD_LICENSE_KEY}"`),o.GODD_LANGUAGE&&i.push(`GODD_LANGUAGE="${o.GODD_LANGUAGE}"`),o.GODD_REGISTRY_URL&&i.push(`GODD_REGISTRY_URL="${o.GODD_REGISTRY_URL}"`),i.push("");let s=[...r,...i].join(`
|
|
82
82
|
`);(0,Jt.writeFileSync)(e,s,"utf-8")}function I1(e){let t=J9(),r=(0,hl.join)((0,hl.dirname)(t),".env");if(e.action==="show"){let s=[`## GoDD \u8A2D\u5B9A
|
|
@@ -112,17 +112,17 @@ ${s instanceof Error?s.message:String(s)}`}return`## \u8A2D\u5B9A\u3092\u66F4\u6
|
|
|
112
112
|
${i.map(s=>`- ${s}`).join(`
|
|
113
113
|
`)}
|
|
114
114
|
|
|
115
|
-
\u26A0 MCP \u30B5\u30FC\u30D0\u30FC\u306E\u518D\u8D77\u52D5\u304C\u5FC5\u8981\u3067\u3059\uFF08Cursor IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002`}var Jt,hl,sg,ag,cg,A1,z1=b(()=>{"use strict";tt();Jt=require("node:fs"),hl=require("node:path");Ls();
|
|
116
|
-
${a}`:""}`)}pg.set(r,{verified:!0,verifiedAt:Date.now()})}function eZ(e){if(e){let t=pg.get(e);return t?Date.now()-t.verifiedAt<L1:!1}for(let t of pg.values())if(Date.now()-t.verifiedAt<L1)return!0;return!1}async function Z1(e,t){let r=wa();r&&eZ(r)||await X9(e,t)}var L1,lg,pg,U1=b(()=>{"use strict";ug();Kr();L1=3600*1e3,lg=class extends Error{constructor(r,n){super(n);this.status=r}},pg=new Map});var Dt=$(Yt=>{"use strict";Yt.__esModule=!0;Yt.extend=q1;Yt.indexOf=iZ;Yt.escapeExpression=sZ;Yt.isEmpty=aZ;Yt.createFrame=cZ;Yt.blockParams=uZ;Yt.appendContextPath=lZ;var tZ={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},rZ=/[&<>"'`=]/g,nZ=/[&<>"'`=]/;function oZ(e){return tZ[e]}function q1(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&(e[r]=arguments[t][r]);return e}var fg=Object.prototype.toString;Yt.toString=fg;var dg=function(t){return typeof t=="function"};dg(/x/)&&(Yt.isFunction=dg=function(e){return typeof e=="function"&&fg.call(e)==="[object Function]"});Yt.isFunction=dg;var F1=Array.isArray||function(e){return e&&typeof e=="object"?fg.call(e)==="[object Array]":!1};Yt.isArray=F1;function iZ(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function sZ(e){if(typeof e!="string"){if(e&&e.toHTML)return e.toHTML();if(e==null)return"";if(!e)return e+"";e=""+e}return nZ.test(e)?e.replace(rZ,oZ):e}function aZ(e){return!e&&e!==0?!0:!!(F1(e)&&e.length===0)}function cZ(e){var t=q1({},e);return t._parent=e,t}function uZ(e,t){return e.path=t,e}function lZ(e,t){return(e?e+".":"")+t}});var
|
|
115
|
+
\u26A0 MCP \u30B5\u30FC\u30D0\u30FC\u306E\u518D\u8D77\u52D5\u304C\u5FC5\u8981\u3067\u3059\uFF08Cursor IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002`}var Jt,hl,sg,ag,cg,A1,z1=b(()=>{"use strict";tt();Jt=require("node:fs"),hl=require("node:path");Ls();Ln();sg="godd-config",ag="GoDD \u8A2D\u5B9A\u306E\u8868\u793A\u30FB\u66F4\u65B0\u3092\u884C\u3044\u307E\u3059\u3002show \u3067\u73FE\u5728\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3001update \u3067\u6307\u5B9A\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002components \u306F config.godd\u3001license_key/language/registry_url \u306F .env \u306B\u4FDD\u5B58\u3055\u308C\u307E\u3059\u3002",cg=m.object({action:m.enum(["show","update"]).describe("show=\u73FE\u5728\u306E\u8A2D\u5B9A\u3092\u8868\u793A, update=\u8A2D\u5B9A\u3092\u66F4\u65B0"),license_key:m.string().min(1,"license_key \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08.env \u306E GODD_LICENSE_KEY \u3092\u66F4\u65B0\uFF09"),components:m.array(m.string().min(1).max(1e3)).min(1,"components \u306F\u7A7A\u914D\u5217\u306B\u3067\u304D\u307E\u305B\u3093").optional().describe("\u66F4\u65B0\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u914D\u5217\uFF08config.godd \u3092\u66F4\u65B0\uFF09"),language:m.string().min(1,"language \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B\u8A00\u8A9E\uFF08.env \u306E GODD_LANGUAGE \u3092\u66F4\u65B0\uFF09"),registry_url:m.string().min(1,"registry_url \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").url("registry_url \u306F\u6709\u52B9\u306A URL \u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093").max(1e3).optional().describe("\u66F4\u65B0\u3059\u308B Registry URL\uFF08.env \u306E GODD_REGISTRY_URL \u3092\u66F4\u65B0\uFF09")});A1=new Set(["GODD_LICENSE_KEY","GODD_LANGUAGE","GODD_REGISTRY_URL"])});function wa(e){let t=e??process.cwd();try{let r=(0,D1.execSync)("git config --get remote.origin.url",{encoding:"utf-8",cwd:t,timeout:5e3}).trim();if(r)return r}catch{}try{let r=(0,O1.join)(t,".git","config");return(0,ml.existsSync)(r)?(0,ml.readFileSync)(r,"utf-8").match(/\[remote\s+"origin"\][^[]*url\s*=\s*(.+)/)?.[1]?.trim()??null:null}catch{return null}}var D1,ml,O1,ug=b(()=>{"use strict";D1=require("node:child_process"),ml=require("node:fs"),O1=require("node:path")});function j1(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function M1(e){return e.trim().startsWith("goddt-")?"device_token":"license_key"}function nt(e,t,r){return e===401&&t.includes("Device token has been revoked")?"\u3053\u306E\u7AEF\u672B\u306E\u30ED\u30B0\u30A4\u30F3\u306F\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\uFF08\u7BA1\u7406\u753B\u9762\u3067\u5931\u52B9\u3055\u308C\u305F\u304B\u3001\u30ED\u30B0\u30A2\u30A6\u30C8\u6E08\u307F\u3067\u3059\uFF09\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+N1:e===401&&r==="device_token"?`godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u304C Registry \u3067\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002${N1}`:e===403&&t.includes("License has expired")?"\u30E9\u30A4\u30BB\u30F3\u30B9\u307E\u305F\u306F\u30ED\u30B0\u30A4\u30F3\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u3044\u308B\u5834\u5408\u3084\u3001\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u3066\u3082\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F\u7BA1\u7406\u8005\u306B\u671F\u9650\u306E\u5EF6\u9577\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403&&t.includes("License is suspended")?"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002":null}var N1,Kr=b(()=>{"use strict";N1="\u5225\u306E\u30BF\u30FC\u30DF\u30CA\u30EB\u3067 godd login \u3057\u76F4\u3057\u305F\u76F4\u5F8C\u306A\u3089\u3001MCP \u30B5\u30FC\u30D0\u30FC\uFF08IDE / Claude Code / Codex\uFF09\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53E4\u3044\u30ED\u30B0\u30A4\u30F3\u306F\u5931\u52B9\u3057\u3066\u3044\u307E\u3059\uFF09\u3002"});async function X9(e,t){let r=wa();if(!r)throw new Error("Git \u30EA\u30E2\u30FC\u30C8 (origin) \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002godd init \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let n=await fetch(`${e}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({remote_url:r}),signal:AbortSignal.timeout(1e4)});if(!n.ok){let i=(await n.json().catch(()=>({detail:n.statusText}))).detail,s=typeof i=="string"?i:i!=null?JSON.stringify(i):n.statusText,a=nt(n.status,s,M1(t));throw new lg(n.status,`\u30EA\u30DD\u30B8\u30C8\u30EA\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${s}${a?`
|
|
116
|
+
${a}`:""}`)}pg.set(r,{verified:!0,verifiedAt:Date.now()})}function eZ(e){if(e){let t=pg.get(e);return t?Date.now()-t.verifiedAt<L1:!1}for(let t of pg.values())if(Date.now()-t.verifiedAt<L1)return!0;return!1}async function Z1(e,t){let r=wa();r&&eZ(r)||await X9(e,t)}var L1,lg,pg,U1=b(()=>{"use strict";ug();Kr();L1=3600*1e3,lg=class extends Error{constructor(r,n){super(n);this.status=r}},pg=new Map});var Dt=$(Yt=>{"use strict";Yt.__esModule=!0;Yt.extend=q1;Yt.indexOf=iZ;Yt.escapeExpression=sZ;Yt.isEmpty=aZ;Yt.createFrame=cZ;Yt.blockParams=uZ;Yt.appendContextPath=lZ;var tZ={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},rZ=/[&<>"'`=]/g,nZ=/[&<>"'`=]/;function oZ(e){return tZ[e]}function q1(e){for(var t=1;t<arguments.length;t++)for(var r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&(e[r]=arguments[t][r]);return e}var fg=Object.prototype.toString;Yt.toString=fg;var dg=function(t){return typeof t=="function"};dg(/x/)&&(Yt.isFunction=dg=function(e){return typeof e=="function"&&fg.call(e)==="[object Function]"});Yt.isFunction=dg;var F1=Array.isArray||function(e){return e&&typeof e=="object"?fg.call(e)==="[object Array]":!1};Yt.isArray=F1;function iZ(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function sZ(e){if(typeof e!="string"){if(e&&e.toHTML)return e.toHTML();if(e==null)return"";if(!e)return e+"";e=""+e}return nZ.test(e)?e.replace(rZ,oZ):e}function aZ(e){return!e&&e!==0?!0:!!(F1(e)&&e.length===0)}function cZ(e){var t=q1({},e);return t._parent=e,t}function uZ(e,t){return e.path=t,e}function lZ(e,t){return(e?e+".":"")+t}});var mr=$((gl,G1)=>{"use strict";gl.__esModule=!0;var hg=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function mg(e,t){var r=t&&t.loc,n=void 0,o=void 0,i=void 0,s=void 0;r&&(n=r.start.line,o=r.end.line,i=r.start.column,s=r.end.column,e+=" - "+n+":"+i);for(var a=Error.prototype.constructor.call(this,e),c=0;c<hg.length;c++)this[hg[c]]=a[hg[c]];Error.captureStackTrace&&Error.captureStackTrace(this,mg);try{r&&(this.lineNumber=n,this.endLineNumber=o,Object.defineProperty?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:s,enumerable:!0})):(this.column=i,this.endColumn=s))}catch{}}mg.prototype=new Error;gl.default=mg;G1.exports=gl.default});var V1=$((yl,B1)=>{"use strict";yl.__esModule=!0;var gg=Dt();yl.default=function(e){e.registerHelper("blockHelperMissing",function(t,r){var n=r.inverse,o=r.fn;if(t===!0)return o(this);if(t===!1||t==null)return n(this);if(gg.isArray(t))return t.length>0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):n(this);if(r.data&&r.ids){var i=gg.createFrame(r.data);i.contextPath=gg.appendContextPath(r.data.contextPath,r.name),r={data:i}}return o(t,r)})};B1.exports=yl.default});var W1=$((_l,H1)=>{"use strict";_l.__esModule=!0;function pZ(e){return e&&e.__esModule?e:{default:e}}var ba=Dt(),dZ=mr(),fZ=pZ(dZ);_l.default=function(e){e.registerHelper("each",function(t,r){if(!r)throw new fZ.default("Must pass iterator to #each");var n=r.fn,o=r.inverse,i=0,s="",a=void 0,c=void 0;r.data&&r.ids&&(c=ba.appendContextPath(r.data.contextPath,r.ids[0])+"."),ba.isFunction(t)&&(t=t.call(this)),r.data&&(a=ba.createFrame(r.data));function u(h,g,y){a&&(a.key=h,a.index=g,a.first=g===0,a.last=!!y,c&&(a.contextPath=c+h)),s=s+n(t[h],{data:a,blockParams:ba.blockParams([t[h],h],[c+h,null])})}if(t&&typeof t=="object")if(ba.isArray(t))for(var p=t.length;i<p;i++)i in t&&u(i,i,i===t.length-1);else if(typeof Symbol=="function"&&t[Symbol.iterator]){for(var l=[],d=t[Symbol.iterator](),f=d.next();!f.done;f=d.next())l.push(f.value);t=l;for(var p=t.length;i<p;i++)u(i,i,i===t.length-1)}else(function(){var h=void 0;Object.keys(t).forEach(function(g){h!==void 0&&u(h,i-1),h=g,i++}),h!==void 0&&u(h,i-1,!0)})();return i===0&&(s=o(this)),s})};H1.exports=_l.default});var J1=$((vl,K1)=>{"use strict";vl.__esModule=!0;function hZ(e){return e&&e.__esModule?e:{default:e}}var mZ=mr(),gZ=hZ(mZ);vl.default=function(e){e.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new gZ.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};K1.exports=vl.default});var eP=$((wl,X1)=>{"use strict";wl.__esModule=!0;function yZ(e){return e&&e.__esModule?e:{default:e}}var Y1=Dt(),_Z=mr(),Q1=yZ(_Z);wl.default=function(e){e.registerHelper("if",function(t,r){if(arguments.length!=2)throw new Q1.default("#if requires exactly one argument");return Y1.isFunction(t)&&(t=t.call(this)),!r.hash.includeZero&&!t||Y1.isEmpty(t)?r.inverse(this):r.fn(this)}),e.registerHelper("unless",function(t,r){if(arguments.length!=2)throw new Q1.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:r.inverse,inverse:r.fn,hash:r.hash})})};X1.exports=wl.default});var rP=$((bl,tP)=>{"use strict";bl.__esModule=!0;bl.default=function(e){e.registerHelper("log",function(){for(var t=[void 0],r=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)t.push(arguments[n]);var o=1;r.hash.level!=null?o=r.hash.level:r.data&&r.data.level!=null&&(o=r.data.level),t[0]=o,e.log.apply(e,t)})};tP.exports=bl.default});var oP=$((xl,nP)=>{"use strict";xl.__esModule=!0;xl.default=function(e){e.registerHelper("lookup",function(t,r,n){return t&&n.lookupProperty(t,r)})};nP.exports=xl.default});var sP=$((kl,iP)=>{"use strict";kl.__esModule=!0;function vZ(e){return e&&e.__esModule?e:{default:e}}var xa=Dt(),wZ=mr(),bZ=vZ(wZ);kl.default=function(e){e.registerHelper("with",function(t,r){if(arguments.length!=2)throw new bZ.default("#with requires exactly one argument");xa.isFunction(t)&&(t=t.call(this));var n=r.fn;if(xa.isEmpty(t))return r.inverse(this);var o=r.data;return r.data&&r.ids&&(o=xa.createFrame(r.data),o.contextPath=xa.appendContextPath(r.data.contextPath,r.ids[0])),n(t,{data:o,blockParams:xa.blockParams([t],[o&&o.contextPath])})})};iP.exports=kl.default});var yg=$(Sl=>{"use strict";Sl.__esModule=!0;Sl.registerDefaultHelpers=NZ;Sl.moveHelperToHooks=jZ;function Vo(e){return e&&e.__esModule?e:{default:e}}var xZ=V1(),kZ=Vo(xZ),SZ=W1(),$Z=Vo(SZ),PZ=J1(),EZ=Vo(PZ),CZ=eP(),TZ=Vo(CZ),AZ=rP(),RZ=Vo(AZ),IZ=oP(),zZ=Vo(IZ),DZ=sP(),OZ=Vo(DZ);function NZ(e){kZ.default(e),$Z.default(e),EZ.default(e),TZ.default(e),RZ.default(e),zZ.default(e),OZ.default(e)}function jZ(e,t,r){e.helpers[t]&&(e.hooks[t]=e.helpers[t],r||delete e.helpers[t])}});var cP=$(($l,aP)=>{"use strict";$l.__esModule=!0;var MZ=Dt();$l.default=function(e){e.registerDecorator("inline",function(t,r,n,o){var i=t;return r.partials||(r.partials={},i=function(s,a){var c=n.partials;n.partials=MZ.extend({},c,r.partials);var u=t(s,a);return n.partials=c,u}),r.partials[o.args[0]]=o.fn,i})};aP.exports=$l.default});var uP=$(_g=>{"use strict";_g.__esModule=!0;_g.registerDefaultDecorators=qZ;function LZ(e){return e&&e.__esModule?e:{default:e}}var ZZ=cP(),UZ=LZ(ZZ);function qZ(e){UZ.default(e)}});var vg=$((Pl,lP)=>{"use strict";Pl.__esModule=!0;var FZ=Dt(),Vi={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if(typeof t=="string"){var r=FZ.indexOf(Vi.methodMap,t.toLowerCase());r>=0?t=r:t=parseInt(t,10)}return t},log:function(t){if(t=Vi.lookupLevel(t),typeof console<"u"&&Vi.lookupLevel(Vi.level)<=t){var r=Vi.methodMap[t];console[r]||(r="log");for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];console[r].apply(console,o)}}};Pl.default=Vi;lP.exports=Pl.default});var pP=$(wg=>{"use strict";wg.__esModule=!0;wg.createNewLookupObject=BZ;var GZ=Dt();function BZ(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return GZ.extend.apply(void 0,[Object.create(null)].concat(t))}});var bg=$(ka=>{"use strict";ka.__esModule=!0;ka.createProtoAccessControl=KZ;ka.resultIsAllowed=JZ;ka.resetLoggedProperties=QZ;function VZ(e){return e&&e.__esModule?e:{default:e}}var dP=pP(),HZ=vg(),WZ=VZ(HZ),El=Object.create(null);function KZ(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var r=Object.create(null);return r.__proto__=!1,{properties:{whitelist:dP.createNewLookupObject(r,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:dP.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}}function JZ(e,t,r){return fP(typeof e=="function"?t.methods:t.properties,r)}function fP(e,t){return e.whitelist[t]!==void 0?e.whitelist[t]===!0:e.defaultValue!==void 0?e.defaultValue:(YZ(t),!1)}function YZ(e){El[e]!==!0&&(El[e]=!0,WZ.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+`" because it is not an "own property" of its parent.
|
|
117
117
|
You can add a runtime option to disable the check or this warning:
|
|
118
|
-
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function QZ(){Object.keys(El).forEach(function(e){delete El[e]})}});var Tl=$(Jr=>{"use strict";Jr.__esModule=!0;Jr.HandlebarsEnvironment=Sg;function hP(e){return e&&e.__esModule?e:{default:e}}var Ho=Dt(),XZ=
|
|
118
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function QZ(){Object.keys(El).forEach(function(e){delete El[e]})}});var Tl=$(Jr=>{"use strict";Jr.__esModule=!0;Jr.HandlebarsEnvironment=Sg;function hP(e){return e&&e.__esModule?e:{default:e}}var Ho=Dt(),XZ=mr(),xg=hP(XZ),e8=yg(),t8=uP(),r8=vg(),Cl=hP(r8),n8=bg(),o8="4.7.8";Jr.VERSION=o8;var i8=8;Jr.COMPILER_REVISION=i8;var s8=7;Jr.LAST_COMPATIBLE_COMPILER_REVISION=s8;var a8={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};Jr.REVISION_CHANGES=a8;var kg="[object Object]";function Sg(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},e8.registerDefaultHelpers(this),t8.registerDefaultDecorators(this)}Sg.prototype={constructor:Sg,logger:Cl.default,log:Cl.default.log,registerHelper:function(t,r){if(Ho.toString.call(t)===kg){if(r)throw new xg.default("Arg not supported with multiple helpers");Ho.extend(this.helpers,t)}else this.helpers[t]=r},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,r){if(Ho.toString.call(t)===kg)Ho.extend(this.partials,t);else{if(typeof r>"u")throw new xg.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=r}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,r){if(Ho.toString.call(t)===kg){if(r)throw new xg.default("Arg not supported with multiple decorators");Ho.extend(this.decorators,t)}else this.decorators[t]=r},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){n8.resetLoggedProperties()}};var c8=Cl.default.log;Jr.log=c8;Jr.createFrame=Ho.createFrame;Jr.logger=Cl.default});var gP=$((Al,mP)=>{"use strict";Al.__esModule=!0;function $g(e){this.string=e}$g.prototype.toString=$g.prototype.toHTML=function(){return""+this.string};Al.default=$g;mP.exports=Al.default});var yP=$(Pg=>{"use strict";Pg.__esModule=!0;Pg.wrapHelper=u8;function u8(e,t){if(typeof e!="function")return e;var r=function(){var o=arguments[arguments.length-1];return arguments[arguments.length-1]=t(o),e.apply(this,arguments)};return r}});var xP=$(Yn=>{"use strict";Yn.__esModule=!0;Yn.checkRevision=m8;Yn.template=g8;Yn.wrapProgram=Rl;Yn.resolvePartial=y8;Yn.invokePartial=_8;Yn.noop=wP;function l8(e){return e&&e.__esModule?e:{default:e}}function p8(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var d8=Dt(),vn=p8(d8),f8=mr(),wn=l8(f8),bn=Tl(),_P=yg(),h8=yP(),vP=bg();function m8(e){var t=e&&e[0]||1,r=bn.COMPILER_REVISION;if(!(t>=bn.LAST_COMPATIBLE_COMPILER_REVISION&&t<=bn.COMPILER_REVISION))if(t<bn.LAST_COMPATIBLE_COMPILER_REVISION){var n=bn.REVISION_CHANGES[r],o=bn.REVISION_CHANGES[t];throw new wn.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+o+").")}else throw new wn.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}function g8(e,t){if(!t)throw new wn.default("No environment passed to template");if(!e||!e.main)throw new wn.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var r=e.compiler&&e.compiler[0]===7;function n(s,a,c){c.hash&&(a=vn.extend({},a,c.hash),c.ids&&(c.ids[0]=!0)),s=t.VM.resolvePartial.call(this,s,a,c);var u=vn.extend({},c,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),p=t.VM.invokePartial.call(this,s,a,u);if(p==null&&t.compile&&(c.partials[c.name]=t.compile(s,e.compilerOptions,t),p=c.partials[c.name](a,u)),p!=null){if(c.indent){for(var l=p.split(`
|
|
119
119
|
`),d=0,f=l.length;d<f&&!(!l[d]&&d+1===f);d++)l[d]=c.indent+l[d];p=l.join(`
|
|
120
|
-
`)}return p}else throw new vn.default("The partial "+c.name+" could not be compiled when running in runtime-only mode")}var o={strict:function(a,c,u){if(!a||!(c in a))throw new vn.default('"'+c+'" not defined in '+a,{loc:u});return o.lookupProperty(a,c)},lookupProperty:function(a,c){var u=a[c];if(u==null||Object.prototype.hasOwnProperty.call(a,c)||vP.resultIsAllowed(u,o.protoAccessControl,c))return u},lookup:function(a,c){for(var u=a.length,p=0;p<u;p++){var l=a[p]&&o.lookupProperty(a[p],c);if(l!=null)return a[p][c]}},lambda:function(a,c){return typeof a=="function"?a.call(c):a},escapeExpression:_n.escapeExpression,invokePartial:n,fn:function(a){var c=e[a];return c.decorator=e[a+"_d"],c},programs:[],program:function(a,c,u,p,l){var d=this.programs[a],f=this.fn(a);return c||l||p||u?d=Rl(this,a,f,c,u,p,l):d||(d=this.programs[a]=Rl(this,a,f)),d},data:function(a,c){for(;a&&c--;)a=a._parent;return a},mergeIfNeeded:function(a,c){var u=a||c;return a&&c&&a!==c&&(u=_n.extend({},c,a)),u},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function i(s){var a=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=a.data;i._setup(a),!a.partial&&e.useData&&(c=v8(s,c));var u=void 0,p=e.useBlockParams?[]:void 0;e.useDepths&&(a.depths?u=s!=a.depths[0]?[s].concat(a.depths):a.depths:u=[s]);function l(d){return""+e.main(o,d,o.helpers,o.partials,c,p,u)}return l=bP(e.main,l,o,a.depths||[],c,p),l(s,a)}return i.isTop=!0,i._setup=function(s){if(s.partial)o.protoAccessControl=s.protoAccessControl,o.helpers=s.helpers,o.partials=s.partials,o.decorators=s.decorators,o.hooks=s.hooks;else{var a=_n.extend({},t.helpers,s.helpers);w8(a,o),o.helpers=a,e.usePartial&&(o.partials=o.mergeIfNeeded(s.partials,t.partials)),(e.usePartial||e.useDecorators)&&(o.decorators=_n.extend({},t.decorators,s.decorators)),o.hooks={},o.protoAccessControl=vP.createProtoAccessControl(s);var c=s.allowCallsToHelperMissing||r;_P.moveHelperToHooks(o,"helperMissing",c),_P.moveHelperToHooks(o,"blockHelperMissing",c)}},i._child=function(s,a,c,u){if(e.useBlockParams&&!c)throw new vn.default("must pass block params");if(e.useDepths&&!u)throw new vn.default("must pass parent depths");return Rl(o,s,e[s],a,0,c,u)},i}function Rl(e,t,r,n,o,i,s){function a(c){var u=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=s;return s&&c!=s[0]&&!(c===e.nullContext&&s[0]===null)&&(p=[c].concat(s)),r(e,c,e.helpers,e.partials,u.data||n,i&&[u.blockParams].concat(i),p)}return a=bP(r,a,e,s,n,i),a.program=t,a.depth=s?s.length:0,a.blockParams=o||0,a}function y8(e,t,r){return e?!e.call&&!r.name&&(r.name=e,e=r.partials[e]):r.name==="@partial-block"?e=r.data["partial-block"]:e=r.partials[r.name],e}function _8(e,t,r){var n=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var o=void 0;if(r.fn&&r.fn!==wP&&(function(){r.data=wn.createFrame(r.data);var i=r.fn;o=r.data["partial-block"]=function(a){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return c.data=wn.createFrame(c.data),c.data["partial-block"]=n,i(a,c)},i.partials&&(r.partials=_n.extend({},r.partials,i.partials))})(),e===void 0&&o&&(e=o),e===void 0)throw new vn.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)}function wP(){return""}function v8(e,t){return(!t||!("root"in t))&&(t=t?wn.createFrame(t):{},t.root=e),t}function bP(e,t,r,n,o,i){if(e.decorator){var s={};t=e.decorator(t,s,r,n&&n[0],o,i,n),_n.extend(t,s)}return t}function w8(e,t){Object.keys(e).forEach(function(r){var n=e[r];e[r]=b8(n,t)})}function b8(e,t){var r=t.lookupProperty;return h8.wrapHelper(e,function(n){return _n.extend({lookupProperty:r},n)})}});var Eg=$((Il,kP)=>{"use strict";Il.__esModule=!0;Il.default=function(e){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}};kP.exports=Il.default});var CP=$((zl,EP)=>{"use strict";zl.__esModule=!0;function Tg(e){return e&&e.__esModule?e:{default:e}}function Ag(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var x8=Tl(),SP=Ag(x8),k8=gP(),S8=Tg(k8),$8=hr(),P8=Tg($8),E8=Dt(),Cg=Ag(E8),C8=xP(),$P=Ag(C8),T8=Eg(),A8=Tg(T8);function PP(){var e=new SP.HandlebarsEnvironment;return Cg.extend(e,SP),e.SafeString=S8.default,e.Exception=P8.default,e.Utils=Cg,e.escapeExpression=Cg.escapeExpression,e.VM=$P,e.template=function(t){return $P.template(t,e)},e}var Sa=PP();Sa.create=PP;A8.default(Sa);Sa.default=Sa;zl.default=Sa;EP.exports=zl.default});var Rg=$((Dl,AP)=>{"use strict";Dl.__esModule=!0;var TP={helpers:{helperExpression:function(t){return t.type==="SubExpression"||(t.type==="MustacheStatement"||t.type==="BlockStatement")&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return t.parts.length===1&&!TP.helpers.scopedId(t)&&!t.depth}}};Dl.default=TP;AP.exports=Dl.default});var IP=$((Ol,RP)=>{"use strict";Ol.__esModule=!0;var R8=(function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,i,s,a,c,u,p){var l=u.length-1;switch(c){case 1:return u[l-1];case 2:this.$=a.prepareProgram(u[l]);break;case 3:this.$=u[l];break;case 4:this.$=u[l];break;case 5:this.$=u[l];break;case 6:this.$=u[l];break;case 7:this.$=u[l];break;case 8:this.$=u[l];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(u[l]),strip:a.stripFlags(u[l],u[l]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:u[l],value:u[l],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(u[l-2],u[l-1],u[l],this._$);break;case 12:this.$={path:u[l-3],params:u[l-2],hash:u[l-1]};break;case 13:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!1,this._$);break;case 14:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!0,this._$);break;case 15:this.$={open:u[l-5],path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 16:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 17:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 18:this.$={strip:a.stripFlags(u[l-1],u[l-1]),program:u[l]};break;case 19:var d=a.prepareBlock(u[l-2],u[l-1],u[l],u[l],!1,this._$),f=a.prepareProgram([d],u[l-1].loc);f.chained=!0,this.$={strip:u[l-2].strip,program:f,chain:!0};break;case 20:this.$=u[l];break;case 21:this.$={path:u[l-1],strip:a.stripFlags(u[l-2],u[l])};break;case 22:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 23:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:u[l-3],params:u[l-2],hash:u[l-1],indent:"",strip:a.stripFlags(u[l-4],u[l]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(u[l-2],u[l-1],u[l],this._$);break;case 26:this.$={path:u[l-3],params:u[l-2],hash:u[l-1],strip:a.stripFlags(u[l-4],u[l])};break;case 27:this.$=u[l];break;case 28:this.$=u[l];break;case 29:this.$={type:"SubExpression",path:u[l-3],params:u[l-2],hash:u[l-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:u[l],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(u[l-2]),value:u[l],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(u[l-1]);break;case 33:this.$=u[l];break;case 34:this.$=u[l];break;case 35:this.$={type:"StringLiteral",value:u[l],original:u[l],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(u[l]),original:Number(u[l]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:u[l]==="true",original:u[l]==="true",loc:a.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:a.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:a.locInfo(this._$)};break;case 40:this.$=u[l];break;case 41:this.$=u[l];break;case 42:this.$=a.preparePath(!0,u[l],this._$);break;case 43:this.$=a.preparePath(!1,u[l],this._$);break;case 44:u[l-2].push({part:a.id(u[l]),original:u[l],separator:u[l-1]}),this.$=u[l-2];break;case 45:this.$=[{part:a.id(u[l]),original:u[l]}];break;case 46:this.$=[];break;case 47:u[l-1].push(u[l]);break;case 48:this.$=[];break;case 49:u[l-1].push(u[l]);break;case 50:this.$=[];break;case 51:u[l-1].push(u[l]);break;case 58:this.$=[];break;case 59:u[l-1].push(u[l]);break;case 64:this.$=[];break;case 65:u[l-1].push(u[l]);break;case 70:this.$=[];break;case 71:u[l-1].push(u[l]);break;case 78:this.$=[];break;case 79:u[l-1].push(u[l]);break;case 82:this.$=[];break;case 83:u[l-1].push(u[l]);break;case 86:this.$=[];break;case 87:u[l-1].push(u[l]);break;case 90:this.$=[];break;case 91:u[l-1].push(u[l]);break;case 94:this.$=[];break;case 95:u[l-1].push(u[l]);break;case 98:this.$=[u[l]];break;case 99:u[l-1].push(u[l]);break;case 100:this.$=[u[l]];break;case 101:u[l-1].push(u[l]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,i){throw new Error(o)},parse:function(o){var i=this,s=[0],a=[null],c=[],u=this.table,p="",l=0,d=0,f=0,h=2,g=1;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var y=this.lexer.yylloc;c.push(y);var v=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function w(Ee){s.length=s.length-2*Ee,a.length=a.length-Ee,c.length=c.length-Ee}function x(){var Ee;return Ee=i.lexer.lex()||1,typeof Ee!="number"&&(Ee=i.symbols_[Ee]||Ee),Ee}for(var k,P,q,L,Ue,we,Q={},qe,Be,En,ao;;){if(q=s[s.length-1],this.defaultActions[q]?L=this.defaultActions[q]:((k===null||typeof k>"u")&&(k=x()),L=u[q]&&u[q][k]),typeof L>"u"||!L.length||!L[0]){var ie="";if(!f){ao=[];for(qe in u[q])this.terminals_[qe]&&qe>2&&ao.push("'"+this.terminals_[qe]+"'");this.lexer.showPosition?ie="Parse error on line "+(l+1)+`:
|
|
120
|
+
`)}return p}else throw new wn.default("The partial "+c.name+" could not be compiled when running in runtime-only mode")}var o={strict:function(a,c,u){if(!a||!(c in a))throw new wn.default('"'+c+'" not defined in '+a,{loc:u});return o.lookupProperty(a,c)},lookupProperty:function(a,c){var u=a[c];if(u==null||Object.prototype.hasOwnProperty.call(a,c)||vP.resultIsAllowed(u,o.protoAccessControl,c))return u},lookup:function(a,c){for(var u=a.length,p=0;p<u;p++){var l=a[p]&&o.lookupProperty(a[p],c);if(l!=null)return a[p][c]}},lambda:function(a,c){return typeof a=="function"?a.call(c):a},escapeExpression:vn.escapeExpression,invokePartial:n,fn:function(a){var c=e[a];return c.decorator=e[a+"_d"],c},programs:[],program:function(a,c,u,p,l){var d=this.programs[a],f=this.fn(a);return c||l||p||u?d=Rl(this,a,f,c,u,p,l):d||(d=this.programs[a]=Rl(this,a,f)),d},data:function(a,c){for(;a&&c--;)a=a._parent;return a},mergeIfNeeded:function(a,c){var u=a||c;return a&&c&&a!==c&&(u=vn.extend({},c,a)),u},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function i(s){var a=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=a.data;i._setup(a),!a.partial&&e.useData&&(c=v8(s,c));var u=void 0,p=e.useBlockParams?[]:void 0;e.useDepths&&(a.depths?u=s!=a.depths[0]?[s].concat(a.depths):a.depths:u=[s]);function l(d){return""+e.main(o,d,o.helpers,o.partials,c,p,u)}return l=bP(e.main,l,o,a.depths||[],c,p),l(s,a)}return i.isTop=!0,i._setup=function(s){if(s.partial)o.protoAccessControl=s.protoAccessControl,o.helpers=s.helpers,o.partials=s.partials,o.decorators=s.decorators,o.hooks=s.hooks;else{var a=vn.extend({},t.helpers,s.helpers);w8(a,o),o.helpers=a,e.usePartial&&(o.partials=o.mergeIfNeeded(s.partials,t.partials)),(e.usePartial||e.useDecorators)&&(o.decorators=vn.extend({},t.decorators,s.decorators)),o.hooks={},o.protoAccessControl=vP.createProtoAccessControl(s);var c=s.allowCallsToHelperMissing||r;_P.moveHelperToHooks(o,"helperMissing",c),_P.moveHelperToHooks(o,"blockHelperMissing",c)}},i._child=function(s,a,c,u){if(e.useBlockParams&&!c)throw new wn.default("must pass block params");if(e.useDepths&&!u)throw new wn.default("must pass parent depths");return Rl(o,s,e[s],a,0,c,u)},i}function Rl(e,t,r,n,o,i,s){function a(c){var u=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=s;return s&&c!=s[0]&&!(c===e.nullContext&&s[0]===null)&&(p=[c].concat(s)),r(e,c,e.helpers,e.partials,u.data||n,i&&[u.blockParams].concat(i),p)}return a=bP(r,a,e,s,n,i),a.program=t,a.depth=s?s.length:0,a.blockParams=o||0,a}function y8(e,t,r){return e?!e.call&&!r.name&&(r.name=e,e=r.partials[e]):r.name==="@partial-block"?e=r.data["partial-block"]:e=r.partials[r.name],e}function _8(e,t,r){var n=r.data&&r.data["partial-block"];r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var o=void 0;if(r.fn&&r.fn!==wP&&(function(){r.data=bn.createFrame(r.data);var i=r.fn;o=r.data["partial-block"]=function(a){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return c.data=bn.createFrame(c.data),c.data["partial-block"]=n,i(a,c)},i.partials&&(r.partials=vn.extend({},r.partials,i.partials))})(),e===void 0&&o&&(e=o),e===void 0)throw new wn.default("The partial "+r.name+" could not be found");if(e instanceof Function)return e(t,r)}function wP(){return""}function v8(e,t){return(!t||!("root"in t))&&(t=t?bn.createFrame(t):{},t.root=e),t}function bP(e,t,r,n,o,i){if(e.decorator){var s={};t=e.decorator(t,s,r,n&&n[0],o,i,n),vn.extend(t,s)}return t}function w8(e,t){Object.keys(e).forEach(function(r){var n=e[r];e[r]=b8(n,t)})}function b8(e,t){var r=t.lookupProperty;return h8.wrapHelper(e,function(n){return vn.extend({lookupProperty:r},n)})}});var Eg=$((Il,kP)=>{"use strict";Il.__esModule=!0;Il.default=function(e){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}};kP.exports=Il.default});var CP=$((zl,EP)=>{"use strict";zl.__esModule=!0;function Tg(e){return e&&e.__esModule?e:{default:e}}function Ag(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var x8=Tl(),SP=Ag(x8),k8=gP(),S8=Tg(k8),$8=mr(),P8=Tg($8),E8=Dt(),Cg=Ag(E8),C8=xP(),$P=Ag(C8),T8=Eg(),A8=Tg(T8);function PP(){var e=new SP.HandlebarsEnvironment;return Cg.extend(e,SP),e.SafeString=S8.default,e.Exception=P8.default,e.Utils=Cg,e.escapeExpression=Cg.escapeExpression,e.VM=$P,e.template=function(t){return $P.template(t,e)},e}var Sa=PP();Sa.create=PP;A8.default(Sa);Sa.default=Sa;zl.default=Sa;EP.exports=zl.default});var Rg=$((Dl,AP)=>{"use strict";Dl.__esModule=!0;var TP={helpers:{helperExpression:function(t){return t.type==="SubExpression"||(t.type==="MustacheStatement"||t.type==="BlockStatement")&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return t.parts.length===1&&!TP.helpers.scopedId(t)&&!t.depth}}};Dl.default=TP;AP.exports=Dl.default});var IP=$((Ol,RP)=>{"use strict";Ol.__esModule=!0;var R8=(function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(o,i,s,a,c,u,p){var l=u.length-1;switch(c){case 1:return u[l-1];case 2:this.$=a.prepareProgram(u[l]);break;case 3:this.$=u[l];break;case 4:this.$=u[l];break;case 5:this.$=u[l];break;case 6:this.$=u[l];break;case 7:this.$=u[l];break;case 8:this.$=u[l];break;case 9:this.$={type:"CommentStatement",value:a.stripComment(u[l]),strip:a.stripFlags(u[l],u[l]),loc:a.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:u[l],value:u[l],loc:a.locInfo(this._$)};break;case 11:this.$=a.prepareRawBlock(u[l-2],u[l-1],u[l],this._$);break;case 12:this.$={path:u[l-3],params:u[l-2],hash:u[l-1]};break;case 13:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!1,this._$);break;case 14:this.$=a.prepareBlock(u[l-3],u[l-2],u[l-1],u[l],!0,this._$);break;case 15:this.$={open:u[l-5],path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 16:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 17:this.$={path:u[l-4],params:u[l-3],hash:u[l-2],blockParams:u[l-1],strip:a.stripFlags(u[l-5],u[l])};break;case 18:this.$={strip:a.stripFlags(u[l-1],u[l-1]),program:u[l]};break;case 19:var d=a.prepareBlock(u[l-2],u[l-1],u[l],u[l],!1,this._$),f=a.prepareProgram([d],u[l-1].loc);f.chained=!0,this.$={strip:u[l-2].strip,program:f,chain:!0};break;case 20:this.$=u[l];break;case 21:this.$={path:u[l-1],strip:a.stripFlags(u[l-2],u[l])};break;case 22:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 23:this.$=a.prepareMustache(u[l-3],u[l-2],u[l-1],u[l-4],a.stripFlags(u[l-4],u[l]),this._$);break;case 24:this.$={type:"PartialStatement",name:u[l-3],params:u[l-2],hash:u[l-1],indent:"",strip:a.stripFlags(u[l-4],u[l]),loc:a.locInfo(this._$)};break;case 25:this.$=a.preparePartialBlock(u[l-2],u[l-1],u[l],this._$);break;case 26:this.$={path:u[l-3],params:u[l-2],hash:u[l-1],strip:a.stripFlags(u[l-4],u[l])};break;case 27:this.$=u[l];break;case 28:this.$=u[l];break;case 29:this.$={type:"SubExpression",path:u[l-3],params:u[l-2],hash:u[l-1],loc:a.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:u[l],loc:a.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:a.id(u[l-2]),value:u[l],loc:a.locInfo(this._$)};break;case 32:this.$=a.id(u[l-1]);break;case 33:this.$=u[l];break;case 34:this.$=u[l];break;case 35:this.$={type:"StringLiteral",value:u[l],original:u[l],loc:a.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(u[l]),original:Number(u[l]),loc:a.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:u[l]==="true",original:u[l]==="true",loc:a.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:a.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:a.locInfo(this._$)};break;case 40:this.$=u[l];break;case 41:this.$=u[l];break;case 42:this.$=a.preparePath(!0,u[l],this._$);break;case 43:this.$=a.preparePath(!1,u[l],this._$);break;case 44:u[l-2].push({part:a.id(u[l]),original:u[l],separator:u[l-1]}),this.$=u[l-2];break;case 45:this.$=[{part:a.id(u[l]),original:u[l]}];break;case 46:this.$=[];break;case 47:u[l-1].push(u[l]);break;case 48:this.$=[];break;case 49:u[l-1].push(u[l]);break;case 50:this.$=[];break;case 51:u[l-1].push(u[l]);break;case 58:this.$=[];break;case 59:u[l-1].push(u[l]);break;case 64:this.$=[];break;case 65:u[l-1].push(u[l]);break;case 70:this.$=[];break;case 71:u[l-1].push(u[l]);break;case 78:this.$=[];break;case 79:u[l-1].push(u[l]);break;case 82:this.$=[];break;case 83:u[l-1].push(u[l]);break;case 86:this.$=[];break;case 87:u[l-1].push(u[l]);break;case 90:this.$=[];break;case 91:u[l-1].push(u[l]);break;case 94:this.$=[];break;case 95:u[l-1].push(u[l]);break;case 98:this.$=[u[l]];break;case 99:u[l-1].push(u[l]);break;case 100:this.$=[u[l]];break;case 101:u[l-1].push(u[l]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(o,i){throw new Error(o)},parse:function(o){var i=this,s=[0],a=[null],c=[],u=this.table,p="",l=0,d=0,f=0,h=2,g=1;this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u"&&(this.lexer.yylloc={});var y=this.lexer.yylloc;c.push(y);var v=this.lexer.options&&this.lexer.options.ranges;typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);function w(Ee){s.length=s.length-2*Ee,a.length=a.length-Ee,c.length=c.length-Ee}function x(){var Ee;return Ee=i.lexer.lex()||1,typeof Ee!="number"&&(Ee=i.symbols_[Ee]||Ee),Ee}for(var k,P,q,L,Ue,we,Q={},qe,Be,Cn,ao;;){if(q=s[s.length-1],this.defaultActions[q]?L=this.defaultActions[q]:((k===null||typeof k>"u")&&(k=x()),L=u[q]&&u[q][k]),typeof L>"u"||!L.length||!L[0]){var ie="";if(!f){ao=[];for(qe in u[q])this.terminals_[qe]&&qe>2&&ao.push("'"+this.terminals_[qe]+"'");this.lexer.showPosition?ie="Parse error on line "+(l+1)+`:
|
|
121
121
|
`+this.lexer.showPosition()+`
|
|
122
|
-
Expecting `+ao.join(", ")+", got '"+(this.terminals_[k]||k)+"'":ie="Parse error on line "+(l+1)+": Unexpected "+(k==1?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(ie,{text:this.lexer.match,token:this.terminals_[k]||k,line:this.lexer.yylineno,loc:y,expected:ao})}}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+k);switch(L[0]){case 1:s.push(k),a.push(this.lexer.yytext),c.push(this.lexer.yylloc),s.push(L[1]),k=null,P?(k=P,P=null):(d=this.lexer.yyleng,p=this.lexer.yytext,l=this.lexer.yylineno,y=this.lexer.yylloc,f>0&&f--);break;case 2:if(Be=this.productions_[L[1]][1],Q.$=a[a.length-Be],Q._$={first_line:c[c.length-(Be||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Be||1)].first_column,last_column:c[c.length-1].last_column},v&&(Q._$.range=[c[c.length-(Be||1)].range[0],c[c.length-1].range[1]]),we=this.performAction.call(Q,p,d,l,this.yy,L[1],a,c),typeof we<"u")return we;Be&&(s=s.slice(0,-1*Be*2),a=a.slice(0,-1*Be),c=c.slice(0,-1*Be)),s.push(this.productions_[L[1]][0]),a.push(Q.$),c.push(Q._$),
|
|
122
|
+
Expecting `+ao.join(", ")+", got '"+(this.terminals_[k]||k)+"'":ie="Parse error on line "+(l+1)+": Unexpected "+(k==1?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(ie,{text:this.lexer.match,token:this.terminals_[k]||k,line:this.lexer.yylineno,loc:y,expected:ao})}}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+k);switch(L[0]){case 1:s.push(k),a.push(this.lexer.yytext),c.push(this.lexer.yylloc),s.push(L[1]),k=null,P?(k=P,P=null):(d=this.lexer.yyleng,p=this.lexer.yytext,l=this.lexer.yylineno,y=this.lexer.yylloc,f>0&&f--);break;case 2:if(Be=this.productions_[L[1]][1],Q.$=a[a.length-Be],Q._$={first_line:c[c.length-(Be||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Be||1)].first_column,last_column:c[c.length-1].last_column},v&&(Q._$.range=[c[c.length-(Be||1)].range[0],c[c.length-1].range[1]]),we=this.performAction.call(Q,p,d,l,this.yy,L[1],a,c),typeof we<"u")return we;Be&&(s=s.slice(0,-1*Be*2),a=a.slice(0,-1*Be),c=c.slice(0,-1*Be)),s.push(this.productions_[L[1]][0]),a.push(Q.$),c.push(Q._$),Cn=u[s[s.length-2]][s[s.length-1]],s.push(Cn);break;case 3:return!0}}return!0}},t=(function(){var n={EOF:1,parseError:function(i,s){if(this.yy.parser)this.yy.parser.parseError(i,s);else throw new Error(i)},setInput:function(i){return this._input=i,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var s=i.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var s=i.length,a=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s-1),this.offset-=s;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-s]),this},more:function(){return this._more=!0,this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),s=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
123
123
|
`+s+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,s,a,c,u,p;this._more||(this.yytext="",this.match="");for(var l=this._currentRules(),d=0;d<l.length&&(a=this._input.match(this.rules[l[d]]),!(a&&(!s||a[0].length>s[0].length)&&(s=a,c=d,!this.options.flex)));d++);return s?(p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],i=this.performAction.call(this,this.yy,this,l[c],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
124
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var i=this.next();return typeof i<"u"?i:this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(i){this.begin(i)}};return n.options={},n.performAction=function(i,s,a,c){function u(l,d){return s.yytext=s.yytext.substring(l,s.yyleng-d+l)}var p=c;switch(a){case 0:if(s.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):s.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),s.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(u(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(s.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return s.yytext=u(1,2).replace(/\\"/g,'"'),80;break;case 32:return s.yytext=u(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return s.yytext=s.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();e.lexer=t;function r(){this.yy={}}return r.prototype=e,e.Parser=r,new r})();Ol.default=R8;RP.exports=Ol.default});var Ll=$((Ml,OP)=>{"use strict";Ml.__esModule=!0;function I8(e){return e&&e.__esModule?e:{default:e}}var z8=hr(),Ig=I8(z8);function Nl(){this.parents=[]}Nl.prototype={constructor:Nl,mutating:!1,acceptKey:function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!Nl.prototype[n.type])throw new Ig.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+t.type);t[r]=n}},acceptRequired:function(t,r){if(this.acceptKey(t,r),!t[r])throw new Ig.default(t.type+" requires "+r)},acceptArray:function(t){for(var r=0,n=t.length;r<n;r++)this.acceptKey(t,r),t[r]||(t.splice(r,1),r--,n--)},accept:function(t){if(t){if(!this[t.type])throw new Ig.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var r=this[t.type](t);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return t}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:jl,Decorator:jl,BlockStatement:zP,DecoratorBlock:zP,PartialStatement:DP,PartialBlockStatement:function(t){DP.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:jl,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}};function jl(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function zP(e){jl.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function DP(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}Ml.default=Nl;OP.exports=Ml.default});var jP=$((Zl,NP)=>{"use strict";Zl.__esModule=!0;function D8(e){return e&&e.__esModule?e:{default:e}}var O8=Ll(),N8=D8(O8);function Yr(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}Yr.prototype=new N8.default;Yr.prototype.Program=function(e){var t=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,o=0,i=n.length;o<i;o++){var s=n[o],a=this.accept(s);if(a){var c=zg(n,o,r),u=Dg(n,o,r),p=a.openStandalone&&c,l=a.closeStandalone&&u,d=a.inlineStandalone&&c&&u;a.close&&Wo(n,o,!0),a.open&&Yn(n,o,!0),t&&d&&(Wo(n,o),Yn(n,o)&&s.type==="PartialStatement"&&(s.indent=/([ \t]+$)/.exec(n[o-1].original)[1])),t&&p&&(Wo((s.program||s.inverse).body),Yn(n,o)),t&&l&&(Wo(n,o),Yn((s.inverse||s.program).body))}}return e};Yr.prototype.BlockStatement=Yr.prototype.DecoratorBlock=Yr.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,r=e.program&&e.inverse,n=r,o=r;if(r&&r.chained)for(n=r.body[0].program;o.chained;)o=o.body[o.body.length-1].program;var i={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:Dg(t.body),closeStandalone:zg((n||t).body)};if(e.openStrip.close&&Wo(t.body,null,!0),r){var s=e.inverseStrip;s.open&&Yn(t.body,null,!0),s.close&&Wo(n.body,null,!0),e.closeStrip.open&&Yn(o.body,null,!0),!this.options.ignoreStandalone&&zg(t.body)&&Dg(n.body)&&(Yn(t.body),Wo(n.body))}else e.closeStrip.open&&Yn(t.body,null,!0);return i};Yr.prototype.Decorator=Yr.prototype.MustacheStatement=function(e){return e.strip};Yr.prototype.PartialStatement=Yr.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function zg(e,t,r){t===void 0&&(t=e.length);var n=e[t-1],o=e[t-2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original)}function Dg(e,t,r){t===void 0&&(t=-1);var n=e[t+1],o=e[t+2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}function Wo(e,t,r){var n=e[t==null?0:t+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var o=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==o}}function Yn(e,t,r){var n=e[t==null?e.length-1:t-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var o=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==o,n.leftStripped}}Zl.default=Yr;NP.exports=Zl.default});var MP=$(mr=>{"use strict";mr.__esModule=!0;mr.SourceLocation=L8;mr.id=Z8;mr.stripFlags=U8;mr.stripComment=q8;mr.preparePath=F8;mr.prepareMustache=G8;mr.prepareRawBlock=B8;mr.prepareBlock=V8;mr.prepareProgram=H8;mr.preparePartialBlock=W8;function j8(e){return e&&e.__esModule?e:{default:e}}var M8=hr(),Og=j8(M8);function Ng(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Og.default(e.path.original+" doesn't match "+t,r)}}function L8(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}function Z8(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function U8(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function q8(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function F8(e,t,r){r=this.locInfo(r);for(var n=e?"@":"",o=[],i=0,s=0,a=t.length;s<a;s++){var c=t[s].part,u=t[s].original!==c;if(n+=(t[s].separator||"")+c,!u&&(c===".."||c==="."||c==="this")){if(o.length>0)throw new Og.default("Invalid path: "+n,{loc:r});c===".."&&i++}else o.push(c)}return{type:"PathExpression",data:e,depth:i,parts:o,original:n,loc:r}}function G8(e,t,r,n,o,i){var s=n.charAt(3)||n.charAt(2),a=s!=="{"&&s!=="&",c=/\*/.test(n);return{type:c?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:a,strip:o,loc:this.locInfo(i)}}function B8(e,t,r,n){Ng(e,r),n=this.locInfo(n);var o={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:o,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}function V8(e,t,r,n,o,i){n&&n.path&&Ng(e,n);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var a=void 0,c=void 0;if(r){if(s)throw new Og.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),c=r.strip,a=r.program}return o&&(o=a,a=t,t=o),{type:s?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:a,openStrip:e.strip,inverseStrip:c,closeStrip:n&&n.strip,loc:this.locInfo(i)}}function H8(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}function W8(e,t,r,n){return Ng(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}});var UP=$($a=>{"use strict";$a.__esModule=!0;$a.parseWithoutProcessing=ZP;$a.parse=r6;function K8(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function LP(e){return e&&e.__esModule?e:{default:e}}var J8=IP(),jg=LP(J8),Y8=jP(),Q8=LP(Y8),X8=MP(),e6=K8(X8),t6=Dt();$a.parser=jg.default;var Ul={};t6.extend(Ul,e6);function ZP(e,t){if(e.type==="Program")return e;jg.default.yy=Ul,Ul.locInfo=function(n){return new Ul.SourceLocation(t&&t.srcName,n)};var r=jg.default.parse(e);return r}function r6(e,t){var r=ZP(e,t),n=new Q8.default(t);return n.accept(r)}});var BP=$(Ta=>{"use strict";Ta.__esModule=!0;Ta.Compiler=Mg;Ta.precompile=s6;Ta.compile=a6;function FP(e){return e&&e.__esModule?e:{default:e}}var n6=hr(),Ea=FP(n6),Ca=Dt(),o6=Rg(),Pa=FP(o6),i6=[].slice;function Mg(){}Mg.prototype={compiler:Mg,equals:function(t){var r=this.opcodes.length;if(t.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var o=this.opcodes[n],i=t.opcodes[n];if(o.opcode!==i.opcode||!GP(o.args,i.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(t.children[n]))return!1;return!0},guid:0,compile:function(t,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=Ca.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(t)},compileProgram:function(t){var r=new this.compiler,n=r.compile(t,this.options),o=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[o]=n,this.useDepths=this.useDepths||n.useDepths,o},accept:function(t){if(!this[t.type])throw new Ea.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var r=this[t.type](t);return this.sourceNode.shift(),r},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var r=t.body,n=r.length,o=0;o<n;o++)this.accept(r[o]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){qP(t);var r=t.program,n=t.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var o=this.classifySexpr(t);o==="helper"?this.helperSexpr(t,r,n):o==="simple"?(this.simpleSexpr(t),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var r=t.program&&this.compileProgram(t.program),n=this.setupFullMustacheParams(t,r,void 0),o=t.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,o.original)},PartialStatement:function(t){this.usePartial=!0;var r=t.program;r&&(r=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new Ea.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var o=t.name.original,i=t.name.type==="SubExpression";i&&this.accept(t.name),this.setupFullMustacheParams(t,r,void 0,!0);var s=t.indent||"";this.options.preventIndent&&s&&(this.opcode("appendContent",s),s=""),this.opcode("invokePartial",i,o,s),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){qP(t);var r=this.classifySexpr(t);r==="simple"?this.simpleSexpr(t):r==="helper"?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,r,n){var o=t.path,i=o.parts[0],s=r!=null||n!=null;this.opcode("getContext",o.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",n),o.strict=!0,this.accept(o),this.opcode("invokeAmbiguous",i,s)},simpleSexpr:function(t){var r=t.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,r,n){var o=this.setupFullMustacheParams(t,r,n),i=t.path,s=i.parts[0];if(this.options.knownHelpers[s])this.opcode("invokeKnownHelper",o.length,s);else{if(this.options.knownHelpersOnly)throw new Ea.default("You specified knownHelpersOnly, but used the unknown helper "+s,t);i.strict=!0,i.falsy=!0,this.accept(i),this.opcode("invokeHelper",o.length,i.original,Pa.default.helpers.simpleId(i))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=Pa.default.helpers.scopedId(t),o=!t.depth&&!n&&this.blockParamIndex(r);o?this.opcode("lookupBlockParam",o,t.parts):r?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var r=t.pairs,n=0,o=r.length;for(this.opcode("pushHash");n<o;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:i6.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var r=Pa.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),o=!n&&Pa.default.helpers.helperExpression(t),i=!n&&(o||r);if(i&&!o){var s=t.path.parts[0],a=this.options;a.knownHelpers[s]?o=!0:a.knownHelpersOnly&&(i=!1)}return o?"helper":i?"ambiguous":"simple"},pushParams:function(t){for(var r=0,n=t.length;r<n;r++)this.pushParam(t[r])},pushParam:function(t){var r=t.value!=null?t.value:t.original||"";if(this.stringParams)r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",r,t.type),t.type==="SubExpression"&&this.accept(t);else{if(this.trackIds){var n=void 0;if(t.parts&&!Pa.default.helpers.scopedId(t)&&!t.depth&&(n=this.blockParamIndex(t.parts[0])),n){var o=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,o)}else r=t.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,r)}this.accept(t)}},setupFullMustacheParams:function(t,r,n,o){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",r),this.opcode("pushProgram",n),t.hash?this.accept(t.hash):this.opcode("emptyHash",o),i},blockParamIndex:function(t){for(var r=0,n=this.options.blockParams.length;r<n;r++){var o=this.options.blockParams[r],i=o&&Ca.indexOf(o,t);if(o&&i>=0)return[r,i]}}};function s6(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new Ea.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);t=t||{},"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=r.parse(e,t),o=new r.Compiler().compile(n,t);return new r.JavaScriptCompiler().compile(o,t)}function a6(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new Ea.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=Ca.extend({},t),"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function o(){var s=r.parse(e,t),a=new r.Compiler().compile(s,t),c=new r.JavaScriptCompiler().compile(a,t,void 0,!0);return r.template(c)}function i(s,a){return n||(n=o()),n.call(this,s,a)}return i._setup=function(s){return n||(n=o()),n._setup(s)},i._child=function(s,a,c,u){return n||(n=o()),n._child(s,a,c,u)},i}function GP(e,t){if(e===t)return!0;if(Ca.isArray(e)&&Ca.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!GP(e[r],t[r]))return!1;return!0}}function qP(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}});var HP=$(Lg=>{var VP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Lg.encode=function(e){if(0<=e&&e<VP.length)return VP[e];throw new TypeError("Must be between 0 and 63: "+e)};Lg.decode=function(e){var t=65,r=90,n=97,o=122,i=48,s=57,a=43,c=47,u=26,p=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+u:i<=e&&e<=s?e-i+p:e==a?62:e==c?63:-1}});var qg=$(Ug=>{var WP=HP(),Zg=5,KP=1<<Zg,JP=KP-1,YP=KP;function c6(e){return e<0?(-e<<1)+1:(e<<1)+0}function u6(e){var t=(e&1)===1,r=e>>1;return t?-r:r}Ug.encode=function(t){var r="",n,o=c6(t);do n=o&JP,o>>>=Zg,o>0&&(n|=YP),r+=WP.encode(n);while(o>0);return r};Ug.decode=function(t,r,n){var o=t.length,i=0,s=0,a,c;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(c=WP.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));a=!!(c&YP),c&=JP,i=i+(c<<s),s+=Zg}while(a);n.value=u6(i),n.rest=r}});var Ki=$(St=>{function l6(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}St.getArg=l6;var QP=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,p6=/^data:.+\,.+$/;function Aa(e){var t=e.match(QP);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}St.urlParse=Aa;function Hi(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}St.urlGenerate=Hi;function Fg(e){var t=e,r=Aa(e);if(r){if(!r.path)return e;t=r.path}for(var n=St.isAbsolute(t),o=t.split(/\/+/),i,s=0,a=o.length-1;a>=0;a--)i=o[a],i==="."?o.splice(a,1):i===".."?s++:s>0&&(i===""?(o.splice(a+1,s),s=0):(o.splice(a,2),s--));return t=o.join("/"),t===""&&(t=n?"/":"."),r?(r.path=t,Hi(r)):t}St.normalize=Fg;function XP(e,t){e===""&&(e="."),t===""&&(t=".");var r=Aa(t),n=Aa(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Hi(r);if(r||t.match(p6))return t;if(n&&!n.host&&!n.path)return n.host=t,Hi(n);var o=t.charAt(0)==="/"?t:Fg(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Hi(n)):o}St.join=XP;St.isAbsolute=function(e){return e.charAt(0)==="/"||QP.test(e)};function d6(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}St.relative=d6;var e2=(function(){var e=Object.create(null);return!("__proto__"in e)})();function t2(e){return e}function f6(e){return r2(e)?"$"+e:e}St.toSetString=e2?t2:f6;function h6(e){return r2(e)?e.slice(1):e}St.fromSetString=e2?t2:h6;function r2(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function m6(e,t,r){var n=Wi(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:Wi(e.name,t.name)}St.compareByOriginalPositions=m6;function g6(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=Wi(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:Wi(e.name,t.name)}St.compareByGeneratedPositionsDeflated=g6;function Wi(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function y6(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Wi(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Wi(e.name,t.name)}St.compareByGeneratedPositionsInflated=y6;function _6(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}St.parseSourceMapInput=_6;function v6(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Aa(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}t=XP(Hi(n),t)}return Fg(t)}St.computeSourceURL=v6});var Vg=$(n2=>{var Gg=Ki(),Bg=Object.prototype.hasOwnProperty,Ko=typeof Map<"u";function bn(){this._array=[],this._set=Ko?new Map:Object.create(null)}bn.fromArray=function(t,r){for(var n=new bn,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};bn.prototype.size=function(){return Ko?this._set.size:Object.getOwnPropertyNames(this._set).length};bn.prototype.add=function(t,r){var n=Ko?t:Gg.toSetString(t),o=Ko?this.has(t):Bg.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(Ko?this._set.set(t,i):this._set[n]=i)};bn.prototype.has=function(t){if(Ko)return this._set.has(t);var r=Gg.toSetString(t);return Bg.call(this._set,r)};bn.prototype.indexOf=function(t){if(Ko){var r=this._set.get(t);if(r>=0)return r}else{var n=Gg.toSetString(t);if(Bg.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};bn.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};bn.prototype.toArray=function(){return this._array.slice()};n2.ArraySet=bn});var s2=$(i2=>{var o2=Ki();function w6(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||o2.compareByGeneratedPositionsInflated(e,t)<=0}function ql(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ql.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};ql.prototype.add=function(t){w6(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};ql.prototype.toArray=function(){return this._sorted||(this._array.sort(o2.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};i2.MappingList=ql});var Hg=$(a2=>{var Ra=qg(),Ke=Ki(),Fl=Vg().ArraySet,b6=s2().MappingList;function gr(e){e||(e={}),this._file=Ke.getArg(e,"file",null),this._sourceRoot=Ke.getArg(e,"sourceRoot",null),this._skipValidation=Ke.getArg(e,"skipValidation",!1),this._sources=new Fl,this._names=new Fl,this._mappings=new b6,this._sourcesContents=null}gr.prototype._version=3;gr.fromSourceMap=function(t){var r=t.sourceRoot,n=new gr({file:t.file,sourceRoot:r});return t.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,r!=null&&(i.source=Ke.relative(r,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),t.sources.forEach(function(o){var i=o;r!==null&&(i=Ke.relative(r,o)),n._sources.has(i)||n._sources.add(i);var s=t.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};gr.prototype.addMapping=function(t){var r=Ke.getArg(t,"generated"),n=Ke.getArg(t,"original",null),o=Ke.getArg(t,"source",null),i=Ke.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};gr.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=Ke.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Ke.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Ke.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};gr.prototype.applySourceMap=function(t,r,n){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=Ke.relative(i,o));var s=new Fl,a=new Fl;this._mappings.unsortedForEach(function(c){if(c.source===o&&c.originalLine!=null){var u=t.originalPositionFor({line:c.originalLine,column:c.originalColumn});u.source!=null&&(c.source=u.source,n!=null&&(c.source=Ke.join(n,c.source)),i!=null&&(c.source=Ke.relative(i,c.source)),c.originalLine=u.line,c.originalColumn=u.column,u.name!=null&&(c.name=u.name))}var p=c.source;p!=null&&!s.has(p)&&s.add(p);var l=c.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,t.sources.forEach(function(c){var u=t.sourceContentFor(c);u!=null&&(n!=null&&(c=Ke.join(n,c)),i!=null&&(c=Ke.relative(i,c)),this.setSourceContent(c,u))},this)};gr.prototype._validateMapping=function(t,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:o}))}};gr.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,s=0,a="",c,u,p,l,d=this._mappings.toArray(),f=0,h=d.length;f<h;f++){if(u=d[f],c="",u.generatedLine!==r)for(t=0;u.generatedLine!==r;)c+=";",r++;else if(f>0){if(!Ke.compareByGeneratedPositionsInflated(u,d[f-1]))continue;c+=","}c+=Ra.encode(u.generatedColumn-t),t=u.generatedColumn,u.source!=null&&(l=this._sources.indexOf(u.source),c+=Ra.encode(l-s),s=l,c+=Ra.encode(u.originalLine-1-o),o=u.originalLine-1,c+=Ra.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(p=this._names.indexOf(u.name),c+=Ra.encode(p-i),i=p)),a+=c}return a};gr.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Ke.relative(r,n));var o=Ke.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};gr.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};gr.prototype.toString=function(){return JSON.stringify(this.toJSON())};a2.SourceMapGenerator=gr});var c2=$(Jo=>{Jo.GREATEST_LOWER_BOUND=1;Jo.LEAST_UPPER_BOUND=2;function Wg(e,t,r,n,o,i){var s=Math.floor((t-e)/2)+e,a=o(r,n[s],!0);return a===0?s:a>0?t-s>1?Wg(s,t,r,n,o,i):i==Jo.LEAST_UPPER_BOUND?t<n.length?t:-1:s:s-e>1?Wg(e,s,r,n,o,i):i==Jo.LEAST_UPPER_BOUND?s:e<0?-1:e}Jo.search=function(t,r,n,o){if(r.length===0)return-1;var i=Wg(-1,r.length,t,r,n,o||Jo.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(r[i],r[i-1],!0)===0;)--i;return i}});var l2=$(u2=>{function Kg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x6(e,t){return Math.round(e+Math.random()*(t-e))}function Jg(e,t,r,n){if(r<n){var o=x6(r,n),i=r-1;Kg(e,o,n);for(var s=e[n],a=r;a<n;a++)t(e[a],s)<=0&&(i+=1,Kg(e,i,a));Kg(e,i+1,a);var c=i+1;Jg(e,t,r,c-1),Jg(e,t,c+1,n)}}u2.quickSort=function(e,t){Jg(e,t,0,e.length-1)}});var d2=$(Gl=>{var z=Ki(),Yg=c2(),Ji=Vg().ArraySet,k6=qg(),Ia=l2().quickSort;function Re(e,t){var r=e;return typeof e=="string"&&(r=z.parseSourceMapInput(e)),r.sections!=null?new Rr(r,t):new ht(r,t)}Re.fromSourceMap=function(e,t){return ht.fromSourceMap(e,t)};Re.prototype._version=3;Re.prototype.__generatedMappings=null;Object.defineProperty(Re.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Re.prototype.__originalMappings=null;Object.defineProperty(Re.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Re.prototype._charIsMappingSeparator=function(t,r){var n=t.charAt(r);return n===";"||n===","};Re.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Re.GENERATED_ORDER=1;Re.ORIGINAL_ORDER=2;Re.GREATEST_LOWER_BOUND=1;Re.LEAST_UPPER_BOUND=2;Re.prototype.eachMapping=function(t,r,n){var o=r||null,i=n||Re.GENERATED_ORDER,s;switch(i){case Re.GENERATED_ORDER:s=this._generatedMappings;break;case Re.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(c){var u=c.source===null?null:this._sources.at(c.source);return u=z.computeSourceURL(a,u,this._sourceMapURL),{source:u,generatedLine:c.generatedLine,generatedColumn:c.generatedColumn,originalLine:c.originalLine,originalColumn:c.originalColumn,name:c.name===null?null:this._names.at(c.name)}},this).forEach(t,o)};Re.prototype.allGeneratedPositionsFor=function(t){var r=z.getArg(t,"line"),n={source:z.getArg(t,"source"),originalLine:r,originalColumn:z.getArg(t,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",z.compareByOriginalPositions,Yg.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(t.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)o.push({line:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==c;)o.push({line:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};Gl.SourceMapConsumer=Re;function ht(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sources"),i=z.getArg(r,"names",[]),s=z.getArg(r,"sourceRoot",null),a=z.getArg(r,"sourcesContent",null),c=z.getArg(r,"mappings"),u=z.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=z.normalize(s)),o=o.map(String).map(z.normalize).map(function(p){return s&&z.isAbsolute(s)&&z.isAbsolute(p)?z.relative(s,p):p}),this._names=Ji.fromArray(i.map(String),!0),this._sources=Ji.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(p){return z.computeSourceURL(s,p,t)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=t,this.file=u}ht.prototype=Object.create(Re.prototype);ht.prototype.consumer=Re;ht.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=z.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};ht.fromSourceMap=function(t,r){var n=Object.create(ht.prototype),o=n._names=Ji.fromArray(t._names.toArray(),!0),i=n._sources=Ji.fromArray(t._sources.toArray(),!0);n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(f){return z.computeSourceURL(n.sourceRoot,f,r)});for(var s=t._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],u=0,p=s.length;u<p;u++){var l=s[u],d=new p2;d.generatedLine=l.generatedLine,d.generatedColumn=l.generatedColumn,l.source&&(d.source=i.indexOf(l.source),d.originalLine=l.originalLine,d.originalColumn=l.originalColumn,l.name&&(d.name=o.indexOf(l.name)),c.push(d)),a.push(d)}return Ia(n.__originalMappings,z.compareByOriginalPositions),n};ht.prototype._version=3;Object.defineProperty(ht.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function p2(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}ht.prototype._parseMappings=function(t,r){for(var n=1,o=0,i=0,s=0,a=0,c=0,u=t.length,p=0,l={},d={},f=[],h=[],g,y,v,w,x;p<u;)if(t.charAt(p)===";")n++,p++,o=0;else if(t.charAt(p)===",")p++;else{for(g=new p2,g.generatedLine=n,w=p;w<u&&!this._charIsMappingSeparator(t,w);w++);if(y=t.slice(p,w),v=l[y],v)p+=y.length;else{for(v=[];p<w;)k6.decode(t,p,d),x=d.value,p=d.rest,v.push(x);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");l[y]=v}g.generatedColumn=o+v[0],o=g.generatedColumn,v.length>1&&(g.source=a+v[1],a+=v[1],g.originalLine=i+v[2],i=g.originalLine,g.originalLine+=1,g.originalColumn=s+v[3],s=g.originalColumn,v.length>4&&(g.name=c+v[4],c+=v[4])),h.push(g),typeof g.originalLine=="number"&&f.push(g)}Ia(h,z.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,Ia(f,z.compareByOriginalPositions),this.__originalMappings=f};ht.prototype._findMapping=function(t,r,n,o,i,s){if(t[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[o]);return Yg.search(t,r,i,s)};ht.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var n=this._generatedMappings[t+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};ht.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",z.compareByGeneratedPositionsDeflated,z.getArg(t,"bias",Re.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var i=z.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=z.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=z.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:z.getArg(o,"originalLine",null),column:z.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};ht.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};ht.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];var o=t;this.sourceRoot!=null&&(o=z.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=z.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')};ht.prototype.generatedPositionFor=function(t){var r=z.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:z.getArg(t,"line"),originalColumn:z.getArg(t,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",z.compareByOriginalPositions,z.getArg(t,"bias",Re.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:z.getArg(i,"generatedLine",null),column:z.getArg(i,"generatedColumn",null),lastColumn:z.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Gl.BasicSourceMapConsumer=ht;function Rr(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Ji,this._names=new Ji;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=z.getArg(s,"offset"),c=z.getArg(a,"line"),u=z.getArg(a,"column");if(c<i.line||c===i.line&&u<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=a,{generatedOffset:{generatedLine:c+1,generatedColumn:u+1},consumer:new Re(z.getArg(s,"map"),t)}})}Rr.prototype=Object.create(Re.prototype);Rr.prototype.constructor=Re;Rr.prototype._version=3;Object.defineProperty(Rr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});Rr.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=Yg.search(r,this._sections,function(i,s){var a=i.generatedLine-s.generatedOffset.generatedLine;return a||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:r.generatedLine-(o.generatedOffset.generatedLine-1),column:r.generatedColumn-(o.generatedOffset.generatedLine===r.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};Rr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Rr.prototype.sourceContentFor=function(t,r){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(t,!0);if(i)return i}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};Rr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(z.getArg(t,"source"))!==-1){var o=n.consumer.generatedPositionFor(t);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};Rr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var a=i[s],c=o.consumer._sources.at(a.source);c=z.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;a.name&&(u=o.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var p={source:c,generatedLine:a.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(o.generatedOffset.generatedLine===a.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}Ia(this.__generatedMappings,z.compareByGeneratedPositionsDeflated),Ia(this.__originalMappings,z.compareByOriginalPositions)};Gl.IndexedSourceMapConsumer=Rr});var h2=$(f2=>{var S6=Hg().SourceMapGenerator,Bl=Ki(),$6=/(\r?\n)/,P6=10,Yi="$$$isSourceNode$$$";function Qt(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=o??null,this[Yi]=!0,n!=null&&this.add(n)}Qt.fromStringWithSourceMap=function(t,r,n){var o=new Qt,i=t.split($6),s=0,a=function(){var d=h(),f=h()||"";return d+f;function h(){return s<i.length?i[s++]:void 0}},c=1,u=0,p=null;return r.eachMapping(function(d){if(p!==null)if(c<d.generatedLine)l(p,a()),c++,u=0;else{var f=i[s]||"",h=f.substr(0,d.generatedColumn-u);i[s]=f.substr(d.generatedColumn-u),u=d.generatedColumn,l(p,h),p=d;return}for(;c<d.generatedLine;)o.add(a()),c++;if(u<d.generatedColumn){var f=i[s]||"";o.add(f.substr(0,d.generatedColumn)),i[s]=f.substr(d.generatedColumn),u=d.generatedColumn}p=d},this),s<i.length&&(p&&l(p,a()),o.add(i.splice(s).join(""))),r.sources.forEach(function(d){var f=r.sourceContentFor(d);f!=null&&(n!=null&&(d=Bl.join(n,d)),o.setSourceContent(d,f))}),o;function l(d,f){if(d===null||d.source===void 0)o.add(f);else{var h=n?Bl.join(n,d.source):d.source;o.add(new Qt(d.originalLine,d.originalColumn,h,f,d.name))}}};Qt.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Yi]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};Qt.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Yi]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};Qt.prototype.walk=function(t){for(var r,n=0,o=this.children.length;n<o;n++)r=this.children[n],r[Yi]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Qt.prototype.join=function(t){var r,n,o=this.children.length;if(o>0){for(r=[],n=0;n<o-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this};Qt.prototype.replaceRight=function(t,r){var n=this.children[this.children.length-1];return n[Yi]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this};Qt.prototype.setSourceContent=function(t,r){this.sourceContents[Bl.toSetString(t)]=r};Qt.prototype.walkSourceContents=function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Yi]&&this.children[r].walkSourceContents(t);for(var o=Object.keys(this.sourceContents),r=0,n=o.length;r<n;r++)t(Bl.fromSetString(o[r]),this.sourceContents[o[r]])};Qt.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};Qt.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},n=new S6(t),o=!1,i=null,s=null,a=null,c=null;return this.walk(function(u,p){r.code+=u,p.source!==null&&p.line!==null&&p.column!==null?((i!==p.source||s!==p.line||a!==p.column||c!==p.name)&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name}),i=p.source,s=p.line,a=p.column,c=p.name,o=!0):o&&(n.addMapping({generated:{line:r.line,column:r.column}}),i=null,o=!1);for(var l=0,d=u.length;l<d;l++)u.charCodeAt(l)===P6?(r.line++,r.column=0,l+1===d?(i=null,o=!1):o&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name})):r.column++}),this.walkSourceContents(function(u,p){n.setSourceContent(u,p)}),{code:r.code,map:n}};f2.SourceNode=Qt});var m2=$(Vl=>{Vl.SourceMapGenerator=Hg().SourceMapGenerator;Vl.SourceMapConsumer=d2().SourceMapConsumer;Vl.SourceNode=h2().SourceNode});var v2=$((Hl,_2)=>{"use strict";Hl.__esModule=!0;var Xg=Dt(),Yo=void 0;try{(typeof define!="function"||!define.amd)&&(g2=m2(),Yo=g2.SourceNode)}catch{}var g2;Yo||(Yo=function(e,t,r,n){this.src="",n&&this.add(n)},Yo.prototype={add:function(t){Xg.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){Xg.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function Qg(e,t,r){if(Xg.isArray(e)){for(var n=[],o=0,i=e.length;o<i;o++)n.push(t.wrap(e[o],r));return n}else if(typeof e=="boolean"||typeof e=="number")return e+"";return e}function y2(e){this.srcFile=e,this.source=[]}y2.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,r){this.source.unshift(this.wrap(t,r))},push:function(t,r){this.source.push(this.wrap(t,r))},merge:function(){var t=this.empty();return this.each(function(r){t.add([" ",r,`
|
|
125
|
-
`])}),t},each:function(t){for(var r=0,n=this.source.length;r<n;r++)t(this.source[r])},empty:function(){var t=this.currentLocation||{start:{}};return new Yo(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return t instanceof Yo?t:(t=Qg(t,this,r),new Yo(r.start.line,r.start.column,this.srcFile,t))},functionCall:function(t,r,n){return n=this.generateList(n),this.wrap([t,r?"."+r+"(":"(",n,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var r=this,n=[];Object.keys(t).forEach(function(i){var s=Qg(t[i],r);s!=="undefined"&&n.push([r.quotedString(i),":",s])});var o=this.generateList(n);return o.prepend("{"),o.add("}"),o},generateList:function(t){for(var r=this.empty(),n=0,o=t.length;n<o;n++)n&&r.add(","),r.add(Qg(t[n],this));return r},generateArray:function(t){var r=this.generateList(t);return r.prepend("["),r.add("]"),r}};Hl.default=y2;_2.exports=Hl.default});var S2=$((Wl,k2)=>{"use strict";Wl.__esModule=!0;function x2(e){return e&&e.__esModule?e:{default:e}}var w2=Tl(),E6=
|
|
124
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var i=this.next();return typeof i<"u"?i:this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(i){this.begin(i)}};return n.options={},n.performAction=function(i,s,a,c){function u(l,d){return s.yytext=s.yytext.substring(l,s.yyleng-d+l)}var p=c;switch(a){case 0:if(s.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):s.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),s.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(u(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(s.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return s.yytext=u(1,2).replace(/\\"/g,'"'),80;break;case 32:return s.yytext=u(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return s.yytext=s.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},n})();e.lexer=t;function r(){this.yy={}}return r.prototype=e,e.Parser=r,new r})();Ol.default=R8;RP.exports=Ol.default});var Ll=$((Ml,OP)=>{"use strict";Ml.__esModule=!0;function I8(e){return e&&e.__esModule?e:{default:e}}var z8=mr(),Ig=I8(z8);function Nl(){this.parents=[]}Nl.prototype={constructor:Nl,mutating:!1,acceptKey:function(t,r){var n=this.accept(t[r]);if(this.mutating){if(n&&!Nl.prototype[n.type])throw new Ig.default('Unexpected node type "'+n.type+'" found when accepting '+r+" on "+t.type);t[r]=n}},acceptRequired:function(t,r){if(this.acceptKey(t,r),!t[r])throw new Ig.default(t.type+" requires "+r)},acceptArray:function(t){for(var r=0,n=t.length;r<n;r++)this.acceptKey(t,r),t[r]||(t.splice(r,1),r--,n--)},accept:function(t){if(t){if(!this[t.type])throw new Ig.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var r=this[t.type](t);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return t}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:jl,Decorator:jl,BlockStatement:zP,DecoratorBlock:zP,PartialStatement:DP,PartialBlockStatement:function(t){DP.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:jl,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}};function jl(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function zP(e){jl.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function DP(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}Ml.default=Nl;OP.exports=Ml.default});var jP=$((Zl,NP)=>{"use strict";Zl.__esModule=!0;function D8(e){return e&&e.__esModule?e:{default:e}}var O8=Ll(),N8=D8(O8);function Yr(){var e=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=e}Yr.prototype=new N8.default;Yr.prototype.Program=function(e){var t=!this.options.ignoreStandalone,r=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,o=0,i=n.length;o<i;o++){var s=n[o],a=this.accept(s);if(a){var c=zg(n,o,r),u=Dg(n,o,r),p=a.openStandalone&&c,l=a.closeStandalone&&u,d=a.inlineStandalone&&c&&u;a.close&&Wo(n,o,!0),a.open&&Qn(n,o,!0),t&&d&&(Wo(n,o),Qn(n,o)&&s.type==="PartialStatement"&&(s.indent=/([ \t]+$)/.exec(n[o-1].original)[1])),t&&p&&(Wo((s.program||s.inverse).body),Qn(n,o)),t&&l&&(Wo(n,o),Qn((s.inverse||s.program).body))}}return e};Yr.prototype.BlockStatement=Yr.prototype.DecoratorBlock=Yr.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,r=e.program&&e.inverse,n=r,o=r;if(r&&r.chained)for(n=r.body[0].program;o.chained;)o=o.body[o.body.length-1].program;var i={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:Dg(t.body),closeStandalone:zg((n||t).body)};if(e.openStrip.close&&Wo(t.body,null,!0),r){var s=e.inverseStrip;s.open&&Qn(t.body,null,!0),s.close&&Wo(n.body,null,!0),e.closeStrip.open&&Qn(o.body,null,!0),!this.options.ignoreStandalone&&zg(t.body)&&Dg(n.body)&&(Qn(t.body),Wo(n.body))}else e.closeStrip.open&&Qn(t.body,null,!0);return i};Yr.prototype.Decorator=Yr.prototype.MustacheStatement=function(e){return e.strip};Yr.prototype.PartialStatement=Yr.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}};function zg(e,t,r){t===void 0&&(t=e.length);var n=e[t-1],o=e[t-2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original)}function Dg(e,t,r){t===void 0&&(t=-1);var n=e[t+1],o=e[t+2];if(!n)return r;if(n.type==="ContentStatement")return(o||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original)}function Wo(e,t,r){var n=e[t==null?0:t+1];if(!(!n||n.type!=="ContentStatement"||!r&&n.rightStripped)){var o=n.value;n.value=n.value.replace(r?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==o}}function Qn(e,t,r){var n=e[t==null?e.length-1:t-1];if(!(!n||n.type!=="ContentStatement"||!r&&n.leftStripped)){var o=n.value;return n.value=n.value.replace(r?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==o,n.leftStripped}}Zl.default=Yr;NP.exports=Zl.default});var MP=$(gr=>{"use strict";gr.__esModule=!0;gr.SourceLocation=L8;gr.id=Z8;gr.stripFlags=U8;gr.stripComment=q8;gr.preparePath=F8;gr.prepareMustache=G8;gr.prepareRawBlock=B8;gr.prepareBlock=V8;gr.prepareProgram=H8;gr.preparePartialBlock=W8;function j8(e){return e&&e.__esModule?e:{default:e}}var M8=mr(),Og=j8(M8);function Ng(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var r={loc:e.path.loc};throw new Og.default(e.path.original+" doesn't match "+t,r)}}function L8(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}}function Z8(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e}function U8(e,t){return{open:e.charAt(2)==="~",close:t.charAt(t.length-3)==="~"}}function q8(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function F8(e,t,r){r=this.locInfo(r);for(var n=e?"@":"",o=[],i=0,s=0,a=t.length;s<a;s++){var c=t[s].part,u=t[s].original!==c;if(n+=(t[s].separator||"")+c,!u&&(c===".."||c==="."||c==="this")){if(o.length>0)throw new Og.default("Invalid path: "+n,{loc:r});c===".."&&i++}else o.push(c)}return{type:"PathExpression",data:e,depth:i,parts:o,original:n,loc:r}}function G8(e,t,r,n,o,i){var s=n.charAt(3)||n.charAt(2),a=s!=="{"&&s!=="&",c=/\*/.test(n);return{type:c?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:a,strip:o,loc:this.locInfo(i)}}function B8(e,t,r,n){Ng(e,r),n=this.locInfo(n);var o={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:o,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}function V8(e,t,r,n,o,i){n&&n.path&&Ng(e,n);var s=/\*/.test(e.open);t.blockParams=e.blockParams;var a=void 0,c=void 0;if(r){if(s)throw new Og.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),c=r.strip,a=r.program}return o&&(o=a,a=t,t=o),{type:s?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:a,openStrip:e.strip,inverseStrip:c,closeStrip:n&&n.strip,loc:this.locInfo(i)}}function H8(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;r&&n&&(t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}}function W8(e,t,r,n){return Ng(e,r),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}});var UP=$($a=>{"use strict";$a.__esModule=!0;$a.parseWithoutProcessing=ZP;$a.parse=r6;function K8(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function LP(e){return e&&e.__esModule?e:{default:e}}var J8=IP(),jg=LP(J8),Y8=jP(),Q8=LP(Y8),X8=MP(),e6=K8(X8),t6=Dt();$a.parser=jg.default;var Ul={};t6.extend(Ul,e6);function ZP(e,t){if(e.type==="Program")return e;jg.default.yy=Ul,Ul.locInfo=function(n){return new Ul.SourceLocation(t&&t.srcName,n)};var r=jg.default.parse(e);return r}function r6(e,t){var r=ZP(e,t),n=new Q8.default(t);return n.accept(r)}});var BP=$(Ta=>{"use strict";Ta.__esModule=!0;Ta.Compiler=Mg;Ta.precompile=s6;Ta.compile=a6;function FP(e){return e&&e.__esModule?e:{default:e}}var n6=mr(),Ea=FP(n6),Ca=Dt(),o6=Rg(),Pa=FP(o6),i6=[].slice;function Mg(){}Mg.prototype={compiler:Mg,equals:function(t){var r=this.opcodes.length;if(t.opcodes.length!==r)return!1;for(var n=0;n<r;n++){var o=this.opcodes[n],i=t.opcodes[n];if(o.opcode!==i.opcode||!GP(o.args,i.args))return!1}r=this.children.length;for(var n=0;n<r;n++)if(!this.children[n].equals(t.children[n]))return!1;return!0},guid:0,compile:function(t,r){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=r,this.stringParams=r.stringParams,this.trackIds=r.trackIds,r.blockParams=r.blockParams||[],r.knownHelpers=Ca.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},r.knownHelpers),this.accept(t)},compileProgram:function(t){var r=new this.compiler,n=r.compile(t,this.options),o=this.guid++;return this.usePartial=this.usePartial||n.usePartial,this.children[o]=n,this.useDepths=this.useDepths||n.useDepths,o},accept:function(t){if(!this[t.type])throw new Ea.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var r=this[t.type](t);return this.sourceNode.shift(),r},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var r=t.body,n=r.length,o=0;o<n;o++)this.accept(r[o]);return this.options.blockParams.shift(),this.isSimple=n===1,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){qP(t);var r=t.program,n=t.inverse;r=r&&this.compileProgram(r),n=n&&this.compileProgram(n);var o=this.classifySexpr(t);o==="helper"?this.helperSexpr(t,r,n):o==="simple"?(this.simpleSexpr(t),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,r,n),this.opcode("pushProgram",r),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var r=t.program&&this.compileProgram(t.program),n=this.setupFullMustacheParams(t,r,void 0),o=t.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,o.original)},PartialStatement:function(t){this.usePartial=!0;var r=t.program;r&&(r=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new Ea.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var o=t.name.original,i=t.name.type==="SubExpression";i&&this.accept(t.name),this.setupFullMustacheParams(t,r,void 0,!0);var s=t.indent||"";this.options.preventIndent&&s&&(this.opcode("appendContent",s),s=""),this.opcode("invokePartial",i,o,s),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){qP(t);var r=this.classifySexpr(t);r==="simple"?this.simpleSexpr(t):r==="helper"?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,r,n){var o=t.path,i=o.parts[0],s=r!=null||n!=null;this.opcode("getContext",o.depth),this.opcode("pushProgram",r),this.opcode("pushProgram",n),o.strict=!0,this.accept(o),this.opcode("invokeAmbiguous",i,s)},simpleSexpr:function(t){var r=t.path;r.strict=!0,this.accept(r),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,r,n){var o=this.setupFullMustacheParams(t,r,n),i=t.path,s=i.parts[0];if(this.options.knownHelpers[s])this.opcode("invokeKnownHelper",o.length,s);else{if(this.options.knownHelpersOnly)throw new Ea.default("You specified knownHelpersOnly, but used the unknown helper "+s,t);i.strict=!0,i.falsy=!0,this.accept(i),this.opcode("invokeHelper",o.length,i.original,Pa.default.helpers.simpleId(i))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var r=t.parts[0],n=Pa.default.helpers.scopedId(t),o=!t.depth&&!n&&this.blockParamIndex(r);o?this.opcode("lookupBlockParam",o,t.parts):r?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var r=t.pairs,n=0,o=r.length;for(this.opcode("pushHash");n<o;n++)this.pushParam(r[n].value);for(;n--;)this.opcode("assignToHash",r[n].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:i6.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var r=Pa.default.helpers.simpleId(t.path),n=r&&!!this.blockParamIndex(t.path.parts[0]),o=!n&&Pa.default.helpers.helperExpression(t),i=!n&&(o||r);if(i&&!o){var s=t.path.parts[0],a=this.options;a.knownHelpers[s]?o=!0:a.knownHelpersOnly&&(i=!1)}return o?"helper":i?"ambiguous":"simple"},pushParams:function(t){for(var r=0,n=t.length;r<n;r++)this.pushParam(t[r])},pushParam:function(t){var r=t.value!=null?t.value:t.original||"";if(this.stringParams)r.replace&&(r=r.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",r,t.type),t.type==="SubExpression"&&this.accept(t);else{if(this.trackIds){var n=void 0;if(t.parts&&!Pa.default.helpers.scopedId(t)&&!t.depth&&(n=this.blockParamIndex(t.parts[0])),n){var o=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,o)}else r=t.original||r,r.replace&&(r=r.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,r)}this.accept(t)}},setupFullMustacheParams:function(t,r,n,o){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",r),this.opcode("pushProgram",n),t.hash?this.accept(t.hash):this.opcode("emptyHash",o),i},blockParamIndex:function(t){for(var r=0,n=this.options.blockParams.length;r<n;r++){var o=this.options.blockParams[r],i=o&&Ca.indexOf(o,t);if(o&&i>=0)return[r,i]}}};function s6(e,t,r){if(e==null||typeof e!="string"&&e.type!=="Program")throw new Ea.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);t=t||{},"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=r.parse(e,t),o=new r.Compiler().compile(n,t);return new r.JavaScriptCompiler().compile(o,t)}function a6(e,t,r){if(t===void 0&&(t={}),e==null||typeof e!="string"&&e.type!=="Program")throw new Ea.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);t=Ca.extend({},t),"data"in t||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function o(){var s=r.parse(e,t),a=new r.Compiler().compile(s,t),c=new r.JavaScriptCompiler().compile(a,t,void 0,!0);return r.template(c)}function i(s,a){return n||(n=o()),n.call(this,s,a)}return i._setup=function(s){return n||(n=o()),n._setup(s)},i._child=function(s,a,c,u){return n||(n=o()),n._child(s,a,c,u)},i}function GP(e,t){if(e===t)return!0;if(Ca.isArray(e)&&Ca.isArray(t)&&e.length===t.length){for(var r=0;r<e.length;r++)if(!GP(e[r],t[r]))return!1;return!0}}function qP(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}});var HP=$(Lg=>{var VP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Lg.encode=function(e){if(0<=e&&e<VP.length)return VP[e];throw new TypeError("Must be between 0 and 63: "+e)};Lg.decode=function(e){var t=65,r=90,n=97,o=122,i=48,s=57,a=43,c=47,u=26,p=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+u:i<=e&&e<=s?e-i+p:e==a?62:e==c?63:-1}});var qg=$(Ug=>{var WP=HP(),Zg=5,KP=1<<Zg,JP=KP-1,YP=KP;function c6(e){return e<0?(-e<<1)+1:(e<<1)+0}function u6(e){var t=(e&1)===1,r=e>>1;return t?-r:r}Ug.encode=function(t){var r="",n,o=c6(t);do n=o&JP,o>>>=Zg,o>0&&(n|=YP),r+=WP.encode(n);while(o>0);return r};Ug.decode=function(t,r,n){var o=t.length,i=0,s=0,a,c;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(c=WP.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));a=!!(c&YP),c&=JP,i=i+(c<<s),s+=Zg}while(a);n.value=u6(i),n.rest=r}});var Ki=$(St=>{function l6(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}St.getArg=l6;var QP=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,p6=/^data:.+\,.+$/;function Aa(e){var t=e.match(QP);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}St.urlParse=Aa;function Hi(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}St.urlGenerate=Hi;function Fg(e){var t=e,r=Aa(e);if(r){if(!r.path)return e;t=r.path}for(var n=St.isAbsolute(t),o=t.split(/\/+/),i,s=0,a=o.length-1;a>=0;a--)i=o[a],i==="."?o.splice(a,1):i===".."?s++:s>0&&(i===""?(o.splice(a+1,s),s=0):(o.splice(a,2),s--));return t=o.join("/"),t===""&&(t=n?"/":"."),r?(r.path=t,Hi(r)):t}St.normalize=Fg;function XP(e,t){e===""&&(e="."),t===""&&(t=".");var r=Aa(t),n=Aa(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Hi(r);if(r||t.match(p6))return t;if(n&&!n.host&&!n.path)return n.host=t,Hi(n);var o=t.charAt(0)==="/"?t:Fg(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Hi(n)):o}St.join=XP;St.isAbsolute=function(e){return e.charAt(0)==="/"||QP.test(e)};function d6(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}St.relative=d6;var e2=(function(){var e=Object.create(null);return!("__proto__"in e)})();function t2(e){return e}function f6(e){return r2(e)?"$"+e:e}St.toSetString=e2?t2:f6;function h6(e){return r2(e)?e.slice(1):e}St.fromSetString=e2?t2:h6;function r2(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function m6(e,t,r){var n=Wi(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:Wi(e.name,t.name)}St.compareByOriginalPositions=m6;function g6(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=Wi(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:Wi(e.name,t.name)}St.compareByGeneratedPositionsDeflated=g6;function Wi(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function y6(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Wi(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Wi(e.name,t.name)}St.compareByGeneratedPositionsInflated=y6;function _6(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}St.parseSourceMapInput=_6;function v6(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Aa(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}t=XP(Hi(n),t)}return Fg(t)}St.computeSourceURL=v6});var Vg=$(n2=>{var Gg=Ki(),Bg=Object.prototype.hasOwnProperty,Ko=typeof Map<"u";function xn(){this._array=[],this._set=Ko?new Map:Object.create(null)}xn.fromArray=function(t,r){for(var n=new xn,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};xn.prototype.size=function(){return Ko?this._set.size:Object.getOwnPropertyNames(this._set).length};xn.prototype.add=function(t,r){var n=Ko?t:Gg.toSetString(t),o=Ko?this.has(t):Bg.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(Ko?this._set.set(t,i):this._set[n]=i)};xn.prototype.has=function(t){if(Ko)return this._set.has(t);var r=Gg.toSetString(t);return Bg.call(this._set,r)};xn.prototype.indexOf=function(t){if(Ko){var r=this._set.get(t);if(r>=0)return r}else{var n=Gg.toSetString(t);if(Bg.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};xn.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};xn.prototype.toArray=function(){return this._array.slice()};n2.ArraySet=xn});var s2=$(i2=>{var o2=Ki();function w6(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||o2.compareByGeneratedPositionsInflated(e,t)<=0}function ql(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ql.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};ql.prototype.add=function(t){w6(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};ql.prototype.toArray=function(){return this._sorted||(this._array.sort(o2.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};i2.MappingList=ql});var Hg=$(a2=>{var Ra=qg(),Ke=Ki(),Fl=Vg().ArraySet,b6=s2().MappingList;function yr(e){e||(e={}),this._file=Ke.getArg(e,"file",null),this._sourceRoot=Ke.getArg(e,"sourceRoot",null),this._skipValidation=Ke.getArg(e,"skipValidation",!1),this._sources=new Fl,this._names=new Fl,this._mappings=new b6,this._sourcesContents=null}yr.prototype._version=3;yr.fromSourceMap=function(t){var r=t.sourceRoot,n=new yr({file:t.file,sourceRoot:r});return t.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,r!=null&&(i.source=Ke.relative(r,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),t.sources.forEach(function(o){var i=o;r!==null&&(i=Ke.relative(r,o)),n._sources.has(i)||n._sources.add(i);var s=t.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};yr.prototype.addMapping=function(t){var r=Ke.getArg(t,"generated"),n=Ke.getArg(t,"original",null),o=Ke.getArg(t,"source",null),i=Ke.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};yr.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=Ke.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Ke.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Ke.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};yr.prototype.applySourceMap=function(t,r,n){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=Ke.relative(i,o));var s=new Fl,a=new Fl;this._mappings.unsortedForEach(function(c){if(c.source===o&&c.originalLine!=null){var u=t.originalPositionFor({line:c.originalLine,column:c.originalColumn});u.source!=null&&(c.source=u.source,n!=null&&(c.source=Ke.join(n,c.source)),i!=null&&(c.source=Ke.relative(i,c.source)),c.originalLine=u.line,c.originalColumn=u.column,u.name!=null&&(c.name=u.name))}var p=c.source;p!=null&&!s.has(p)&&s.add(p);var l=c.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,t.sources.forEach(function(c){var u=t.sourceContentFor(c);u!=null&&(n!=null&&(c=Ke.join(n,c)),i!=null&&(c=Ke.relative(i,c)),this.setSourceContent(c,u))},this)};yr.prototype._validateMapping=function(t,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:o}))}};yr.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,s=0,a="",c,u,p,l,d=this._mappings.toArray(),f=0,h=d.length;f<h;f++){if(u=d[f],c="",u.generatedLine!==r)for(t=0;u.generatedLine!==r;)c+=";",r++;else if(f>0){if(!Ke.compareByGeneratedPositionsInflated(u,d[f-1]))continue;c+=","}c+=Ra.encode(u.generatedColumn-t),t=u.generatedColumn,u.source!=null&&(l=this._sources.indexOf(u.source),c+=Ra.encode(l-s),s=l,c+=Ra.encode(u.originalLine-1-o),o=u.originalLine-1,c+=Ra.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(p=this._names.indexOf(u.name),c+=Ra.encode(p-i),i=p)),a+=c}return a};yr.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Ke.relative(r,n));var o=Ke.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};yr.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};yr.prototype.toString=function(){return JSON.stringify(this.toJSON())};a2.SourceMapGenerator=yr});var c2=$(Jo=>{Jo.GREATEST_LOWER_BOUND=1;Jo.LEAST_UPPER_BOUND=2;function Wg(e,t,r,n,o,i){var s=Math.floor((t-e)/2)+e,a=o(r,n[s],!0);return a===0?s:a>0?t-s>1?Wg(s,t,r,n,o,i):i==Jo.LEAST_UPPER_BOUND?t<n.length?t:-1:s:s-e>1?Wg(e,s,r,n,o,i):i==Jo.LEAST_UPPER_BOUND?s:e<0?-1:e}Jo.search=function(t,r,n,o){if(r.length===0)return-1;var i=Wg(-1,r.length,t,r,n,o||Jo.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(r[i],r[i-1],!0)===0;)--i;return i}});var l2=$(u2=>{function Kg(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function x6(e,t){return Math.round(e+Math.random()*(t-e))}function Jg(e,t,r,n){if(r<n){var o=x6(r,n),i=r-1;Kg(e,o,n);for(var s=e[n],a=r;a<n;a++)t(e[a],s)<=0&&(i+=1,Kg(e,i,a));Kg(e,i+1,a);var c=i+1;Jg(e,t,r,c-1),Jg(e,t,c+1,n)}}u2.quickSort=function(e,t){Jg(e,t,0,e.length-1)}});var d2=$(Gl=>{var z=Ki(),Yg=c2(),Ji=Vg().ArraySet,k6=qg(),Ia=l2().quickSort;function Re(e,t){var r=e;return typeof e=="string"&&(r=z.parseSourceMapInput(e)),r.sections!=null?new Rr(r,t):new ht(r,t)}Re.fromSourceMap=function(e,t){return ht.fromSourceMap(e,t)};Re.prototype._version=3;Re.prototype.__generatedMappings=null;Object.defineProperty(Re.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Re.prototype.__originalMappings=null;Object.defineProperty(Re.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Re.prototype._charIsMappingSeparator=function(t,r){var n=t.charAt(r);return n===";"||n===","};Re.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Re.GENERATED_ORDER=1;Re.ORIGINAL_ORDER=2;Re.GREATEST_LOWER_BOUND=1;Re.LEAST_UPPER_BOUND=2;Re.prototype.eachMapping=function(t,r,n){var o=r||null,i=n||Re.GENERATED_ORDER,s;switch(i){case Re.GENERATED_ORDER:s=this._generatedMappings;break;case Re.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(c){var u=c.source===null?null:this._sources.at(c.source);return u=z.computeSourceURL(a,u,this._sourceMapURL),{source:u,generatedLine:c.generatedLine,generatedColumn:c.generatedColumn,originalLine:c.originalLine,originalColumn:c.originalColumn,name:c.name===null?null:this._names.at(c.name)}},this).forEach(t,o)};Re.prototype.allGeneratedPositionsFor=function(t){var r=z.getArg(t,"line"),n={source:z.getArg(t,"source"),originalLine:r,originalColumn:z.getArg(t,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",z.compareByOriginalPositions,Yg.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(t.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)o.push({line:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==c;)o.push({line:z.getArg(s,"generatedLine",null),column:z.getArg(s,"generatedColumn",null),lastColumn:z.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};Gl.SourceMapConsumer=Re;function ht(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sources"),i=z.getArg(r,"names",[]),s=z.getArg(r,"sourceRoot",null),a=z.getArg(r,"sourcesContent",null),c=z.getArg(r,"mappings"),u=z.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=z.normalize(s)),o=o.map(String).map(z.normalize).map(function(p){return s&&z.isAbsolute(s)&&z.isAbsolute(p)?z.relative(s,p):p}),this._names=Ji.fromArray(i.map(String),!0),this._sources=Ji.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(p){return z.computeSourceURL(s,p,t)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=t,this.file=u}ht.prototype=Object.create(Re.prototype);ht.prototype.consumer=Re;ht.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=z.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};ht.fromSourceMap=function(t,r){var n=Object.create(ht.prototype),o=n._names=Ji.fromArray(t._names.toArray(),!0),i=n._sources=Ji.fromArray(t._sources.toArray(),!0);n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(f){return z.computeSourceURL(n.sourceRoot,f,r)});for(var s=t._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],u=0,p=s.length;u<p;u++){var l=s[u],d=new p2;d.generatedLine=l.generatedLine,d.generatedColumn=l.generatedColumn,l.source&&(d.source=i.indexOf(l.source),d.originalLine=l.originalLine,d.originalColumn=l.originalColumn,l.name&&(d.name=o.indexOf(l.name)),c.push(d)),a.push(d)}return Ia(n.__originalMappings,z.compareByOriginalPositions),n};ht.prototype._version=3;Object.defineProperty(ht.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function p2(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}ht.prototype._parseMappings=function(t,r){for(var n=1,o=0,i=0,s=0,a=0,c=0,u=t.length,p=0,l={},d={},f=[],h=[],g,y,v,w,x;p<u;)if(t.charAt(p)===";")n++,p++,o=0;else if(t.charAt(p)===",")p++;else{for(g=new p2,g.generatedLine=n,w=p;w<u&&!this._charIsMappingSeparator(t,w);w++);if(y=t.slice(p,w),v=l[y],v)p+=y.length;else{for(v=[];p<w;)k6.decode(t,p,d),x=d.value,p=d.rest,v.push(x);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");l[y]=v}g.generatedColumn=o+v[0],o=g.generatedColumn,v.length>1&&(g.source=a+v[1],a+=v[1],g.originalLine=i+v[2],i=g.originalLine,g.originalLine+=1,g.originalColumn=s+v[3],s=g.originalColumn,v.length>4&&(g.name=c+v[4],c+=v[4])),h.push(g),typeof g.originalLine=="number"&&f.push(g)}Ia(h,z.compareByGeneratedPositionsDeflated),this.__generatedMappings=h,Ia(f,z.compareByOriginalPositions),this.__originalMappings=f};ht.prototype._findMapping=function(t,r,n,o,i,s){if(t[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[o]);return Yg.search(t,r,i,s)};ht.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var n=this._generatedMappings[t+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};ht.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",z.compareByGeneratedPositionsDeflated,z.getArg(t,"bias",Re.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var i=z.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=z.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=z.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:z.getArg(o,"originalLine",null),column:z.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};ht.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};ht.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];var o=t;this.sourceRoot!=null&&(o=z.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=z.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')};ht.prototype.generatedPositionFor=function(t){var r=z.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:z.getArg(t,"line"),originalColumn:z.getArg(t,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",z.compareByOriginalPositions,z.getArg(t,"bias",Re.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:z.getArg(i,"generatedLine",null),column:z.getArg(i,"generatedColumn",null),lastColumn:z.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Gl.BasicSourceMapConsumer=ht;function Rr(e,t){var r=e;typeof e=="string"&&(r=z.parseSourceMapInput(e));var n=z.getArg(r,"version"),o=z.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Ji,this._names=new Ji;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=z.getArg(s,"offset"),c=z.getArg(a,"line"),u=z.getArg(a,"column");if(c<i.line||c===i.line&&u<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=a,{generatedOffset:{generatedLine:c+1,generatedColumn:u+1},consumer:new Re(z.getArg(s,"map"),t)}})}Rr.prototype=Object.create(Re.prototype);Rr.prototype.constructor=Re;Rr.prototype._version=3;Object.defineProperty(Rr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});Rr.prototype.originalPositionFor=function(t){var r={generatedLine:z.getArg(t,"line"),generatedColumn:z.getArg(t,"column")},n=Yg.search(r,this._sections,function(i,s){var a=i.generatedLine-s.generatedOffset.generatedLine;return a||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:r.generatedLine-(o.generatedOffset.generatedLine-1),column:r.generatedColumn-(o.generatedOffset.generatedLine===r.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};Rr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Rr.prototype.sourceContentFor=function(t,r){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(t,!0);if(i)return i}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};Rr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(z.getArg(t,"source"))!==-1){var o=n.consumer.generatedPositionFor(t);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};Rr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var a=i[s],c=o.consumer._sources.at(a.source);c=z.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;a.name&&(u=o.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var p={source:c,generatedLine:a.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(o.generatedOffset.generatedLine===a.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}Ia(this.__generatedMappings,z.compareByGeneratedPositionsDeflated),Ia(this.__originalMappings,z.compareByOriginalPositions)};Gl.IndexedSourceMapConsumer=Rr});var h2=$(f2=>{var S6=Hg().SourceMapGenerator,Bl=Ki(),$6=/(\r?\n)/,P6=10,Yi="$$$isSourceNode$$$";function Qt(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=o??null,this[Yi]=!0,n!=null&&this.add(n)}Qt.fromStringWithSourceMap=function(t,r,n){var o=new Qt,i=t.split($6),s=0,a=function(){var d=h(),f=h()||"";return d+f;function h(){return s<i.length?i[s++]:void 0}},c=1,u=0,p=null;return r.eachMapping(function(d){if(p!==null)if(c<d.generatedLine)l(p,a()),c++,u=0;else{var f=i[s]||"",h=f.substr(0,d.generatedColumn-u);i[s]=f.substr(d.generatedColumn-u),u=d.generatedColumn,l(p,h),p=d;return}for(;c<d.generatedLine;)o.add(a()),c++;if(u<d.generatedColumn){var f=i[s]||"";o.add(f.substr(0,d.generatedColumn)),i[s]=f.substr(d.generatedColumn),u=d.generatedColumn}p=d},this),s<i.length&&(p&&l(p,a()),o.add(i.splice(s).join(""))),r.sources.forEach(function(d){var f=r.sourceContentFor(d);f!=null&&(n!=null&&(d=Bl.join(n,d)),o.setSourceContent(d,f))}),o;function l(d,f){if(d===null||d.source===void 0)o.add(f);else{var h=n?Bl.join(n,d.source):d.source;o.add(new Qt(d.originalLine,d.originalColumn,h,f,d.name))}}};Qt.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Yi]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};Qt.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Yi]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};Qt.prototype.walk=function(t){for(var r,n=0,o=this.children.length;n<o;n++)r=this.children[n],r[Yi]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Qt.prototype.join=function(t){var r,n,o=this.children.length;if(o>0){for(r=[],n=0;n<o-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this};Qt.prototype.replaceRight=function(t,r){var n=this.children[this.children.length-1];return n[Yi]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this};Qt.prototype.setSourceContent=function(t,r){this.sourceContents[Bl.toSetString(t)]=r};Qt.prototype.walkSourceContents=function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Yi]&&this.children[r].walkSourceContents(t);for(var o=Object.keys(this.sourceContents),r=0,n=o.length;r<n;r++)t(Bl.fromSetString(o[r]),this.sourceContents[o[r]])};Qt.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};Qt.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},n=new S6(t),o=!1,i=null,s=null,a=null,c=null;return this.walk(function(u,p){r.code+=u,p.source!==null&&p.line!==null&&p.column!==null?((i!==p.source||s!==p.line||a!==p.column||c!==p.name)&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name}),i=p.source,s=p.line,a=p.column,c=p.name,o=!0):o&&(n.addMapping({generated:{line:r.line,column:r.column}}),i=null,o=!1);for(var l=0,d=u.length;l<d;l++)u.charCodeAt(l)===P6?(r.line++,r.column=0,l+1===d?(i=null,o=!1):o&&n.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name})):r.column++}),this.walkSourceContents(function(u,p){n.setSourceContent(u,p)}),{code:r.code,map:n}};f2.SourceNode=Qt});var m2=$(Vl=>{Vl.SourceMapGenerator=Hg().SourceMapGenerator;Vl.SourceMapConsumer=d2().SourceMapConsumer;Vl.SourceNode=h2().SourceNode});var v2=$((Hl,_2)=>{"use strict";Hl.__esModule=!0;var Xg=Dt(),Yo=void 0;try{(typeof define!="function"||!define.amd)&&(g2=m2(),Yo=g2.SourceNode)}catch{}var g2;Yo||(Yo=function(e,t,r,n){this.src="",n&&this.add(n)},Yo.prototype={add:function(t){Xg.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){Xg.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}});function Qg(e,t,r){if(Xg.isArray(e)){for(var n=[],o=0,i=e.length;o<i;o++)n.push(t.wrap(e[o],r));return n}else if(typeof e=="boolean"||typeof e=="number")return e+"";return e}function y2(e){this.srcFile=e,this.source=[]}y2.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,r){this.source.unshift(this.wrap(t,r))},push:function(t,r){this.source.push(this.wrap(t,r))},merge:function(){var t=this.empty();return this.each(function(r){t.add([" ",r,`
|
|
125
|
+
`])}),t},each:function(t){for(var r=0,n=this.source.length;r<n;r++)t(this.source[r])},empty:function(){var t=this.currentLocation||{start:{}};return new Yo(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return t instanceof Yo?t:(t=Qg(t,this,r),new Yo(r.start.line,r.start.column,this.srcFile,t))},functionCall:function(t,r,n){return n=this.generateList(n),this.wrap([t,r?"."+r+"(":"(",n,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var r=this,n=[];Object.keys(t).forEach(function(i){var s=Qg(t[i],r);s!=="undefined"&&n.push([r.quotedString(i),":",s])});var o=this.generateList(n);return o.prepend("{"),o.add("}"),o},generateList:function(t){for(var r=this.empty(),n=0,o=t.length;n<o;n++)n&&r.add(","),r.add(Qg(t[n],this));return r},generateArray:function(t){var r=this.generateList(t);return r.prepend("["),r.add("]"),r}};Hl.default=y2;_2.exports=Hl.default});var S2=$((Wl,k2)=>{"use strict";Wl.__esModule=!0;function x2(e){return e&&e.__esModule?e:{default:e}}var w2=Tl(),E6=mr(),ey=x2(E6),C6=Dt(),T6=v2(),b2=x2(T6);function Qi(e){this.value=e}function Xi(){}Xi.prototype={nameLookup:function(t,r){return this.internalNameLookup(t,r)},depthedLookup:function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},compilerInfo:function(){var t=w2.COMPILER_REVISION,r=w2.REVISION_CHANGES[t];return[t,r]},appendToBuffer:function(t,r,n){return C6.isArray(t)||(t=[t]),t=this.source.wrap(t,r),this.environment.isSimple?["return ",t,";"]:n?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(t,r){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(r),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(t,r,n,o){this.environment=t,this.options=r,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!o,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,r),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var i=t.opcodes,s=void 0,a=void 0,c=void 0,u=void 0;for(c=0,u=i.length;c<u;c++)s=i[c],this.source.currentLocation=s.loc,a=a||s.loc,this[s.opcode].apply(this,s.args);if(this.source.currentLocation=a,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new ey.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
|
126
126
|
`]),this.decorators.push("return fn;"),o?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
|
127
127
|
`),this.decorators.push(`}
|
|
128
128
|
`),this.decorators=this.decorators.merge()));var p=this.createFunctionContext(o);if(this.isChild)return p;var l={compiler:this.compilerInfo(),main:p};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var d=this.context,f=d.programs,h=d.decorators;for(c=0,u=f.length;c<u;c++)f[c]&&(l[c]=f[c],h[c]&&(l[c+"_d"]=h[c],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),o?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),r.srcName?(l=l.toStringWithSourceMap({file:r.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new b2.default(this.options.srcName),this.decorators=new b2.default(this.options.srcName)},createFunctionContext:function(t){var r=this,n="",o=this.stackVars.concat(this.registers.list);o.length>0&&(n+=", "+o.join(", "));var i=0;Object.keys(this.aliases).forEach(function(c){var u=r.aliases[c];u.children&&u.referenceCount>1&&(n+=", alias"+ ++i+"="+c,u.children[0]="alias"+i)}),this.lookupPropertyFunctionIsUsed&&(n+=", "+this.lookupPropertyFunctionVarDeclaration());var s=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&s.push("blockParams"),this.useDepths&&s.push("depths");var a=this.mergeSource(n);return t?(s.push(a),Function.apply(this,s)):this.source.wrap(["function(",s.join(","),`) {
|
|
@@ -135,8 +135,8 @@ Expecting `+ao.join(", ")+", got '"+(this.terminals_[k]||k)+"'":ie="Parse error
|
|
|
135
135
|
return undefined
|
|
136
136
|
}
|
|
137
137
|
`.trim()},blockValue:function(t){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var o=this.popStack();n.splice(1,0,o),this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",r),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,r,n,o){var i=0;!o&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(t[i++])):this.pushContext(),this.resolvePath("context",t,i,r,n)},lookupBlockParam:function(t,r){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(t,r,n){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},resolvePath:function(t,r,n,o,i){var s=this;if(this.options.strict||this.options.assumeObjects){this.push(A6(this.options.strict&&i,this,r,n,t));return}for(var a=r.length;n<a;n++)this.replaceStack(function(c){var u=s.nameLookup(c,r[n],t);return o?[" && ",u]:[" != null ? ",u," : ",c]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,r){var n=this.nameLookup("decorators",r,"decorator"),o=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",o])," || fn;"])},invokeHelper:function(t,r,n){var o=this.popStack(),i=this.setupHelper(t,r),s=[];n&&s.push(i.name),s.push(o),this.options.strict||s.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(s,"||"),")"],c=this.source.functionCall(a,"call",i.callParams);this.push(c)},itemsSeparatedBy:function(t,r){var n=[];n.push(t[0]);for(var o=1;o<t.length;o++)n.push(r,t[o]);return n},invokeKnownHelper:function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var o=this.setupHelper(0,t,r),i=this.lastHelper=this.nameLookup("helpers",t,"helper"),s=["(","(helper = ",i," || ",n,")"];this.options.strict||(s[0]="(helper = ",s.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",s,o.paramsInit?["),(",o.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",o.callParams)," : helper))"])},invokePartial:function(t,r,n){var o=[],i=this.setupParams(r,1,o);t&&(r=this.popStack(),delete i.name),n&&(i.indent=JSON.stringify(n)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?o.unshift(r):o.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),o.push(i),this.push(this.source.functionCall("container.invokePartial","",o))},assignToHash:function(t){var r=this.popStack(),n=void 0,o=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(o=this.popStack(),n=this.popStack());var s=this.hash;n&&(s.contexts[t]=n),o&&(s.types[t]=o),i&&(s.ids[t]=i),s.values[t]=r},pushId:function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:Xi,compileChildren:function(t,r){for(var n=t.children,o=void 0,i=void 0,s=0,a=n.length;s<a;s++){o=n[s],i=new this.compiler;var c=this.matchExistingProgram(o);if(c==null){this.context.programs.push("");var u=this.context.programs.length;o.index=u,o.name="program"+u,this.context.programs[u]=i.compile(o,r,this.context,!this.precompile),this.context.decorators[u]=i.decorators,this.context.environments[u]=o,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,o.useDepths=this.useDepths,o.useBlockParams=this.useBlockParams}else o.index=c.index,o.name="program"+c.index,this.useDepths=this.useDepths||c.useDepths,this.useBlockParams=this.useBlockParams||c.useBlockParams}},matchExistingProgram:function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var o=this.context.environments[r];if(o&&o.equals(t))return o}},programExpression:function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof Qi||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new Qi(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var r=["("],n=void 0,o=void 0,i=void 0;if(!this.isInline())throw new ey.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof Qi)n=[s.value],r=["(",n],i=!0;else{o=!0;var a=this.incrStack();r=["((",this.push(a)," = ",s,")"],n=this.topStack()}var c=t.call(this,n);i||this.popStack(),o&&this.stackSlot--,this.push(r.concat(c,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var r=0,n=t.length;r<n;r++){var o=t[r];if(o instanceof Qi)this.compileStack.push(o);else{var i=this.incrStack();this.pushSource([i," = ",o,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof Qi)return n.value;if(!r){if(!this.stackSlot)throw new ey.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,r=t[t.length-1];return r instanceof Qi?r.value:r},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(t,r,n){var o=[],i=this.setupHelperArgs(r,t,o,n),s=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:o,paramsInit:i,name:s,callParams:[a].concat(o)}},setupParams:function(t,r,n){var o={},i=[],s=[],a=[],c=!n,u=void 0;c&&(n=[]),o.name=this.quotedString(t),o.hash=this.popStack(),this.trackIds&&(o.hashIds=this.popStack()),this.stringParams&&(o.hashTypes=this.popStack(),o.hashContexts=this.popStack());var p=this.popStack(),l=this.popStack();(l||p)&&(o.fn=l||"container.noop",o.inverse=p||"container.noop");for(var d=r;d--;)u=this.popStack(),n[d]=u,this.trackIds&&(a[d]=this.popStack()),this.stringParams&&(s[d]=this.popStack(),i[d]=this.popStack());return c&&(o.args=this.source.generateArray(n)),this.trackIds&&(o.ids=this.source.generateArray(a)),this.stringParams&&(o.types=this.source.generateArray(s),o.contexts=this.source.generateArray(i)),this.options.data&&(o.data="data"),this.useBlockParams&&(o.blockParams="blockParams"),o},setupHelperArgs:function(t,r,n,o){var i=this.setupParams(t,r,n);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),o?(this.useRegister("options"),n.push("options"),["options=",i]):n?(n.push(i),""):i}};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=Xi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();Xi.isValidJavaScriptVariableName=function(e){return!Xi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function A6(e,t,r,n,o){var i=t.popStack(),s=r.length;for(e&&s--;n<s;n++)i=t.nameLookup(i,r[n],o);return e?[t.aliasable("container.strict"),"(",i,", ",t.quotedString(r[n]),", ",JSON.stringify(t.source.currentLocation)," )"]:i}Wl.default=Xi;k2.exports=Wl.default});var E2=$((Kl,P2)=>{"use strict";Kl.__esModule=!0;function za(e){return e&&e.__esModule?e:{default:e}}var R6=CP(),I6=za(R6),z6=Rg(),D6=za(z6),ty=UP(),ry=BP(),O6=S2(),N6=za(O6),j6=Ll(),M6=za(j6),L6=Eg(),Z6=za(L6),U6=I6.default.create;function $2(){var e=U6();return e.compile=function(t,r){return ry.compile(t,r,e)},e.precompile=function(t,r){return ry.precompile(t,r,e)},e.AST=D6.default,e.Compiler=ry.Compiler,e.JavaScriptCompiler=N6.default,e.Parser=ty.parser,e.parse=ty.parse,e.parseWithoutProcessing=ty.parseWithoutProcessing,e}var es=$2();es.create=$2;Z6.default(es);es.Visitor=M6.default;es.default=es;Kl.default=es;P2.exports=Kl.default});var C2=$(Jl=>{"use strict";Jl.__esModule=!0;Jl.print=B6;Jl.PrintVisitor=Ze;function q6(e){return e&&e.__esModule?e:{default:e}}var F6=Ll(),G6=q6(F6);function B6(e){return new Ze().accept(e)}function Ze(){this.padding=0}Ze.prototype=new G6.default;Ze.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
138
|
-
`,t};Ze.prototype.Program=function(e){var t="",r=e.body,n=void 0,o=void 0;if(e.blockParams){var i="BLOCK PARAMS: [";for(n=0,o=e.blockParams.length;n<o;n++)i+=" "+e.blockParams[n];i+=" ]",t+=this.pad(i)}for(n=0,o=r.length;n<o;n++)t+=this.accept(r[n]);return this.padding--,t};Ze.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Ze.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Ze.prototype.BlockStatement=Ze.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Ze.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Ze.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Ze.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Ze.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Ze.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,o=0,i=t.length;o<i;o++)r.push(this.accept(t[o]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Ze.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Ze.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Ze.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Ze.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Ze.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Ze.prototype.NullLiteral=function(){return"NULL"};Ze.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,o=t.length;n<o;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Ze.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Ql=$((BY,R2)=>{var Yl=E2().default,A2=C2();Yl.PrintVisitor=A2.PrintVisitor;Yl.print=A2.print;R2.exports=Yl;function T2(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Yl.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=T2,require.extensions[".hbs"]=T2)});function V6(e,t){return{profile_name:e.name,stacks:e.stacks,frontend:e.frontend?{...e.frontend,mindset:""}:void 0,backend:e.backend?{...e.backend,mindset:""}:void 0,quality_gate:e.quality_gate,tools:e.tools??[],vendor:e.vendor??[],...t}}function I2(e,t){let r=D2.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function O2(e,t,r){let n=D2.get(`prompt:${e}`);if(!n)throw new Error(`\u30D7\u30ED\u30F3\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 '${e}' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u914D\u4FE1\u30D0\u30F3\u30C9\u30EB\u306B\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3059\u308B\u3068 Registry \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3055\u308C\u307E\u3059\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F Registry \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u767B\u9332\uFF08seed\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`);let o=V6(t,r);if(t.frontend?.mindset_template){let i=I2(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=I2(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var z2,D2,N2=b(()=>{"use strict";z2=yt(Ql(),1);z2.default.registerHelper("eq",function(e,t){return e===t});D2=new Map});var Xl,ny=b(()=>{"use strict";Xl="finish"});function L2(e){return M2.map(t=>({apiDir:(0,ke.join)(e,...t.api),appDir:(0,ke.join)(e,...t.app)}))}function Z2(){try{return(0,ke.dirname)((0,j2.fileURLToPath)(__goddBundleUrl))}catch{return(0,ke.dirname)(process.execPath)}}function H6(e,t){return(0,Ir.existsSync)((0,ke.join)(e,"app","main.py"))&&(0,Ir.existsSync)((0,ke.join)(t,"package.json"))&&(0,Ir.existsSync)((0,ke.join)(t,"src"))}function W6(e){for(let t of M2){let r=(0,ke.join)(e,...t.api),n=(0,ke.join)(e,...t.app);if((0,Ir.existsSync)(r)&&(0,Ir.existsSync)(n)&&H6(r,n))return{apiDir:r,appDir:n,projectRoot:e}}return null}function K6(e){let t=new Set,r=[];for(let n of e){let o=(0,ke.resolve)(n);t.has(o)||(t.add(o),r.push(o))}return r}function U2(e){let t=Z2(),r=(0,ke.dirname)(process.execPath),n=K6([...e?.preferredRoots??[],process.cwd(),(0,ke.resolve)(process.cwd(),".."),(0,ke.resolve)(t,".."),(0,ke.resolve)(t,"..",".."),t,r,(0,ke.resolve)(r,"..")]);for(let o of n){let i=W6(o);if(i)return i}return null}function ep(e){let t=U2(e);return t?{apiDir:t.apiDir,appDir:t.appDir}:null}function J6(e){let t=Z2();return[(0,ke.join)(e,"templates","notes-compose.yml"),(0,ke.join)((0,ke.resolve)(t,".."),"templates","notes-compose.yml")].find(n=>(0,Ir.existsSync)(n))??null}function q2(e){let t=U2(e);if(!t)return null;let r=J6(t.projectRoot);return r?{apiDir:t.apiDir,appDir:t.appDir,composeTemplate:r}:null}function oy(e){return(0,ke.isAbsolute)(e)||Y6.test(e)}function Q6(e,t){let r=(0,ke.resolve)(t);return typeof e!="string"||e===""?r:oy(e)?(0,Ir.existsSync)(e)?(0,ke.resolve)(e):(console.warn(` \u26A0 ${xn} \u306E outputDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,ke.resolve)(t,e)}function tp(e){let t=(0,ke.join)(e,xn);if(!(0,Ir.existsSync)(t))return null;try{let r=JSON.parse((0,Ir.readFileSync)(t,"utf-8"));return{...r,outputDir:Q6(r.outputDir,e)}}catch{return null}}function X6(e){return[`notes-api: ${e.apiDir}`,`notes-app: ${e.appDir}`]}function F2(e){console.log("--- \u30C7\u30D7\u30ED\u30A4\u5BFE\u8C61\u30BD\u30FC\u30B9 ---");for(let t of X6(e))console.log(` ${t}`);console.log()}var Ir,ke,j2,M2,xn,Y6,rp=b(()=>{"use strict";Ir=require("node:fs"),ke=require("node:path"),j2=require("node:url"),M2=[{api:["notes","api"],app:["notes","app"]},{api:["notes-api"],app:["notes-app"]}];xn=".godd-notes-infra.json",Y6=/^(?:[A-Za-z]:[\\/]|\\\\)/});function ts(e){try{return(0,ne.existsSync)(e)?JSON.parse((0,ne.readFileSync)(e,"utf-8")):null}catch{return null}}function kn(e,t=4096){try{return(0,ne.existsSync)(e)?(0,ne.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function tU(e){let t=(0,W.join)(e,"vendor");if(!(0,ne.existsSync)(t))return[];let r=[];try{for(let n of(0,ne.readdirSync)(t)){let o=(0,W.join)(t,n);if(!(0,ne.statSync)(o).isDirectory())continue;let i=eU[n];if(i)r.push({name:n,path:o,description:i.description,runtime:i.runtime,setupHint:i.setupHint});else{let s=(0,ne.existsSync)((0,W.join)(o,"pyproject.toml")),a=(0,ne.existsSync)((0,W.join)(o,"package.json")),c=s?"python":a?"node":"unknown";r.push({name:n,path:o,description:`vendor/${n}`,runtime:c,setupHint:c==="python"?"uv sync":"pnpm install"})}}}catch{}return r}function rU(e){let t=[],r=(0,W.join)(e,"backend","pyproject.toml"),n=(0,W.join)(e,"backend","requirements.txt");if((0,ne.existsSync)(r)){let y=kn(r);y.includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/pyproject.toml \u306B fastapi \u3092\u691C\u51FA"}),y.includes("django")&&t.push({id:"django",label:"Django",evidence:"backend/pyproject.toml \u306B django \u3092\u691C\u51FA"})}else(0,ne.existsSync)(n)&&kn(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=ts((0,W.join)(e,"frontend","package.json")),i=ts((0,W.join)(e,"package.json")),s=ts((0,W.join)(e,"src","package.json"));for(let[y,v]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!v)continue;let w={...v.dependencies,...v.devDependencies};w.react&&t.push({id:"react",label:"React",evidence:`${y} \u306B react \u3092\u691C\u51FA`}),w.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${y} \u306B next \u3092\u691C\u51FA`}),w.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${y} \u306B vue \u3092\u691C\u51FA`}),w.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${y} \u306B svelte \u3092\u691C\u51FA`}),w.electron&&t.push({id:"electron",label:"Electron",evidence:`${y} \u306B electron \u3092\u691C\u51FA`})}let a=(0,W.join)(e,"pubspec.yaml");if((0,ne.existsSync)(a)){let y=kn(a);t.push({id:"dart",label:"Dart",evidence:"pubspec.yaml \u3092\u691C\u51FA"}),y.includes("flutter")&&t.push({id:"flutter",label:"Flutter",evidence:"pubspec.yaml \u306B flutter \u3092\u691C\u51FA"})}let c=(0,ne.existsSync)((0,W.join)(e,"Package.swift")),u=(0,W.join)(e,"ios"),p=(0,ne.existsSync)(u)&&(()=>{try{return(0,ne.readdirSync)(u).some(y=>y.endsWith(".xcodeproj")||y.endsWith(".xcworkspace"))}catch{return!1}})();(c||p)&&t.push({id:"swift",label:"Swift",evidence:c?"Package.swift \u3092\u691C\u51FA":"ios/*.xcodeproj \u3092\u691C\u51FA"});let l=(0,ne.existsSync)((0,W.join)(e,"build.gradle.kts")),d=(0,ne.existsSync)((0,W.join)(e,"build.gradle")),f=(0,W.join)(e,"android"),h=(0,ne.existsSync)((0,W.join)(f,"build.gradle.kts"))||(0,ne.existsSync)((0,W.join)(f,"build.gradle"));(l||d||h)&&t.push({id:"kotlin",label:"Kotlin",evidence:l?"build.gradle.kts \u3092\u691C\u51FA":d?"build.gradle \u3092\u691C\u51FA":"android/build.gradle \u3092\u691C\u51FA"});let g=kn((0,W.join)(e,"docker-compose.yml"));return g&&g.includes("postgres")&&t.push({id:"postgres",label:"Postgres",evidence:"docker-compose.yml \u306B postgres \u3092\u691C\u51FA"}),((0,ne.existsSync)((0,W.join)(e,"prisma","schema.prisma"))||(0,ne.existsSync)((0,W.join)(e,"backend","prisma","schema.prisma")))&&t.push({id:"prisma",label:"Prisma",evidence:"prisma/schema.prisma \u3092\u691C\u51FA"}),t}function oU(e){let t={},r=new Map,n=[(0,W.join)(e,"package.json"),(0,W.join)(e,"frontend","package.json"),(0,W.join)(e,"src","package.json")];for(let o of n){let i=ts(o);if(!i)continue;let s=o.replace(e,"").replace(/^[\\/]/,""),a=i.dependencies,c=i.devDependencies;for(let[u,p]of Object.entries({...a,...c}))t[u]=p,r.set(u,s)}return{deps:t,sources:r}}function iU(e){let t=new Set,r="";for(let n of[(0,W.join)(e,"backend"),e]){let o=(0,W.join)(n,"pyproject.toml");if((0,ne.existsSync)(o)){let a=kn(o,16384).matchAll(/["']([a-zA-Z][\w.-]*)(?:\[.*?\])?(?:>=|<=|==|~=|!=|<|>)?/g);for(let c of a)t.add(c[1].toLowerCase().replace(/[-_.]+/g,"-"));r=o.replace(e,"").replace(/^[\\/]/,"");break}let i=(0,W.join)(n,"requirements.txt");if((0,ne.existsSync)(i)){let s=kn(i,16384);for(let a of s.split(`
|
|
139
|
-
`)){let c=a.trim();if(!c||c.startsWith("#"))continue;let u=c.match(/^([a-zA-Z][\w.-]*)/);u&&t.add(u[1].toLowerCase().replace(/[-_.]+/g,"-"))}r=i.replace(e,"").replace(/^[\\/]/,"");break}}return{deps:t,source:r}}function sU(e){let t=[],r=new Set,{deps:n,sources:o}=oU(e),{deps:i,source:s}=iU(e),a="";for(let c of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]){let u=kn((0,W.join)(e,c));if(u){a=u;break}}for(let c of nU)if(!r.has(c.id)){if(c.npmPackage&&c.npmPackage in n){let u=o.get(c.npmPackage)??"package.json";r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u306B ${c.npmPackage} \u3092\u691C\u51FA`,version:n[c.npmPackage],url:c.url});continue}if(c.pyPackage&&i.has(c.pyPackage.toLowerCase().replace(/[-_.]+/g,"-"))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${s} \u306B ${c.pyPackage} \u3092\u691C\u51FA`,url:c.url});continue}if(c.configFiles){for(let u of c.configFiles)if((0,ne.existsSync)((0,W.join)(e,u))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u3092\u691C\u51FA`,url:c.url});break}if(r.has(c.id))continue}c.dockerPattern&&a.includes(c.dockerPattern)&&(r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`docker-compose.yml \u306B ${c.dockerPattern} \u3092\u691C\u51FA`,url:c.url}))}return t}function aU(e){let t;for(let i of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"])if(t=kn((0,W.join)(e,i)),t)break;if(!t)return[];let r=[],n=/^\s{2}(\w[\w-]*):\s*$/gm,o;for(;(o=n.exec(t))!==null;)r.push(o[1]);return r}function cU(e){let t=(0,W.join)(e,"docs"),r=L2(e),n=r.some(({appDir:c})=>(0,ne.existsSync)((0,W.join)(c,"package.json"))),o=r.some(({apiDir:c})=>(0,ne.existsSync)((0,W.join)(c,"pyproject.toml")));if(!(0,ne.existsSync)(t))return{exists:!1,sections:[],files:[],has_notes_app:n,has_notes_api:o};let i=[],s=[];function a(c,u){try{for(let p of(0,ne.readdirSync)(c)){if(p.startsWith("."))continue;let l=(0,W.join)(c,p),d=u?`${u}/${p}`:p;(0,ne.statSync)(l).isDirectory()?(u||i.push(p),a(l,d)):s.push(d)}}catch{}}return a(t,""),{exists:!0,sections:i,files:s,has_notes_app:n,has_notes_api:o}}function G2(e){let t=ts((0,W.join)(e,"package.json"))?.name||(0,W.basename)(e),r=[];try{for(let u of(0,ne.readdirSync)(e)){if(u.startsWith(".")||u==="node_modules")continue;let p=(0,W.join)(e,u);(0,ne.statSync)(p).isDirectory()&&r.push(u)}}catch{}let o=["package.json","pyproject.toml","docker-compose.yml","docker-compose.yaml","Dockerfile","tsconfig.json",".env.example","env.example","AGENTS.md","README.md","Makefile",".mise.toml","turbo.json","pnpm-workspace.yaml"].filter(u=>(0,ne.existsSync)((0,W.join)(e,u))),s=ts((0,W.join)(e,"package.json"))?.scripts??{},a=[];try{for(let u of(0,ne.readdirSync)(e))(u.match(/^env.*\.example$/)||u.match(/^\.env.*\.example$/))&&a.push(u)}catch{}let c=kn((0,W.join)(e,"README.md"),500);return{root:e,name:t,detected_stacks:rU(e),detected_tools:sU(e),vendor_items:tU(e),key_files:o,directories:r,scripts:s,docker_services:aU(e),env_templates:a,readme_excerpt:c,docs_structure:cU(e)}}var ne,W,eU,nU,B2=b(()=>{"use strict";ne=require("node:fs"),W=require("node:path");rp();eU={"browser-use":{description:"Python AI \u30D6\u30E9\u30A6\u30B6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Web\u30D6\u30E9\u30A6\u30B6\u3092\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"uv sync && uv run browser-use install"},"android-use":{description:"Python Android AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Android\u7AEF\u672B\u3092ADB\u3067\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"python -m venv .venv && pip install -r requirements.txt"},"react-grab":{description:"Node.js React \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B3\u30D4\u30FC\u30C4\u30FC\u30EB \u2014 React\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30C4\u30EA\u30FC\u3092\u62BD\u51FA",runtime:"node",setupHint:"pnpm install && pnpm build"}};nU=[{id:"orval",label:"Orval",category:"frontend",description:"OpenAPI \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u30B3\u30FC\u30C9\u81EA\u52D5\u751F\u6210",url:"https://github.com/orval-labs/orval",npmPackage:"orval",configFiles:["orval.config.ts","orval.config.js","orval.config.cjs"]},{id:"tanstack-query",label:"TanStack Query",category:"frontend",description:"\u975E\u540C\u671F\u30C7\u30FC\u30BF\u30D5\u30A7\u30C3\u30C1\u30F3\u30B0/\u30AD\u30E3\u30C3\u30B7\u30E5\u7BA1\u7406",url:"https://github.com/TanStack/query",npmPackage:"@tanstack/react-query"},{id:"vite",label:"Vite",category:"frontend",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://vitejs.dev/",npmPackage:"vite",configFiles:["vite.config.ts","vite.config.js","vite.config.mts"]},{id:"biome",label:"Biome",category:"devtool",description:"\u9AD8\u901F Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://biomejs.dev/",npmPackage:"@biomejs/biome",configFiles:["biome.json","biome.jsonc"]},{id:"storybook",label:"Storybook",category:"frontend",description:"UI\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u958B\u767A/\u30AB\u30BF\u30ED\u30B0\u30C4\u30FC\u30EB",url:"https://storybook.js.org/",npmPackage:"storybook",configFiles:[".storybook/main.ts",".storybook/main.js"]},{id:"ruff",label:"Ruff",category:"devtool",description:"\u8D85\u9AD8\u901F Python Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/ruff/",pyPackage:"ruff",configFiles:["ruff.toml",".ruff.toml"]},{id:"uv",label:"uv",category:"devtool",description:"\u9AD8\u901F Python \u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/uv/",configFiles:["uv.lock"]},{id:"sqlmodel",label:"SQLModel",category:"backend",description:"SQLAlchemy + Pydantic \u30D9\u30FC\u30B9\u306E Python ORM",url:"https://sqlmodel.tiangolo.com/",pyPackage:"sqlmodel"},{id:"alembic",label:"Alembic",category:"backend",description:"SQLAlchemy \u30D9\u30FC\u30B9\u306E DB \u30DE\u30A4\u30B0\u30EC\u30FC\u30B7\u30E7\u30F3\u30C4\u30FC\u30EB",url:"https://alembic.sqlalchemy.org/",pyPackage:"alembic",configFiles:["alembic.ini","backend/alembic.ini"]},{id:"fastapi-users",label:"FastAPI Users",category:"backend",description:"FastAPI \u5411\u3051\u8A8D\u8A3C/\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406\u30E9\u30A4\u30D6\u30E9\u30EA",url:"https://fastapi-users.github.io/fastapi-users/",pyPackage:"fastapi-users"},{id:"pytest",label:"Pytest",category:"testing",description:"Python \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://docs.pytest.org/",pyPackage:"pytest",configFiles:["pytest.ini","pyproject.toml"]},{id:"httpx",label:"HTTPX",category:"testing",description:"Python \u975E\u540C\u671F HTTP \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF08\u30C6\u30B9\u30C8\u7528\uFF09",url:"https://www.python-httpx.org/",pyPackage:"httpx"},{id:"playwright",label:"Playwright",category:"testing",description:"\u30AF\u30ED\u30B9\u30D6\u30E9\u30A6\u30B6 E2E \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://playwright.dev/",npmPackage:"@playwright/test",pyPackage:"playwright",configFiles:["playwright.config.ts","playwright.config.js"]},{id:"docker-compose",label:"Docker Compose",category:"infra",description:"\u30DE\u30EB\u30C1\u30B3\u30F3\u30C6\u30CA\u30AA\u30FC\u30B1\u30B9\u30C8\u30EC\u30FC\u30B7\u30E7\u30F3",url:"https://docs.docker.com/compose/",configFiles:["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]},{id:"caddy",label:"Caddy",category:"infra",description:"\u81EA\u52D5 HTTPS \u5BFE\u5FDC\u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7",url:"https://caddyserver.com/",configFiles:["Caddyfile"],dockerPattern:"caddy"},{id:"traefik",label:"Traefik",category:"infra",description:"\u30AF\u30E9\u30A6\u30C9\u30CD\u30A4\u30C6\u30A3\u30D6 \u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7 / \u30ED\u30FC\u30C9\u30D0\u30E9\u30F3\u30B5",url:"https://traefik.io/",configFiles:["traefik.yml","traefik.toml"],dockerPattern:"traefik"},{id:"flutter",label:"Flutter",category:"frontend",description:"\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\uFF08Dart\uFF09",url:"https://flutter.dev/",configFiles:["pubspec.yaml"]},{id:"cocoapods",label:"CocoaPods",category:"devtool",description:"iOS / macOS \u4F9D\u5B58\u7BA1\u7406\u30C4\u30FC\u30EB",url:"https://cocoapods.org/",configFiles:["Podfile","ios/Podfile"]},{id:"gradle",label:"Gradle",category:"devtool",description:"Android / JVM \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://gradle.org/",configFiles:["build.gradle.kts","build.gradle","android/build.gradle.kts","android/build.gradle"]},{id:"swiftpm",label:"Swift Package Manager",category:"devtool",description:"Swift \u30D1\u30C3\u30B1\u30FC\u30B8\u7BA1\u7406\u30FB\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://www.swift.org/package-manager/",configFiles:["Package.swift"]},{id:"sentry",label:"Sentry",category:"monitoring",description:"\u30A8\u30E9\u30FC\u8FFD\u8DE1 / \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u76E3\u8996",url:"https://sentry.io/",npmPackage:"@sentry/react",pyPackage:"sentry-sdk",configFiles:["sentry.properties"]}]});function V2(e,t){let r=process.platform==="win32"?e.toLowerCase():e,n=process.platform==="win32"?t.toLowerCase():t,o=(0,Ot.relative)(r,n);return o===""||!(0,Ot.isAbsolute)(o)&&o!==".."&&!o.startsWith(`..${process.platform==="win32"?"\\":"/"}`)}function iy(e){let t=e,r=[];for(;;){try{(0,np.lstatSync)(t)}catch(n){if((n&&typeof n=="object"&&"code"in n?n.code:void 0)!=="ENOENT")throw new Error(Qn);let i=(0,Ot.dirname)(t);if(i===t)throw new Error(Qn);r.unshift((0,Ot.basename)(t)),t=i;continue}try{return(0,Ot.resolve)((0,np.realpathSync)(t),...r)}catch{throw new Error(Qn)}}}function uU(){let e=(0,Ot.resolve)(process.cwd()),t=process.env.GODD_PROJECT_ROOT;if(!t)return[e];if(process.platform!=="win32"&&H2.test(t))throw new Error(Qn);let r=process.platform==="win32"?t:t.replaceAll("\\","/"),n=(0,Ot.resolve)(e,r);return n===e?[e]:[e,n]}function W2(e){let t=uU(),r=(0,Ot.resolve)(process.cwd()),n=process.env.GODD_PROJECT_ROOT,o=n&&process.platform!=="win32"?n.replaceAll("\\","/"):n,i=o?(0,Ot.resolve)(r,o):r;if(e===void 0)return iy(i);if(process.platform!=="win32"&&H2.test(e))throw new Error(Qn);let s=process.platform==="win32"?e:e.replaceAll("\\","/");if(s.includes("\0"))throw new Error(Qn);let a=(0,Ot.resolve)(r,s);if(!t.some(l=>V2(l,a)))throw new Error(Qn);let u=iy(a);if(!t.some(l=>V2(iy(l),u)))throw new Error(Qn);return u}function K2(e){return W2(e)}function Nt(e,t){let r=W2(t);if(e.projectContext?.root===r)return e.projectContext;let n=G2(r);return e.projectContext=n,n}function Xn(e,t,r,n,o,i){let s=Nt(e,n),a=e.config.language??"en",c={project:s,language:a,...o},p=[...i?.prefixTemplates??[],t,...e.endsWithFinish?[Xl]:[]].map(d=>e.renderPrompt?e.renderPrompt(d,c):O2(d,e.profile,c)).join(`
|
|
138
|
+
`,t};Ze.prototype.Program=function(e){var t="",r=e.body,n=void 0,o=void 0;if(e.blockParams){var i="BLOCK PARAMS: [";for(n=0,o=e.blockParams.length;n<o;n++)i+=" "+e.blockParams[n];i+=" ]",t+=this.pad(i)}for(n=0,o=r.length;n<o;n++)t+=this.accept(r[n]);return this.padding--,t};Ze.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Ze.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Ze.prototype.BlockStatement=Ze.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};Ze.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};Ze.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};Ze.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Ze.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Ze.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,o=0,i=t.length;o<i;o++)r.push(this.accept(t[o]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};Ze.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Ze.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Ze.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Ze.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Ze.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Ze.prototype.NullLiteral=function(){return"NULL"};Ze.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,o=t.length;n<o;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};Ze.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Ql=$((VY,R2)=>{var Yl=E2().default,A2=C2();Yl.PrintVisitor=A2.PrintVisitor;Yl.print=A2.print;R2.exports=Yl;function T2(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Yl.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=T2,require.extensions[".hbs"]=T2)});function V6(e,t){return{profile_name:e.name,stacks:e.stacks,frontend:e.frontend?{...e.frontend,mindset:""}:void 0,backend:e.backend?{...e.backend,mindset:""}:void 0,quality_gate:e.quality_gate,tools:e.tools??[],vendor:e.vendor??[],...t}}function I2(e,t){let r=D2.get(`mindset:${e}`);return r?r(t):`[Mindset '${e}' not found]`}function O2(e,t,r){let n=D2.get(`prompt:${e}`);if(!n)throw new Error(`\u30D7\u30ED\u30F3\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 '${e}' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u914D\u4FE1\u30D0\u30F3\u30C9\u30EB\u306B\u542B\u307E\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3059\u308B\u3068 Registry \u304B\u3089\u518D\u30D5\u30A7\u30C3\u30C1\u3055\u308C\u307E\u3059\u3002\u89E3\u6D88\u3057\u306A\u3044\u5834\u5408\u306F Registry \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u767B\u9332\uFF08seed\uFF09\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`);let o=V6(t,r);if(t.frontend?.mindset_template){let i=I2(t.frontend.mindset_template,o);o.frontend.mindset=i}if(t.backend?.mindset_template){let i=I2(t.backend.mindset_template,o);o.backend.mindset=i}return n(o)}var z2,D2,N2=b(()=>{"use strict";z2=yt(Ql(),1);z2.default.registerHelper("eq",function(e,t){return e===t});D2=new Map});var Xl,ny=b(()=>{"use strict";Xl="finish"});function L2(e){return M2.map(t=>({apiDir:(0,ke.join)(e,...t.api),appDir:(0,ke.join)(e,...t.app)}))}function Z2(){try{return(0,ke.dirname)((0,j2.fileURLToPath)(__goddBundleUrl))}catch{return(0,ke.dirname)(process.execPath)}}function H6(e,t){return(0,Ir.existsSync)((0,ke.join)(e,"app","main.py"))&&(0,Ir.existsSync)((0,ke.join)(t,"package.json"))&&(0,Ir.existsSync)((0,ke.join)(t,"src"))}function W6(e){for(let t of M2){let r=(0,ke.join)(e,...t.api),n=(0,ke.join)(e,...t.app);if((0,Ir.existsSync)(r)&&(0,Ir.existsSync)(n)&&H6(r,n))return{apiDir:r,appDir:n,projectRoot:e}}return null}function K6(e){let t=new Set,r=[];for(let n of e){let o=(0,ke.resolve)(n);t.has(o)||(t.add(o),r.push(o))}return r}function U2(e){let t=Z2(),r=(0,ke.dirname)(process.execPath),n=K6([...e?.preferredRoots??[],process.cwd(),(0,ke.resolve)(process.cwd(),".."),(0,ke.resolve)(t,".."),(0,ke.resolve)(t,"..",".."),t,r,(0,ke.resolve)(r,"..")]);for(let o of n){let i=W6(o);if(i)return i}return null}function ep(e){let t=U2(e);return t?{apiDir:t.apiDir,appDir:t.appDir}:null}function J6(e){let t=Z2();return[(0,ke.join)(e,"templates","notes-compose.yml"),(0,ke.join)((0,ke.resolve)(t,".."),"templates","notes-compose.yml")].find(n=>(0,Ir.existsSync)(n))??null}function q2(e){let t=U2(e);if(!t)return null;let r=J6(t.projectRoot);return r?{apiDir:t.apiDir,appDir:t.appDir,composeTemplate:r}:null}function oy(e){return(0,ke.isAbsolute)(e)||Y6.test(e)}function Q6(e,t){let r=(0,ke.resolve)(t);return typeof e!="string"||e===""?r:oy(e)?(0,Ir.existsSync)(e)?(0,ke.resolve)(e):(console.warn(` \u26A0 ${kn} \u306E outputDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,ke.resolve)(t,e)}function tp(e){let t=(0,ke.join)(e,kn);if(!(0,Ir.existsSync)(t))return null;try{let r=JSON.parse((0,Ir.readFileSync)(t,"utf-8"));return{...r,outputDir:Q6(r.outputDir,e)}}catch{return null}}function X6(e){return[`notes-api: ${e.apiDir}`,`notes-app: ${e.appDir}`]}function F2(e){console.log("--- \u30C7\u30D7\u30ED\u30A4\u5BFE\u8C61\u30BD\u30FC\u30B9 ---");for(let t of X6(e))console.log(` ${t}`);console.log()}var Ir,ke,j2,M2,kn,Y6,rp=b(()=>{"use strict";Ir=require("node:fs"),ke=require("node:path"),j2=require("node:url"),M2=[{api:["notes","api"],app:["notes","app"]},{api:["notes-api"],app:["notes-app"]}];kn=".godd-notes-infra.json",Y6=/^(?:[A-Za-z]:[\\/]|\\\\)/});function ts(e){try{return(0,ne.existsSync)(e)?JSON.parse((0,ne.readFileSync)(e,"utf-8")):null}catch{return null}}function Sn(e,t=4096){try{return(0,ne.existsSync)(e)?(0,ne.readFileSync)(e).subarray(0,t).toString("utf-8"):""}catch{return""}}function tU(e){let t=(0,W.join)(e,"vendor");if(!(0,ne.existsSync)(t))return[];let r=[];try{for(let n of(0,ne.readdirSync)(t)){let o=(0,W.join)(t,n);if(!(0,ne.statSync)(o).isDirectory())continue;let i=eU[n];if(i)r.push({name:n,path:o,description:i.description,runtime:i.runtime,setupHint:i.setupHint});else{let s=(0,ne.existsSync)((0,W.join)(o,"pyproject.toml")),a=(0,ne.existsSync)((0,W.join)(o,"package.json")),c=s?"python":a?"node":"unknown";r.push({name:n,path:o,description:`vendor/${n}`,runtime:c,setupHint:c==="python"?"uv sync":"pnpm install"})}}}catch{}return r}function rU(e){let t=[],r=(0,W.join)(e,"backend","pyproject.toml"),n=(0,W.join)(e,"backend","requirements.txt");if((0,ne.existsSync)(r)){let y=Sn(r);y.includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/pyproject.toml \u306B fastapi \u3092\u691C\u51FA"}),y.includes("django")&&t.push({id:"django",label:"Django",evidence:"backend/pyproject.toml \u306B django \u3092\u691C\u51FA"})}else(0,ne.existsSync)(n)&&Sn(n).includes("fastapi")&&t.push({id:"fastapi",label:"FastAPI",evidence:"backend/requirements.txt \u306B fastapi \u3092\u691C\u51FA"});let o=ts((0,W.join)(e,"frontend","package.json")),i=ts((0,W.join)(e,"package.json")),s=ts((0,W.join)(e,"src","package.json"));for(let[y,v]of[["frontend/package.json",o],["package.json",i],["src/package.json",s]]){if(!v)continue;let w={...v.dependencies,...v.devDependencies};w.react&&t.push({id:"react",label:"React",evidence:`${y} \u306B react \u3092\u691C\u51FA`}),w.next&&t.push({id:"nextjs",label:"Next.js",evidence:`${y} \u306B next \u3092\u691C\u51FA`}),w.vue&&t.push({id:"vue",label:"Vue.js",evidence:`${y} \u306B vue \u3092\u691C\u51FA`}),w.svelte&&t.push({id:"svelte",label:"Svelte",evidence:`${y} \u306B svelte \u3092\u691C\u51FA`}),w.electron&&t.push({id:"electron",label:"Electron",evidence:`${y} \u306B electron \u3092\u691C\u51FA`})}let a=(0,W.join)(e,"pubspec.yaml");if((0,ne.existsSync)(a)){let y=Sn(a);t.push({id:"dart",label:"Dart",evidence:"pubspec.yaml \u3092\u691C\u51FA"}),y.includes("flutter")&&t.push({id:"flutter",label:"Flutter",evidence:"pubspec.yaml \u306B flutter \u3092\u691C\u51FA"})}let c=(0,ne.existsSync)((0,W.join)(e,"Package.swift")),u=(0,W.join)(e,"ios"),p=(0,ne.existsSync)(u)&&(()=>{try{return(0,ne.readdirSync)(u).some(y=>y.endsWith(".xcodeproj")||y.endsWith(".xcworkspace"))}catch{return!1}})();(c||p)&&t.push({id:"swift",label:"Swift",evidence:c?"Package.swift \u3092\u691C\u51FA":"ios/*.xcodeproj \u3092\u691C\u51FA"});let l=(0,ne.existsSync)((0,W.join)(e,"build.gradle.kts")),d=(0,ne.existsSync)((0,W.join)(e,"build.gradle")),f=(0,W.join)(e,"android"),h=(0,ne.existsSync)((0,W.join)(f,"build.gradle.kts"))||(0,ne.existsSync)((0,W.join)(f,"build.gradle"));(l||d||h)&&t.push({id:"kotlin",label:"Kotlin",evidence:l?"build.gradle.kts \u3092\u691C\u51FA":d?"build.gradle \u3092\u691C\u51FA":"android/build.gradle \u3092\u691C\u51FA"});let g=Sn((0,W.join)(e,"docker-compose.yml"));return g&&g.includes("postgres")&&t.push({id:"postgres",label:"Postgres",evidence:"docker-compose.yml \u306B postgres \u3092\u691C\u51FA"}),((0,ne.existsSync)((0,W.join)(e,"prisma","schema.prisma"))||(0,ne.existsSync)((0,W.join)(e,"backend","prisma","schema.prisma")))&&t.push({id:"prisma",label:"Prisma",evidence:"prisma/schema.prisma \u3092\u691C\u51FA"}),t}function oU(e){let t={},r=new Map,n=[(0,W.join)(e,"package.json"),(0,W.join)(e,"frontend","package.json"),(0,W.join)(e,"src","package.json")];for(let o of n){let i=ts(o);if(!i)continue;let s=o.replace(e,"").replace(/^[\\/]/,""),a=i.dependencies,c=i.devDependencies;for(let[u,p]of Object.entries({...a,...c}))t[u]=p,r.set(u,s)}return{deps:t,sources:r}}function iU(e){let t=new Set,r="";for(let n of[(0,W.join)(e,"backend"),e]){let o=(0,W.join)(n,"pyproject.toml");if((0,ne.existsSync)(o)){let a=Sn(o,16384).matchAll(/["']([a-zA-Z][\w.-]*)(?:\[.*?\])?(?:>=|<=|==|~=|!=|<|>)?/g);for(let c of a)t.add(c[1].toLowerCase().replace(/[-_.]+/g,"-"));r=o.replace(e,"").replace(/^[\\/]/,"");break}let i=(0,W.join)(n,"requirements.txt");if((0,ne.existsSync)(i)){let s=Sn(i,16384);for(let a of s.split(`
|
|
139
|
+
`)){let c=a.trim();if(!c||c.startsWith("#"))continue;let u=c.match(/^([a-zA-Z][\w.-]*)/);u&&t.add(u[1].toLowerCase().replace(/[-_.]+/g,"-"))}r=i.replace(e,"").replace(/^[\\/]/,"");break}}return{deps:t,source:r}}function sU(e){let t=[],r=new Set,{deps:n,sources:o}=oU(e),{deps:i,source:s}=iU(e),a="";for(let c of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]){let u=Sn((0,W.join)(e,c));if(u){a=u;break}}for(let c of nU)if(!r.has(c.id)){if(c.npmPackage&&c.npmPackage in n){let u=o.get(c.npmPackage)??"package.json";r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u306B ${c.npmPackage} \u3092\u691C\u51FA`,version:n[c.npmPackage],url:c.url});continue}if(c.pyPackage&&i.has(c.pyPackage.toLowerCase().replace(/[-_.]+/g,"-"))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${s} \u306B ${c.pyPackage} \u3092\u691C\u51FA`,url:c.url});continue}if(c.configFiles){for(let u of c.configFiles)if((0,ne.existsSync)((0,W.join)(e,u))){r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`${u} \u3092\u691C\u51FA`,url:c.url});break}if(r.has(c.id))continue}c.dockerPattern&&a.includes(c.dockerPattern)&&(r.add(c.id),t.push({id:c.id,label:c.label,category:c.category,description:c.description,evidence:`docker-compose.yml \u306B ${c.dockerPattern} \u3092\u691C\u51FA`,url:c.url}))}return t}function aU(e){let t;for(let i of["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"])if(t=Sn((0,W.join)(e,i)),t)break;if(!t)return[];let r=[],n=/^\s{2}(\w[\w-]*):\s*$/gm,o;for(;(o=n.exec(t))!==null;)r.push(o[1]);return r}function cU(e){let t=(0,W.join)(e,"docs"),r=L2(e),n=r.some(({appDir:c})=>(0,ne.existsSync)((0,W.join)(c,"package.json"))),o=r.some(({apiDir:c})=>(0,ne.existsSync)((0,W.join)(c,"pyproject.toml")));if(!(0,ne.existsSync)(t))return{exists:!1,sections:[],files:[],has_notes_app:n,has_notes_api:o};let i=[],s=[];function a(c,u){try{for(let p of(0,ne.readdirSync)(c)){if(p.startsWith("."))continue;let l=(0,W.join)(c,p),d=u?`${u}/${p}`:p;(0,ne.statSync)(l).isDirectory()?(u||i.push(p),a(l,d)):s.push(d)}}catch{}}return a(t,""),{exists:!0,sections:i,files:s,has_notes_app:n,has_notes_api:o}}function G2(e){let t=ts((0,W.join)(e,"package.json"))?.name||(0,W.basename)(e),r=[];try{for(let u of(0,ne.readdirSync)(e)){if(u.startsWith(".")||u==="node_modules")continue;let p=(0,W.join)(e,u);(0,ne.statSync)(p).isDirectory()&&r.push(u)}}catch{}let o=["package.json","pyproject.toml","docker-compose.yml","docker-compose.yaml","Dockerfile","tsconfig.json",".env.example","env.example","AGENTS.md","README.md","Makefile",".mise.toml","turbo.json","pnpm-workspace.yaml"].filter(u=>(0,ne.existsSync)((0,W.join)(e,u))),s=ts((0,W.join)(e,"package.json"))?.scripts??{},a=[];try{for(let u of(0,ne.readdirSync)(e))(u.match(/^env.*\.example$/)||u.match(/^\.env.*\.example$/))&&a.push(u)}catch{}let c=Sn((0,W.join)(e,"README.md"),500);return{root:e,name:t,detected_stacks:rU(e),detected_tools:sU(e),vendor_items:tU(e),key_files:o,directories:r,scripts:s,docker_services:aU(e),env_templates:a,readme_excerpt:c,docs_structure:cU(e)}}var ne,W,eU,nU,B2=b(()=>{"use strict";ne=require("node:fs"),W=require("node:path");rp();eU={"browser-use":{description:"Python AI \u30D6\u30E9\u30A6\u30B6\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Web\u30D6\u30E9\u30A6\u30B6\u3092\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"uv sync && uv run browser-use install"},"android-use":{description:"Python Android AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8 \u2014 Android\u7AEF\u672B\u3092ADB\u3067\u81EA\u52D5\u64CD\u4F5C",runtime:"python",setupHint:"python -m venv .venv && pip install -r requirements.txt"},"react-grab":{description:"Node.js React \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B3\u30D4\u30FC\u30C4\u30FC\u30EB \u2014 React\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30C4\u30EA\u30FC\u3092\u62BD\u51FA",runtime:"node",setupHint:"pnpm install && pnpm build"}};nU=[{id:"orval",label:"Orval",category:"frontend",description:"OpenAPI \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u30B3\u30FC\u30C9\u81EA\u52D5\u751F\u6210",url:"https://github.com/orval-labs/orval",npmPackage:"orval",configFiles:["orval.config.ts","orval.config.js","orval.config.cjs"]},{id:"tanstack-query",label:"TanStack Query",category:"frontend",description:"\u975E\u540C\u671F\u30C7\u30FC\u30BF\u30D5\u30A7\u30C3\u30C1\u30F3\u30B0/\u30AD\u30E3\u30C3\u30B7\u30E5\u7BA1\u7406",url:"https://github.com/TanStack/query",npmPackage:"@tanstack/react-query"},{id:"vite",label:"Vite",category:"frontend",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://vitejs.dev/",npmPackage:"vite",configFiles:["vite.config.ts","vite.config.js","vite.config.mts"]},{id:"biome",label:"Biome",category:"devtool",description:"\u9AD8\u901F Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://biomejs.dev/",npmPackage:"@biomejs/biome",configFiles:["biome.json","biome.jsonc"]},{id:"storybook",label:"Storybook",category:"frontend",description:"UI\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u958B\u767A/\u30AB\u30BF\u30ED\u30B0\u30C4\u30FC\u30EB",url:"https://storybook.js.org/",npmPackage:"storybook",configFiles:[".storybook/main.ts",".storybook/main.js"]},{id:"ruff",label:"Ruff",category:"devtool",description:"\u8D85\u9AD8\u901F Python Linter / Formatter\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/ruff/",pyPackage:"ruff",configFiles:["ruff.toml",".ruff.toml"]},{id:"uv",label:"uv",category:"devtool",description:"\u9AD8\u901F Python \u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\uFF08Rust\u88FD\uFF09",url:"https://docs.astral.sh/uv/",configFiles:["uv.lock"]},{id:"sqlmodel",label:"SQLModel",category:"backend",description:"SQLAlchemy + Pydantic \u30D9\u30FC\u30B9\u306E Python ORM",url:"https://sqlmodel.tiangolo.com/",pyPackage:"sqlmodel"},{id:"alembic",label:"Alembic",category:"backend",description:"SQLAlchemy \u30D9\u30FC\u30B9\u306E DB \u30DE\u30A4\u30B0\u30EC\u30FC\u30B7\u30E7\u30F3\u30C4\u30FC\u30EB",url:"https://alembic.sqlalchemy.org/",pyPackage:"alembic",configFiles:["alembic.ini","backend/alembic.ini"]},{id:"fastapi-users",label:"FastAPI Users",category:"backend",description:"FastAPI \u5411\u3051\u8A8D\u8A3C/\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406\u30E9\u30A4\u30D6\u30E9\u30EA",url:"https://fastapi-users.github.io/fastapi-users/",pyPackage:"fastapi-users"},{id:"pytest",label:"Pytest",category:"testing",description:"Python \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://docs.pytest.org/",pyPackage:"pytest",configFiles:["pytest.ini","pyproject.toml"]},{id:"httpx",label:"HTTPX",category:"testing",description:"Python \u975E\u540C\u671F HTTP \u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF08\u30C6\u30B9\u30C8\u7528\uFF09",url:"https://www.python-httpx.org/",pyPackage:"httpx"},{id:"playwright",label:"Playwright",category:"testing",description:"\u30AF\u30ED\u30B9\u30D6\u30E9\u30A6\u30B6 E2E \u30C6\u30B9\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF",url:"https://playwright.dev/",npmPackage:"@playwright/test",pyPackage:"playwright",configFiles:["playwright.config.ts","playwright.config.js"]},{id:"docker-compose",label:"Docker Compose",category:"infra",description:"\u30DE\u30EB\u30C1\u30B3\u30F3\u30C6\u30CA\u30AA\u30FC\u30B1\u30B9\u30C8\u30EC\u30FC\u30B7\u30E7\u30F3",url:"https://docs.docker.com/compose/",configFiles:["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"]},{id:"caddy",label:"Caddy",category:"infra",description:"\u81EA\u52D5 HTTPS \u5BFE\u5FDC\u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7",url:"https://caddyserver.com/",configFiles:["Caddyfile"],dockerPattern:"caddy"},{id:"traefik",label:"Traefik",category:"infra",description:"\u30AF\u30E9\u30A6\u30C9\u30CD\u30A4\u30C6\u30A3\u30D6 \u30EA\u30D0\u30FC\u30B9\u30D7\u30ED\u30AD\u30B7 / \u30ED\u30FC\u30C9\u30D0\u30E9\u30F3\u30B5",url:"https://traefik.io/",configFiles:["traefik.yml","traefik.toml"],dockerPattern:"traefik"},{id:"flutter",label:"Flutter",category:"frontend",description:"\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\uFF08Dart\uFF09",url:"https://flutter.dev/",configFiles:["pubspec.yaml"]},{id:"cocoapods",label:"CocoaPods",category:"devtool",description:"iOS / macOS \u4F9D\u5B58\u7BA1\u7406\u30C4\u30FC\u30EB",url:"https://cocoapods.org/",configFiles:["Podfile","ios/Podfile"]},{id:"gradle",label:"Gradle",category:"devtool",description:"Android / JVM \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://gradle.org/",configFiles:["build.gradle.kts","build.gradle","android/build.gradle.kts","android/build.gradle"]},{id:"swiftpm",label:"Swift Package Manager",category:"devtool",description:"Swift \u30D1\u30C3\u30B1\u30FC\u30B8\u7BA1\u7406\u30FB\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",url:"https://www.swift.org/package-manager/",configFiles:["Package.swift"]},{id:"sentry",label:"Sentry",category:"monitoring",description:"\u30A8\u30E9\u30FC\u8FFD\u8DE1 / \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u76E3\u8996",url:"https://sentry.io/",npmPackage:"@sentry/react",pyPackage:"sentry-sdk",configFiles:["sentry.properties"]}]});function V2(e,t){let r=process.platform==="win32"?e.toLowerCase():e,n=process.platform==="win32"?t.toLowerCase():t,o=(0,Ot.relative)(r,n);return o===""||!(0,Ot.isAbsolute)(o)&&o!==".."&&!o.startsWith(`..${process.platform==="win32"?"\\":"/"}`)}function iy(e){let t=e,r=[];for(;;){try{(0,np.lstatSync)(t)}catch(n){if((n&&typeof n=="object"&&"code"in n?n.code:void 0)!=="ENOENT")throw new Error(Xn);let i=(0,Ot.dirname)(t);if(i===t)throw new Error(Xn);r.unshift((0,Ot.basename)(t)),t=i;continue}try{return(0,Ot.resolve)((0,np.realpathSync)(t),...r)}catch{throw new Error(Xn)}}}function uU(){let e=(0,Ot.resolve)(process.cwd()),t=process.env.GODD_PROJECT_ROOT;if(!t)return[e];if(process.platform!=="win32"&&H2.test(t))throw new Error(Xn);let r=process.platform==="win32"?t:t.replaceAll("\\","/"),n=(0,Ot.resolve)(e,r);return n===e?[e]:[e,n]}function W2(e){let t=uU(),r=(0,Ot.resolve)(process.cwd()),n=process.env.GODD_PROJECT_ROOT,o=n&&process.platform!=="win32"?n.replaceAll("\\","/"):n,i=o?(0,Ot.resolve)(r,o):r;if(e===void 0)return iy(i);if(process.platform!=="win32"&&H2.test(e))throw new Error(Xn);let s=process.platform==="win32"?e:e.replaceAll("\\","/");if(s.includes("\0"))throw new Error(Xn);let a=(0,Ot.resolve)(r,s);if(!t.some(l=>V2(l,a)))throw new Error(Xn);let u=iy(a);if(!t.some(l=>V2(iy(l),u)))throw new Error(Xn);return u}function K2(e){return W2(e)}function Nt(e,t){let r=W2(t);if(e.projectContext?.root===r)return e.projectContext;let n=G2(r);return e.projectContext=n,n}function Qr(e,t,r,n,o,i){let s=Nt(e,n),a=e.config.language??"en",c={project:s,language:a,...o},p=[...i?.prefixTemplates??[],t,...e.endsWithFinish?[Xl]:[]].map(d=>e.renderPrompt?e.renderPrompt(d,c):O2(d,e.profile,c)).join(`
|
|
140
140
|
|
|
141
141
|
`);return`${a!=="en"?`> **Output Language**: Respond entirely in ${a}.
|
|
142
142
|
|
|
@@ -144,20 +144,20 @@ Expecting `+ao.join(", ")+", got '"+(this.terminals_[k]||k)+"'":ie="Parse error
|
|
|
144
144
|
|
|
145
145
|
---
|
|
146
146
|
|
|
147
|
-
${r}`}var np,Ot,H2,
|
|
147
|
+
${r}`}var np,Ot,H2,Xn,Xt=b(()=>{"use strict";N2();ny();B2();np=require("node:fs"),Ot=require("node:path"),H2=/^(?:[A-Za-z]:[\\/]|\\\\)/,Xn="project_root must resolve inside the GoDD workspace."});function sy(e){return e.length<=8?"****":e.slice(0,4)+"****"+e.slice(-4)}function Y2(e,t){if(t.mode==="generate-config"){let n=["## GoDD MCP Config \u81EA\u52D5\u751F\u6210\u30E2\u30FC\u30C9","","\u4EE5\u4E0B\u306E\u60C5\u5831\u3092\u3082\u3068\u306B `config.godd` \u3068 `.cursor/mcp.json` \u3092\u751F\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",""];if(t.components&&t.components.length>0){n.push("### \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"),n.push("```yaml"),n.push("components:");for(let o of t.components)n.push(` - ${o}`);n.push("```")}else n.push("### \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u672A\u6307\u5B9A"),n.push("\u30E6\u30FC\u30B6\u30FC\u306B\u4F7F\u7528\u3059\u308B\u6280\u8853\u30B9\u30BF\u30C3\u30AF\u3092\u8CEA\u554F\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),n.push(`
|
|
148
148
|
**\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8**: ${lU}`);t.license_key?n.push(`
|
|
149
149
|
### \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC: \`${sy(t.license_key)}\`\uFF08\u8A2D\u5B9A\u6E08\u307F\uFF09`):n.push(`
|
|
150
150
|
### \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u672A\u6307\u5B9A\u3067\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),n.push(`
|
|
151
151
|
### \u8A00\u8A9E: ${t.language??"ja"}`),n.push(`
|
|
152
|
-
### \u751F\u6210\u3059\u308B\u30D5\u30A1\u30A4\u30EB`),n.push("1. **config.godd** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08components \u306E\u307F\uFF09"),n.push("```yaml"),n.push("components:");for(let o of t.components??["fastapi","react","postgresql"])n.push(` - ${o}`);return n.push("```"),n.push(""),n.push("2. **.env** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08GoDD \u7BA1\u7406\u5024\uFF09"),n.push("```"),n.push(`GODD_LICENSE_KEY="${t.license_key?sy(t.license_key):"YOUR_LICENSE_KEY"}"`),n.push(`GODD_LANGUAGE="${t.language??"ja"}"`),n.push(`GODD_REGISTRY_URL="${
|
|
152
|
+
### \u751F\u6210\u3059\u308B\u30D5\u30A1\u30A4\u30EB`),n.push("1. **config.godd** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08components \u306E\u307F\uFF09"),n.push("```yaml"),n.push("components:");for(let o of t.components??["fastapi","react","postgresql"])n.push(` - ${o}`);return n.push("```"),n.push(""),n.push("2. **.env** \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u306B\u914D\u7F6E\uFF08GoDD \u7BA1\u7406\u5024\uFF09"),n.push("```"),n.push(`GODD_LICENSE_KEY="${t.license_key?sy(t.license_key):"YOUR_LICENSE_KEY"}"`),n.push(`GODD_LANGUAGE="${t.language??"ja"}"`),n.push(`GODD_REGISTRY_URL="${fn}"`),n.push("```"),n.push(""),n.push("3. **`.cursor/mcp.json`** \u2014 Cursor IDE \u7528 MCP \u767B\u9332"),n.push("```json"),n.push(JSON.stringify({mcpServers:{godd:{command:"node",args:["path/to/godd-mcp-server/dist/index.js"],env:{GODD_CONFIG:"./config.godd",GODD_LICENSE_KEY:"****",GODD_LANGUAGE:t.language??"ja",GODD_REGISTRY_URL:fn}}}},null,2)),n.push("```"),n.join(`
|
|
153
153
|
`)}let r=[`## \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30E2\u30FC\u30C9: ${t.mode??"full"}`];return t.license_key&&r.push(`## \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC
|
|
154
154
|
\`${sy(t.license_key)}\`\uFF08\u8A2D\u5B9A\u6E08\u307F\uFF09`),t.stack_profile&&r.push(`## \u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB
|
|
155
155
|
${t.stack_profile}`),t.components&&t.components.length>0&&r.push(`## \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8
|
|
156
156
|
${t.components.join(", ")}`),t.environment&&r.push(`## \u74B0\u5883\u60C5\u5831
|
|
157
157
|
${t.environment}`),t.issues&&r.push(`## \u554F\u984C
|
|
158
|
-
${t.issues}`),
|
|
158
|
+
${t.issues}`),Qr(e,"setup",r.join(`
|
|
159
159
|
|
|
160
|
-
`),t.project_root)}var J2,lU,Q2=b(()=>{"use strict";tt();
|
|
160
|
+
`),t.project_root)}var J2,lU,Q2=b(()=>{"use strict";tt();Xt();Ln();J2=m.object({mode:m.enum(["full","godd-only","project-only","generate-config"]).optional().default("full").describe("\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u7BC4\u56F2: full=GoDD+\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5168\u4F53, godd-only=GoDD MCP \u8A2D\u5B9A\u306E\u307F, project-only=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u74B0\u5883\u306E\u307F, generate-config=config.godd \u81EA\u52D5\u751F\u6210"),environment:m.string().max(2e5).optional().describe("\u74B0\u5883\u60C5\u5831\uFF08OS\u3001\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u307F\u30C4\u30FC\u30EB\u7B49\uFF09"),license_key:m.string().max(1e3).optional().describe("GoDD \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08config.godd \u306B\u66F8\u304D\u8FBC\u3080\uFF09"),stack_profile:m.string().max(1e3).optional().describe("\u30B9\u30BF\u30C3\u30AF\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u540D\uFF08\u4F8B: fastapi-react\uFF09"),components:m.array(m.string().max(1e3)).optional().describe('\u6280\u8853\u30B9\u30BF\u30C3\u30AF\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u306E\u914D\u5217\uFF08\u4F8B: ["fastapi", "react", "postgresql"]\uFF09\u3002generate-config \u30E2\u30FC\u30C9\u3067\u4F7F\u7528\u3002'),language:m.string().max(1e3).optional().describe("\u30DE\u30A4\u30F3\u30C9\u30BB\u30C3\u30C8\u8A00\u8A9E\uFF08\u4F8B: ja, en\uFF09"),issues:m.string().max(2e5).optional().describe("\u56F0\u3063\u3066\u3044\u308B\u3053\u3068\uFF08\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u7B49\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),lU=["python, typescript, javascript, go, php, ruby, c, html, css","react, nextjs, vue, angular, svelte, vite, tailwind, sass, electron","fastapi, django, flask, express, fastify, nestjs, gin, echo, fiber, laravel, symfony, wordpress, rails, sinatra, koa","node, agent-stdio","postgresql, mysql, mongodb, redis","sqlalchemy, celery","docker, terraform","ddd-clean-architecture"].join(", ")});function pU(){try{return(0,zr.dirname)((0,X2.fileURLToPath)(__goddBundleUrl))}catch{return(0,zr.dirname)(process.execPath)}}function tE(e,t){let r=[];for(let n of(0,eo.readdirSync)(e)){if(n==="GENERATED.md")continue;let o=(0,zr.join)(e,n);if((0,eo.statSync)(o).isDirectory())r.push(...tE(o,t));else{let i=(0,zr.relative)(t,o).replace(/\\/g,"/"),s=(0,eo.readFileSync)(o,"utf-8");r.push({relativePath:i,content:s})}}return r}function ay(e){let t=pU(),r=[(0,zr.resolve)(t,"..","templates",e),(0,zr.resolve)(t,"templates",e),(0,zr.resolve)(t,"..","..","templates",e)];for(let n of r)if((0,eo.existsSync)(n))try{let o=tE(n,n);if(o.length>0)return o}catch{}return[]}function cy(){return ay("notes-docs")}function rE(e,t){let r=[`## \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D
|
|
161
161
|
${t.project_name??"(\u81EA\u52D5\u691C\u51FA)"}`];t.roles?.length&&r.push(`## \u30ED\u30FC\u30EB
|
|
162
162
|
${t.roles.map(o=>`- ${o}`).join(`
|
|
163
163
|
`)}`),t.screens?.length&&r.push(`## \u753B\u9762ID
|
|
@@ -172,9 +172,9 @@ ${o}`);for(let i of n){let s=i.relativePath.endsWith(".csv")?"csv":"md";r.push(`
|
|
|
172
172
|
|
|
173
173
|
\`\`\`${s}
|
|
174
174
|
${i.content.trimEnd()}
|
|
175
|
-
\`\`\``)}}return
|
|
175
|
+
\`\`\``)}}return Qr(e,"docs-init",r.join(`
|
|
176
176
|
|
|
177
|
-
`),t.project_root)}var eo,zr,X2,eE,op=b(()=>{"use strict";tt();eo=require("node:fs"),zr=require("node:path"),X2=require("node:url");
|
|
177
|
+
`),t.project_root)}var eo,zr,X2,eE,op=b(()=>{"use strict";tt();eo=require("node:fs"),zr=require("node:path"),X2=require("node:url");Xt();eE=m.object({project_name:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D"),roles:m.array(m.string().max(1e3)).optional().describe("\u30ED\u30FC\u30EB\u540D\u4E00\u89A7\uFF08\u4F8B: \u7BA1\u7406\u8005, \u904B\u55B6\u8005, \u5229\u7528\u8005\uFF09"),screens:m.array(m.string().max(1e3)).optional().describe("\u753B\u9762ID\u4E00\u89A7\uFF08\u4F8B: SC-OP-01, SC-US-01\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function nE(e,t){let r=[];return e.forEach((n,o)=>{n.trim()===t&&r.push(o)}),r}function hU(e){let t=e.split(/\r?\n/),r=nE(t,dU),n=nE(t,fU);return r.length!==1||n.length!==1||n[0]<r[0]?e:t.slice(r[0]+1,n[0]).join(`
|
|
178
178
|
`).trim()}function mU(e,t){let r=(0,rs.relative)(e,t);return r===""||!r.startsWith("..")&&!(0,rs.isAbsolute)(r)}function gU(e){try{let t=(0,Da.realpathSync)(e),r=(0,Da.realpathSync)((0,rs.join)(e,"docs","README.md"));return mU(t,r)?hU((0,Da.readFileSync)(r,"utf-8")):null}catch{return null}}function oE(e){let t=Math.max(0,...[...e.matchAll(/`+/g)].map(r=>r[0].length));return"`".repeat(Math.max(3,t+1))}function cE(){return sE??=ay("notes-docs"),sE}function _U(){return cE().filter(e=>e.relativePath.includes(yU))}function vU(){return cE().filter(e=>e.relativePath.endsWith(".csv")).map(e=>({relativePath:e.relativePath,header:e.content.split(/\r?\n/)[0]})).filter(({header:e})=>e.trim()!=="")}function wU(e,t){if(e.length<=t)return e;let r=e.slice(0,t);if(e[t]===`
|
|
179
179
|
`)return r;let n=r.lastIndexOf(`
|
|
180
180
|
`);return n===-1?"":r.slice(0,n)}function uE(e,t){let r=[`## \u5909\u66F4\u5185\u5BB9
|
|
@@ -200,9 +200,9 @@ ${c}`)}}else r.push(`## \u4ED5\u69D8\u66F8\u306E\u96DB\u5F62\u304C\u8AAD\u307F\u
|
|
|
200
200
|
\u6B20\u640D\u3057\u305F\u4E00\u89A7 CSV \u3092\u4F5C\u6210\u3059\u308B\u3068\u304D\u306F\u3001\u30D5\u30A1\u30A4\u30EB\u540D\u304C\u4E00\u81F4\u3059\u308B\u4EE5\u4E0B\u306E\u30D8\u30C3\u30C0\u30FC\u884C\u304B\u3089\u59CB\u3081\u308B\uFF08\u904E\u53BB\u306E\u6A5F\u80FD\u30FB\u753B\u9762\u306E\u884C\u3092\u9061\u3063\u3066\u5275\u4F5C\u3057\u306A\u3044\u3002\u4ECA\u56DE\u306E\u5909\u66F4\u306B\u5BFE\u5FDC\u3059\u308B\u884C\u3060\u3051\u3092\u8FFD\u52A0\u3059\u308B\uFF09\u3002\u4E00\u81F4\u3059\u308B\u3082\u306E\u304C\u7121\u3044 CSV \u306F\u5217\u3092\u5275\u4F5C\u305B\u305A\u3001\u4F5C\u6210\u3092\u898B\u9001\u3063\u3066\u6700\u7D42\u5831\u544A\u306B\u542B\u3081\u308B\u3053\u3068\u3002
|
|
201
201
|
|
|
202
202
|
`+s.map(({relativePath:a,header:c})=>`- \`${a}\`: \`${c}\``).join(`
|
|
203
|
-
`)),
|
|
203
|
+
`)),Qr(e,"docs",r.join(`
|
|
204
204
|
|
|
205
|
-
`),t.project_root)}var Da,rs,aE,dU,fU,yU,iE,sE,lE=b(()=>{"use strict";tt();Da=require("node:fs"),rs=require("node:path");
|
|
205
|
+
`),t.project_root)}var Da,rs,aE,dU,fU,yU,iE,sE,lE=b(()=>{"use strict";tt();Da=require("node:fs"),rs=require("node:path");Xt();op();aE=m.object({changes:m.string().max(2e5).optional().describe("\u5909\u66F4\u5185\u5BB9\uFF08\u30B3\u30FC\u30C9\u5909\u66F4\u306E\u6982\u8981\uFF09"),target_sections:m.array(m.string().max(1e3)).optional().describe("\u66F4\u65B0\u5BFE\u8C61\u30BB\u30AF\u30B7\u30E7\u30F3\uFF08\u4F8B: 001_project, 003_requirements, 005_architecture\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),dU="<!-- godd:docs-index:start -->",fU="<!-- godd:docs-index:end -->";yU="\u3010\u4ED5\u69D8\u66F8\u3011\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8",iE=6e4});function dE(e,t){let r=cy(),n=[];if(t.project_name&&n.push(`## \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D
|
|
206
206
|
${t.project_name}`),r.length===0)n.push("## \u8B66\u544A\n\u30D0\u30F3\u30C9\u30EB\u6E08\u307F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n`godd-mcp-server/templates/notes-docs/` \u304C\u5B58\u5728\u3059\u308B\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n`godd-docs-init` \u30C4\u30FC\u30EB\u3092\u4EE3\u308F\u308A\u306B\u4F7F\u7528\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002");else{let o=r.map(i=>`- docs/${i.relativePath}`).join(`
|
|
207
207
|
`);n.push(`## \u5C55\u958B\u3059\u308B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\uFF08${r.length} \u4EF6\uFF09
|
|
208
208
|
|
|
@@ -213,31 +213,32 @@ ${t.project_name}`),r.length===0)n.push("## \u8B66\u544A\n\u30D0\u30F3\u30C9\u30
|
|
|
213
213
|
|
|
214
214
|
\`\`\`${s}
|
|
215
215
|
${i.content.trimEnd()}
|
|
216
|
-
\`\`\``)}}return
|
|
216
|
+
\`\`\``)}}return Qr(e,"notes-init",n.join(`
|
|
217
217
|
|
|
218
|
-
`),t.project_root)}var pE,fE=b(()=>{"use strict";tt();
|
|
218
|
+
`),t.project_root)}var pE,fE=b(()=>{"use strict";tt();Xt();op();pE=m.object({project_name:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D\uFF08\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5185\u306E [\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC] \u306B\u7F6E\u63DB\uFF09"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u81EA\u52D5\u691C\u51FA\u7528\uFF09")})});function ye(e){return e instanceof Error?e.message:String(e)}var er=b(()=>{"use strict"});function to(e){let t=(0,hE.join)(e,Kt);if(!(0,ip.existsSync)(t))return;let r;try{r=br.load((0,ip.readFileSync)(t,"utf-8"))}catch(o){throw new Error(`${Kt} \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${ye(o)}`)}let n=bU.safeParse(r??{});if(!n.success)throw new Error(`${Kt} \u306E knowledge.project_id \u304C\u4E0D\u6B63\u3067\u3059\uFF08UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09: ${n.error.issues.map(o=>o.message).join(", ")}`);return n.data.knowledge?.project_id}var ip,hE,bU,Oa=b(()=>{"use strict";ip=require("node:fs"),hE=require("node:path");Ls();tt();Ln();er();bU=m.object({knowledge:m.object({project_id:m.string().uuid().optional()}).optional()})});function uy(e){return kU[(0,ro.extname)(e).toLowerCase()]}function ly(e,t){return e.map(r=>{let n=(0,ro.isAbsolute)(r)?r:(0,ro.resolve)(t,r),o;try{o=(0,sp.statSync)(n)}catch{throw new Error(`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${r}\uFF08\u89E3\u6C7A\u5F8C\u306E\u30D1\u30B9: ${n}\uFF09`)}if(!o.isFile())throw new Error(`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${r}`);try{return{fileName:(0,ro.basename)(n),bytes:(0,sp.readFileSync)(n)}}catch(i){throw new Error(`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${r} \u2014 ${ye(i)}`)}})}function SU(e,t){if(e!==void 0)return e;let r=to(t);if(r!==void 0)return r;throw new Error("\u4FDD\u5B58\u5148\u306E project \u304C\u6C7A\u307E\u3063\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u4FDD\u5B58\u3057\u3066\u3044\u307E\u305B\u3093\u3002godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u3001\u5185\u5BB9\u306B\u5408\u3046\u5019\u88DC\u3092\u9078\u3093\u3067\u3001\u4FDD\u5B58\u524D\u306B\u5FC5\u305A\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3057\u3066\u304B\u3089\u3001project_id \u3092\u6307\u5B9A\u3057\u3066\u3082\u3046\u4E00\u5EA6\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002\uFF08\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u65E2\u5B9A\u306E\u4FDD\u5B58\u5148\u306B\u3059\u308B\u306A\u3089\u3001config.godd \u306B knowledge.project_id \u3092\u8A2D\u5B9A\u3067\u304D\u307E\u3059\uFF09")}function $U(e,t){let r=new FormData;r.append("project_id",e.project_id),r.append("title",e.title),r.append("body",e.body);for(let n of t){let o=uy(n.fileName),i=new Blob([new Uint8Array(n.bytes)],o?{type:o}:void 0);r.append("attachments",i,n.fileName)}return r}function ns(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function py(e,t,r){let n=nt(e,t,r);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u4FDD\u5B58\u5148\u306E project \u304C\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u7D42\u4E86\u3057\u3066\u3044\u308B\u3001\u307E\u305F\u306F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3067\u3059\u3002${t}
|
|
219
219
|
godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`Knowledge DB \u3078\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function gE(e,t){let r=Nt(e,t.project_root).root,n=SU(t.project_id,r),o=ly(t.attachments??[],r),i=$U({...t,project_id:n},o),s=e.config.registry_url.replace(/\/+$/,""),a,c;try{a=await fetch(`${s}/knowledge`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`},body:i,signal:AbortSignal.timeout(9e4)}),c=await a.text()}catch(l){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ye(l)}`)}if(!a.ok)throw new Na(a.status,py(a.status,ns(c).slice(0,300),e.config.auth_source));let u;try{u=JSON.parse(c)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${c.slice(0,200)}`)}let p=xU.safeParse(u);if(!p.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${p.error.message}`);return PU(p.data,t.title)}function PU(e,t){if(!e.saved)return`\u77E5\u898B\u306F\u4FDD\u5B58\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F: ${t}\uFF08id: ${e.id}\uFF09`;let r=[`\u77E5\u898B\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F: ${t}`,`- \u4FDD\u5B58\u5148: ${e.project.name}\uFF08project id: ${e.project.id}\uFF09`,`- id: ${e.id}`];e.attachments.length>0&&r.push(`- \u6DFB\u4ED8 ${e.attachments.length} \u4EF6: ${e.attachments.map(n=>n.file_name).join(", ")}`),e.embedded||r.push("- \u6CE8\u610F: embedding \u306E\u751F\u6210\u306B\u5931\u6557\u3057\u305F\u305F\u3081\u3001\u610F\u5473\u691C\u7D22\u3067\u306F\u5F53\u9762\u30D2\u30C3\u30C8\u3057\u307E\u305B\u3093\uFF08\u4FDD\u5B58\u81EA\u4F53\u306F\u6210\u529F\u3057\u3066\u3044\u307E\u3059\uFF09");for(let n of e.warnings)r.push(`- \u8B66\u544A: ${n}`);return r.join(`
|
|
220
|
-
`)}var sp,ro,mE,xU,Na,kU,ap=b(()=>{"use strict";tt();sp=require("node:fs"),ro=require("node:path");
|
|
221
|
-
GoDD \u306E\u958B\u767A\u30C1\u30FC\u30E0\u306E Slack \u306B\u3082\u901A\u77E5\u3055\u308C\u307E\u3059\u3002
|
|
220
|
+
`)}var sp,ro,mE,xU,Na,kU,ap=b(()=>{"use strict";tt();sp=require("node:fs"),ro=require("node:path");Xt();Oa();er();Kr();mE=m.object({title:m.string().min(1,"title \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u77E5\u898B\u306E 1 \u884C\u8981\u7D04\uFF08\u4E00\u89A7\u8868\u793A\u30FB\u4EBA\u9593\u306E\u30EC\u30D3\u30E5\u30FC\u7528\uFF09"),body:m.string().min(1,"body \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u77E5\u898B\u306E\u672C\u6587\u30021 \u884C\u76EE\u306B\u7D50\u8AD6\u3092 1 \u6587\u3001\u4EE5\u964D\u306B\u80CC\u666F\u30FB\u9069\u7528\u6761\u4EF6\u30FB\u6CE8\u610F\u70B9\u3002200\u301C600 \u5B57\u76EE\u5B89"),attachments:m.array(m.string().min(1).max(4e3)).optional().describe("\u6DFB\u4ED8\u3059\u308B\u30ED\u30FC\u30AB\u30EB\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u3002\u7D76\u5BFE\u30D1\u30B9\u3001\u307E\u305F\u306F project_root \u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9"),project_id:m.string().uuid("project_id \u306F godd-knowledge-projects \u304C\u8FD4\u3059 UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u4FDD\u5B58\u5148 project \u306E id\uFF08godd-knowledge-projects \u3067\u53D6\u5F97\uFF09\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08\u76F8\u5BFE\u30D1\u30B9\u306E\u6DFB\u4ED8\u3068 config.godd \u3092\u89E3\u6C7A\u3059\u308B\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),xU=m.object({id:m.string(),saved:m.boolean(),embedded:m.boolean(),attachments:m.array(m.object({id:m.string(),file_name:m.string(),mime_type:m.string().nullable().optional()})),warnings:m.array(m.string()),project:m.object({id:m.string(),name:m.string(),description:m.string().nullable().optional()})}),Na=class extends Error{constructor(r,n){super(n);this.status=r;this.name="KnowledgeSaveError"}},kU={".txt":"text/plain",".log":"text/plain",".md":"text/markdown",".csv":"text/csv",".json":"application/json",".yaml":"application/yaml",".yml":"application/yaml",".xml":"application/xml",".html":"text/html",".css":"text/css",".js":"text/javascript",".ts":"text/plain",".py":"text/x-python",".sh":"application/x-sh",".sql":"application/sql",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".pdf":"application/pdf",".zip":"application/zip",".gz":"application/gzip"}});async function _E(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n,o;try{n=await fetch(`${r}/v1/feedback`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`,"Content-Type":"application/json"},body:JSON.stringify({...t,tool:t.tool?.replace(EU,"")}),signal:AbortSignal.timeout(3e4)}),o=await n.text()}catch(c){throw new Error(`GoDD API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ye(c)}`)}if(!n.ok)throw new Error(AU(n.status,j1(o).slice(0,300),e));let i;try{i=JSON.parse(o)}catch{throw new Error(`\u6539\u5584\u8981\u671B\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${o.slice(0,200)}`)}let s=CU.safeParse(i);if(!s.success)throw new Error(`\u6539\u5584\u8981\u671B\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${s.error.message}`);let a=`\u6539\u5584\u8981\u671B\u3092\u9001\u308A\u307E\u3057\u305F: #${s.data.number} ${s.data.url}
|
|
221
|
+
GoDD \u306E\u958B\u767A\u30C1\u30FC\u30E0\u306E Slack \u306B\u3082\u901A\u77E5\u3055\u308C\u307E\u3059\u3002`;return TU(e,a,s.data)}function TU(e,t,r){try{return Qr(e,"feedback",`## \u9001\u4FE1\u7D50\u679C
|
|
222
|
+
${t}`,void 0,{issue_number:r.number,issue_url:r.url})}catch{return t}}function AU(e,t,r){let n=nt(e,t,r.config.auth_source);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u3067\u306F godd-feedback \u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002":`\u6539\u5584\u8981\u671B\u3092\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F: ${e} ${t}`)}var EU,yE,CU,vE=b(()=>{"use strict";tt();Xt();Kr();er();EU=/^mcp__[A-Za-z0-9_-]+?__/,yE=m.object({tool:m.string().regex(/^(?:mcp__[A-Za-z0-9_-]+?__)?[a-z0-9][a-z0-9-]{0,63}$/,"tool \u306F godd-dev \u306E\u3088\u3046\u306A GoDD \u306E\u30C4\u30FC\u30EB\u540D\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u5BFE\u8C61\u306E GoDD \u30C4\u30FC\u30EB\u540D\uFF08\u4F8B: godd-dev\uFF09\u3002\u7279\u5B9A\u306E\u30C4\u30FC\u30EB\u306E\u8A71\u3067\u306A\u3051\u308C\u3070\u7701\u7565"),title:m.string().trim().min(1,"title \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(200).describe("\u8981\u671B\u306E 1 \u884C\u8981\u7D04"),body:m.string().trim().min(1,"body \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(2e4).describe("\u3069\u3093\u306A\u5834\u9762\u3067\u4F55\u304C\u8D77\u304D\u305F\u304B\u3001\u3069\u3046\u306A\u3063\u3066\u307B\u3057\u3044\u304B")}),CU=m.object({number:m.number(),url:m.string()})});function dy(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function fy(e,t,r){let n=nt(e,t,r);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u6307\u5B9A\u3057\u305F project \u304C\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${t}
|
|
222
223
|
godd-knowledge-projects \u3067\u691C\u7D22\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:e===422?`\u691C\u7D22\u6761\u4EF6\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:e===502?`\u610F\u5473\u691C\u7D22\u306B\u4F7F\u3046 embedding \u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002keywords\uFF08\u56FA\u6709\u540D\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u30FB\u8A2D\u5B9A\u30AD\u30FC\u540D\u306A\u3069\uFF09\u3092\u6307\u5B9A\u3057\u3066\u547C\u3073\u76F4\u3059\u3068\u3001\u30AD\u30FC\u30EF\u30FC\u30C9\u691C\u7D22\u3060\u3051\u3067\u63A2\u305B\u307E\u3059\u3002\uFF08${t}\uFF09`:`Knowledge DB \u306E\u691C\u7D22\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function bE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n=t.project_id===void 0?to(Nt(e,t.project_root).root):void 0,o=t.project_id??n;if(o===void 0)throw new Error("\u691C\u7D22\u3059\u308B project \u304C\u6C7A\u307E\u3063\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u691C\u7D22\u3057\u3066\u3044\u307E\u305B\u3093\u3002godd-knowledge-projects \u3067\u4ED8\u4E0E\u3055\u308C\u305F project \u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u3001\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306B\u8A72\u5F53\u3057\u305D\u3046\u306A project \u3092\u9078\u3093\u3067\u3001config.godd \u306B knowledge.project_id \u3068\u3057\u3066\u8FFD\u52A0\u3059\u308B\u304B\u3092\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u6848\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u81EA\u5206\u3067\u306F\u66F8\u304D\u8FBC\u307E\u306A\u3044\uFF09\u3002\u30E6\u30FC\u30B6\u30FC\u304C project \u3092\u78BA\u8A8D\u30FB\u6307\u793A\u3057\u305F\u5834\u5408\u3060\u3051\u3001project_id \u3092\u6307\u5B9A\u3057\u3066\u3082\u3046\u4E00\u5EA6\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u4ED6\u306E\u6848\u4EF6\u306E\u77E5\u898B\u306F godd-knowledge-search-general\uFF08\u533F\u540D\u5316\u3055\u308C\u305F\u30CA\u30EC\u30C3\u30B8\u5C64\uFF09\u3067\u691C\u7D22\u3067\u304D\u307E\u3059\u3002");let i,s;try{i=await fetch(`${r}/knowledge/search`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`,"Content-Type":"application/json"},body:JSON.stringify({query:t.query,keywords:t.keywords,project_id:o}),signal:AbortSignal.timeout(3e4)}),s=await i.text()}catch(u){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ye(u)}`)}if(!i.ok){let u=dy(s).slice(0,300),p=i.status===403&&n!==void 0?`config.godd \u306E knowledge.project_id \u306E project \u304C\u3001\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${u}
|
|
223
|
-
config.godd \u306E knowledge.project_id \u306F\u66F8\u304D\u63DB\u3048\u305A\u3001\u305D\u306E project \u306E\u4ED8\u4E0E\u3092\u7BA1\u7406\u8005\u306B\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:fy(i.status,u,e.config.auth_source);throw new ja(i.status,p)}let a;try{a=JSON.parse(s)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=
|
|
224
|
-
`)}var wE,
|
|
225
|
-
`)}var xE,
|
|
226
|
-
\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B godd-knowledge-search-general \u306E\u8A31\u53EF\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:fy(e,t,r))}async function PE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n,o;try{n=await fetch(`${r}/knowledge/general/search`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`,"Content-Type":"application/json"},body:JSON.stringify({query:t.query,keywords:t.keywords}),signal:AbortSignal.timeout(3e4)}),o=await n.text()}catch(a){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ye(a)}`)}if(!n.ok)throw new ja(n.status,
|
|
227
|
-
`)}var $E,
|
|
228
|
-
`)}var CE,
|
|
229
|
-
`,"utf-8"),(0,
|
|
230
|
-
${e.content}`}function NE(e,t){let r=Nt(e,t.project_root).root;if(t.action==="remember"){let s=t.content?.trim();if(!s)return"## \u30A8\u30E9\u30FC\nremember \u306B\u306F `content`\uFF08\u8A18\u61B6\u5185\u5BB9\uFF09\u304C\u5FC5\u8981\u3067\u3059\u3002";let a=gy(r),{entries:c,entry:u,duplicate:p}=
|
|
224
|
+
config.godd \u306E knowledge.project_id \u306F\u66F8\u304D\u63DB\u3048\u305A\u3001\u305D\u306E project \u306E\u4ED8\u4E0E\u3092\u7BA1\u7406\u8005\u306B\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:fy(i.status,u,e.config.auth_source);throw new ja(i.status,p)}let a;try{a=JSON.parse(s)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=RU.safeParse(a);if(!c.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${c.error.message}`);return IU(c.data,t.query)}function IU(e,t){let r=[];e.results.length===0?r.push(`\u8A72\u5F53\u3059\u308B\u77E5\u898B\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08query: ${t}\uFF09`):r.push(`${e.results.length} \u4EF6\u306E\u77E5\u898B\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\uFF08query: ${t}\uFF09`);for(let n of e.warnings)r.push(`- \u8B66\u544A: ${n}`);return e.results.forEach((n,o)=>{r.push(""),r.push(`## ${o+1}. ${n.title}`),r.push(`id: ${n.id} / ${n.created_at}`),r.push(""),r.push(n.body),n.attachments.length>0&&(r.push(""),r.push(`\u6DFB\u4ED8\uFF08godd-knowledge-attachment \u3067\u53D6\u5F97\uFF09: ${n.attachments.map(i=>`${i.file_name} [${i.id}]`).join(", ")}`))}),r.join(`
|
|
225
|
+
`)}var wE,RU,ja,hy=b(()=>{"use strict";tt();Xt();Oa();er();Kr();wE=m.object({query:m.string().min(1,"query \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u63A2\u3057\u3066\u3044\u308B\u5185\u5BB9\u3092\u8AAC\u660E\u3059\u308B\u81EA\u7136\u6587\u3002\u610F\u5473\u691C\u7D22\u306B\u4F7F\u3046"),keywords:m.array(m.string()).optional().describe("\u30AD\u30FC\u30EF\u30FC\u30C9\u691C\u7D22\u306B\u4F7F\u3046\u8A9E\u306E\u914D\u5217\u3002\u56FA\u6709\u540D\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u30FB\u8A2D\u5B9A\u30AD\u30FC\u540D\u306A\u3069 2\u301C5 \u8A9E"),project_id:m.string().uuid("project_id \u306F UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u691C\u7D22\u3059\u308B project \u306E ID\uFF08godd-knowledge-projects \u3067\u78BA\u8A8D\uFF09\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u78BA\u8A8D\u30FB\u6307\u793A\u3057\u305F\u5834\u5408\u3060\u3051\u6307\u5B9A\u3059\u308B\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id\u3002\u3069\u3061\u3089\u3082\u7121\u3051\u308C\u3070\u691C\u7D22\u3057\u306A\u3044"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u3092\u89E3\u6C7A\u3059\u308B\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),RU=m.object({results:m.array(m.object({id:m.string(),title:m.string(),body:m.string(),created_at:m.string(),attachments:m.array(m.object({id:m.string(),file_name:m.string(),mime_type:m.string().nullable().optional()}))})),warnings:m.array(m.string())}),ja=class extends Error{constructor(r,n){super(n);this.status=r;this.name="KnowledgeSearchError"}}});function DU(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:JSON.stringify(r)}}catch{}return e}function OU(e,t,r){let n=nt(e,t,r);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${t}`:e===404?"\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002ID \u304C\u9593\u9055\u3063\u3066\u3044\u308B\u304B\u3001\u7D10\u3065\u304F\u77E5\u898B\u304C\u53D6\u308A\u4E0B\u3052\u6E08\u307F\u304B\u3001\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044 project \u306E\u3082\u306E\u3067\u3059\u3002":`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u306E URL \u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}async function kE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n=encodeURIComponent(t.attachment_id),o,i;try{o=await fetch(`${r}/knowledge/attachments/${n}`,{method:"GET",headers:{Authorization:`Bearer ${e.config.license_key}`},signal:AbortSignal.timeout(3e4)}),i=await o.text()}catch(f){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ye(f)}`)}if(!o.ok)throw new my(o.status,OU(o.status,DU(i).slice(0,300),e.config.auth_source));let s;try{s=JSON.parse(i)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${i.slice(0,200)}`)}let a=zU.safeParse(s);if(!a.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${a.error.message}`);let{file_name:c,mime_type:u,url:p,expires_in:l}=a.data,d=Math.round(l/60);return[`\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u306E\u53D6\u5F97 URL \u3092\u767A\u884C\u3057\u307E\u3057\u305F: ${c}`,u?`- \u7A2E\u985E: ${u}`:void 0,`- \u6709\u52B9\u671F\u9650: \u7D04 ${d} \u5206`,`- URL: ${p}`].filter(f=>f!==void 0).join(`
|
|
226
|
+
`)}var xE,zU,my,SE=b(()=>{"use strict";tt();er();Kr();xE=m.object({attachment_id:m.string().min(1,"attachment_id \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("godd-knowledge-search \u306E\u7D50\u679C\u306B\u8868\u793A\u3055\u308C\u305F\u6DFB\u4ED8\u306E ID")}),zU=m.object({id:m.string(),file_name:m.string(),mime_type:m.string().nullable().optional(),url:m.string(),expires_in:m.number()}),my=class extends Error{constructor(r,n){super(n);this.status=r;this.name="KnowledgeAttachmentError"}}});function jU(e,t,r){let n=nt(e,t,r);return n||(e===403?`\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u30CA\u30EC\u30C3\u30B8\u5C64\u306E\u691C\u7D22\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u671F\u9650\u5207\u308C\u3067\u3059\u3002${t}
|
|
227
|
+
\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B godd-knowledge-search-general \u306E\u8A31\u53EF\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:fy(e,t,r))}async function PE(e,t){let r=e.config.registry_url.replace(/\/+$/,""),n,o;try{n=await fetch(`${r}/knowledge/general/search`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`,"Content-Type":"application/json"},body:JSON.stringify({query:t.query,keywords:t.keywords}),signal:AbortSignal.timeout(3e4)}),o=await n.text()}catch(a){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ye(a)}`)}if(!n.ok)throw new ja(n.status,jU(n.status,dy(o).slice(0,300),e.config.auth_source));let i;try{i=JSON.parse(o)}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${o.slice(0,200)}`)}let s=NU.safeParse(i);if(!s.success)throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${s.error.message}`);return MU(s.data,t.query)}function MU(e,t){let r=[];e.results.length===0?r.push(`\u30CA\u30EC\u30C3\u30B8\u5C64\u306B\u8A72\u5F53\u3059\u308B\u77E5\u898B\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08query: ${t}\uFF09`):r.push(`\u30CA\u30EC\u30C3\u30B8\u5C64\u304B\u3089 ${e.results.length} \u4EF6\u306E\u77E5\u898B\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\uFF08query: ${t}\uFF09\u3002\u3044\u305A\u308C\u3082\u4ED6\u306E\u6848\u4EF6\u306E\u77E5\u898B\u3092\u533F\u540D\u5316\u3057\u305F\u3082\u306E\u3067\u3059`);for(let n of e.warnings)r.push(`- \u8B66\u544A: ${n}`);return e.results.forEach((n,o)=>{r.push(""),r.push(`## ${o+1}. ${n.title}`),r.push(`id: ${n.id} / ${n.generalized_at}`),r.push(""),r.push(n.body)}),r.join(`
|
|
228
|
+
`)}var $E,NU,EE=b(()=>{"use strict";tt();hy();er();Kr();$E=m.object({query:m.string().min(1,"query \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u63A2\u3057\u3066\u3044\u308B\u5185\u5BB9\u3092\u8AAC\u660E\u3059\u308B\u81EA\u7136\u6587\u3002\u610F\u5473\u691C\u7D22\u306B\u4F7F\u3046"),keywords:m.array(m.string()).optional().describe("\u30AD\u30FC\u30EF\u30FC\u30C9\u691C\u7D22\u306B\u4F7F\u3046\u8A9E\u306E\u914D\u5217\u3002\u753B\u9762\u540D\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u540D\u30FB\u8A2D\u5B9A\u30AD\u30FC\u540D\u306A\u3069 2\u301C5 \u8A9E")}),NU=m.object({results:m.array(m.object({id:m.string(),title:m.string(),body:m.string(),generalized_at:m.string()})),warnings:m.array(m.string())})});async function TE(e,t){let r=Nt(e,t.project_root).root,n=to(r),o=e.config.registry_url.replace(/\/+$/,""),i,s;try{i=await fetch(`${o}/knowledge/projects`,{method:"GET",headers:{Authorization:`Bearer ${e.config.license_key}`},signal:AbortSignal.timeout(3e4)}),s=await i.text()}catch(u){throw new Error(`GoDD API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${ye(u)}`)}if(!i.ok)throw new Na(i.status,py(i.status,ns(s).slice(0,300),e.config.auth_source));let a;try{a=JSON.parse(s)}catch{throw new Error(`project \u4E00\u89A7\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=LU.safeParse(a);if(!c.success)throw new Error(`project \u4E00\u89A7\u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u30B9\u30AD\u30FC\u30DE\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: ${c.error.message}`);return ZU(c.data,n)}function ZU(e,t){if(e.length===0)return"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u4ED8\u4E0E\u3055\u308C\u305F project \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u77E5\u898B\u3092\u4FDD\u5B58\u30FB\u53C2\u7167\u3059\u308B\u306B\u306F\u3001GoDD Admin \u306E\u7BA1\u7406\u8005\u306B project \u306E\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002";let r=[`\u4FDD\u5B58\u3067\u304D\u308B project\uFF08${e.length} \u4EF6\uFF09:`];for(let n of e){let o=n.id===t?" \u2190 config.godd \u3067\u8A2D\u5B9A\u4E2D":"";r.push(`- ${n.name}\uFF08id: ${n.id}\uFF09${o}`),n.description&&r.push(` ${n.description}`)}return t===void 0?r.push("","config.godd \u306B knowledge.project_id \u304C\u7121\u3044\u305F\u3081\u3001\u4FDD\u5B58\u6642\u306F\u4E0A\u304B\u3089\u5019\u88DC\u3092\u9078\u3073\u3001\u4FDD\u5B58\u524D\u306B\u5FC5\u305A\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"):e.some(n=>n.id===t)||r.push("",`\u6CE8\u610F: config.godd \u306E knowledge.project_id\uFF08${t}\uFF09\u306F\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u7D42\u4E86\u3057\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u307E\u307E\u3067\u306F\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3059\u308B\u3088\u3046\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`),r.join(`
|
|
229
|
+
`)}var CE,LU,AE=b(()=>{"use strict";tt();Xt();Oa();ap();er();CE=m.object({project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u306E knowledge.project_id \u3092\u8AAD\u3080\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),LU=m.array(m.object({id:m.string(),name:m.string(),description:m.string().nullable().optional()}))});function qU(e){return e.toLowerCase().split(/\s+/).map(t=>t.trim()).filter(t=>t.length>0)}function FU(e,t,r){let n=t.content.trim(),o=n.toLowerCase(),i=e.find(a=>a.content.trim().toLowerCase()===o);if(i)return{entries:e,entry:i,duplicate:!0};let s={id:r.id,content:n,tags:(t.tags??[]).map(a=>a.trim()).filter(a=>a.length>0),who:t.who?.trim()||"agent",createdAt:r.now,...t.source?.trim()?{source:t.source.trim()}:{}};return{entries:[...e,s],entry:s,duplicate:!1}}function RE(e,t,r={}){let n=r.limit??zE,o=qU(t),i=[...e].sort((u,p)=>u.createdAt<p.createdAt?-1:u.createdAt>p.createdAt?1:0),s=new Map;i.forEach((u,p)=>{let l=e.length<=1?1:p/(e.length-1);s.set(u.id,l)});let a=e.map(u=>{let p=u.content.toLowerCase(),l=u.tags.map(h=>h.toLowerCase()),d=0;for(let h of o)p.includes(h)&&(d+=2),l.some(g=>g.includes(h))&&(d+=3);let f=s.get(u.id)??0;return{entry:u,score:d+f,keywordScore:d}});return(o.length===0?a:a.filter(u=>u.keywordScore>0)).sort((u,p)=>p.score-u.score).slice(0,Math.max(0,n)).map(({entry:u,score:p})=>({entry:u,score:p}))}function DE(e){return(0,Ma.join)(e,IE)}function gy(e){let t=DE(e);if(!(0,Xr.existsSync)(t))return[];try{let r=JSON.parse((0,Xr.readFileSync)(t,"utf-8"));return Array.isArray(r)?r.flatMap(n=>{if(!n||typeof n!="object")return[];let o=n;return typeof o.id!="string"||typeof o.content!="string"?[]:[{id:o.id,content:o.content,tags:Array.isArray(o.tags)?o.tags.filter(i=>typeof i=="string"):[],who:typeof o.who=="string"?o.who:"agent",createdAt:typeof o.createdAt=="string"?o.createdAt:"",...typeof o.source=="string"?{source:o.source}:{}}]}):[]}catch{return[]}}function GU(e,t){let r=DE(e);(0,Xr.mkdirSync)((0,Ma.dirname)(r),{recursive:!0});let n=`${r}.tmp-${(0,_y.randomUUID)()}`;(0,Xr.writeFileSync)(n,`${JSON.stringify(t,null,2)}
|
|
230
|
+
`,"utf-8"),(0,Xr.renameSync)(n,r)}function yy(e){let t=e.tags.length?` [${e.tags.join(", ")}]`:"",r=e.source?` (source: ${e.source})`:"";return`- (${e.createdAt} / ${e.who})${t}${r}
|
|
231
|
+
${e.content}`}function NE(e,t){let r=Nt(e,t.project_root).root;if(t.action==="remember"){let s=t.content?.trim();if(!s)return"## \u30A8\u30E9\u30FC\nremember \u306B\u306F `content`\uFF08\u8A18\u61B6\u5185\u5BB9\uFF09\u304C\u5FC5\u8981\u3067\u3059\u3002";let a=gy(r),{entries:c,entry:u,duplicate:p}=FU(a,{content:s,tags:t.tags,who:t.who,source:t.source},{id:(0,_y.randomUUID)(),now:new Date().toISOString()});return p||GU(r,c),[p?"## \u8A18\u61B6\u6E08\u307F\uFF08\u91CD\u8907\u306E\u305F\u3081\u30B9\u30AD\u30C3\u30D7\uFF09":"## \u8A18\u61B6\u3057\u307E\u3057\u305F",`- id: ${u.id}`,`- \u4FDD\u5B58\u5148: ${IE}`,`- \u7DCF\u8A18\u61B6\u6570: ${c.length} \u4EF6`,"",yy(u)].join(`
|
|
231
232
|
`)}if(t.action==="recall"){let s=gy(r);if(s.length===0)return"## \u8A18\u61B6\u306A\u3057\n\u307E\u3060\u8A18\u61B6\u304C\u3042\u308A\u307E\u305B\u3093\uFF08`godd-memory action=remember` \u3067\u4FDD\u5B58\u3067\u304D\u307E\u3059\uFF09\u3002";let a=RE(s,t.query??"",{limit:t.limit});if(a.length===0)return`## \u8A72\u5F53\u306A\u3057
|
|
232
233
|
\u30AF\u30A8\u30EA\u300C${t.query??""}\u300D\u306B\u4E00\u81F4\u3059\u308B\u8A18\u61B6\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u5168 ${s.length} \u4EF6\uFF09\u3002`;let c=a.map(u=>yy(u.entry));return[`## \u60F3\u8D77\u3057\u305F\u8A18\u61B6\uFF08${a.length}/${s.length} \u4EF6\uFF09`,t.query?`\u30AF\u30A8\u30EA: ${t.query}`:"\uFF08\u30AF\u30A8\u30EA\u672A\u6307\u5B9A: \u65B0\u3057\u3044\u9806\uFF09","",...c].join(`
|
|
233
234
|
`)}let n=gy(r),o=RE(n,t.query??"",{limit:t.limit??30});return["# \u8A18\u61B6\u306E\u7D71\u5408\uFF08consolidate\uFF09","","\u4EE5\u4E0B\u306F `.godd/memory/godd-memory.json` \u304B\u3089\u60F3\u8D77\u3057\u305F\u8A18\u61B6\u3067\u3059\u3002\u91CD\u8907\u30FB\u9673\u8150\u5316\u30FB\u77DB\u76FE\u3092\u8E0F\u307E\u3048\u3066\u6574\u7406\u3057\u3001","\u518D\u5229\u7528\u4FA1\u5024\u306E\u9AD8\u3044\u77E5\u898B\u3092 `.godd/memory/` \u306E\u6574\u7406\u6E08\u307F\u30CA\u30EC\u30C3\u30B8\u3078\u84B8\u7559\u3057\u3066\u304F\u3060\u3055\u3044\u3002","","## \u624B\u9806","1. \u60F3\u8D77\u3057\u305F\u8A18\u61B6\u3092\u4E3B\u984C\u3054\u3068\u306B\u30B0\u30EB\u30FC\u30D4\u30F3\u30B0\u3059\u308B\u3002","2. \u6052\u4E45\u7684\u306B\u6709\u7528\u306A\u3082\u306E\u3092\u6B21\u306E\u3044\u305A\u308C\u304B\u3078\u8981\u7D04\u3057\u3066\u8FFD\u8A18\u3059\u308B\uFF08\u65E2\u5B58\u3068\u77DB\u76FE\u3059\u308B\u5834\u5408\u306F\u660E\u8A18\uFF09:"," - `.godd/memory/decisions.yaml`\uFF08\u8A2D\u8A08\u5224\u65AD\uFF09"," - `.godd/memory/patterns.yaml`\uFF08\u6709\u52B9\u30D1\u30BF\u30FC\u30F3\uFF09"," - `.godd/memory/anti-patterns.yaml`\uFF08\u907F\u3051\u308B\u3079\u304D\u5931\u6557\uFF09"," - `.godd/memory/blockers.yaml`\uFF08\u8A70\u307E\u308A\u3068\u89E3\u6D88\uFF09","3. \u9673\u8150\u5316\u30FB\u91CD\u8907\u3057\u305F\u751F\u8A18\u61B6\u306F\u8981\u7D04\u5F8C\u306B\u6574\u7406\u5BFE\u8C61\u3068\u3057\u3066\u5831\u544A\u3059\u308B\uFF08\u524A\u9664\u306F\u4EBA\u624B\u5224\u65AD\uFF09\u3002","4. \u77DB\u76FE\u306F\u89E3\u6D88\u305B\u305A\u300C\u5BFE\u7ACB\u300D\u3068\u3057\u3066\u4E21\u8AD6\u4F75\u8A18\u3067\u6B8B\u3059\uFF08\u65E9\u3059\u304E\u308B\u6B63\u898F\u5316\u3092\u907F\u3051\u308B\uFF09\u3002","","## \u60F3\u8D77\u3057\u305F\u8A18\u61B6",o.length?o.map(s=>yy(s.entry)).join(`
|
|
234
235
|
`):"\uFF08\u5BFE\u8C61\u306E\u8A18\u61B6\u306A\u3057\uFF09"].join(`
|
|
235
|
-
`)}var _y,
|
|
236
|
-
godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6210\u679C\u7269\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`working record \u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}function
|
|
237
|
-
`)}var ME,
|
|
236
|
+
`)}var _y,Xr,Ma,IE,UU,zE,OE,jE=b(()=>{"use strict";tt();_y=require("node:crypto"),Xr=require("node:fs"),Ma=require("node:path");Xt();IE=(0,Ma.join)(".godd","memory","godd-memory.json"),UU=2e4,zE=10;OE=m.object({action:m.enum(["remember","recall","consolidate"]).describe("remember: \u4FDD\u5B58 / recall: \u691C\u7D22 / consolidate: \u6574\u7406\u624B\u9806\u3092\u8FD4\u3059"),content:m.string().max(UU).optional().describe("remember \u6642\u306E\u8A18\u61B6\u5185\u5BB9\uFF08\u5FC5\u9808\uFF09"),tags:m.array(m.string().max(100)).max(50).optional().describe("\u5206\u985E\u30BF\u30B0\uFF08\u4EFB\u610F\uFF09"),who:m.string().max(100).optional().describe("\u8A18\u61B6\u306E\u66F8\u304D\u624B\uFF08\u65E2\u5B9A agent\uFF09"),source:m.string().max(500).optional().describe("\u7531\u6765\uFF08issue \u756A\u53F7\u30FB\u30BB\u30C3\u30B7\u30E7\u30F3\u7B49\u3001\u4EFB\u610F\uFF09"),query:m.string().max(1e3).optional().describe("recall / consolidate \u6642\u306E\u691C\u7D22\u30AF\u30A8\u30EA\uFF08\u7A7A\u306A\u3089\u65B0\u3057\u3044\u9806\uFF09"),limit:m.number().int().min(1).max(100).optional().describe(`recall / consolidate \u306E\u6700\u5927\u4EF6\u6570\uFF08\u65E2\u5B9A ${zE}\uFF09`),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\uFF08\u81EA\u52D5\u691C\u51FA\uFF09")})});function HU(e,t){if(e.without_project&&e.project_id!==void 0)throw new Error("project_id \u3068 without_project \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\u3069\u3061\u3089\u304B\u4E00\u65B9\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(!e.without_project)return e.project_id??to(t)}function WU(e,t,r){let n=nt(e,t,r.config.auth_source);return n||(e===401?"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002godd-config \u3067 GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002":e===403?`\u4FDD\u5B58\u5148\u306E project \u304C\u4ED8\u4E0E\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u7D42\u4E86\u3057\u3066\u3044\u308B\u3001\u307E\u305F\u306F\u3053\u306E\u64CD\u4F5C\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${t}
|
|
237
|
+
godd-knowledge-projects \u3067\u4FDD\u5B58\u3067\u304D\u308B project \u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002`:e===413?`\u6210\u679C\u7269\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002${t}`:e===422?`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${t}`:`working record \u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} ${t}`)}function KU(e,t,r,n,o){let i=e.deliverables.flatMap(u=>u.type==="file"&&u.path?[u.path]:[]),s=ly(i,o),a={session_id:r.sessionId,sequence:r.sequence,title:e.title,process:e.process,mcp_version:n,started_at:r.startedAt,tools:r.tools,deliverables:e.deliverables.map(u=>({type:u.type,title:u.title,...u.type==="url"?{url:u.url}:{},...u.type==="text"?{body:u.body}:{},...u.type==="file"&&u.path?{file_name:(0,ME.basename)(u.path)}:{}}))},c=new FormData;t!==void 0&&c.append("project_id",t),c.append("record",JSON.stringify(a));for(let u of s){let p=uy(u.fileName);c.append("files",new Blob([new Uint8Array(u.bytes)],p?{type:p}:void 0),u.fileName)}return c}async function ZE(e,t){let r=e.session;if(!r)throw new Error("\u3053\u306E\u30C4\u30FC\u30EB\u306F GoDD MCP \u30B5\u30FC\u30D0\u30FC\u304B\u3089\u3060\u3051\u547C\u3073\u51FA\u305B\u307E\u3059\uFF08\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u8A18\u9332\u304C\u3042\u308A\u307E\u305B\u3093\uFF09\u3002");let n=Nt(e,t.project_root).root,o=HU(t,n),i=r.snapshot(),s=KU(t,o,i,e.config.client_version,n),a=e.config.registry_url.replace(/\/+$/,""),c,u;try{c=await fetch(`${a}/working-records`,{method:"POST",headers:{Authorization:`Bearer ${e.config.license_key}`},body:s,signal:AbortSignal.timeout(9e4)}),u=await c.text()}catch(d){throw new Error(`Knowledge DB \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u547C\u3073\u51FA\u3059\u3068\u3001\u540C\u3058\u5185\u5BB9\u3092\u91CD\u8907\u306A\u304F\u4FDD\u5B58\u3057\u76F4\u3057\u307E\u3059: ${ye(d)}`)}if(c.status===409)return r.commit(i),`\u3053\u306E working record \u306F\u4FDD\u5B58\u6E08\u307F\u3067\u3057\u305F\uFF08${i.sequence} \u4EF6\u76EE\uFF09\u3002\u91CD\u8907\u3057\u3066\u4FDD\u5B58\u306F\u3057\u3066\u3044\u307E\u305B\u3093\u3002${ns(u).slice(0,300)}`;if(!c.ok)throw new vy(c.status,WU(c.status,ns(u).slice(0,300),e));let p;try{p=VU.parse(JSON.parse(u))}catch{throw new Error(`Knowledge DB \u306E\u30EC\u30B9\u30DD\u30F3\u30B9\u304C\u4E0D\u6B63\u3067\u3059: ${u.slice(0,200)}`)}return r.commit(i),[`working record \u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F: ${t.title}`,p.project?`- \u4FDD\u5B58\u5148: ${p.project.name}\uFF08project id: ${p.project.id}\uFF09`:t.without_project?"- \u4FDD\u5B58\u5148: project \u306A\u3057\uFF08\u6307\u5B9A\u3069\u304A\u308A\uFF09":"- \u4FDD\u5B58\u5148: project \u306A\u3057\uFF08config.godd \u306B knowledge.project_id \u3092\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u305D\u306E project \u306B\u4FDD\u5B58\u3055\u308C\u307E\u3059\uFF09",`- id: ${p.id}\uFF08\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306E ${p.sequence} \u4EF6\u76EE\uFF09`,`- \u4F7F\u3063\u305F GoDD \u30C4\u30FC\u30EB: ${i.tools.length>0?i.tools.map(d=>d.tool_name).join(", "):"\u306A\u3057"}`,`- \u6210\u679C\u7269: ${p.deliverables.length>0?p.deliverables.map(d=>`${d.title}\uFF08${d.type}\uFF09`).join(", "):"\u306A\u3057"}`].join(`
|
|
238
|
+
`)}var ME,BU,LE,VU,vy,UE=b(()=>{"use strict";tt();ME=require("node:path");Xt();Oa();ap();er();Kr();BU=m.object({type:m.enum(["url","text","file"]).describe("\u6210\u679C\u7269\u306E\u7A2E\u985E"),title:m.string().min(1).max(500).describe("\u6210\u679C\u7269\u306E\u540D\u524D\uFF08\u4F8B: \u898B\u7A4D\u66F8\uFF08\u5E97\u8217\u4E88\u7D04\u30B7\u30B9\u30C6\u30E0\u958B\u767A\uFF09\uFF09"),url:m.string().max(4e3).regex(/^https?:\/\//,"url \u306F http:// \u304B https:// \u3067\u59CB\u307E\u308B\u30EA\u30F3\u30AF\u306B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u300CPR #123\u300D\u306E\u3088\u3046\u306A\u5024\u306F text \u306B\u3059\u308B\uFF09").optional().describe("type=url \u306E\u3068\u304D\u306E\u30EA\u30F3\u30AF\uFF08http(s) \u306E\u307F\uFF09"),body:m.string().optional().describe("type=text \u306E\u3068\u304D\u306E\u672C\u6587\uFF08Markdown\uFF09"),path:m.string().min(1).max(4e3).optional().describe("type=file \u306E\u3068\u304D\u306E\u30ED\u30FC\u30AB\u30EB\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u3002\u7D76\u5BFE\u30D1\u30B9\u3001\u307E\u305F\u306F project_root \u304B\u3089\u306E\u76F8\u5BFE\u30D1\u30B9")}).superRefine((e,t)=>{e.type==="url"&&!e.url&&t.addIssue({code:"custom",message:"type=url \u306B\u306F url \u304C\u5FC5\u8981\u3067\u3059"}),e.type==="text"&&!e.body?.trim()&&t.addIssue({code:"custom",message:"type=text \u306B\u306F body \u304C\u5FC5\u8981\u3067\u3059"}),e.type==="file"&&!e.path&&t.addIssue({code:"custom",message:"type=file \u306B\u306F path \u304C\u5FC5\u8981\u3067\u3059"})}),LE=m.object({title:m.string().min(1,"title \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").max(500).describe("\u3053\u306E\u8A18\u9332\u306E 1 \u884C\u306E\u8981\u7D04\uFF08\u4F8B: \u30B5\u30F3\u30D7\u30EB\u793E \u5E97\u8217\u4E88\u7D04\u30B7\u30B9\u30C6\u30E0\u306E\u898B\u7A4D\uFF09"),process:m.string().min(1,"process \u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093").describe("\u4F5C\u696D\u306E\u533A\u5207\u308A\u306E\u624B\u9806\u306E\u5F62\u5F0F\u3067\u66F8\u3044\u305F\u7D4C\u7DEF\uFF08Markdown\uFF09"),deliverables:m.array(BU).max(50).default([]).describe("\u6210\u679C\u7269\u306E\u4E00\u89A7\u3002\u7121\u3051\u308C\u3070\u7A7A\u306E\u914D\u5217"),project_id:m.string().uuid("project_id \u306F godd-knowledge-projects \u304C\u8FD4\u3059 UUID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044").optional().describe("\u4FDD\u5B58\u5148 project \u306E id\u3002\u7701\u7565\u6642\u306F config.godd \u306E knowledge.project_id\u3001\u305D\u308C\u3082\u7121\u3051\u308C\u3070 project \u306A\u3057"),without_project:m.boolean().optional().describe("true \u3067 config.godd \u306E\u8A2D\u5B9A\u306B\u304B\u304B\u308F\u3089\u305A project \u306A\u3057\u3067\u4FDD\u5B58\u3059\u308B\uFF08\u91D1\u984D\u3092\u6271\u3046\u4F5C\u696D\u3067\u793E\u5916\u79D8 project \u304C\u7121\u3044\u3068\u304D\uFF09\u3002project_id \u3068\u306F\u4F75\u7528\u3057\u306A\u3044"),project_root:m.string().max(1e3).optional().describe("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30EB\u30FC\u30C8\u30D1\u30B9\uFF08config.godd \u3068\u76F8\u5BFE\u30D1\u30B9\u306E\u89E3\u6C7A\u57FA\u6E96\u3002\u81EA\u52D5\u691C\u51FA\u7528\uFF09")}),VU=m.object({id:m.string(),saved:m.boolean(),sequence:m.number(),project:m.object({id:m.string(),name:m.string()}).nullable(),deliverables:m.array(m.object({type:m.string(),title:m.string()}))}),vy=class extends Error{constructor(r,n){super(n);this.status=r;this.name="WorkingRecordSaveError"}}});var qE,FE=b(()=>{"use strict";Q2();op();lE();fE();ap();vE();hy();SE();EE();AE();jE();UE();qE={setup:(e,t)=>Y2(e,J2.parse(t)),"docs-init":(e,t)=>rE(e,eE.parse(t)),docs:(e,t)=>uE(e,aE.parse(t)),"notes-init":(e,t)=>dE(e,pE.parse(t)),"knowledge-save":(e,t)=>gE(e,mE.parse(t)),feedback:(e,t)=>_E(e,yE.parse(t)),"knowledge-search":(e,t)=>bE(e,wE.parse(t)),"knowledge-attachment":(e,t)=>kE(e,xE.parse(t)),"knowledge-search-general":(e,t)=>PE(e,$E.parse(t)),"knowledge-projects":(e,t)=>TE(e,CE.parse(t)),memory:(e,t)=>NE(e,OE.parse(t)),"working-record-save":(e,t)=>ZE(e,LE.parse(t))}});var La,GE=b(()=>{"use strict";La={network:{message:"Registry \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093",action:"\u901A\u4FE1\u3001\u63A5\u7D9A\u5148 URL\u3001DNS \u3068 HTTPS \u306E\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},unavailable:{message:"Registry \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7A3C\u50CD\u72B6\u6CC1\u3068\u914D\u4FE1\u6A5F\u80FD\u306E\u53CD\u6620\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3001\u5FA9\u65E7\u5F8C\u306B\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},timeout:{message:"Registry \u306E\u5FDC\u7B54\u5F85\u3061\u3001\u5229\u7528\u5236\u9650\u3001\u307E\u305F\u306F\u6642\u9593\u5207\u308C\u3067\u3059",action:"\u901A\u4FE1\u3068\u7A3C\u50CD\u72B6\u6CC1\u3092\u78BA\u8A8D\u3057\u3001\u6642\u9593\u3092\u304A\u3044\u3066\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},auth:{message:"\u8A8D\u8A3C\u307E\u305F\u306F\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",action:"godd login \u307E\u305F\u306F godd-config \u3067\u8A8D\u8A3C\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3001\u505C\u6B62\u3084\u6A29\u9650\u306F\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},missing:{message:"\u5229\u7528\u53EF\u80FD\u306A\u30C4\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",action:"\u6700\u65B0\u306E\u30C4\u30FC\u30EB\u4E00\u89A7\u3068\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},data:{message:"\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093",action:"\u7BA1\u7406\u8005\u306B\u30C7\u30FC\u30BF\u306E\u767B\u9332\u72B6\u614B\u3068\u672C\u4F53\u3068\u306E\u5BFE\u5FDC\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u53E4\u3044\u5185\u5BB9\u3067\u306F\u7D9A\u3051\u307E\u305B\u3093\u3002"},input:{message:"\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F",action:"\u6700\u65B0\u306E\u30AC\u30A4\u30C9\u3068\u5F15\u6570\u306E\u9805\u76EE\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},execution_unknown:{message:"\u5B9F\u884C\u306E\u7D50\u679C\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093",action:"\u51E6\u7406\u304C\u5B8C\u4E86\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u518D\u9001\u3059\u308B\u524D\u306B\u4FDD\u5B58\u5148\u3084\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3001\u4E0D\u660E\u306A\u3089\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}});function mt(e){let t=La[e];return new me(e,`${t.message}\u3002${t.action}`)}function by(e,t,r){if(typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="object"&&t.detail!==null&&"code"in t.detail&&t.detail.code==="delivery_data_invalid")return mt("data");if(e===426)return new me("compatibility",`\u672C\u4F53 ${r.client_version??Nr()} \u306E\u7248\u30FB\u7CFB\u5217\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u540C\u3058\u7CFB\u5217\u306E\u672C\u4F53\u3078\u66F4\u65B0\u3057\u3066MCP\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);if(e===401||e===403){let o=typeof t=="object"&&t!==null&&"detail"in t&&typeof t.detail=="string"?t.detail:"",i=nt(e,o,r.auth_source);return i?new me("auth",i.includes("\u518D\u8D77\u52D5")?i:i+`
|
|
238
239
|
\u30ED\u30B0\u30A4\u30F3\u3057\u76F4\u3057\u305F\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002`):mt("auth")}return e===404?mt("missing"):e===429||e===408||e===504?mt("timeout"):e>=500?mt("unavailable"):mt("input")}function up(e,t){if(e instanceof me)return e;if(e instanceof Error&&["TimeoutError","AbortError"].includes(e.name))return mt("timeout");if(e instanceof TypeError&&/fetch|network/i.test(e.message))return mt("network");if(e&&typeof e=="object"&&"status"in e&&typeof e.status=="number"){let r=e instanceof Error&&["KnowledgeSaveError","KnowledgeSearchError","KnowledgeAttachmentError"].includes(e.name);if(!r){let n=nt(e.status,e instanceof Error?e.message:"",t.auth_source);if(n)return new me("auth",n)}if(e instanceof Error){let n=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message,o=!r&&e.status===401?`
|
|
239
240
|
${La.auth.action}`:!r&&e.status===403?`
|
|
240
|
-
\u5229\u7528\u5BFE\u8C61\u306E\u6A29\u9650\u3084\u767B\u9332\u4E0A\u9650\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:"";return new me(e.status===401||e.status===403?"auth":"tool",n.slice(0,1500-o.length)+o)}return by(e.status,{},t)}if(e instanceof m.ZodError){let r=[...new Set(e.issues.map(n=>n.path.join(".")||"\u5165\u529B"))].slice(0,5);return new me("input",`${La.input.message}\u3002\u78BA\u8A8D\u3059\u308B\u9805\u76EE: ${r.join("\u3001")}\u3002${La.input.action}`)}if(e instanceof Error){let r=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message;return new me("tool",r.slice(0,1500))}return mt("input")}async function os(e,t,r,n){let o,i,s=n!==void 0&&t.includes("/execute"),a=e.client_version??Nr(),c=a==="0.0.0"?void 0:
|
|
241
|
+
\u5229\u7528\u5BFE\u8C61\u306E\u6A29\u9650\u3084\u767B\u9332\u4E0A\u9650\u3092\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:"";return new me(e.status===401||e.status===403?"auth":"tool",n.slice(0,1500-o.length)+o)}return by(e.status,{},t)}if(e instanceof m.ZodError){let r=[...new Set(e.issues.map(n=>n.path.join(".")||"\u5165\u529B"))].slice(0,5);return new me("input",`${La.input.message}\u3002\u78BA\u8A8D\u3059\u308B\u9805\u76EE: ${r.join("\u3001")}\u3002${La.input.action}`)}if(e instanceof Error){let r=t.license_key.length>8?e.message.replaceAll(t.license_key,"[\u8A8D\u8A3C\u60C5\u5831]"):e.message;return new me("tool",r.slice(0,1500))}return mt("input")}async function os(e,t,r,n){let o,i,s=n!==void 0&&t.includes("/execute"),a=e.client_version??Nr(),c=a==="0.0.0"?void 0:nr(a);try{o=await fetch(`${e.registry_url.replace(/\/+$/,"")}/v1/tools${t}`,{method:n===void 0?"GET":"POST",headers:{Authorization:`Bearer ${e.license_key}`,"Content-Type":"application/json","Cache-Control":"no-store",...c?{"X-GoDD-Version":c.version,"X-GoDD-Channel":c.channel}:{}},...n===void 0?{}:{body:JSON.stringify(n)},signal:AbortSignal.timeout(s?9e4:15e3)});let p=await o.text();try{i=JSON.parse(p)}catch{i=null}}catch(p){throw s?mt("execution_unknown"):p instanceof Error&&["TimeoutError","AbortError"].includes(p.name)?mt("timeout"):mt("network")}if(!o.ok){if(t.includes("/prepare?")&&(o.status===400||o.status===422))throw new me("configuration","\u69CB\u6210\u3084\u8A00\u8A9E\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002config.godd \u306E components \u3068\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092 godd-config \u3067\u78BA\u8A8D\u3057\u3001\u66F4\u65B0\u5F8C\u306F MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let p=by(o.status,i,e);throw s&&o.status>=500&&p.kind!=="data"?mt("execution_unknown"):o.status===404&&t===""?mt("unavailable"):p}let u=r.safeParse(i);if(!u.success)throw mt(s?"execution_unknown":"data");return u.data}async function HE(e,t){let r=e.client_version??Nr(),n=r==="0.0.0"?void 0:nr(r),o,i;try{o=await fetch(`${e.registry_url.replace(/\/+$/,"")}/v1/tools/${encodeURIComponent(t)}/archive`,{headers:{Authorization:`Bearer ${e.license_key}`,"Cache-Control":"no-store",...n?{"X-GoDD-Version":n.version,"X-GoDD-Channel":n.channel}:{}},signal:AbortSignal.timeout(6e4)}),i=Buffer.from(await o.arrayBuffer())}catch(s){throw s instanceof Error&&["TimeoutError","AbortError"].includes(s.name)?mt("timeout"):mt("network")}if(!o.ok){let s=null;try{s=JSON.parse(i.toString("utf8"))}catch{s=null}throw by(o.status,s,e)}return{data:i,sha256:o.headers.get("X-GoDD-Archive-Sha256")??"",version:o.headers.get("X-GoDD-Archive-Version")??""}}function xy(e){return new URLSearchParams({components:e.components.join(","),language:e.language}).toString()}var cp,BE,VE,JU,wy,me,lp=b(()=>{"use strict";tt();Kr();GE();ri();cp=m.object({name:m.string(),description:m.string().max(300),inputSchema:m.object({type:m.literal("object")}).passthrough(),version:m.number().int().positive(),guide_uri:m.string(),compatibility:m.object({min_version:m.string().nullable(),max_version:m.string().nullable(),channels:m.array(m.string()).nullable()}).optional()}),BE=m.object({tools:m.array(cp),revision:m.string().optional()}),VE=m.object({name:m.string(),version:m.number(),related_tools:m.array(m.string()),guide:m.object({purpose:m.string(),prerequisites:m.array(m.string()),steps:m.array(m.string()),success:m.string(),failures:m.array(m.object({message:m.string(),action:m.string()}))})}),JU=m.object({prompts:m.record(m.string()),agents:m.record(m.string()),partials:m.record(m.string()),mindsets:m.record(m.string()),quality_gate:m.record(m.string()),tools:m.array(m.unknown()),components:m.array(m.string()),language:m.string()}),wy=m.object({definition:cp,execution:m.object({kind:m.enum(["prompt","public_client","server"]),prompts:m.array(m.string()),handler:m.string().nullable(),defaults:m.record(m.unknown()),context_env:m.record(m.enum(["GODD_CONFIG","GODD_SLACK_TOOL","GODD_SLACK_PERMALINK_TOOL"])).optional(),archive:m.string().nullable().optional()}).optional(),bundle:JU.nullable().optional(),arguments:m.record(m.unknown()).optional(),result:m.unknown().optional(),prompt_versions:m.record(m.number()).optional(),assets:m.record(m.string()).optional(),catalog_revision:m.string().optional()}),me=class extends Error{constructor(r,n){super(n);this.kind=r}}});function ky(e,t,r){let n=WE.default.create();n.registerHelper("eq",(s,a)=>s===a);for(let[s,a]of Object.entries(t.bundle?.partials??{}))n.registerPartial(s,a);let o={name:`registry:${e.components.join("+")}`,stacks:e.components.map(s=>({id:s,name:s,label:s})),quality_gate:{frontend:t.bundle?.quality_gate.frontend,backend:t.bundle?.quality_gate.backend,preflight_command:t.bundle?.quality_gate.preflight??"pnpm preflight",summary:"format/lint/typecheck/build"}},i=t.execution?.prompts.includes(Xl)??!1;return{config:e,profile:o,session:r,endsWithFinish:i,renderPrompt:(s,a)=>{let c=t.bundle?.prompts[s];if(c===void 0)throw new me("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let u={profile_name:o.name,stacks:o.stacks,quality_gate:o.quality_gate,tools:t.bundle?.tools??[],...t.execution?.defaults,...t.arguments,...a};for(let[p,l]of Object.entries(t.execution?.context_env??{}))u[p]=process.env[l];try{let p={};for(let[l,d]of Object.entries(t.bundle?.mindsets??{}))p[l]=n.compile(d)(u);return u.mindsets=p,n.compile(c)(u)}catch{throw new me("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}}}}function KE(e,t){let r=ky(e,t),n=t.arguments??{},o=Nt(r,typeof n.project_root=="string"?n.project_root:void 0),i={...n,project:o,language:e.language},s=t.execution?.prompts.map(u=>r.renderPrompt(u,i)).join(`
|
|
241
242
|
|
|
242
243
|
`)??"",a=e.language==="en"?"":`> **Output Language**: Respond entirely in ${e.language}.
|
|
243
244
|
|
|
@@ -255,17 +256,17 @@ ${JSON.stringify(n,null,2)}${c?`
|
|
|
255
256
|
|
|
256
257
|
## \u540C\u68B1\u30D5\u30A1\u30A4\u30EB
|
|
257
258
|
|
|
258
|
-
${c}`:""}`}var WE,JE=b(()=>{"use strict";WE=yt(Ql(),1);
|
|
259
|
-
`),(0,Ne.existsSync)(n)&&(0,Ne.rmdirSync)(n),(0,Ne.renameSync)(a,n)}catch(c){if((0,Ne.rmSync)(a,{recursive:!0,force:!0}),(0,Ne.existsSync)((0,Je.join)(n,pp)))return YE(n);throw c instanceof me?c:new me("input","\u96DB\u5F62\u3092\u66F8\u304D\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u7F6E\u304D\u5148\u306E\u7A7A\u304D\u5BB9\u91CF\u3068\u66F8\u304D\u8FBC\u307F\u6A29\u9650\u3092\u78BA\u304B\u3081\u3066\u3001\u547C\u3073\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return`\u96DB\u5F62\u3092\u7F6E\u304D\u307E\u3057\u305F\uFF08${n}\u3001${s.size} \u30D5\u30A1\u30A4\u30EB\u3001\u7248 ${o.version}\uFF09\u3002`}var QE,Ne,Je,XE,
|
|
260
|
-
\u53E4\u3044\u914D\u4FE1\u5185\u5BB9\u3067\u306F\u51E6\u7406\u3092\u7D9A\u3051\u307E\u305B\u3093\u3002`}function oC(e,t,r){e={...e,client_version:t};let n=t==="0.0.0"?void 0:
|
|
259
|
+
${c}`:""}`}var WE,JE=b(()=>{"use strict";WE=yt(Ql(),1);Xt();lp();ny()});function no(){return new me("data","\u914D\u4FE1\u3055\u308C\u305F\u96DB\u5F62\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u96DB\u5F62\u306E\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}function nq(e){return!e||e.length>400||e.startsWith("/")?!1:e.split("/").every(t=>t!=="."&&t!==".."&&tq.test(t))}function oq(e){let t=new Set;for(let r of e){let n=r.toLowerCase();if(t.has(n)||n===pp)return!1;t.add(n)}for(let r of t){let n=r.split("/");for(let o=1;o<n.length;o++)if(t.has(n.slice(0,o).join("/")))return!1}return!0}function iq(e){if(e.length>QU)throw no();let t;try{t=JSON.parse((0,XE.gunzipSync)(e,{maxOutputLength:XU}).toString("utf8"))}catch{throw no()}if(!t||typeof t!="object"||t.format!==YU)throw no();let r=t.files;if(!r||typeof r!="object"||Array.isArray(r))throw no();let n=Object.entries(r);if(n.length===0||n.length>eq||!oq(n.map(([i])=>i)))throw no();let o=new Map;for(let[i,s]of n){if(!nq(i)||typeof s!="string"||!rq.test(s))throw no();o.set(i,Buffer.from(s,"base64"))}return o}function sq(e,t){let r=(0,Je.relative)(e,t);return r!==""&&r!==".."&&!r.startsWith(`..${Je.sep}`)&&!(0,Je.isAbsolute)(r)}function YE(e){return`\u96DB\u5F62\u306F\u65E2\u306B\u7F6E\u304B\u308C\u3066\u3044\u307E\u3059\uFF08${e}\uFF09\u3002\u4E0A\u66F8\u304D\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u7D9A\u304D\u306F\u305D\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u9032\u3081\u3066\u304F\u3060\u3055\u3044\u3002`}async function eC(e,t,r){let n;try{n=K2(r)}catch{throw new me("input","\u96DB\u5F62\u306E\u7F6E\u304D\u5148\u306F\u3001\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF08GoDD \u3092\u8A2D\u5B9A\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF09\u306E\u4E2D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}if((0,Ne.existsSync)((0,Je.join)(n,pp)))return YE(n);if((0,Ne.existsSync)(n)&&(!(0,Ne.statSync)(n).isDirectory()||(0,Ne.readdirSync)(n).length>0))throw new me("input",`\u7F6E\u304D\u5148\uFF08${n}\uFF09\u306F\u7A7A\u3067\u306A\u3044\u304B\u3001\u30D5\u30A1\u30A4\u30EB\u3067\u3059\u3002\u5B58\u5728\u3057\u306A\u3044\u304B\u7A7A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let o=await HE(e,t),i=(0,QE.createHash)("sha256").update(o.data).digest("hex");if(!o.sha256||i!==o.sha256)throw new me("data","\u96DB\u5F62\u306E\u7167\u5408\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u6642\u9593\u3092\u304A\u3044\u3066\u547C\u3073\u76F4\u3057\u3001\u7D9A\u304F\u5834\u5408\u306F\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let s=iq(o.data);(0,Ne.mkdirSync)((0,Je.dirname)(n),{recursive:!0});let a=(0,Ne.mkdtempSync)((0,Je.join)((0,Je.dirname)(n),`.${(0,Je.basename)(n)}.godd-archive-`));try{for(let[c,u]of s){let p=(0,Je.resolve)(a,...c.split("/"));if(!sq(a,p))throw no();(0,Ne.mkdirSync)((0,Je.dirname)(p),{recursive:!0}),(0,Ne.writeFileSync)(p,u,{flag:"wx"})}(0,Ne.mkdirSync)((0,Je.join)(a,".godd"),{recursive:!0}),(0,Ne.writeFileSync)((0,Je.join)(a,pp),`${JSON.stringify({name:t,version:o.version,sha256:i},null,2)}
|
|
260
|
+
`),(0,Ne.existsSync)(n)&&(0,Ne.rmdirSync)(n),(0,Ne.renameSync)(a,n)}catch(c){if((0,Ne.rmSync)(a,{recursive:!0,force:!0}),(0,Ne.existsSync)((0,Je.join)(n,pp)))return YE(n);throw c instanceof me?c:new me("input","\u96DB\u5F62\u3092\u66F8\u304D\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u7F6E\u304D\u5148\u306E\u7A7A\u304D\u5BB9\u91CF\u3068\u66F8\u304D\u8FBC\u307F\u6A29\u9650\u3092\u78BA\u304B\u3081\u3066\u3001\u547C\u3073\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return`\u96DB\u5F62\u3092\u7F6E\u304D\u307E\u3057\u305F\uFF08${n}\u3001${s.size} \u30D5\u30A1\u30A4\u30EB\u3001\u7248 ${o.version}\uFF09\u3002`}var QE,Ne,Je,XE,YU,QU,XU,eq,tq,rq,pp,tC=b(()=>{"use strict";QE=require("node:crypto"),Ne=require("node:fs"),Je=require("node:path"),XE=require("node:zlib");Xt();lp();YU="godd-archive/1",QU=5*1024*1024,XU=20*1024*1024,eq=2e3,tq=/^[^\u0000-\u001f\u007f/\\:]+$/,rq=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,pp=".godd/archive.json"});var rC,aq,cq,uq,dp,nC=b(()=>{"use strict";rC=require("node:crypto"),aq=new Set(["godd-config","godd-working-record-save","godd-knowledge-projects"]),cq=new Set(["godd-knowledge-save"]),uq=["step","phase","mode"],dp=class{sessionId;saved=0;calls=[];finishing=!1;constructor(t=(0,rC.randomUUID)()){this.sessionId=t}record(t,r,n={},o=new Date){if(t==="godd-working-record-save"&&(this.finishing=!0),aq.has(t)||this.finishing&&cq.has(t))return;this.finishing=!1;let i=uq.map(s=>r[s]).filter(s=>typeof s=="string"&&s.length>0);this.calls.push({toolName:t,steps:i,...n,at:o})}recordFailure(t){t==="godd-working-record-save"&&(this.finishing=!0)}snapshot(){let t=new Map;for(let r of this.calls){let n=t.get(r.toolName)??{tool_name:r.toolName,steps:[],call_count:0};n.call_count+=1;for(let o of r.steps)n.steps.includes(o)||n.steps.push(o);r.definitionVersion!==void 0&&(n.definition_version=r.definitionVersion),r.promptVersions!==void 0&&(n.prompt_versions=r.promptVersions),t.set(r.toolName,n)}return{sessionId:this.sessionId,sequence:this.saved+1,startedAt:this.calls[0]?.at.toISOString(),tools:[...t.values()],covered:this.calls.length}}commit(t){t.sequence===this.saved+1&&(this.calls=this.calls.slice(t.covered),this.saved=t.sequence)}}});function pq(e){return!lq.has(e.kind)||e.message.includes("\u53E4\u3044\u5185\u5BB9\u3067\u306F\u7D9A\u3051\u307E\u305B\u3093")?e.message:`${e.message}
|
|
261
|
+
\u53E4\u3044\u914D\u4FE1\u5185\u5BB9\u3067\u306F\u51E6\u7406\u3092\u7D9A\u3051\u307E\u305B\u3093\u3002`}function oC(e,t,r){e={...e,client_version:t};let n=t==="0.0.0"?void 0:nr(t),o=r?.checkForUpdate??lc({version:t}),i="",s="",a;function c(){a??=o().then(k=>{i=k}).catch(()=>{i=""}).finally(()=>{a=void 0})}c();let u=new fl({name:"godd-mcp-server",version:t},{capabilities:{tools:{listChanged:!0},resources:{},prompts:{}}}),p={name:sg,description:ag,inputSchema:Dk(cg,{target:"jsonSchema7"})},l,d=!1,f=r?.session??new dp;function h(k,P,q){return{client:n??{version:t,channel:"unknown"},...k?{catalog_revision:k}:{},...P!==void 0?{definition_version:P}:{},...q?{prompt_versions:q}:{}}}async function g(){d||(d=!0,await u.notification({method:"notifications/tools/list_changed"}).catch(()=>{}))}async function y(k,P=!0){if(!k)return;let q=l!==void 0&&l!==k;l=k,q&&P&&await g()}async function v(k=!0){let P=await os(e,"",BE);return await y(P.revision,k),P}async function w(){try{await Z1(e.registry_url,e.license_key)}catch(k){throw up(k,e)}}async function x(k,P){if(k===sg)return{text:await I1(cg.parse(P))};if(e.components.length===0)throw new me("configuration","\u6280\u8853\u69CB\u6210\uFF08components\uFF09\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd init \u307E\u305F\u306F godd-config \u306E update \u3067\u69CB\u6210\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");if(!/^[a-z]{2}(-[A-Z]{2})?$/.test(e.language))throw new me("configuration","\u8A00\u8A9E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002godd-config \u3067 en\u3001ja \u306A\u3069\u306E\u8A00\u8A9E\u30B3\u30FC\u30C9\u3092\u8A2D\u5B9A\u3057\u3001MCP \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\u3002");await w();let q=`/${encodeURIComponent(k)}`,L=await os(e,`${q}/prepare?${xy(e)}`,wy);await y(L.catalog_revision);let Ue={...L.execution?.defaults,...P};try{let qe=new Bi().getValidator(L.definition.inputSchema)(Ue);if(!qe.valid)throw new me("input",`\u5165\u529B\u304C\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002${qe.errorMessage??"\u5F15\u6570\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}`)}catch(Q){throw Q instanceof me?Q:new me("data","\u914D\u4FE1\u3055\u308C\u305F\u5F15\u6570\u5B9A\u7FA9\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}if(L.execution?.kind==="server"){let Q=await os(e,`${q}/execute?${xy(e)}`,wy,Ue);if(Q.result===void 0)throw new me("execution_unknown","\u5B9F\u884C\u7D50\u679C\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002\u518D\u9001\u306E\u524D\u306B\u51E6\u7406\u7D50\u679C\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return{text:typeof Q.result=="string"?Q.result:JSON.stringify(Q.result),definitionVersion:Q.definition.version,revision:Q.catalog_revision}}let we={...L,arguments:Ue};if(L.execution?.kind==="prompt"){let Q=Ue.archive_target;return{text:(L.execution.archive&&typeof Q=="string"&&Q.trim()?`${await eC(e,k,Q)}
|
|
261
262
|
|
|
262
263
|
`:"")+KE(e,we),definitionVersion:L.definition.version,revision:L.catalog_revision,promptVersions:L.prompt_versions}}if(L.execution?.kind==="public_client"){let Q=qE[L.execution.handler??""];if(Q)return{text:await Q(ky(e,we,f),Ue),definitionVersion:L.definition.version,revision:L.catalog_revision,promptVersions:L.prompt_versions}}throw new me("data","\u914D\u4FE1\u30C7\u30FC\u30BF\u3092\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u767B\u9332\u72B6\u614B\u3068\u672C\u4F53\u3068\u306E\u5BFE\u5FDC\u3092\u78BA\u8A8D\u3057\u3066\u3082\u3089\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}return u.setRequestHandler(Xd,async()=>{try{let k=await v(!1);return d=!1,{_meta:h(k.revision),tools:[p,...k.tools.map(P=>({name:P.name,description:P.description,inputSchema:P.inputSchema}))]}}catch(k){let P=up(k,e);return{tools:[{...p,description:`${ag}
|
|
263
|
-
${P.message}`}],_meta:{delivery_error:P.kind}}}}),u.setRequestHandler(Is,async({params:k})=>{try{let P=await x(k.name,k.arguments??{});f.record(k.name,k.arguments??{},{definitionVersion:P.definitionVersion,promptVersions:P.promptVersions}),c();let q=i!==s?i:"";return s=i,{_meta:h(P.revision,P.definitionVersion,P.promptVersions),content:[{type:"text",text:P.text},...q?[{type:"text",text:q}]:[]]}}catch(P){f.recordFailure(k.name);let q=up(P,e);return["missing","input","auth","compatibility"].includes(q.kind)&&await g(),{isError:!0,content:[{type:"text",text:
|
|
264
|
+
${P.message}`}],_meta:{delivery_error:P.kind}}}}),u.setRequestHandler(Is,async({params:k})=>{try{let P=await x(k.name,k.arguments??{});f.record(k.name,k.arguments??{},{definitionVersion:P.definitionVersion,promptVersions:P.promptVersions}),c();let q=i!==s?i:"";return s=i,{_meta:h(P.revision,P.definitionVersion,P.promptVersions),content:[{type:"text",text:P.text},...q?[{type:"text",text:q}]:[]]}}catch(P){f.recordFailure(k.name);let q=up(P,e);return["missing","input","auth","compatibility"].includes(q.kind)&&await g(),{isError:!0,content:[{type:"text",text:pq(q)}]}}}),u.setRequestHandler(Gd,async()=>({resources:(await v()).tools.map(k=>({uri:k.guide_uri,name:k.name,description:k.description,mimeType:"text/markdown"}))})),u.setRequestHandler(Vd,async({params:k})=>{let P=/^godd:\/\/mcp-tools\/([^/?#]+)$/.exec(k.uri);if(!P)throw new Error("Resource not found");let q=await os(e,`/${encodeURIComponent(decodeURIComponent(P[1]))}/guide`,VE),L=q.guide,Ue=[`# ${q.name}`,`\u672C\u4F53: ${t} / ${n?.channel??"unknown"}\u3001\u914D\u4FE1: ${q.version}`,L.purpose,"## \u5FC5\u8981\u306A\u3082\u306E",...L.prerequisites.map(we=>`- ${we}`),"## \u624B\u9806",...L.steps.map((we,Q)=>`${Q+1}. ${we}`),"## \u6210\u529F\u3057\u305F\u72B6\u614B",L.success,"## \u3046\u307E\u304F\u3044\u304B\u306A\u3044\u3068\u304D",...L.failures.map(we=>`### ${we.message}
|
|
264
265
|
${we.action}`),"## \u95A2\u9023\u30AC\u30A4\u30C9",...q.related_tools.map(we=>`[${we}](godd://mcp-tools/${encodeURIComponent(we)})`)].join(`
|
|
265
266
|
|
|
266
267
|
`);return{_meta:h(void 0,q.version),contents:[{uri:k.uri,text:Ue,mimeType:"text/markdown"}]}}),u.setRequestHandler(Hd,async()=>({prompts:(await v()).tools.map(k=>({name:k.name,description:k.description}))})),u.setRequestHandler(Wd,async({params:k})=>{await w();let P=await os(e,`/${encodeURIComponent(k.name)}`,cp);return{_meta:h(void 0,P.version),messages:[{role:"user",content:{type:"text",text:`${P.name} \u30C4\u30FC\u30EB\u3092\u3001\u6B21\u306E\u5165\u529B\u3092\u78BA\u8A8D\u3057\u3066\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
267
268
|
${JSON.stringify(k.arguments??{},null,2)}
|
|
268
|
-
\u8A73\u3057\u3044\u624B\u9806\u306F ${P.guide_uri} \u304B\u3089\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}}]}}),u}var
|
|
269
|
+
\u8A73\u3057\u3044\u624B\u9806\u306F ${P.guide_uri} \u304B\u3089\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}}]}}),u}var lq,iC=b(()=>{"use strict";T1();Rn();dh();ig();z1();U1();FE();lp();JE();tC();ri();Np();nC();lq=new Set(["network","unavailable","timeout","auth","missing","compatibility","data"])});var aC={};rr(aC,{startServer:()=>sC});function dq(){try{return __goddBundleUrl}catch{return}}async function sC(){let e=Zx();await oC(e,Nr()).connect(new hi)}var cC=b(()=>{"use strict";sf();Ln();Tf();iC();ri();mu(process.env,process.argv[1],dq())&&sC().catch(e=>{let t=e instanceof Error?e.message.replace(/((?:GODD_LICENSE_KEY|license_key)\s*[:=]\s*)[^\s,]+/gi,"$1[\u8A8D\u8A3C\u60C5\u5831]").replace(/goddt-[A-Za-z0-9_-]+|godd-[0-9a-f-]{36}/gi,"[\u8A8D\u8A3C\u60C5\u5831]").split(`
|
|
269
270
|
`).slice(0,4).join(`
|
|
270
271
|
`).slice(0,1500):"\u63A5\u7D9A\u8A2D\u5B9A\u3068\u30ED\u30B0\u30A4\u30F3\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";console.error(`GoDD \u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3002${t}`),process.exitCode=1})});function fp(e,t){let r=(0,uC.join)(e,".gitignore"),n=t.map(c=>c.trim()).filter(Boolean);if(n.length===0)return!1;let o=(0,is.existsSync)(r)?(0,is.readFileSync)(r,"utf-8"):"",i=new Set(o.split(/\r?\n/).map(c=>c.trim()).filter(Boolean)),s=n.filter(c=>!i.has(c));if(s.length===0)return!1;let a=o.length===0||o.endsWith(`
|
|
271
272
|
`)||o.endsWith(`\r
|
|
@@ -273,22 +274,22 @@ ${JSON.stringify(k.arguments??{},null,2)}
|
|
|
273
274
|
`;return(0,is.writeFileSync)(r,`${a}${s.join(`
|
|
274
275
|
`)}
|
|
275
276
|
`,"utf-8"),!0}var is,uC,Sy=b(()=>{"use strict";is=require("node:fs"),uC=require("node:path")});function mp(e){if(!(0,hp.existsSync)(e))return{};try{let t=(0,hp.readFileSync)(e,"utf-8"),r={};for(let n of t.split(`
|
|
276
|
-
`)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim(),a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),r[s]=a}return r}catch{return{}}}var hp,$y=b(()=>{"use strict";hp=require("node:fs")});function Py(e=process.env){let t=e.GODD_GOOGLE_MCP_URL?.trim();if(!t)return gp;try{let r=new URL(t),n=["localhost","127.0.0.1","[::1]"].includes(r.hostname);return r.protocol==="https:"||r.protocol==="http:"&&n?t:null}catch{return null}}function Ey(e=process.env){let t=e.GODD_GOOGLE_MCP?.trim().toLowerCase();if(t&&dq.has(t))return{enabled:!1,reason:"disabled"};let r=Py(e);return r?{enabled:!0,url:r}:{enabled:!1,reason:"invalid-url"}}var gp,dq,Cy=b(()=>{"use strict";gp="https://google-mcp.ripla.co.jp/mcp",dq=new Set(["off","0","false","no"])});function Ry(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function mq(){let e=Ry((0,Ua.randomBytes)(32));return{verifier:e,challenge:gq(e)}}function gq(e){return Ry((0,Ua.createHash)("sha256").update(e).digest())}function yq(){return Ry((0,Ua.randomBytes)(16))}function Xr(e){let t=ot(e),r;try{r=new URL(t)}catch{throw new Ye(`Registry \u306E URL \u304C\u4E0D\u6B63\u3067\u3059: ${t}`)}if(r.protocol==="https:"||r.protocol==="http:"&&_q.has(r.hostname))return t;throw new Ye(`Registry \u306E URL \u306F https:// \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08http:// \u306F 127.0.0.1 / localhost / [::1] \u306E\u307F\uFF09: ${t}`)}function vq(e,t){let r=new URL(`${Xr(e)}/v1/auth/google/start`);return r.searchParams.set("redirect_uri",t.redirectUri),r.searchParams.set("code_challenge",t.codeChallenge),r.searchParams.set("code_challenge_method","S256"),r.searchParams.set("state",t.state),r.searchParams.set("device_name",t.deviceName),t.drive&&r.searchParams.set("drive","true"),r.toString()}function bq(e,t){if(e.get("state")!==t)return{kind:"state_mismatch"};let r=e.get("error");if(r){let o=e.get("error_description")?.trim()||wq[r]||"";return{kind:"error",error:new Ye(`Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${r}\uFF09${o?`: ${o}`:""}`)}}let n=e.get("code");return n?{kind:"code",code:n}:{kind:"error",error:new Ye("\u30ED\u30B0\u30A4\u30F3\u5FDC\u7B54\u306B\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}function Iy(e){return`<!doctype html><html lang="ja"><meta charset="utf-8"><title>GoDD</title><body><p>${e}</p></body></html>`}function Za(e,t,r){e.writeHead(t,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),e.end(r)}async function Sq(e,t,r=Ay){let n=null,o=new Promise((l,d)=>{n={resolve:l,reject:d}});o.catch(()=>{});let i=!1,s=!1,a=l=>{i||(i=!0,l())},c,u=(0,dC.createServer)((l,d)=>{let f=new URL(l.url??"/","http://127.0.0.1");if(f.pathname!==lC){d.writeHead(404).end();return}if(l.method!=="GET"){d.writeHead(405,{Allow:"GET"}).end();return}if(i||s){Za(d,409,Ty);return}let h=bq(f.searchParams,e);if(h.kind==="state_mismatch"){Za(d,400,kq);return}if(h.kind==="error"){Za(d,400,Ty),a(()=>n?.reject(h.error));return}s=!0,clearTimeout(c),t(h.code).then(g=>{Za(d,200,xq),a(()=>n?.resolve(g))},g=>{Za(d,502,Ty),a(()=>n?.reject(g instanceof Error?g:new Error(String(g))))})});await new Promise((l,d)=>{u.once("error",d),u.listen(0,"127.0.0.1",()=>l())}),c=setTimeout(()=>{a(()=>n?.reject(new Ye(`${Math.round(r/6e4)} \u5206\u4EE5\u5185\u306B\u30ED\u30B0\u30A4\u30F3\u304C\u5B8C\u4E86\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)))},r),c.unref?.();let{port:p}=u.address();return{redirectUri:`http://127.0.0.1:${p}${lC}`,result:o,close(){clearTimeout(c),a(()=>n?.reject(new Ye("\u30ED\u30B0\u30A4\u30F3\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002"))),u.closeAllConnections?.(),u.close()}}}function fC(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:r&&typeof r=="object"&&"message"in r?String(r.message):JSON.stringify(r)}}catch{}return e.slice(0,300)}async function Pq(e,t,r,n=fetch){let o=Xr(e),i,s;try{i=await n(`${o}/v1/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,code_verifier:r}),signal:AbortSignal.timeout(fq)}),s=await i.text()}catch(u){throw new Ye(`Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\uFF08${e}\uFF09: ${u instanceof Error?u.message:String(u)}`)}if(!i.ok)throw i.status===503?new Ye("\u3053\u306E Registry \u3067\u306F Google \u30ED\u30B0\u30A4\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3059\u308B\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002"):new Ye(`\u30ED\u30B0\u30A4\u30F3\u30B3\u30FC\u30C9\u306E\u4EA4\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${i.status}\uFF09: ${fC(s)}\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a;try{a=JSON.parse(s)}catch{throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=$q.safeParse(a);if(!c.success)throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u3068\u7570\u306A\u308A\u307E\u3059: ${c.error.message}`);return c.data}async function zy(e,t,r=fetch){let n=await r(`${Xr(e)}/v1/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`${n.status} ${fC(o)}`.trim())}}function Eq(e){let t="";try{t=new URL(e).protocol}catch{}if(t!=="https:"&&t!=="http:")return Promise.resolve(!1);let[r,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(o=>{try{let i=(0,pC.spawn)(r,n,{stdio:"ignore",detached:!0});i.once("error",()=>o(!1)),i.once("spawn",()=>{i.unref(),o(!0)})}catch{o(!1)}})}function Dy(e){return((e??"").trim()||"unknown device").slice(0,hq)}async function hC(e,t={}){let r=t.log??(c=>console.log(c)),n=t.openBrowser??Eq,o=Xr(e.registryUrl),i=mq(),s=yq(),a=await Sq(s,c=>Pq(o,c,i.verifier,t.fetch),t.timeoutMs??Ay);try{let c=vq(o,{redirectUri:a.redirectUri,codeChallenge:i.challenge,state:s,deviceName:Dy(e.deviceName),drive:e.drive});return(e.noBrowser?!1:await n(c))?(r("\u30D6\u30E9\u30A6\u30B6\u3067 Google \u30ED\u30B0\u30A4\u30F3\u306E\u753B\u9762\u3092\u958B\u304D\u307E\u3057\u305F\u3002\u30ED\u30B0\u30A4\u30F3\u3092\u5B8C\u4E86\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),r("\u30D6\u30E9\u30A6\u30B6\u304C\u958B\u304B\u306A\u3044\u5834\u5408\u306F\u3001\u6B21\u306E URL \u3092\u958B\u3044\u3066\u304F\u3060\u3055\u3044:")):r("\u6B21\u306E URL \u3092\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304D\u3001Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304F\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09:"),r(c),r(""),r(`\u5F85\u6A5F\u4E2D...\uFF08${Math.round((t.timeoutMs??Ay)/6e4)} \u5206\u3067\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3059\uFF09`),await a.result}finally{a.close()}}var pC,Ua,dC,Ay,fq,lC,hq,Ye,_q,wq,xq,Ty,kq,$q,yp=b(()=>{"use strict";pC=require("node:child_process"),Ua=require("node:crypto"),dC=require("node:http");tt();Ci();Ay=300*1e3,fq=15e3,lC="/callback",hq=200,Ye=class extends Error{constructor(t){super(t),this.name="LoginError"}};_q=new Set(["127.0.0.1","localhost","[::1]"]);wq={access_denied:"Google \u306E\u753B\u9762\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002",not_allowed:"\u3053\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306B\u7D10\u3065\u304F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",suspended:"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",expired:"\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",account_mismatch:"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u5225\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u7D10\u3065\u3044\u3066\u3044\u307E\u3059\u3002\u7D10\u3065\u3044\u305F\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002",google_error:"Google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"};xq=Iy("\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),Ty=Iy("\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306E\u8868\u793A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),kq=Iy("\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u64CD\u4F5C\u306E\u5FDC\u7B54\u3067\u306F\u306A\u3044\u305F\u3081\u7121\u8996\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u5B9F\u884C\u4E2D\u306E godd login \u306E\u753B\u9762\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002");$q=m.object({access_token:m.string().min(1),token_type:m.string().optional(),expires_at:m.string().nullable().optional().default(null),license_id:m.string().nullable().optional().default(null),email:m.string().nullable().optional().default(null),user:m.string().nullable().optional(),drive_authorized:m.boolean().optional().default(!1),drive_error:m.string().nullable().optional().default(null)})});var Ny={};tr(Ny,{formatLoginSummary:()=>xC,loginAndSave:()=>_p,parseLoginArgs:()=>_C,parseLogoutArgs:()=>vC,resolveLoginRegistryUrl:()=>qa,runLogin:()=>Cq,runLogout:()=>Tq});function _C(e){let t={drive:!1,noBrowser:!1};for(let r=0;r<e.length;r+=1){let n=e[r],[o,i]=n.includes("=")?[n.slice(0,n.indexOf("=")),n.slice(n.indexOf("=")+1)]:[n,void 0],s=()=>{if(i!==void 0)return i;let a=e[r+1];if(a===void 0||a.startsWith("--"))throw new Ye(`${o} \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002`);return r+=1,a};switch(o){case"--drive":t.drive=!0;break;case"--no-browser":t.noBrowser=!0;break;case"--device-name":t.deviceName=s();break;case"--registry-url":t.registryUrl=s();break;default:throw new Ye(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${n}
|
|
277
|
+
`)){let o=n.trim();if(!o||o.startsWith("#"))continue;let i=o.indexOf("=");if(i===-1)continue;let s=o.slice(0,i).trim(),a=o.slice(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),r[s]=a}return r}catch{return{}}}var hp,$y=b(()=>{"use strict";hp=require("node:fs")});function Py(e=process.env){let t=e.GODD_GOOGLE_MCP_URL?.trim();if(!t)return gp;try{let r=new URL(t),n=["localhost","127.0.0.1","[::1]"].includes(r.hostname);return r.protocol==="https:"||r.protocol==="http:"&&n?t:null}catch{return null}}function Ey(e=process.env){let t=e.GODD_GOOGLE_MCP?.trim().toLowerCase();if(t&&fq.has(t))return{enabled:!1,reason:"disabled"};let r=Py(e);return r?{enabled:!0,url:r}:{enabled:!1,reason:"invalid-url"}}var gp,fq,Cy=b(()=>{"use strict";gp="https://google-mcp.ripla.co.jp/mcp",fq=new Set(["off","0","false","no"])});function Ry(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function gq(){let e=Ry((0,Ua.randomBytes)(32));return{verifier:e,challenge:yq(e)}}function yq(e){return Ry((0,Ua.createHash)("sha256").update(e).digest())}function _q(){return Ry((0,Ua.randomBytes)(16))}function en(e){let t=ot(e),r;try{r=new URL(t)}catch{throw new Ye(`Registry \u306E URL \u304C\u4E0D\u6B63\u3067\u3059: ${t}`)}if(r.protocol==="https:"||r.protocol==="http:"&&vq.has(r.hostname))return t;throw new Ye(`Registry \u306E URL \u306F https:// \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08http:// \u306F 127.0.0.1 / localhost / [::1] \u306E\u307F\uFF09: ${t}`)}function wq(e,t){let r=new URL(`${en(e)}/v1/auth/google/start`);return r.searchParams.set("redirect_uri",t.redirectUri),r.searchParams.set("code_challenge",t.codeChallenge),r.searchParams.set("code_challenge_method","S256"),r.searchParams.set("state",t.state),r.searchParams.set("device_name",t.deviceName),t.drive&&r.searchParams.set("drive","true"),r.toString()}function xq(e,t){if(e.get("state")!==t)return{kind:"state_mismatch"};let r=e.get("error");if(r){let o=e.get("error_description")?.trim()||bq[r]||"";return{kind:"error",error:new Ye(`Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${r}\uFF09${o?`: ${o}`:""}`)}}let n=e.get("code");return n?{kind:"code",code:n}:{kind:"error",error:new Ye("\u30ED\u30B0\u30A4\u30F3\u5FDC\u7B54\u306B\u30B3\u30FC\u30C9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}function Iy(e){return`<!doctype html><html lang="ja"><meta charset="utf-8"><title>GoDD</title><body><p>${e}</p></body></html>`}function Za(e,t,r){e.writeHead(t,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),e.end(r)}async function $q(e,t,r=Ay){let n=null,o=new Promise((l,d)=>{n={resolve:l,reject:d}});o.catch(()=>{});let i=!1,s=!1,a=l=>{i||(i=!0,l())},c,u=(0,dC.createServer)((l,d)=>{let f=new URL(l.url??"/","http://127.0.0.1");if(f.pathname!==lC){d.writeHead(404).end();return}if(l.method!=="GET"){d.writeHead(405,{Allow:"GET"}).end();return}if(i||s){Za(d,409,Ty);return}let h=xq(f.searchParams,e);if(h.kind==="state_mismatch"){Za(d,400,Sq);return}if(h.kind==="error"){Za(d,400,Ty),a(()=>n?.reject(h.error));return}s=!0,clearTimeout(c),t(h.code).then(g=>{Za(d,200,kq),a(()=>n?.resolve(g))},g=>{Za(d,502,Ty),a(()=>n?.reject(g instanceof Error?g:new Error(String(g))))})});await new Promise((l,d)=>{u.once("error",d),u.listen(0,"127.0.0.1",()=>l())}),c=setTimeout(()=>{a(()=>n?.reject(new Ye(`${Math.round(r/6e4)} \u5206\u4EE5\u5185\u306B\u30ED\u30B0\u30A4\u30F3\u304C\u5B8C\u4E86\u3057\u306A\u304B\u3063\u305F\u305F\u3081\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)))},r),c.unref?.();let{port:p}=u.address();return{redirectUri:`http://127.0.0.1:${p}${lC}`,result:o,close(){clearTimeout(c),a(()=>n?.reject(new Ye("\u30ED\u30B0\u30A4\u30F3\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002"))),u.closeAllConnections?.(),u.close()}}}function fC(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"&&"detail"in t){let r=t.detail;return typeof r=="string"?r:r&&typeof r=="object"&&"message"in r?String(r.message):JSON.stringify(r)}}catch{}return e.slice(0,300)}async function Eq(e,t,r,n=fetch){let o=en(e),i,s;try{i=await n(`${o}/v1/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,code_verifier:r}),signal:AbortSignal.timeout(hq)}),s=await i.text()}catch(u){throw new Ye(`Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\uFF08${e}\uFF09: ${u instanceof Error?u.message:String(u)}`)}if(!i.ok)throw i.status===503?new Ye("\u3053\u306E Registry \u3067\u306F Google \u30ED\u30B0\u30A4\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3059\u308B\u304B\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002"):new Ye(`\u30ED\u30B0\u30A4\u30F3\u30B3\u30FC\u30C9\u306E\u4EA4\u63DB\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${i.status}\uFF09: ${fC(s)}\u3002godd login \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);let a;try{a=JSON.parse(s)}catch{throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u4E0D\u6B63\u306A JSON \u3067\u3059: ${s.slice(0,200)}`)}let c=Pq.safeParse(a);if(!c.success)throw new Ye(`Registry API \u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u3068\u7570\u306A\u308A\u307E\u3059: ${c.error.message}`);return c.data}async function zy(e,t,r=fetch){let n=await r(`${en(e)}/v1/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(1e4)});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`${n.status} ${fC(o)}`.trim())}}function Cq(e){let t="";try{t=new URL(e).protocol}catch{}if(t!=="https:"&&t!=="http:")return Promise.resolve(!1);let[r,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(o=>{try{let i=(0,pC.spawn)(r,n,{stdio:"ignore",detached:!0});i.once("error",()=>o(!1)),i.once("spawn",()=>{i.unref(),o(!0)})}catch{o(!1)}})}function Dy(e){return((e??"").trim()||"unknown device").slice(0,mq)}async function hC(e,t={}){let r=t.log??(c=>console.log(c)),n=t.openBrowser??Cq,o=en(e.registryUrl),i=gq(),s=_q(),a=await $q(s,c=>Eq(o,c,i.verifier,t.fetch),t.timeoutMs??Ay);try{let c=wq(o,{redirectUri:a.redirectUri,codeChallenge:i.challenge,state:s,deviceName:Dy(e.deviceName),drive:e.drive});return(e.noBrowser?!1:await n(c))?(r("\u30D6\u30E9\u30A6\u30B6\u3067 Google \u30ED\u30B0\u30A4\u30F3\u306E\u753B\u9762\u3092\u958B\u304D\u307E\u3057\u305F\u3002\u30ED\u30B0\u30A4\u30F3\u3092\u5B8C\u4E86\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),r("\u30D6\u30E9\u30A6\u30B6\u304C\u958B\u304B\u306A\u3044\u5834\u5408\u306F\u3001\u6B21\u306E URL \u3092\u958B\u3044\u3066\u304F\u3060\u3055\u3044:")):r("\u6B21\u306E URL \u3092\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304D\u3001Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u958B\u304F\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09:"),r(c),r(""),r(`\u5F85\u6A5F\u4E2D...\uFF08${Math.round((t.timeoutMs??Ay)/6e4)} \u5206\u3067\u6642\u9593\u5207\u308C\u306B\u306A\u308A\u307E\u3059\uFF09`),await a.result}finally{a.close()}}var pC,Ua,dC,Ay,hq,lC,mq,Ye,vq,bq,kq,Ty,Sq,Pq,yp=b(()=>{"use strict";pC=require("node:child_process"),Ua=require("node:crypto"),dC=require("node:http");tt();Ci();Ay=300*1e3,hq=15e3,lC="/callback",mq=200,Ye=class extends Error{constructor(t){super(t),this.name="LoginError"}};vq=new Set(["127.0.0.1","localhost","[::1]"]);bq={access_denied:"Google \u306E\u753B\u9762\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002",not_allowed:"\u3053\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306B\u7D10\u3065\u304F\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",suspended:"\u30E9\u30A4\u30BB\u30F3\u30B9\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",expired:"\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u6709\u52B9\u671F\u9650\u304C\u5207\u308C\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",account_mismatch:"\u3053\u306E\u30E9\u30A4\u30BB\u30F3\u30B9\u306B\u306F\u5225\u306E Google \u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u7D10\u3065\u3044\u3066\u3044\u307E\u3059\u3002\u7D10\u3065\u3044\u305F\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002",google_error:"Google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"};kq=Iy("\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002"),Ty=Iy("\u30ED\u30B0\u30A4\u30F3\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u306E\u8868\u793A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),Sq=Iy("\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u64CD\u4F5C\u306E\u5FDC\u7B54\u3067\u306F\u306A\u3044\u305F\u3081\u7121\u8996\u3057\u307E\u3057\u305F\u3002\u30BF\u30FC\u30DF\u30CA\u30EB\u3067\u5B9F\u884C\u4E2D\u306E godd login \u306E\u753B\u9762\u304B\u3089\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002");Pq=m.object({access_token:m.string().min(1),token_type:m.string().optional(),expires_at:m.string().nullable().optional().default(null),license_id:m.string().nullable().optional().default(null),email:m.string().nullable().optional().default(null),user:m.string().nullable().optional(),drive_authorized:m.boolean().optional().default(!1),drive_error:m.string().nullable().optional().default(null)})});var Ny={};rr(Ny,{formatLoginSummary:()=>xC,loginAndSave:()=>_p,parseLoginArgs:()=>_C,parseLogoutArgs:()=>vC,resolveLoginRegistryUrl:()=>qa,runLogin:()=>Tq,runLogout:()=>Aq});function _C(e){let t={drive:!1,noBrowser:!1};for(let r=0;r<e.length;r+=1){let n=e[r],[o,i]=n.includes("=")?[n.slice(0,n.indexOf("=")),n.slice(n.indexOf("=")+1)]:[n,void 0],s=()=>{if(i!==void 0)return i;let a=e[r+1];if(a===void 0||a.startsWith("--"))throw new Ye(`${o} \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002`);return r+=1,a};switch(o){case"--drive":t.drive=!0;break;case"--no-browser":t.noBrowser=!0;break;case"--device-name":t.deviceName=s();break;case"--registry-url":t.registryUrl=s();break;default:throw new Ye(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${n}
|
|
277
278
|
\u4F7F\u3044\u65B9: godd login [--drive] [--device-name <\u540D\u524D>] [--no-browser] [--registry-url <url>]`)}}return t}function vC(e){let t="\u4F7F\u3044\u65B9: godd logout [--registry-url <url>]",r={};for(let n=0;n<e.length;n+=1){let o=e[n];if(o==="--registry-url"||o.startsWith("--registry-url=")){let i=o.includes("=")?o.slice(o.indexOf("=")+1):e[n+1];if(i===void 0||i.startsWith("--"))throw new Ye(`--registry-url \u306B\u306F\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002
|
|
278
279
|
${t}`);o.includes("=")||(n+=1),r.registryUrl=i;continue}throw new Ye(`\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: ${o}
|
|
279
|
-
${t}`)}return r}function qa(e,t={}){let r=t.env??process.env,n=mp((0,yC.join)(t.cwd??process.cwd(),".env")).GODD_REGISTRY_URL,o=t.savedRegistries??[],i=e?.trim()||r.GODD_REGISTRY_URL?.trim()||n?.trim()||(o.length===1?o[0]:void 0)||
|
|
280
|
-
`),"utf-8"),n}function MC(e){let t=new Map;for(let n of e){let o=
|
|
280
|
+
${t}`)}return r}function qa(e,t={}){let r=t.env??process.env,n=mp((0,yC.join)(t.cwd??process.cwd(),".env")).GODD_REGISTRY_URL,o=t.savedRegistries??[],i=e?.trim()||r.GODD_REGISTRY_URL?.trim()||n?.trim()||(o.length===1?o[0]:void 0)||fn;return en(i)}function wC(e){let t=new Map;for(let r of e){let n=[];try{n=dn([r])}catch{}for(let o of n){let i=ot(o.registry_url);t.has(i)||t.set(i,o)}}return[...t.values()]}function bC(e,t){for(let r of t)try{let n=Do(e,[r]);if(n)return n}catch{}return null}function Oy(e){return e.credentialsPath?[e.credentialsPath]:kr(e.env)}async function _p(e,t={}){let r=t.log??(u=>console.log(u)),n=t.credentialsPath??Mn(t.env),o=en(e.registryUrl),i=bC(o,Oy(t)),s=Dy(e.deviceName??(t.defaultDeviceName??gC.hostname)()),a=await hC({registryUrl:o,deviceName:s,drive:e.drive,noBrowser:e.noBrowser},t),c={registry_url:o,access_token:a.access_token,expires_at:a.expires_at,email:a.email,license_id:a.license_id,device_name:s,drive_authorized:a.drive_authorized,saved_at:(t.now??(()=>new Date))().toISOString()};if(Lx(c,n),i&&i.credentials.access_token!==c.access_token){if(i.path!==n)try{Ef(o,i.path)}catch{}await zy(o,i.credentials.access_token,t.fetch).catch(()=>{r(" \uFF08\u524D\u56DE\u306E\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u671F\u9650\u304C\u6765\u308B\u304B\u7BA1\u7406\u753B\u9762\u3067\u5931\u52B9\u3055\u308C\u308B\u307E\u3067\u6709\u52B9\u3067\u3059\uFF09")})}return{credentials:c,driveError:a.drive_error}}function xC(e,t,r,n=null){let o=[`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${e.email??"\uFF08\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E\uFF09"}`,` \u30E9\u30A4\u30BB\u30F3\u30B9: ${e.license_id??"\uFF08\u4E0D\u660E\uFF09"}`,` \u7AEF\u672B\u540D: ${e.device_name}`,` \u6709\u52B9\u671F\u9650: ${e.expires_at??"\u306A\u3057\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u306E\u671F\u9650\u306B\u5F93\u3044\u307E\u3059\uFF09"}`,` Registry: ${e.registry_url}`,` \u4FDD\u5B58\u5148: ${t}`];return e.drive_authorized?o.push(" Drive: \u672C\u4EBA\u306E\u6A29\u9650\u3067\u306E\u8AAD\u307F\u53D6\u308A\u3092\u8A31\u53EF\u3057\u307E\u3057\u305F\uFF08Google \u306E\u540C\u610F\u753B\u9762\u304C\u30C6\u30B9\u30C8\u4E2D\u306E\u9593\u306F 7 \u65E5\u3067\u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u307E\u3059\u3002\u5207\u308C\u305F\u3089 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09"):n==="not_granted"?o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u304C\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u540C\u610F\u753B\u9762\u3067 Google \u30C9\u30E9\u30A4\u30D6\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5165\u308C\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"):n==="not_configured"?o.push(" \u26A0 Registry \u5074\u3067 Drive \u306E\u8A31\u53EF\u3092\u4FDD\u5B58\u3059\u308B\u8A2D\u5B9A\u304C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u3084\u308A\u76F4\u3057\u3066\u3082\u76F4\u308A\u307E\u305B\u3093\uFF09\u3002"):r&&o.push(" \u26A0 Drive \u306E\u8AAD\u307F\u53D6\u308A\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002Google \u306E\u753B\u9762\u3067 Drive \u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u8A31\u53EF\u3057\u3066 godd login --drive \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),o.push(""),o.push("\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u306A\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3001\u3053\u306E\u30ED\u30B0\u30A4\u30F3\u304C\u4F7F\u308F\u308C\u307E\u3059\u3002"),o.push("IDE / Claude Code / Codex \u306E MCP \u30B5\u30FC\u30D0\u30FC\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u518D\u8D77\u52D5\u3059\u308B\u307E\u3067\u306F\u524D\u306E\u30ED\u30B0\u30A4\u30F3\u306E\u307E\u307E\u3067\u3059\uFF09\u3002"),o}async function Tq(e,t={}){let r=t.log??(o=>console.log(o)),n=t.credentialsPath??Mn(t.env);try{let o=_C(e),i=wC(Oy(t)).map(u=>u.registry_url),s=qa(o.registryUrl,{env:t.env,cwd:t.cwd,savedRegistries:i});r(`GoDD \u306B Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\uFF08Registry: ${s}\uFF09`),o.drive&&r("Drive \u306E\u8AAD\u307F\u53D6\u308A\uFF08\u672C\u4EBA\u306E\u6A29\u9650\uFF09\u3082\u8A31\u53EF\u3092\u6C42\u3081\u307E\u3059\u3002");let{credentials:a,driveError:c}=await _p({...o,registryUrl:s},{...t,credentialsPath:n});for(let u of xC(a,n,o.drive,c))r(u)}catch(o){console.error(`\u30A8\u30E9\u30FC: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1}}async function Aq(e,t={}){let r=t.log??(c=>console.log(c)),n=Oy(t),o,i;try{let c=vC(e);i=wC(n),o=c.registryUrl?ot(c.registryUrl):i.length===1?ot(i[0].registry_url):qa(void 0,{env:t.env,cwd:t.cwd})}catch(c){console.error(`\u30A8\u30E9\u30FC: ${c instanceof Error?c.message:String(c)}`),process.exitCode=1;return}let s=bC(o,n);if(s)try{await zy(o,s.credentials.access_token,t.fetch),r("\u2713 Registry \u3067\u3053\u306E\u7AEF\u672B\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u307E\u3057\u305F")}catch(c){r(`\u26A0 Registry \u3067\u306E\u5931\u52B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${c instanceof Error?c.message:String(c)}\uFF09\u3002\u30ED\u30FC\u30AB\u30EB\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u524A\u9664\u3057\u307E\u3059\u3002\u5FC5\u8981\u306A\u3089\u7BA1\u7406\u753B\u9762\u3067\u7AEF\u672B\u30C8\u30FC\u30AF\u30F3\u3092\u5931\u52B9\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}let a=!1;for(let c of n)try{Ef(o,c)&&(a=!0,r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08Registry: ${o}\uFF09: ${c}`))}catch{(0,mC.rmSync)(c,{force:!0}),a=!0,r(`\u2713 \u8AAD\u307F\u8FBC\u3081\u306A\u3044\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u307E\u3057\u305F: ${c}`)}if(!a){r(`\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u307E\u305B\u3093\uFF08Registry: ${o} \u306E\u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3\u60C5\u5831\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002`);let c=i.filter(u=>ot(u.registry_url)!==o);c.length>0&&r(` \u4FDD\u5B58\u6E08\u307F\u306E\u30ED\u30B0\u30A4\u30F3: ${c.map(u=>u.registry_url).join(", ")}\uFF08godd logout --registry-url <url> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)}}var mC,gC,yC,Fa=b(()=>{"use strict";mC=require("node:fs"),gC=require("node:os"),yC=require("node:path");Ci();yp();Ln();$y()});var dT={};rr(dT,{BUILTIN_COMPONENTS:()=>jy,CATEGORY_LABELS:()=>My,DEFAULT_GOOGLE_MCP_URL:()=>gp,GOOGLE_ACCESS_TIMEOUT_MS:()=>JC,GOOGLE_MCP_SERVER_NAME:()=>jt,buildAgentBrowserMcpServerEntry:()=>WC,buildGoddMcpEnv:()=>lT,buildGoogleMcpServerEntry:()=>QC,buildHeadroomMcpServerEntry:()=>VC,buildLicenseKeyPrompt:()=>aT,buildMcpServerEntry:()=>Ly,buildMcpTargets:()=>oT,buildProjectUrlPrompt:()=>RC,buildTypeUiMcpServerEntry:()=>KC,ensureInitGitignoreEntries:()=>DC,fetchGoogleAccess:()=>YC,findSavedLogin:()=>cT,formatGoogleMcpMessage:()=>tT,getCategoryShortLabel:()=>LC,getHeadroomInstallNote:()=>HC,getProjectUrlDefaultMessage:()=>zC,groupByCategory:()=>MC,isGoogleRelayServerEntry:()=>XC,loadExistingConfigSafe:()=>UC,mergeMcpServers:()=>rT,resolveGoogleMcp:()=>eT,resolveGoogleMcpSettings:()=>Ey,resolveInitAuthChoice:()=>sT,resolveInitDeviceLogin:()=>uT,resolveProjectUrl:()=>IC,runInit:()=>pT,toClaudeCodeMcpServers:()=>nT,writeCodexMcpConfigFile:()=>jC,writeEnvFile:()=>GC,writeGoddDevCommandFiles:()=>OC,writeGoddDevSkillFile:()=>NC,writeMcpJsonFile:()=>iT});function Dr(e){return new Promise(t=>{AC.question(e,r=>t(r.trim()))})}function RC(e,t){return`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\uFF08GoDD Admin Console \u3068\u9023\u643A\u3057\u3066\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u53D6\u5F97\u3059\u308B Registry API \u306E\u63A5\u7D9A\u5148\u3002Enter \u3067${t?"\u65E2\u5B58\u5024\u3092\u4FDD\u6301":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u4F7F\u7528"}: ${e}\uFF09: `}function IC(e,t){let r=e.trim();return r?{url:en(r),usedDefault:!1}:{url:en(t),usedDefault:!0}}function zC(e,t){return` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8URL\u306F${t?"\u65E2\u5B58\u306E\u8A2D\u5B9A\u5024":"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024"}\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e}`}function DC(e){return fp(e,Rq)}function OC(e){let t=[];for(let r of Dq){let n=(0,fe.join)(e,r);(!(0,_e.existsSync)(n)||(0,_e.readFileSync)(n,"utf-8").includes(CC))&&((0,_e.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,_e.writeFileSync)(n,Iq,"utf-8"),t.push(n))}return t}function NC(e){let t=(0,fe.join)(e,".agents","skills","godd-dev","SKILL.md");if(!(0,_e.existsSync)(t)||(0,_e.readFileSync)(t,"utf-8").includes(TC))return(0,_e.mkdirSync)((0,fe.dirname)(t),{recursive:!0}),(0,_e.writeFileSync)(t,zq,"utf-8"),t}function jC(e,t,r){let n=(0,fe.join)(e,".codex","config.toml");if(!(!(0,_e.existsSync)(n)||(0,_e.readFileSync)(n,"utf-8").includes(kC)))return;let i=Ly(t,r),s=typeof i.command=="string"?i.command:"godd",a=Array.isArray(i.args)?i.args.filter(p=>typeof p=="string"):["server"],c=i.env&&typeof i.env=="object"?i.env:{},u=[kC,"GODD_LICENSE_KEY"in c?"# This file contains the license key; keep it out of version control.":"# The license is read from the `godd login` credentials (no key in this file).","","[mcp_servers.godd]",`command = ${JSON.stringify(s)}`,`args = [${a.map(p=>JSON.stringify(p)).join(", ")}]`,"","[mcp_servers.godd.env]",...Object.entries(c).map(([p,l])=>`${p} = ${JSON.stringify(String(l))}`),""];return(0,_e.mkdirSync)((0,fe.dirname)(n),{recursive:!0}),(0,_e.writeFileSync)(n,u.join(`
|
|
281
|
+
`),"utf-8"),n}function MC(e){let t=new Map;for(let n of e){let o=Nq[n.name]??n.category,i=t.get(o)??[];i.push(n),t.set(o,i)}return["language","frontend-ui","frontend-css","frontend-build","frontend","backend-api","backend-orm","backend-task","backend","runtime","database","infra","architecture"].filter(n=>t.has(n)).map(n=>({category:n,components:t.get(n)}))}function LC(e){return(My[e]??e).replace(/([^)]*)$/,"")}function jq(e,t){let r=Oq[e];return r===void 0||r.length===0?!0:r.some(n=>t.has(n))}function Mq(){return!!process.pkg}async function Lq(e,t){try{let r=await fetch(`${e}/v1/components`,{headers:{Authorization:`Bearer ${t}`}});return r.ok?await r.json():null}catch{return null}}function ZC(e){return e.length<=8?"****":`${e.slice(0,4)}****${e.slice(-4)}`}function UC(e){let t=(0,fe.join)((0,fe.dirname)(e),".env"),r=mp(t),n={};if((0,_e.existsSync)(e))try{let c=(0,_e.readFileSync)(e,"utf-8"),u=br.load(c);u&&typeof u=="object"&&(n=u)}catch{}if(Object.keys(n).length===0&&Object.keys(r).length===0)return null;let o={},i=r.GODD_LICENSE_KEY??(typeof n.license_key=="string"?n.license_key:void 0);i&&(o.license_key=i);let s=r.GODD_LANGUAGE??(typeof n.language=="string"?n.language:void 0);s&&(o.language=s);let a=r.GODD_REGISTRY_URL??(typeof n.registry_url=="string"?n.registry_url:void 0);return a&&(o.registry_url=a),Array.isArray(n.components)&&n.components.every(c=>typeof c=="string")&&(o.components=n.components),typeof n.stack_profile=="string"&&(o.stack_profile=n.stack_profile),o}function Zq(e){return["# GoDD MCP Server Configuration","# Generated by godd-init","","# \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8","components:",...e.map(r=>` - ${r}`),""].join(`
|
|
281
282
|
`)}function GC(e,t,r,n){let o=new Set(["GODD_LICENSE_KEY","GODD_LANGUAGE","GODD_REGISTRY_URL"]),i=[];if((0,_e.existsSync)(e)){let c=(0,_e.readFileSync)(e,"utf-8");for(let u of c.split(`
|
|
282
|
-
`)){let p=u.trim();if(
|
|
283
|
-
`);(0,_e.writeFileSync)(e,a,"utf-8")}function BC(){if(jq())return{command:"godd",args:[]};let e;try{e=(0,PC.fileURLToPath)(__goddBundleUrl)}catch{typeof __filename<"u"?e=__filename:(e=process.argv[1]??process.execPath,console.warn(`[GoDD] import.meta.url / __filename \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002process.argv[1] \u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF: ${e}`))}let t=(0,fe.dirname)(e),r=e.includes("src")?(0,fe.resolve)(t,"..","..","dist","godd.js"):(0,fe.resolve)(t,"godd.js");return{command:process.execPath,args:[r]}}function Ly(e,t){let r={GODD_CONFIG:e,...t},{command:n,args:o}=BC();return{command:n,args:[...o,"server"],env:r}}function VC(e){let t=["mcp","serve"];return e&&t.push("--proxy-url",e),{type:"stdio",command:"headroom",args:t}}function HC(e=process.platform){let t="pipx/venv \u306E headroom \u304C Cursor \u304B\u3089\u898B\u3048\u306A\u3044\u5834\u5408\u306F .cursor/mcp.json \u306E command \u3092\u7D76\u5BFE\u30D1\u30B9\u306B\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002";return e==="darwin"?"macOS + Homebrew Python \u3067\u306F PEP 668 \u306B\u3088\u308A bare pip install \u304C\u5931\u6557\u3059\u308B\u305F\u3081\u3001venv \u307E\u305F\u306F pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t:"\u4E8B\u524D\u306B venv/pipx \u7B49\u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t}function WC(e="core"){return{type:"stdio",command:"agent-browser",args:["mcp","--tools",e]}}function KC(e="https://mcp.typeui.sh",t){let r=t?.trim();return r?{url:e,headers:{Authorization:`Bearer ${r}`}}:{url:e}}async function YC(e,t,r={}){let n=r.fetchImpl??fetch,o=r.timeoutMs??JC,i=`${e.replace(/\/+$/,"")}/v1/google/access`,s;try{s=await n(i,{headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(o)})}catch(u){let p=u instanceof Error?u.name:"";return{status:"unavailable",reason:p==="TimeoutError"||p==="AbortError"?"\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8":"\u901A\u4FE1\u30A8\u30E9\u30FC"}}if(s.status===401||s.status===403)return{status:"unauthorized",httpStatus:s.status};if(s.status===404)return{status:"unsupported"};if(!s.ok)return{status:"unavailable",reason:`HTTP ${s.status}`};let a;try{a=await s.json()}catch{return{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}let c=a&&typeof a=="object"?a.projects:void 0;return Array.isArray(c)?c.length===0?{status:"none"}:{status:"granted",projectCount:c.length}:{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}function QC(e,t){return{url:e,headers:{Authorization:`Bearer ${t}`}}}function Uq(e,t){let{command:r,args:n}=BC(),o={GODD_REGISTRY_URL:e};return t!==gp&&(o.GODD_GOOGLE_MCP_URL=t),{command:r,args:[...n,"google-relay"],env:o}}function XC(e){if(!e||typeof e!="object")return!1;let{url:t,headers:r,args:n,env:o}=e;return t!==void 0||r!==void 0||!Array.isArray(n)||n[n.length-1]!=="google-relay"?!1:!(o&&typeof o=="object"&&"GODD_LICENSE_KEY"in o)}function SC(e,t,r,n,o=!1){let i=qq(e,t,r);return o?i.action==="add"&&e.enabled?{action:"add",entry:Uq(n,e.url),projectCount:i.projectCount,relay:!0}:i.action==="keep"&&i.reason!=="disabled"?{action:"remove",reason:"device-token",cause:i.reason,detail:i.detail}:i:i}function qq(e,t,r){if(!e.enabled)return{action:"keep",reason:e.reason};if(!t)return{action:"keep",reason:"unavailable"};switch(t.status){case"granted":return{action:"add",entry:QC(e.url,r),projectCount:t.projectCount};case"none":return{action:"remove",reason:"no-projects"};case"unauthorized":return{action:"remove",reason:"unauthorized"};case"unsupported":return{action:"keep",reason:"unsupported"};case"unavailable":return{action:"keep",reason:"unavailable",detail:t.reason}}}async function eT(e,t,r={}){let n=Ey(r.env);if(!n.enabled)return SC(n,null,t,e,r.deviceToken);let o=await YC(e,t,{fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs});return SC(n,o,t,e,r.deviceToken)}function tT(e,t,r){switch(e.action){case"add":return t.written?e.relay?`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001godd google-relay \u7D4C\u7531\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u306F MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\uFF09`:`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC ${ZC(r)}\uFF09`:null;case"remove":if(e.reason==="device-token"){if(e.cause==="unsupported")return t.removed&&!t.kept?`\u2713 Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u65E2\u5B58\u306E ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\uFF09`:null;let n=e.cause==="invalid-url"?"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081":`Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09`;return t.kept&&!t.removed?`\u26A0 ${n}\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u65E2\u5B58\u306E godd google-relay \u7D4C\u7531\u306E\u8A2D\u5B9A\u306F\u305D\u306E\u307E\u307E\u6B8B\u3057\u307E\u3057\u305F\uFF09`:`\u26A0 ${n}\u3001${jt} \u3092\u8A2D\u5B9A\u3057\u307E\u305B\u3093\u3067\u3057\u305F`+(t.removed?"\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u65E2\u5B58\u306E\u8A2D\u5B9A\u306F\u524A\u9664\u3057\u307E\u3057\u305F":"")+"\u3002\u63A5\u7D9A\u3067\u304D\u308B\u72B6\u614B\u3067 godd init \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044"}return t.removed?e.reason==="no-projects"?`\u2713 Google \u9023\u643A\u306E\u5272\u5F53\u6848\u4EF6\u304C\u7121\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:`\u2713 \u30E9\u30A4\u30BB\u30F3\u30B9\u3067 Google \u9023\u643A\u3092\u5229\u7528\u3067\u304D\u306A\u3044\u305F\u3081\uFF08\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:null;case"keep":return e.reason==="disabled"?` GODD_GOOGLE_MCP \u306E\u6307\u5B9A\u306B\u3088\u308A ${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="invalid-url"?`\u26A0 GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="unsupported"?null:`\u26A0 Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`}}function rT(e,t,r=[]){let n=e?{...e}:{},i={...typeof n.mcpServers=="object"&&n.mcpServers!==null?n.mcpServers:{},...t};for(let s of r)s in t||delete i[s];return n.mcpServers=i,n}function nT(e){let t={};for(let[r,n]of Object.entries(e))t[r]="url"in n&&!("type"in n)?{type:"http",...n}:n;return t}function oT(e,t,r=(0,EC.homedir)()){return[{label:".cursor/mcp.json\uFF08Cursor \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".cursor","mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".cursor","mcp.json")),servers:t},{label:".mcp.json\uFF08Claude Code \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".mcp.json")),servers:nT(t)}]}function iT(e,t,r=[],n){let o=null,i;if((0,_e.existsSync)(e)){let l=(0,_e.readFileSync)(e,"utf-8");try{o=JSON.parse(l)}catch{i=`${e}.bak`,(0,_e.writeFileSync)(i,l,"utf-8")}}else{let l=(0,fe.dirname)(e);(0,_e.existsSync)(l)||(0,_e.mkdirSync)(l,{recursive:!0})}let s=o&&typeof o.mcpServers=="object"&&o.mcpServers!==null?o.mcpServers:{},a=r.filter(l=>l in s&&!(l in t)),c=n?a.filter(l=>n(s[l])):[],u=a.filter(l=>!c.includes(l)),p=rT(o,t,u);return(0,_e.writeFileSync)(e,JSON.stringify(p,null,2),"utf-8"),{backupPath:i,removed:u,kept:c}}function sT(e,t,r){let n=e.trim();return Fq.has(n.toLowerCase())?{mode:"google"}:n?{mode:"license_key",licenseKey:n}:t?{mode:"license_key",licenseKey:t}:r?{mode:"google"}:{mode:"missing"}}function aT(e,t){return e?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u65E2\u5B58\u3092\u4FDD\u6301 [${ZC(e)}]\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: `:t?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3 [${t.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"} / ${t.registry_url}] \u3092\u4F7F\u7528\uFF09: `:"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: "}function cT(e,t=kr()){try{return Do(e,t)?.credentials??pn(t)[0]??null}catch{return null}}async function uT(e,t={}){let r=t.log??(c=>console.log(c)),n=t.credentialsPath?[t.credentialsPath]:kr(),o=null,i=[];try{o=Do(e,n)?.credentials??null,i=pn(n).filter(c=>ot(c.registry_url)!==ot(e))}catch{}if(o)return r(`\u2713 \u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u3044\u307E\u3059: ${o.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),fu(o,t.now)&&r(` \u26A0 \u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${o.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),o;if(i.length>0){let c=i.map(u=>u.registry_url).join(", ");r(`
|
|
283
|
+
`)){let p=u.trim();if(Uq.has(p))continue;let l=p.indexOf("="),d=l>0?p.slice(0,l).trim():"";o.has(d)||i.push(u)}for(;i.length>0&&i[i.length-1].trim()==="";)i.pop()}let s=["",qC,t!==null?`GODD_LICENSE_KEY="${t}"`:FC,`GODD_LANGUAGE="${r}"`,`GODD_REGISTRY_URL="${n}"`,""],a=[...i,...s].join(`
|
|
284
|
+
`);(0,_e.writeFileSync)(e,a,"utf-8")}function BC(){if(Mq())return{command:"godd",args:[]};let e;try{e=(0,PC.fileURLToPath)(__goddBundleUrl)}catch{typeof __filename<"u"?e=__filename:(e=process.argv[1]??process.execPath,console.warn(`[GoDD] import.meta.url / __filename \u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002process.argv[1] \u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF: ${e}`))}let t=(0,fe.dirname)(e),r=e.includes("src")?(0,fe.resolve)(t,"..","..","dist","godd.js"):(0,fe.resolve)(t,"godd.js");return{command:process.execPath,args:[r]}}function Ly(e,t){let r={GODD_CONFIG:e,...t},{command:n,args:o}=BC();return{command:n,args:[...o,"server"],env:r}}function VC(e){let t=["mcp","serve"];return e&&t.push("--proxy-url",e),{type:"stdio",command:"headroom",args:t}}function HC(e=process.platform){let t="pipx/venv \u306E headroom \u304C Cursor \u304B\u3089\u898B\u3048\u306A\u3044\u5834\u5408\u306F .cursor/mcp.json \u306E command \u3092\u7D76\u5BFE\u30D1\u30B9\u306B\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002";return e==="darwin"?"macOS + Homebrew Python \u3067\u306F PEP 668 \u306B\u3088\u308A bare pip install \u304C\u5931\u6557\u3059\u308B\u305F\u3081\u3001venv \u307E\u305F\u306F pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t:"\u4E8B\u524D\u306B venv/pipx \u7B49\u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044\u3002"+t}function WC(e="core"){return{type:"stdio",command:"agent-browser",args:["mcp","--tools",e]}}function KC(e="https://mcp.typeui.sh",t){let r=t?.trim();return r?{url:e,headers:{Authorization:`Bearer ${r}`}}:{url:e}}async function YC(e,t,r={}){let n=r.fetchImpl??fetch,o=r.timeoutMs??JC,i=`${e.replace(/\/+$/,"")}/v1/google/access`,s;try{s=await n(i,{headers:{Authorization:`Bearer ${t}`},signal:AbortSignal.timeout(o)})}catch(u){let p=u instanceof Error?u.name:"";return{status:"unavailable",reason:p==="TimeoutError"||p==="AbortError"?"\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8":"\u901A\u4FE1\u30A8\u30E9\u30FC"}}if(s.status===401||s.status===403)return{status:"unauthorized",httpStatus:s.status};if(s.status===404)return{status:"unsupported"};if(!s.ok)return{status:"unavailable",reason:`HTTP ${s.status}`};let a;try{a=await s.json()}catch{return{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}let c=a&&typeof a=="object"?a.projects:void 0;return Array.isArray(c)?c.length===0?{status:"none"}:{status:"granted",projectCount:c.length}:{status:"unavailable",reason:"\u5FDC\u7B54\u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093"}}function QC(e,t){return{url:e,headers:{Authorization:`Bearer ${t}`}}}function qq(e,t){let{command:r,args:n}=BC(),o={GODD_REGISTRY_URL:e};return t!==gp&&(o.GODD_GOOGLE_MCP_URL=t),{command:r,args:[...n,"google-relay"],env:o}}function XC(e){if(!e||typeof e!="object")return!1;let{url:t,headers:r,args:n,env:o}=e;return t!==void 0||r!==void 0||!Array.isArray(n)||n[n.length-1]!=="google-relay"?!1:!(o&&typeof o=="object"&&"GODD_LICENSE_KEY"in o)}function SC(e,t,r,n,o=!1){let i=Fq(e,t,r);return o?i.action==="add"&&e.enabled?{action:"add",entry:qq(n,e.url),projectCount:i.projectCount,relay:!0}:i.action==="keep"&&i.reason!=="disabled"?{action:"remove",reason:"device-token",cause:i.reason,detail:i.detail}:i:i}function Fq(e,t,r){if(!e.enabled)return{action:"keep",reason:e.reason};if(!t)return{action:"keep",reason:"unavailable"};switch(t.status){case"granted":return{action:"add",entry:QC(e.url,r),projectCount:t.projectCount};case"none":return{action:"remove",reason:"no-projects"};case"unauthorized":return{action:"remove",reason:"unauthorized"};case"unsupported":return{action:"keep",reason:"unsupported"};case"unavailable":return{action:"keep",reason:"unavailable",detail:t.reason}}}async function eT(e,t,r={}){let n=Ey(r.env);if(!n.enabled)return SC(n,null,t,e,r.deviceToken);let o=await YC(e,t,{fetchImpl:r.fetchImpl,timeoutMs:r.timeoutMs});return SC(n,o,t,e,r.deviceToken)}function tT(e,t,r){switch(e.action){case"add":return t.written?e.relay?`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001godd google-relay \u7D4C\u7531\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u306F MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\uFF09`:`\u2713 ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F\uFF08\u5272\u5F53\u6848\u4EF6 ${e.projectCount} \u4EF6\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC ${ZC(r)}\uFF09`:null;case"remove":if(e.reason==="device-token"){if(e.cause==="unsupported")return t.removed&&!t.kept?`\u2713 Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u65E2\u5B58\u306E ${jt}\uFF08Google \u9023\u643A MCP\uFF09\u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F\uFF08\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u305F\u3081\uFF09`:null;let n=e.cause==="invalid-url"?"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081":`Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09`;return t.kept&&!t.removed?`\u26A0 ${n}\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u65E2\u5B58\u306E godd google-relay \u7D4C\u7531\u306E\u8A2D\u5B9A\u306F\u305D\u306E\u307E\u307E\u6B8B\u3057\u307E\u3057\u305F\uFF09`:`\u26A0 ${n}\u3001${jt} \u3092\u8A2D\u5B9A\u3057\u307E\u305B\u3093\u3067\u3057\u305F`+(t.removed?"\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u305F\u305F\u3081\u3001\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u5E73\u6587\u3067\u66F8\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u65E2\u5B58\u306E\u8A2D\u5B9A\u306F\u524A\u9664\u3057\u307E\u3057\u305F":"")+"\u3002\u63A5\u7D9A\u3067\u304D\u308B\u72B6\u614B\u3067 godd init \u3092\u3084\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044"}return t.removed?e.reason==="no-projects"?`\u2713 Google \u9023\u643A\u306E\u5272\u5F53\u6848\u4EF6\u304C\u7121\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:`\u2713 \u30E9\u30A4\u30BB\u30F3\u30B9\u3067 Google \u9023\u643A\u3092\u5229\u7528\u3067\u304D\u306A\u3044\u305F\u3081\uFF08\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F`:null;case"keep":return e.reason==="disabled"?` GODD_GOOGLE_MCP \u306E\u6307\u5B9A\u306B\u3088\u308A ${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="invalid-url"?`\u26A0 GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u306A\u3044\u305F\u3081\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`:e.reason==="unsupported"?null:`\u26A0 Google \u9023\u643A\u306E\u5272\u5F53\u3092\u78BA\u8A8D\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\uFF08${e.detail??"\u901A\u4FE1\u30A8\u30E9\u30FC"}\uFF09\u3001${jt} \u306E\u8A2D\u5B9A\u306F\u5909\u66F4\u3057\u307E\u305B\u3093\u3067\u3057\u305F`}}function rT(e,t,r=[]){let n=e?{...e}:{},i={...typeof n.mcpServers=="object"&&n.mcpServers!==null?n.mcpServers:{},...t};for(let s of r)s in t||delete i[s];return n.mcpServers=i,n}function nT(e){let t={};for(let[r,n]of Object.entries(e))t[r]="url"in n&&!("type"in n)?{type:"http",...n}:n;return t}function oT(e,t,r=(0,EC.homedir)()){return[{label:".cursor/mcp.json\uFF08Cursor \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".cursor","mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".cursor","mcp.json")),servers:t},{label:".mcp.json\uFF08Claude Code \u7528\uFF09",path:(0,fe.resolve)((0,fe.join)(e,".mcp.json")),userGlobalPath:(0,fe.resolve)((0,fe.join)(r,".mcp.json")),servers:nT(t)}]}function iT(e,t,r=[],n){let o=null,i;if((0,_e.existsSync)(e)){let l=(0,_e.readFileSync)(e,"utf-8");try{o=JSON.parse(l)}catch{i=`${e}.bak`,(0,_e.writeFileSync)(i,l,"utf-8")}}else{let l=(0,fe.dirname)(e);(0,_e.existsSync)(l)||(0,_e.mkdirSync)(l,{recursive:!0})}let s=o&&typeof o.mcpServers=="object"&&o.mcpServers!==null?o.mcpServers:{},a=r.filter(l=>l in s&&!(l in t)),c=n?a.filter(l=>n(s[l])):[],u=a.filter(l=>!c.includes(l)),p=rT(o,t,u);return(0,_e.writeFileSync)(e,JSON.stringify(p,null,2),"utf-8"),{backupPath:i,removed:u,kept:c}}function sT(e,t,r){let n=e.trim();return Gq.has(n.toLowerCase())?{mode:"google"}:n?{mode:"license_key",licenseKey:n}:t?{mode:"license_key",licenseKey:t}:r?{mode:"google"}:{mode:"missing"}}function aT(e,t){return e?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u65E2\u5B58\u3092\u4FDD\u6301 [${ZC(e)}]\u3002Google \u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: `:t?`\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\uFF08Enter \u3067\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3 [${t.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"} / ${t.registry_url}] \u3092\u4F7F\u7528\uFF09: `:"\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3059\u308B\u5834\u5408\u306F google\uFF09: "}function cT(e,t=kr()){try{return Do(e,t)?.credentials??dn(t)[0]??null}catch{return null}}async function uT(e,t={}){let r=t.log??(c=>console.log(c)),n=t.credentialsPath?[t.credentialsPath]:kr(),o=null,i=[];try{o=Do(e,n)?.credentials??null,i=dn(n).filter(c=>ot(c.registry_url)!==ot(e))}catch{}if(o)return r(`\u2713 \u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u3044\u307E\u3059: ${o.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),fu(o,t.now)&&r(` \u26A0 \u624B\u5143\u306E\u8A18\u9332\u3067\u306F\u6709\u52B9\u671F\u9650\uFF08${o.expires_at}\uFF09\u3092\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u304C\u5EF6\u9577\u3057\u3066\u3044\u308C\u3070\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u3059\u3002\u62D2\u5426\u3055\u308C\u305F\u5834\u5408\u306F godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),o;if(i.length>0){let c=i.map(u=>u.registry_url).join(", ");r(`
|
|
284
285
|
\u4FDD\u5B58\u6E08\u307F\u306E Google \u30ED\u30B0\u30A4\u30F3\u306F\u5225\u306E Registry\uFF08${c}\uFF09\u5411\u3051\u3067\u3059\u3002${ot(e)} \u306B\u65B0\u3057\u304F\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\uFF08${c} \u306E\u30ED\u30B0\u30A4\u30F3\u306F\u305D\u306E\u307E\u307E\u6B8B\u308A\u307E\u3059\uFF09\u3002`)}r(`
|
|
285
|
-
Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\u3002`);let a=await(t.login??(c=>_p({drive:!1,noBrowser:!1,registryUrl:c},{credentialsPath:t.credentialsPath,log:r}).then(u=>u.credentials)))(e);return r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${a.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),a}function lT(e,t,r){return{...e!==null?{GODD_LICENSE_KEY:e}:{},GODD_LANGUAGE:t,GODD_REGISTRY_URL:r}}async function pT(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD MCP Server \u2014 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=process.cwd(),t=(0,fe.join)(e,"config.godd"),r=UC(t);r&&(console.log("\u65E2\u5B58\u306E config.godd \u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u5909\u66F4\u3059\u308B\u9805\u76EE\u306E\u307F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Enter \u3067\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"),r.components?.length&&console.log(` \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8: ${r.components.join(", ")} (${r.components.length} \u4EF6)`),r.language&&console.log(` \u8A00\u8A9E: ${r.language}`),console.log(""));let n=cT(r?.registry_url??
|
|
286
|
+
Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3059\u3002`);let a=await(t.login??(c=>_p({drive:!1,noBrowser:!1,registryUrl:c},{credentialsPath:t.credentialsPath,log:r}).then(u=>u.credentials)))(e);return r(`\u2713 \u30ED\u30B0\u30A4\u30F3\u3057\u307E\u3057\u305F: ${a.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}`),a}function lT(e,t,r){return{...e!==null?{GODD_LICENSE_KEY:e}:{},GODD_LANGUAGE:t,GODD_REGISTRY_URL:r}}async function pT(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD MCP Server \u2014 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=process.cwd(),t=(0,fe.join)(e,"config.godd"),r=UC(t);r&&(console.log("\u65E2\u5B58\u306E config.godd \u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u5909\u66F4\u3059\u308B\u9805\u76EE\u306E\u307F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Enter \u3067\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"),r.components?.length&&console.log(` \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8: ${r.components.join(", ")} (${r.components.length} \u4EF6)`),r.language&&console.log(` \u8A00\u8A9E: ${r.language}`),console.log(""));let n=cT(r?.registry_url??fn),o=await Dr(aT(r?.license_key,n)),i=sT(o,r?.license_key,n!==null);i.mode==="missing"&&(console.error("\u30A8\u30E9\u30FC: \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F\u5FC5\u9808\u3067\u3059\u3002Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u4F7F\u3046\u5834\u5408\u306F google \u3068\u5165\u529B\u3059\u308B\u304B\u3001\u5148\u306B godd login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let s=i.mode==="google",a=r?.language??"ja",u=await Dr(`\u4F7F\u7528\u8A00\u8A9E\u3092\u9078\u629E [ja/en/zh/ru/kz/tr] (default: ${a}): `)||a,p=!!r?.registry_url,l=r?.registry_url??fn,d=await Dr(RC(l,p)),f;try{f=IC(d,l)}catch(ie){console.error(`\u30A8\u30E9\u30FC: ${ie instanceof Error?ie.message:String(ie)}`),process.exit(1)}let h=f.url;f.usedDefault&&console.log(zC(h,p));let g,y=null;if(i.mode==="google"){try{y=await uT(h)}catch(ie){console.error(`
|
|
286
287
|
\u30A8\u30E9\u30FC: Google \u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002${ie instanceof Error?ie.message:String(ie)}`),process.exit(1)}g=y.access_token}else g=i.licenseKey;let v=wa();v||(console.error(`
|
|
287
288
|
\u30A8\u30E9\u30FC: Git \u30EA\u30E2\u30FC\u30C8 (origin) \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002`),console.error(" git remote add origin <url> \u3067\u30EA\u30E2\u30FC\u30C8\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),console.log(`
|
|
288
289
|
\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u4E2D: ${v}`);try{let ie=await fetch(`${h}/v1/repos/register`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:JSON.stringify({remote_url:v}),signal:AbortSignal.timeout(1e4)});if(!ie.ok){let Ee=await ie.json().catch(()=>({detail:ie.statusText}));console.error(`
|
|
289
290
|
\u30A8\u30E9\u30FC: \u30EA\u30DD\u30B8\u30C8\u30EA\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(` ${Ee.detail??ie.statusText}`);let $t=nt(ie.status,String(Ee.detail??""));$t?console.error(` ${$t}`):ie.status===401?console.error(s?" \u30ED\u30B0\u30A4\u30F3\u304C\u7121\u52B9\u3067\u3059\u3002godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002":" \u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002"):ie.status===403&&console.error(" \u30EA\u30DD\u30B8\u30C8\u30EA\u6570\u306E\u4E0A\u9650\u306B\u9054\u3057\u3066\u3044\u307E\u3059\u3002\u7BA1\u7406\u8005\u306B\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)}console.log("\u2713 \u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u767B\u9332\u3057\u307E\u3057\u305F")}catch{console.error(`
|
|
290
291
|
\u30A8\u30E9\u30FC: Registry API \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002`),console.error(` ${h} \u304C\u8D77\u52D5\u3057\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`),process.exit(1)}console.log(`
|
|
291
|
-
\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let w=await
|
|
292
|
+
\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u4E2D...`);let w=await Lq(h,g)??jy;console.log(w===jy?" Registry API \u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30D3\u30EB\u30C8\u30A4\u30F3\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002":` ${w.length} \u4EF6\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u53D6\u5F97\u3057\u307E\u3057\u305F\u3002`);let x=MC(w),k=new Set,P=new Set;function q(ie){return x.find(Ee=>Ee.category===ie)}async function L(ie,Ee){let $t=My[ie.category]??ie.category,Pt=Ee?ie.components.filter(Ct=>jq(Ct.name,P)):ie.components;if(Pt.length===0){console.log(` \u3010${$t}\u3011 \u2014 \u5BFE\u5FDC\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306F\u3042\u308A\u307E\u305B\u3093\uFF08\u30B9\u30AD\u30C3\u30D7\uFF09`);return}console.log(`
|
|
292
293
|
\u3010${$t}\u3011`),Pt.forEach((Ct,_r)=>{console.log(` ${String(_r+1).padStart(2)}. ${Ct.label.padEnd(25)} ${Ct.description}`)});let Et=await Dr(" \u9078\u629E (\u4F8B: 1,3): ");if(Et.toLowerCase()==="all")for(let Ct of Pt)k.add(Ct.name);else if(Et){let Ct=Et.split(",").map(_r=>parseInt(_r.trim(),10));for(let _r of Ct)_r>=1&&_r<=Pt.length&&k.add(Pt[_r-1].name)}}let Ue=!1;if(r?.components&&r.components.length>0&&(await Dr("\u65E2\u5B58\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u8A2D\u5B9A\u3092\u5F15\u304D\u7D99\u304E\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){for(let Ee of r.components)k.add(Ee);Ue=!0,console.log(`
|
|
293
294
|
\u2713 \u65E2\u5B58\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u8A2D\u5B9A\u3092\u5F15\u304D\u7D99\u304E\u307E\u3057\u305F\uFF08${k.size} \u4EF6\uFF09`)}if(!Ue){let ie=[{step:1,title:"\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E",categories:["language"]},{step:2,title:"\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF / \u30E9\u30A4\u30D6\u30E9\u30EA",categories:["frontend-ui","backend-api","frontend","backend"]},{step:3,title:`\u95A2\u9023\u30C4\u30FC\u30EB\uFF08CSS / \u30D3\u30EB\u30C9 / ORM / \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC / ${LC("runtime")}\uFF09`,categories:["frontend-css","frontend-build","backend-orm","backend-task","runtime"]},{step:4,title:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",categories:["database"]},{step:5,title:"\u30A4\u30F3\u30D5\u30E9",categories:["infra"]}],Ee=ie.length;console.log(`
|
|
294
295
|
\u2501\u2501\u2501 \u6280\u8853\u30B9\u30BF\u30C3\u30AF\u9078\u629E\uFF08${Ee} \u30B9\u30C6\u30C3\u30D7 + \u81EA\u52D5\u8A2D\u5B9A\uFF09\u2501\u2501\u2501`),console.log(`\u8907\u6570\u9078\u629E: "1,3,5" / \u5168\u9078\u629E: "all" / \u30B9\u30AD\u30C3\u30D7: Enter
|
|
@@ -299,11 +300,11 @@ Google \u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3\u3057\u307E\
|
|
|
299
300
|
\u2714 \u8A2D\u8A08\u30D1\u30BF\u30FC\u30F3\u3092\u81EA\u52D5\u8A2D\u5B9A\u3057\u307E\u3057\u305F: ${Pt}`)}k.size===0&&(console.error(`
|
|
300
301
|
\u30A8\u30E9\u30FC: \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u304C1\u3064\u3082\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`),process.exit(1))}console.log(`
|
|
301
302
|
\u2501\u2501\u2501 \u9078\u629E\u3055\u308C\u305F\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 (${k.size} \u4EF6) \u2501\u2501\u2501`);for(let ie of k){let Ee=w.find($t=>$t.name===ie);console.log(` \u2713 ${Ee?.label??ie}`)}let Q=await Dr(`
|
|
302
|
-
config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,qe=
|
|
303
|
-
\u2713 config.godd \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${Q}`);let Be=(0,fe.join)((0,fe.dirname)(Q),".env");GC(Be,s?null:g,u,h),console.log(`\u2713 .env \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F: ${Be}`),DC(e)?console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059");let
|
|
304
|
-
\u26A0 \u30E6\u30FC\u30B6\u30FC\u30B0\u30ED\u30FC\u30D0\u30EB\u306E MCP \u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3057\u306A\u3044\u305F\u3081\u3001${
|
|
305
|
-
`),console.log(JSON.stringify(
|
|
306
|
-
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`),console.log("\u2551 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. Cursor: IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 2. Claude Code: \u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067 `claude` \u3092\u8D77\u52D5\u3057\u3001"),console.log(" \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B9\u30B3\u30FC\u30D7 MCP\uFF08.mcp.json\uFF09\u306E\u627F\u8A8D\u30C0\u30A4\u30A2\u30ED\u30B0\u3067 godd \u3092\u627F\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" \uFF08\u521D\u56DE\u306F\u627F\u8A8D\u3059\u308B\u307E\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002`claude mcp list` \u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09"),console.log(" 3. Codex: `/mcp` \u3067 godd \u304C\u63A5\u7D9A\u6E08\u307F\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 4. \u30C1\u30E3\u30C3\u30C8\u3067 GoDD MCP \u30C4\u30FC\u30EB\u304C\u4F7F\u3048\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3059"),console.log(" - godd-dev: \u958B\u767A\u652F\u63F4"),console.log(" - /godd-dev: Cursor / Claude Code \u5171\u901A\u306E\u76F4\u63A5\u30B3\u30DE\u30F3\u30C9"),console.log(" - godd-check: \u30B3\u30FC\u30C9\u30C1\u30A7\u30C3\u30AF"),console.log(" - godd-review: \u30B3\u30FC\u30C9\u30EC\u30D3\u30E5\u30FC"),console.log(" - godd-setup: \u74B0\u5883\u69CB\u7BC9\u652F\u63F4"),console.log(" \u4ED6 12 \u30C4\u30FC\u30EB"),En&&(console.log(` 5. Google \u9023\u643A: IDE / Claude Code \u3092\u518D\u8D77\u52D5\u3057\u3001/mcp \u3067 ${jt} \u304C connected \u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`),console.log(` \uFF08Claude Code \u306F godd \u3068\u540C\u3058\u304F\u521D\u56DE\u306B ${jt} \u306E\u627F\u8A8D\u304C\u5FC5\u8981\u3067\u3059\uFF09`)),y&&(console.log(""),console.log(`\u30ED\u30B0\u30A4\u30F3: Google\uFF08${y.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}\uFF09\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F .env / MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002`),console.log(` \u30ED\u30B0\u30A4\u30F3\u60C5\u5831: ${jn()}`),console.log(" \u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u305F\u3089 godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002Drive \u3092\u672C\u4EBA\u306E\u6A29\u9650\u3067\u8AAD\u3080\u5834\u5408\u306F godd login --drive \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")),console.log(""),console.log("\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u63A8\u5968\u8A2D\u5B9A:"),console.log(" \u79D8\u5BC6\u60C5\u5831\u6F0F\u6D29\u9632\u6B62\u306E\u305F\u3081\u3001\u500B\u4EBA\u306E ~/.gitignore_global \u306B\u4EE5\u4E0B\u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3092\u63A8\u5968\u3057\u307E\u3059:"),console.log(" git config --global core.excludesFile ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json' >> ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json.bak' >> ~/.gitignore_global"),console.log(" echo '.mcp.json' >> ~/.gitignore_global"),console.log(" echo '.mcp.json.bak' >> ~/.gitignore_global"),console.log(""),AC.close()}function Gq(){try{return __goddBundleUrl}catch{return}}var $C,_e,fe,PC,EC,jy,Aq,CC,Rq,TC,Iq,zq,AC,kC,My,Dq,Oq,qC,FC,Zq,jt,JC,Fq,fT=b(()=>{"use strict";$C=yt(require("node:readline"),1),_e=require("node:fs"),fe=require("node:path"),PC=require("node:url"),EC=require("node:os");Ls();Tf();ug();Sy();$y();Mn();Cy();Ci();yp();Kr();Fa();jy=[{id:"",name:"python",category:"language",label:"Python",description:"\u6C4E\u7528\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"typescript",category:"language",label:"TypeScript",description:"\u578B\u5B89\u5168\u306A JavaScript \u30B9\u30FC\u30D1\u30FC\u30BB\u30C3\u30C8"},{id:"",name:"javascript",category:"language",label:"JavaScript",description:"\u52D5\u7684\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E (ES2024+)"},{id:"",name:"go",category:"language",label:"Go",description:"\u9759\u7684\u578B\u4ED8\u3051\u30B3\u30F3\u30D1\u30A4\u30EB\u8A00\u8A9E"},{id:"",name:"php",category:"language",label:"PHP",description:"\u6C4E\u7528\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E"},{id:"",name:"ruby",category:"language",label:"Ruby",description:"\u52D5\u7684\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u6307\u5411\u8A00\u8A9E"},{id:"",name:"c",category:"language",label:"C",description:"\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"html",category:"language",label:"HTML",description:"HyperText Markup Language"},{id:"",name:"css",category:"language",label:"CSS",description:"Cascading Style Sheets"},{id:"",name:"react",category:"frontend",label:"React",description:"React UI \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"nextjs",category:"frontend",label:"Next.js",description:"React \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (SSR/SSG/ISR)"},{id:"",name:"vue",category:"frontend",label:"Vue.js",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 JavaScript \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"angular",category:"frontend",label:"Angular",description:"TypeScript \u30D9\u30FC\u30B9 Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"svelte",category:"frontend",label:"Svelte",description:"\u30B3\u30F3\u30D1\u30A4\u30EB\u6642 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"vite",category:"frontend",label:"Vite",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB"},{id:"",name:"tailwind",category:"frontend",label:"Tailwind CSS",description:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u30D5\u30A1\u30FC\u30B9\u30C8 CSS"},{id:"",name:"sass",category:"frontend",label:"Sass",description:"CSS \u30D7\u30EA\u30D7\u30ED\u30BB\u30C3\u30B5"},{id:"",name:"emotion",category:"frontend",label:"Emotion",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"styled-components",category:"frontend",label:"styled-components",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"mui",category:"frontend",label:"MUI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"chakra-ui",category:"frontend",label:"Chakra UI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"electron",category:"frontend",label:"Electron",description:"\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastapi",category:"backend",label:"FastAPI",description:"\u9AD8\u901F Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"django",category:"backend",label:"Django",description:"Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (batteries included)"},{id:"",name:"flask",category:"backend",label:"Flask",description:"Python \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"express",category:"backend",label:"Express",description:"\u6700\u5C0F\u9650\u306E Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastify",category:"backend",label:"Fastify",description:"\u9AD8\u901F Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"nestjs",category:"backend",label:"NestJS",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 Node.js \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"gin",category:"backend",label:"Gin",description:"Go HTTP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"echo",category:"backend",label:"Echo",description:"\u9AD8\u6027\u80FD Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fiber",category:"backend",label:"Fiber",description:"Express \u98A8 Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"laravel",category:"backend",label:"Laravel",description:"PHP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"symfony",category:"backend",label:"Symfony",description:"PHP \u30A8\u30F3\u30BF\u30FC\u30D7\u30E9\u30A4\u30BA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"wordpress",category:"backend",label:"WordPress",description:"PHP CMS \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"rails",category:"backend",label:"Ruby on Rails",description:"Ruby Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (MVC)"},{id:"",name:"sinatra",category:"backend",label:"Sinatra",description:"Ruby \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"koa",category:"backend",label:"Koa",description:"\u6B21\u4E16\u4EE3 Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"node",category:"runtime",label:"Node.js",description:"config.godd \u767B\u9332\u7528\u306E JavaScript \u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"config.godd \u767B\u9332\u7528\u306E MCP Agent stdio \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"postgresql",category:"database",label:"PostgreSQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mysql",category:"database",label:"MySQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mongodb",category:"database",label:"MongoDB",description:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u6307\u5411 NoSQL DB"},{id:"",name:"redis",category:"database",label:"Redis",description:"\u30A4\u30F3\u30E1\u30E2\u30EA KVS / \u30AD\u30E3\u30C3\u30B7\u30E5"},{id:"",name:"sqlalchemy",category:"backend",label:"SQLAlchemy",description:"Python SQL \u30C4\u30FC\u30EB\u30AD\u30C3\u30C8 + ORM"},{id:"",name:"celery",category:"backend",label:"Celery",description:"\u5206\u6563\u30BF\u30B9\u30AF\u30AD\u30E5\u30FC"},{id:"",name:"docker",category:"infra",label:"Docker",description:"\u30B3\u30F3\u30C6\u30CA\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"terraform",category:"infra",label:"Terraform",description:"IaC \u30C4\u30FC\u30EB (HashiCorp)"},{id:"",name:"ddd-clean-architecture",category:"architecture",label:"DDD / Clean Architecture",description:"\u30C9\u30E1\u30A4\u30F3\u99C6\u52D5\u8A2D\u8A08 + Clean Architecture"}],Aq=[".cursor/mcp.json",".cursor/mcp.json.bak",".mcp.json",".mcp.json.bak",".codex/config.toml",".codex/config.toml.bak",".env",".cursor/commands/godd-dev.md",".claude/commands/godd-dev.md",".agents/skills/godd-dev/SKILL.md"],CC="<!-- GoDD managed command: godd-dev -->",Rq=`${CC}
|
|
303
|
+
config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,qe=Zq([...k]);(0,_e.writeFileSync)(Q,qe,"utf-8"),console.log(`
|
|
304
|
+
\u2713 config.godd \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${Q}`);let Be=(0,fe.join)((0,fe.dirname)(Q),".env");GC(Be,s?null:g,u,h),console.log(`\u2713 .env \u3092\u66F4\u65B0\u3057\u307E\u3057\u305F: ${Be}`),DC(e)?console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 GoDD \u306E\u79D8\u5BC6\u8A2D\u5B9A\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059");let Cn=!1;if((await Dr(".cursor/mcp.json / .mcp.json / .codex/config.toml\uFF08\u5BFE\u5FDC\u5A92\u4F53\u306E MCP \u8A2D\u5B9A\uFF09\u3092\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: ")).toLowerCase()!=="n"){let ie=lT(s?null:g,u,h),$t=(await Dr("Headroom\uFF08\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u5727\u7E2E MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F \u4E8B\u524D\u306B venv/pipx \u3067 headroom-ai[mcp] \u3092\u5C0E\u5165\u3057\u3066\u304F\u3060\u3055\u3044 [y/N]: ")).toLowerCase()==="y";$t&&console.log(` \u6CE8\u610F: ${HC()}`);let Et=(await Dr("agent-browser\uFF08\u30D6\u30E9\u30A6\u30B6\u64CD\u4F5C MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F \u30D6\u30E9\u30A6\u30B6\u81EA\u52D5\u64CD\u4F5C\u306B\u52A0\u3048 JavaScript \u5B9F\u884C\uFF08eval, \u8A8D\u8A3C\u6E08\u307F\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u4F5C\u7528\uFF09\u3092\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3078\u8A31\u53EF\u3057\u307E\u3059\u3002\u4E8B\u524D\u306B `npm install -g agent-browser && agent-browser install` \u304C\u5FC5\u8981\u3067\u3059 [y/N]: ")).toLowerCase()==="y",_r=(await Dr("TypeUI\uFF08\u30C7\u30B6\u30A4\u30F3\u30B9\u30AD\u30EB / UI \u30D7\u30ED\u30F3\u30D7\u30C8 MCP\uFF09\u3082\u767B\u9332\u3057\u307E\u3059\u304B\uFF1F UI \u751F\u6210\u54C1\u8CEA\uFF08\u8131\u30FBAI \u611F\uFF09\u3092\u9AD8\u3081\u308B\u30C7\u30B6\u30A4\u30F3\u30AC\u30A4\u30C0\u30F3\u30B9\u3092\u6CE8\u5165\u3057\u307E\u3059\u3002\u30DB\u30B9\u30C8\u578B\u30B5\u30FC\u30D0\u30FC\uFF08https://mcp.typeui.sh\uFF09\u3067\u3001\u521D\u56DE\u5229\u7528\u6642\u306B TypeUI \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30B5\u30A4\u30F3\u30A4\u30F3\u304C\u5FC5\u8981\u3067\u3059 [y/N]: ")).toLowerCase()==="y",Ip="";_r&&(Ip=await Dr(" TypeUI \u3092\u72EC\u81EA\u30DB\u30B9\u30C8/\u30C8\u30FC\u30AF\u30F3\u8A8D\u8A3C\u3067\u4F7F\u3046\u5834\u5408\u306F Bearer \u30C8\u30FC\u30AF\u30F3\u3092\u5165\u529B \uFF08\u901A\u5E38\u306F\u7A7A Enter \u3067 OAuth \u5BFE\u8A71\u30B5\u30A4\u30F3\u30A4\u30F3\uFF09: "));let us={godd:Ly((0,fe.resolve)(Q),ie)};$t&&(us.headroom=VC()),Et&&(us["agent-browser"]=WC()),_r&&(us.typeui=KC(void 0,Ip));let co=await eT(h,g,{deviceToken:s});co.action==="add"&&(us[jt]=co.entry);let BA=co.action==="remove"?[jt]:[],VA=co.action==="remove"&&co.reason==="device-token"?XC:void 0,zp=!1,a_=!1,c_=!1,HA=oT(e,us),u_=0;for(let tr of HA){if(tr.path===tr.userGlobalPath){console.log(`
|
|
305
|
+
\u26A0 \u30E6\u30FC\u30B6\u30FC\u30B0\u30ED\u30FC\u30D0\u30EB\u306E MCP \u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3057\u306A\u3044\u305F\u3081\u3001${tr.label} \u306B\u306F\u66F8\u304D\u8FBC\u307F\u307E\u305B\u3093\u3002`),console.log(` \u4EE5\u4E0B\u306E\u30D6\u30ED\u30C3\u30AF\u3092\u624B\u52D5\u3067 ${tr.userGlobalPath} \u306E mcpServers \u306B\u8FFD\u8A18\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
306
|
+
`),console.log(JSON.stringify(tr.servers,null,2)),console.log("");continue}let{backupPath:f_,removed:WA,kept:KA}=iT(tr.path,tr.servers,BA,VA);co.action==="add"&&(zp=!0),WA.length>0&&(a_=!0),KA.length>0&&(c_=!0),f_&&(console.warn(`\u26A0 \u65E2\u5B58\u306E ${tr.path} \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u3092\u9000\u907F\u3057\u3001\u9078\u629E\u3057\u305F MCP \u30A8\u30F3\u30C8\u30EA\u306E\u307F\u3067\u518D\u751F\u6210\u3057\u307E\u3059\u3002`),console.warn(` \u9000\u907F\u5148: ${f_}\uFF08\u5FC5\u8981\u306A\u30A8\u30F3\u30C8\u30EA\u306F\u624B\u52D5\u3067\u30DE\u30FC\u30B8\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`)),console.log(`\u2713 ${tr.label} \u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${tr.path}`),u_+=1}let l_=jC(e,(0,fe.resolve)(Q),ie);console.log(l_?`\u2713 Codex MCP \u8A2D\u5B9A\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${l_}`:"\u2713 \u65E2\u5B58\u306E Codex config.toml \u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\u3067\u3057\u305F");let p_=OC(e);if(p_.length>0)for(let tr of p_)console.log(`\u2713 /godd-dev \u30B3\u30DE\u30F3\u30C9\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${tr}`);else console.log("\u2713 /godd-dev \u30B3\u30DE\u30F3\u30C9\u306F\u65E2\u5B58\u306E\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u3092\u4FDD\u6301\u3057\u307E\u3057\u305F");let d_=NC(e);console.log(d_?`\u2713 Codex \u30B9\u30AD\u30EB\u3092\u751F\u6210\u3057\u307E\u3057\u305F: ${d_}`:"\u2713 \u65E2\u5B58\u306E Codex godd-dev \u30B9\u30AD\u30EB\u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\u3067\u3057\u305F"),u_>0&&($t&&console.log("\u2713 Headroom MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08proxy \u9023\u643A\u306F\u4EFB\u610F\uFF09"),Et&&console.log("\u2713 agent-browser MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u8981 `npm install -g agent-browser && agent-browser install`\uFF09"),_r&&console.log(Ip?"\u2713 TypeUI MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u30DB\u30B9\u30C8\u578B\u30FBAuthorization: Bearer \u30D8\u30C3\u30C0\u3067\u8A8D\u8A3C\uFF09":"\u2713 TypeUI MCP \u3092\u767B\u9332\u3057\u307E\u3057\u305F\uFF08\u30DB\u30B9\u30C8\u578B\u30FB\u521D\u56DE\u5229\u7528\u6642\u306B OAuth \u3067 TypeUI \u30A2\u30AB\u30A6\u30F3\u30C8\u3078\u30B5\u30A4\u30F3\u30A4\u30F3\uFF09"));let cc=tT(co,{written:zp,removed:a_,kept:c_},g);cc&&(cc.startsWith("\u26A0")?console.warn(cc):console.log(cc)),Cn=zp}console.log(`
|
|
307
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`),console.log("\u2551 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. Cursor: IDE \u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 2. Claude Code: \u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3067 `claude` \u3092\u8D77\u52D5\u3057\u3001"),console.log(" \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B9\u30B3\u30FC\u30D7 MCP\uFF08.mcp.json\uFF09\u306E\u627F\u8A8D\u30C0\u30A4\u30A2\u30ED\u30B0\u3067 godd \u3092\u627F\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" \uFF08\u521D\u56DE\u306F\u627F\u8A8D\u3059\u308B\u307E\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002`claude mcp list` \u3067\u72B6\u614B\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09"),console.log(" 3. Codex: `/mcp` \u3067 godd \u304C\u63A5\u7D9A\u6E08\u307F\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(" 4. \u30C1\u30E3\u30C3\u30C8\u3067 GoDD MCP \u30C4\u30FC\u30EB\u304C\u4F7F\u3048\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3059"),console.log(" - godd-dev: \u958B\u767A\u652F\u63F4"),console.log(" - /godd-dev: Cursor / Claude Code \u5171\u901A\u306E\u76F4\u63A5\u30B3\u30DE\u30F3\u30C9"),console.log(" - godd-check: \u30B3\u30FC\u30C9\u30C1\u30A7\u30C3\u30AF"),console.log(" - godd-review: \u30B3\u30FC\u30C9\u30EC\u30D3\u30E5\u30FC"),console.log(" - godd-setup: \u74B0\u5883\u69CB\u7BC9\u652F\u63F4"),console.log(" \u4ED6 12 \u30C4\u30FC\u30EB"),Cn&&(console.log(` 5. Google \u9023\u643A: IDE / Claude Code \u3092\u518D\u8D77\u52D5\u3057\u3001/mcp \u3067 ${jt} \u304C connected \u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044`),console.log(` \uFF08Claude Code \u306F godd \u3068\u540C\u3058\u304F\u521D\u56DE\u306B ${jt} \u306E\u627F\u8A8D\u304C\u5FC5\u8981\u3067\u3059\uFF09`)),y&&(console.log(""),console.log(`\u30ED\u30B0\u30A4\u30F3: Google\uFF08${y.email??"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u4E0D\u660E"}\uFF09\u3002\u30E9\u30A4\u30BB\u30F3\u30B9\u30AD\u30FC\u306F .env / MCP \u8A2D\u5B9A\u306B\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002`),console.log(` \u30ED\u30B0\u30A4\u30F3\u60C5\u5831: ${Mn()}`),console.log(" \u30ED\u30B0\u30A4\u30F3\u304C\u5207\u308C\u305F\u3089 godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002Drive \u3092\u672C\u4EBA\u306E\u6A29\u9650\u3067\u8AAD\u3080\u5834\u5408\u306F godd login --drive \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002")),console.log(""),console.log("\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u63A8\u5968\u8A2D\u5B9A:"),console.log(" \u79D8\u5BC6\u60C5\u5831\u6F0F\u6D29\u9632\u6B62\u306E\u305F\u3081\u3001\u500B\u4EBA\u306E ~/.gitignore_global \u306B\u4EE5\u4E0B\u3092\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u3092\u63A8\u5968\u3057\u307E\u3059:"),console.log(" git config --global core.excludesFile ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json' >> ~/.gitignore_global"),console.log(" echo '.cursor/mcp.json.bak' >> ~/.gitignore_global"),console.log(" echo '.mcp.json' >> ~/.gitignore_global"),console.log(" echo '.mcp.json.bak' >> ~/.gitignore_global"),console.log(""),AC.close()}function Bq(){try{return __goddBundleUrl}catch{return}}var $C,_e,fe,PC,EC,jy,Rq,CC,Iq,TC,zq,Dq,AC,kC,My,Oq,Nq,qC,FC,Uq,jt,JC,Gq,fT=b(()=>{"use strict";$C=yt(require("node:readline"),1),_e=require("node:fs"),fe=require("node:path"),PC=require("node:url"),EC=require("node:os");Ls();Tf();ug();Sy();$y();Ln();Cy();Ci();yp();Kr();Fa();jy=[{id:"",name:"python",category:"language",label:"Python",description:"\u6C4E\u7528\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"typescript",category:"language",label:"TypeScript",description:"\u578B\u5B89\u5168\u306A JavaScript \u30B9\u30FC\u30D1\u30FC\u30BB\u30C3\u30C8"},{id:"",name:"javascript",category:"language",label:"JavaScript",description:"\u52D5\u7684\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E (ES2024+)"},{id:"",name:"go",category:"language",label:"Go",description:"\u9759\u7684\u578B\u4ED8\u3051\u30B3\u30F3\u30D1\u30A4\u30EB\u8A00\u8A9E"},{id:"",name:"php",category:"language",label:"PHP",description:"\u6C4E\u7528\u30B9\u30AF\u30EA\u30D7\u30C8\u8A00\u8A9E"},{id:"",name:"ruby",category:"language",label:"Ruby",description:"\u52D5\u7684\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u6307\u5411\u8A00\u8A9E"},{id:"",name:"c",category:"language",label:"C",description:"\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E"},{id:"",name:"html",category:"language",label:"HTML",description:"HyperText Markup Language"},{id:"",name:"css",category:"language",label:"CSS",description:"Cascading Style Sheets"},{id:"",name:"react",category:"frontend",label:"React",description:"React UI \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"nextjs",category:"frontend",label:"Next.js",description:"React \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (SSR/SSG/ISR)"},{id:"",name:"vue",category:"frontend",label:"Vue.js",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 JavaScript \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"angular",category:"frontend",label:"Angular",description:"TypeScript \u30D9\u30FC\u30B9 Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"svelte",category:"frontend",label:"Svelte",description:"\u30B3\u30F3\u30D1\u30A4\u30EB\u6642 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"vite",category:"frontend",label:"Vite",description:"\u9AD8\u901F\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9\u30C4\u30FC\u30EB"},{id:"",name:"tailwind",category:"frontend",label:"Tailwind CSS",description:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u30D5\u30A1\u30FC\u30B9\u30C8 CSS"},{id:"",name:"sass",category:"frontend",label:"Sass",description:"CSS \u30D7\u30EA\u30D7\u30ED\u30BB\u30C3\u30B5"},{id:"",name:"emotion",category:"frontend",label:"Emotion",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"styled-components",category:"frontend",label:"styled-components",description:"CSS-in-JS \u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"mui",category:"frontend",label:"MUI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"chakra-ui",category:"frontend",label:"Chakra UI",description:"React UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30E9\u30A4\u30D6\u30E9\u30EA"},{id:"",name:"electron",category:"frontend",label:"Electron",description:"\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30A2\u30D7\u30EA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastapi",category:"backend",label:"FastAPI",description:"\u9AD8\u901F Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"django",category:"backend",label:"Django",description:"Python Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (batteries included)"},{id:"",name:"flask",category:"backend",label:"Flask",description:"Python \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"express",category:"backend",label:"Express",description:"\u6700\u5C0F\u9650\u306E Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fastify",category:"backend",label:"Fastify",description:"\u9AD8\u901F Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"nestjs",category:"backend",label:"NestJS",description:"\u30D7\u30ED\u30B0\u30EC\u30C3\u30B7\u30D6 Node.js \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"gin",category:"backend",label:"Gin",description:"Go HTTP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"echo",category:"backend",label:"Echo",description:"\u9AD8\u6027\u80FD Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"fiber",category:"backend",label:"Fiber",description:"Express \u98A8 Go Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"laravel",category:"backend",label:"Laravel",description:"PHP Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"symfony",category:"backend",label:"Symfony",description:"PHP \u30A8\u30F3\u30BF\u30FC\u30D7\u30E9\u30A4\u30BA\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"wordpress",category:"backend",label:"WordPress",description:"PHP CMS \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"rails",category:"backend",label:"Ruby on Rails",description:"Ruby Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF (MVC)"},{id:"",name:"sinatra",category:"backend",label:"Sinatra",description:"Ruby \u30DE\u30A4\u30AF\u30ED Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"koa",category:"backend",label:"Koa",description:"\u6B21\u4E16\u4EE3 Node.js Web \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF"},{id:"",name:"node",category:"runtime",label:"Node.js",description:"config.godd \u767B\u9332\u7528\u306E JavaScript \u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"agent-stdio",category:"runtime",label:"Agent Stdio",description:"config.godd \u767B\u9332\u7528\u306E MCP Agent stdio \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8"},{id:"",name:"postgresql",category:"database",label:"PostgreSQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mysql",category:"database",label:"MySQL",description:"\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9 RDB"},{id:"",name:"mongodb",category:"database",label:"MongoDB",description:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u6307\u5411 NoSQL DB"},{id:"",name:"redis",category:"database",label:"Redis",description:"\u30A4\u30F3\u30E1\u30E2\u30EA KVS / \u30AD\u30E3\u30C3\u30B7\u30E5"},{id:"",name:"sqlalchemy",category:"backend",label:"SQLAlchemy",description:"Python SQL \u30C4\u30FC\u30EB\u30AD\u30C3\u30C8 + ORM"},{id:"",name:"celery",category:"backend",label:"Celery",description:"\u5206\u6563\u30BF\u30B9\u30AF\u30AD\u30E5\u30FC"},{id:"",name:"docker",category:"infra",label:"Docker",description:"\u30B3\u30F3\u30C6\u30CA\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0"},{id:"",name:"terraform",category:"infra",label:"Terraform",description:"IaC \u30C4\u30FC\u30EB (HashiCorp)"},{id:"",name:"ddd-clean-architecture",category:"architecture",label:"DDD / Clean Architecture",description:"\u30C9\u30E1\u30A4\u30F3\u99C6\u52D5\u8A2D\u8A08 + Clean Architecture"}],Rq=[".cursor/mcp.json",".cursor/mcp.json.bak",".mcp.json",".mcp.json.bak",".codex/config.toml",".codex/config.toml.bak",".env",".cursor/commands/godd-dev.md",".claude/commands/godd-dev.md",".agents/skills/godd-dev/SKILL.md"],CC="<!-- GoDD managed command: godd-dev -->",Iq=`${CC}
|
|
307
308
|
# GoDD \u958B\u767A
|
|
308
309
|
|
|
309
310
|
\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u6B63\u5F0F\u306A\u958B\u767A\u5165\u53E3\u3067\u3059\u3002
|
|
@@ -311,7 +312,7 @@ config.godd \u306E\u4FDD\u5B58\u5148 (default: ${t}): `)||t,qe=Lq([...k]);(0,_e.
|
|
|
311
312
|
\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u306E\u5F8C\u306B\u5165\u529B\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30FC\u306E\u4F9D\u983C\u3092 \`task\` \u3068\u3057\u3066\u3001GoDD MCP Server \u306E \`godd-dev\` \u30C4\u30FC\u30EB\uFF08\u30E1\u30F3\u30B7\u30E7\u30F3\u8868\u8A18: \`@godd-dev\`\uFF09\u3078\u76F4\u3061\u306B\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002MCP \u30C4\u30FC\u30EB\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u304C\u8FD4\u308B\u524D\u306B\u3001\u81EA\u5206\u3067\u5B9F\u88C5\u30FB\u7DE8\u96C6\u30FB\u30D6\u30E9\u30F3\u30C1\u4F5C\u6210\u3092\u59CB\u3081\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
312
313
|
|
|
313
314
|
Issue \u756A\u53F7\u3001\u5B8C\u4E86\u6761\u4EF6\u3001\u5236\u7D04\u3001\u56DE\u7B54\u306A\u3069\u3001\u30B3\u30DE\u30F3\u30C9\u306E\u5F8C\u306B\u5165\u529B\u3055\u308C\u305F\u5185\u5BB9\u306F\u7701\u7565\u305B\u305A\u305D\u306E\u307E\u307E \`task\` \u306B\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\`godd-dev\` \u306E\u8FD4\u3057\u305F\u958B\u767A\u30D5\u30ED\u30FC\uFF08\u4ED5\u69D8\u78BA\u8A8D\u3001ATDD\u3001\u5B9F\u88C5\u3001\u54C1\u8CEA\u30B2\u30FC\u30C8\u3001\u8CAC\u52D9\u5225\u30B3\u30DF\u30C3\u30C8\uFF09\u306B\u5F93\u3063\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
314
|
-
`,TC="<!-- GoDD managed skill: godd-dev -->",
|
|
315
|
+
`,TC="<!-- GoDD managed skill: godd-dev -->",zq=`---
|
|
315
316
|
name: godd-dev
|
|
316
317
|
description: Run the GoDD development workflow for an Issue or implementation request. Use when the user asks to implement an Issue, start development with GoDD, or invokes /godd-dev or $godd-dev.
|
|
317
318
|
---
|
|
@@ -322,17 +323,17 @@ ${TC}
|
|
|
322
323
|
Codex \u306E\u6B63\u5F0F\u306A GoDD \u958B\u767A\u5165\u53E3\u3067\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306E\u4F9D\u983C\u3092 \`task\` \u3068\u3057\u3066\u3001GoDD MCP Server \u306E \`godd-dev\` \u30C4\u30FC\u30EB\u3092\u6700\u521D\u306B\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002MCP \u30C4\u30FC\u30EB\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u304C\u8FD4\u308B\u524D\u306B\u3001\u81EA\u5206\u3067\u5B9F\u88C5\u30FB\u7DE8\u96C6\u30FB\u30D6\u30E9\u30F3\u30C1\u4F5C\u6210\u3092\u59CB\u3081\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
323
324
|
|
|
324
325
|
Issue \u756A\u53F7\u3001\u5B8C\u4E86\u6761\u4EF6\u3001\u5236\u7D04\u3001\u56DE\u7B54\u306A\u3069\u3001\u30E6\u30FC\u30B6\u30FC\u304C\u5165\u529B\u3057\u305F\u5185\u5BB9\u306F\u7701\u7565\u305B\u305A \`task\` \u306B\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\`godd-dev\` \u306E\u8FD4\u3057\u305F\u958B\u767A\u30D5\u30ED\u30FC\uFF08\u4ED5\u69D8\u78BA\u8A8D\u3001ATDD\u3001\u5B9F\u88C5\u3001\u54C1\u8CEA\u30B2\u30FC\u30C8\u3001\u8CAC\u52D9\u5225\u30B3\u30DF\u30C3\u30C8\uFF09\u306B\u5F93\u3063\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
325
|
-
`,zq=[(0,fe.join)(".cursor","commands","godd-dev.md"),(0,fe.join)(".claude","commands","godd-dev.md")],AC=$C.createInterface({input:process.stdin,output:process.stdout});kC="# GoDD managed Codex MCP configuration";My={language:"\u8A00\u8A9E","frontend-ui":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","frontend-css":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 CSS","frontend-build":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",frontend:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6","backend-api":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 API \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","backend-orm":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 ORM / DB \u30C4\u30FC\u30EB","backend-task":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC",backend:"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6",runtime:"\u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\uFF08\u4EFB\u610F\u30FB\u8907\u6570\u53EF\uFF09",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"};Dq={fastapi:["python"],django:["python"],flask:["python"],sqlalchemy:["python"],celery:["python"],express:["typescript","javascript"],fastify:["typescript","javascript"],nestjs:["typescript","javascript"],koa:["typescript","javascript"],gin:["go"],echo:["go"],fiber:["go"],laravel:["php"],symfony:["php"],wordpress:["php"],rails:["ruby"],sinatra:["ruby"],react:["typescript","javascript"],nextjs:["typescript","javascript"],vue:["typescript","javascript"],angular:["typescript","javascript"],svelte:["typescript","javascript"],vite:["typescript","javascript"],electron:["typescript","javascript"],emotion:["typescript","javascript"],"styled-components":["typescript","javascript"],mui:["typescript","javascript"],"chakra-ui":["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},Oq={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",mui:"frontend-ui","chakra-ui":"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",emotion:"frontend-css","styled-components":"frontend-css",vite:"frontend-build",fastapi:"backend-api",django:"backend-api",flask:"backend-api",express:"backend-api",fastify:"backend-api",nestjs:"backend-api",gin:"backend-api",echo:"backend-api",fiber:"backend-api",laravel:"backend-api",symfony:"backend-api",wordpress:"backend-api",rails:"backend-api",sinatra:"backend-api",koa:"backend-api",sqlalchemy:"backend-orm",celery:"backend-task"};qC="# GoDD MCP Server (managed by godd init)",FC="# GODD_LICENSE_KEY \u306F\u672A\u8A2D\u5B9A\uFF08godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u7528\uFF09",Zq=new Set([qC,FC]);jt="ripla-google",JC=5e3;Fq=new Set(["google","g"]);mu(process.env,process.argv[1],Gq())&&pT().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});function vp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function hT(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...vp(t.headers),...vp(n.headers)}:t.headers};return e(r,o)}:e}var mT=b(()=>{});async function Bq(e){return(await Zy).getRandomValues(new Uint8Array(e))}async function Vq(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await Bq(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function Hq(e){return await Vq(e)}async function Wq(e){let t=await(await Zy).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Uy(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Hq(e),r=await Wq(t);return{code_verifier:t,code_challenge:r}}var Zy,gT=b(()=>{Zy=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto)});var gt,_T,qy,Kq,vT,wT,bT,yT,Jq,Yq,xT,See,$ee,Fy=b(()=>{jd();gt=Ob().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Vb.custom,message:"URL must be parseable",fatal:!0}),dc}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),_T=Xe({resource:_().url(),authorization_servers:T(gt).optional(),jwks_uri:_().url().optional(),scopes_supported:T(_()).optional(),bearer_methods_supported:T(_()).optional(),resource_signing_alg_values_supported:T(_()).optional(),resource_name:_().optional(),resource_documentation:_().optional(),resource_policy_uri:_().url().optional(),resource_tos_uri:_().url().optional(),tls_client_certificate_bound_access_tokens:be().optional(),authorization_details_types_supported:T(_()).optional(),dpop_signing_alg_values_supported:T(_()).optional(),dpop_bound_access_tokens_required:be().optional()}),qy=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),service_documentation:gt.optional(),revocation_endpoint:gt.optional(),revocation_endpoint_auth_methods_supported:T(_()).optional(),revocation_endpoint_auth_signing_alg_values_supported:T(_()).optional(),introspection_endpoint:_().optional(),introspection_endpoint_auth_methods_supported:T(_()).optional(),introspection_endpoint_auth_signing_alg_values_supported:T(_()).optional(),code_challenge_methods_supported:T(_()).optional(),client_id_metadata_document_supported:be().optional()}),Kq=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,userinfo_endpoint:gt.optional(),jwks_uri:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),acr_values_supported:T(_()).optional(),subject_types_supported:T(_()),id_token_signing_alg_values_supported:T(_()),id_token_encryption_alg_values_supported:T(_()).optional(),id_token_encryption_enc_values_supported:T(_()).optional(),userinfo_signing_alg_values_supported:T(_()).optional(),userinfo_encryption_alg_values_supported:T(_()).optional(),userinfo_encryption_enc_values_supported:T(_()).optional(),request_object_signing_alg_values_supported:T(_()).optional(),request_object_encryption_alg_values_supported:T(_()).optional(),request_object_encryption_enc_values_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),display_values_supported:T(_()).optional(),claim_types_supported:T(_()).optional(),claims_supported:T(_()).optional(),service_documentation:_().optional(),claims_locales_supported:T(_()).optional(),ui_locales_supported:T(_()).optional(),claims_parameter_supported:be().optional(),request_parameter_supported:be().optional(),request_uri_parameter_supported:be().optional(),require_request_uri_registration:be().optional(),op_policy_uri:gt.optional(),op_tos_uri:gt.optional(),client_id_metadata_document_supported:be().optional()}),vT=A({...Kq.shape,...qy.pick({code_challenge_methods_supported:!0}).shape}),wT=A({access_token:_(),id_token:_().optional(),token_type:_(),expires_in:Dc.number().optional(),scope:_().optional(),refresh_token:_().optional()}).strip(),bT=A({error:_(),error_description:_().optional(),error_uri:_().optional()}),yT=gt.optional().or(O("").transform(()=>{})),Jq=A({redirect_uris:T(gt),token_endpoint_auth_method:_().optional(),grant_types:T(_()).optional(),response_types:T(_()).optional(),client_name:_().optional(),client_uri:gt.optional(),logo_uri:yT,scope:_().optional(),contacts:T(_()).optional(),tos_uri:yT,policy_uri:_().optional(),jwks_uri:gt.optional(),jwks:jb().optional(),software_id:_().optional(),software_version:_().optional(),software_statement:_().optional()}).strip(),Yq=A({client_id:_(),client_secret:_().optional(),client_id_issued_at:de().optional(),client_secret_expires_at:de().optional()}).strip(),xT=Jq.merge(Yq),See=A({error:_(),error_description:_().optional()}).strip(),$ee=A({token:_(),token_type_hint:_().optional()}).strip()});function kT(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function ST({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var $T=b(()=>{});var Ge,Ga,Qo,Xo,ei,Ba,Va,Ha,Sn,Wa,Ka,Ja,Ya,Qa,Xa,ti,ec,tc,PT,ET=b(()=>{Ge=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Ga=class extends Ge{};Ga.errorCode="invalid_request";Qo=class extends Ge{};Qo.errorCode="invalid_client";Xo=class extends Ge{};Xo.errorCode="invalid_grant";ei=class extends Ge{};ei.errorCode="unauthorized_client";Ba=class extends Ge{};Ba.errorCode="unsupported_grant_type";Va=class extends Ge{};Va.errorCode="invalid_scope";Ha=class extends Ge{};Ha.errorCode="access_denied";Sn=class extends Ge{};Sn.errorCode="server_error";Wa=class extends Ge{};Wa.errorCode="temporarily_unavailable";Ka=class extends Ge{};Ka.errorCode="unsupported_response_type";Ja=class extends Ge{};Ja.errorCode="unsupported_token_type";Ya=class extends Ge{};Ya.errorCode="invalid_token";Qa=class extends Ge{};Qa.errorCode="method_not_allowed";Xa=class extends Ge{};Xa.errorCode="too_many_requests";ti=class extends Ge{};ti.errorCode="invalid_client_metadata";ec=class extends Ge{};ec.errorCode="insufficient_scope";tc=class extends Ge{};tc.errorCode="invalid_target";PT={[Ga.errorCode]:Ga,[Qo.errorCode]:Qo,[Xo.errorCode]:Xo,[ei.errorCode]:ei,[Ba.errorCode]:Ba,[Va.errorCode]:Va,[Ha.errorCode]:Ha,[Sn.errorCode]:Sn,[Wa.errorCode]:Wa,[Ka.errorCode]:Ka,[Ja.errorCode]:Ja,[Ya.errorCode]:Ya,[Qa.errorCode]:Qa,[Xa.errorCode]:Xa,[ti.errorCode]:ti,[ec.errorCode]:ec,[tc.errorCode]:tc}});function Qq(e){return["client_secret_basic","client_secret_post","none"].includes(e)}function Xq(e,t){let r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Qq(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function eF(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":tF(o,i,r);return;case"client_secret_post":rF(o,i,n);return;case"none":nF(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function tF(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function rF(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function nF(e,t){t.set("client_id",e)}async function TT(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=bT.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:s}=n,a=PT[o]||Sn;return new a(i||"",s)}catch(n){let o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new Sn(o)}}async function rc(e,t){try{return await Vy(e,t)}catch(r){if(r instanceof Qo||r instanceof ei)return await e.invalidateCredentials?.("all"),await Vy(e,t);if(r instanceof Xo)return await e.invalidateCredentials?.("tokens"),await Vy(e,t);throw r}}async function Vy(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let s,a;try{s=await sF(t,{resourceMetadataUrl:o},i),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=new URL("/",t));let c=await iF(t,e,s),u=await pF(a,{fetchFn:i}),p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let y=u?.client_id_metadata_document_supported===!0,v=e.clientMetadataUrl;if(v&&!oF(v))throw new ti(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${v}`);if(y&&v)p={client_id:v},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await gF(a,{metadata:u,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(x),p=x}}let l=!e.redirectUrl;if(r!==void 0||l){let y=await mF(e,a,{metadata:u,resource:c,authorizationCode:r,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}let d=await e.tokens();if(d?.refresh_token)try{let y=await hF(a,{metadata:u,clientInformation:p,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}catch(y){if(!(!(y instanceof Ge)||y instanceof Sn))throw y}let f=e.state?await e.state():void 0,{authorizationUrl:h,codeVerifier:g}=await dF(a,{metadata:u,clientInformation:p,state:f,redirectUrl:e.redirectUrl,scope:n||s?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(h),"REDIRECT"}function oF(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function iF(e,t,r){let n=kT(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!ST({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function Wy(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=Hy(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let s=Hy(e,"scope")||void 0,a=Hy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function Hy(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function sF(e,t,r=fetch){let n=await uF(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return _T.parse(await n.json())}async function Ky(e,t,r=fetch){try{return await r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?Ky(e,void 0,r):void 0;throw n}}function aF(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function CT(e,t,r=fetch){return await Ky(e,{"MCP-Protocol-Version":t},r)}function cF(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function uF(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??li,s;if(n?.metadataUrl)s=new URL(n.metadataUrl);else{let c=aF(t,o.pathname);s=new URL(c,n?.metadataServerUrl??o),s.search=o.search}let a=await CT(s,i,r);if(!n?.metadataUrl&&cF(a,o.pathname)){let c=new URL(`/.well-known/${t}`,o);a=await CT(c,i,r)}return a}function lF(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function pF(e,{fetchFn:t=fetch,protocolVersion:r=li}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=lF(e);for(let{url:i,type:s}of o){let a=await Ky(i,n,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?qy.parse(await a.json()):vT.parse(await a.json())}}}async function dF(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Gy))throw new Error(`Incompatible auth server: does not support response type ${Gy}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(By))throw new Error(`Incompatible auth server: does not support code challenge method ${By}`)}else a=new URL("/authorize",e);let c=await Uy(),u=c.code_verifier,p=c.code_challenge;return a.searchParams.set("response_type",Gy),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",p),a.searchParams.set("code_challenge_method",By),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:u}}function fF(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function AT(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),o)await o(c,r,a,t);else if(n){let p=t?.token_endpoint_auth_methods_supported??[],l=Xq(n,p);eF(l,n,c,r)}let u=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!u.ok)throw await TT(u);return wT.parse(await u.json())}async function hF(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await AT(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:s});return{refresh_token:n,...c}}async function mF(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let s=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(s)),!a){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let u=await e.codeVerifier();a=fF(o,u,e.redirectUrl)}let c=await e.clientInformation();return AT(t,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function gF(e,{metadata:t,clientMetadata:r,fetchFn:n}){let o;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);let i=await(n??fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await TT(i);return xT.parse(await i.json())}var $n,Gy,By,RT=b(()=>{gT();An();Fy();Fy();$T();ET();$n=class extends Error{constructor(t){super(t??"Unauthorized")}};Gy="code",By="S256"});function Jy(e){}function IT(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Jy,onError:r=Jy,onRetry:n=Jy,onComment:o}=e,i="",s=!0,a,c="",u="";function p(g){let y=s?g.replace(/^\xEF\xBB\xBF/,""):g,[v,w]=yF(`${i}${y}`);for(let x of v)l(x);i=w,s=!1}function l(g){if(g===""){f();return}if(g.startsWith(":")){o&&o(g.slice(g.startsWith(": ")?2:1));return}let y=g.indexOf(":");if(y!==-1){let v=g.slice(0,y),w=g[y+1]===" "?2:1,x=g.slice(y+w);d(v,x,g);return}d(g,"",g)}function d(g,y,v){switch(g){case"event":u=y;break;case"data":c=`${c}${y}
|
|
326
|
+
`,Dq=[(0,fe.join)(".cursor","commands","godd-dev.md"),(0,fe.join)(".claude","commands","godd-dev.md")],AC=$C.createInterface({input:process.stdin,output:process.stdout});kC="# GoDD managed Codex MCP configuration";My={language:"\u8A00\u8A9E","frontend-ui":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 UI \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","frontend-css":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 CSS","frontend-build":"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u30D3\u30EB\u30C9\u30C4\u30FC\u30EB",frontend:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6","backend-api":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 API \u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF","backend-orm":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 ORM / DB \u30C4\u30FC\u30EB","backend-task":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u30BF\u30B9\u30AF\u30AD\u30E5\u30FC",backend:"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9 \u2014 \u305D\u306E\u4ED6",runtime:"\u5B9F\u884C\u74B0\u5883\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\uFF08\u4EFB\u610F\u30FB\u8907\u6570\u53EF\uFF09",database:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",infra:"\u30A4\u30F3\u30D5\u30E9",architecture:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"};Oq={fastapi:["python"],django:["python"],flask:["python"],sqlalchemy:["python"],celery:["python"],express:["typescript","javascript"],fastify:["typescript","javascript"],nestjs:["typescript","javascript"],koa:["typescript","javascript"],gin:["go"],echo:["go"],fiber:["go"],laravel:["php"],symfony:["php"],wordpress:["php"],rails:["ruby"],sinatra:["ruby"],react:["typescript","javascript"],nextjs:["typescript","javascript"],vue:["typescript","javascript"],angular:["typescript","javascript"],svelte:["typescript","javascript"],vite:["typescript","javascript"],electron:["typescript","javascript"],emotion:["typescript","javascript"],"styled-components":["typescript","javascript"],mui:["typescript","javascript"],"chakra-ui":["typescript","javascript"],tailwind:[],sass:[],node:["typescript","javascript"],"agent-stdio":[]},Nq={react:"frontend-ui",nextjs:"frontend-ui",vue:"frontend-ui",angular:"frontend-ui",svelte:"frontend-ui",electron:"frontend-ui",mui:"frontend-ui","chakra-ui":"frontend-ui",tailwind:"frontend-css",sass:"frontend-css",emotion:"frontend-css","styled-components":"frontend-css",vite:"frontend-build",fastapi:"backend-api",django:"backend-api",flask:"backend-api",express:"backend-api",fastify:"backend-api",nestjs:"backend-api",gin:"backend-api",echo:"backend-api",fiber:"backend-api",laravel:"backend-api",symfony:"backend-api",wordpress:"backend-api",rails:"backend-api",sinatra:"backend-api",koa:"backend-api",sqlalchemy:"backend-orm",celery:"backend-task"};qC="# GoDD MCP Server (managed by godd init)",FC="# GODD_LICENSE_KEY \u306F\u672A\u8A2D\u5B9A\uFF08godd login \u3067\u4FDD\u5B58\u3057\u305F\u30ED\u30B0\u30A4\u30F3\u3092\u4F7F\u7528\uFF09",Uq=new Set([qC,FC]);jt="ripla-google",JC=5e3;Gq=new Set(["google","g"]);mu(process.env,process.argv[1],Bq())&&pT().catch(e=>{console.error("\u30A8\u30E9\u30FC:",e),process.exit(1)})});function vp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function hT(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...vp(t.headers),...vp(n.headers)}:t.headers};return e(r,o)}:e}var mT=b(()=>{});async function Vq(e){return(await Zy).getRandomValues(new Uint8Array(e))}async function Hq(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await Vq(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function Wq(e){return await Hq(e)}async function Kq(e){let t=await(await Zy).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Uy(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Wq(e),r=await Kq(t);return{code_verifier:t,code_challenge:r}}var Zy,gT=b(()=>{Zy=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto)});var gt,_T,qy,Jq,vT,wT,bT,yT,Yq,Qq,xT,Pee,Eee,Fy=b(()=>{jd();gt=Ob().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Vb.custom,message:"URL must be parseable",fatal:!0}),dc}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),_T=Xe({resource:_().url(),authorization_servers:T(gt).optional(),jwks_uri:_().url().optional(),scopes_supported:T(_()).optional(),bearer_methods_supported:T(_()).optional(),resource_signing_alg_values_supported:T(_()).optional(),resource_name:_().optional(),resource_documentation:_().optional(),resource_policy_uri:_().url().optional(),resource_tos_uri:_().url().optional(),tls_client_certificate_bound_access_tokens:be().optional(),authorization_details_types_supported:T(_()).optional(),dpop_signing_alg_values_supported:T(_()).optional(),dpop_bound_access_tokens_required:be().optional()}),qy=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),service_documentation:gt.optional(),revocation_endpoint:gt.optional(),revocation_endpoint_auth_methods_supported:T(_()).optional(),revocation_endpoint_auth_signing_alg_values_supported:T(_()).optional(),introspection_endpoint:_().optional(),introspection_endpoint_auth_methods_supported:T(_()).optional(),introspection_endpoint_auth_signing_alg_values_supported:T(_()).optional(),code_challenge_methods_supported:T(_()).optional(),client_id_metadata_document_supported:be().optional()}),Jq=Xe({issuer:_(),authorization_endpoint:gt,token_endpoint:gt,userinfo_endpoint:gt.optional(),jwks_uri:gt,registration_endpoint:gt.optional(),scopes_supported:T(_()).optional(),response_types_supported:T(_()),response_modes_supported:T(_()).optional(),grant_types_supported:T(_()).optional(),acr_values_supported:T(_()).optional(),subject_types_supported:T(_()),id_token_signing_alg_values_supported:T(_()),id_token_encryption_alg_values_supported:T(_()).optional(),id_token_encryption_enc_values_supported:T(_()).optional(),userinfo_signing_alg_values_supported:T(_()).optional(),userinfo_encryption_alg_values_supported:T(_()).optional(),userinfo_encryption_enc_values_supported:T(_()).optional(),request_object_signing_alg_values_supported:T(_()).optional(),request_object_encryption_alg_values_supported:T(_()).optional(),request_object_encryption_enc_values_supported:T(_()).optional(),token_endpoint_auth_methods_supported:T(_()).optional(),token_endpoint_auth_signing_alg_values_supported:T(_()).optional(),display_values_supported:T(_()).optional(),claim_types_supported:T(_()).optional(),claims_supported:T(_()).optional(),service_documentation:_().optional(),claims_locales_supported:T(_()).optional(),ui_locales_supported:T(_()).optional(),claims_parameter_supported:be().optional(),request_parameter_supported:be().optional(),request_uri_parameter_supported:be().optional(),require_request_uri_registration:be().optional(),op_policy_uri:gt.optional(),op_tos_uri:gt.optional(),client_id_metadata_document_supported:be().optional()}),vT=A({...Jq.shape,...qy.pick({code_challenge_methods_supported:!0}).shape}),wT=A({access_token:_(),id_token:_().optional(),token_type:_(),expires_in:Dc.number().optional(),scope:_().optional(),refresh_token:_().optional()}).strip(),bT=A({error:_(),error_description:_().optional(),error_uri:_().optional()}),yT=gt.optional().or(O("").transform(()=>{})),Yq=A({redirect_uris:T(gt),token_endpoint_auth_method:_().optional(),grant_types:T(_()).optional(),response_types:T(_()).optional(),client_name:_().optional(),client_uri:gt.optional(),logo_uri:yT,scope:_().optional(),contacts:T(_()).optional(),tos_uri:yT,policy_uri:_().optional(),jwks_uri:gt.optional(),jwks:jb().optional(),software_id:_().optional(),software_version:_().optional(),software_statement:_().optional()}).strip(),Qq=A({client_id:_(),client_secret:_().optional(),client_id_issued_at:de().optional(),client_secret_expires_at:de().optional()}).strip(),xT=Yq.merge(Qq),Pee=A({error:_(),error_description:_().optional()}).strip(),Eee=A({token:_(),token_type_hint:_().optional()}).strip()});function kT(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function ST({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var $T=b(()=>{});var Ge,Ga,Qo,Xo,ei,Ba,Va,Ha,$n,Wa,Ka,Ja,Ya,Qa,Xa,ti,ec,tc,PT,ET=b(()=>{Ge=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Ga=class extends Ge{};Ga.errorCode="invalid_request";Qo=class extends Ge{};Qo.errorCode="invalid_client";Xo=class extends Ge{};Xo.errorCode="invalid_grant";ei=class extends Ge{};ei.errorCode="unauthorized_client";Ba=class extends Ge{};Ba.errorCode="unsupported_grant_type";Va=class extends Ge{};Va.errorCode="invalid_scope";Ha=class extends Ge{};Ha.errorCode="access_denied";$n=class extends Ge{};$n.errorCode="server_error";Wa=class extends Ge{};Wa.errorCode="temporarily_unavailable";Ka=class extends Ge{};Ka.errorCode="unsupported_response_type";Ja=class extends Ge{};Ja.errorCode="unsupported_token_type";Ya=class extends Ge{};Ya.errorCode="invalid_token";Qa=class extends Ge{};Qa.errorCode="method_not_allowed";Xa=class extends Ge{};Xa.errorCode="too_many_requests";ti=class extends Ge{};ti.errorCode="invalid_client_metadata";ec=class extends Ge{};ec.errorCode="insufficient_scope";tc=class extends Ge{};tc.errorCode="invalid_target";PT={[Ga.errorCode]:Ga,[Qo.errorCode]:Qo,[Xo.errorCode]:Xo,[ei.errorCode]:ei,[Ba.errorCode]:Ba,[Va.errorCode]:Va,[Ha.errorCode]:Ha,[$n.errorCode]:$n,[Wa.errorCode]:Wa,[Ka.errorCode]:Ka,[Ja.errorCode]:Ja,[Ya.errorCode]:Ya,[Qa.errorCode]:Qa,[Xa.errorCode]:Xa,[ti.errorCode]:ti,[ec.errorCode]:ec,[tc.errorCode]:tc}});function Xq(e){return["client_secret_basic","client_secret_post","none"].includes(e)}function eF(e,t){let r=e.client_secret!==void 0;return t.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Xq(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function tF(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":rF(o,i,r);return;case"client_secret_post":nF(o,i,n);return;case"none":oF(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function rF(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function nF(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function oF(e,t){t.set("client_id",e)}async function TT(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=bT.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:s}=n,a=PT[o]||$n;return new a(i||"",s)}catch(n){let o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new $n(o)}}async function rc(e,t){try{return await Vy(e,t)}catch(r){if(r instanceof Qo||r instanceof ei)return await e.invalidateCredentials?.("all"),await Vy(e,t);if(r instanceof Xo)return await e.invalidateCredentials?.("tokens"),await Vy(e,t);throw r}}async function Vy(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let s,a;try{s=await aF(t,{resourceMetadataUrl:o},i),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=new URL("/",t));let c=await sF(t,e,s),u=await dF(a,{fetchFn:i}),p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let y=u?.client_id_metadata_document_supported===!0,v=e.clientMetadataUrl;if(v&&!iF(v))throw new ti(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${v}`);if(y&&v)p={client_id:v},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await yF(a,{metadata:u,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(x),p=x}}let l=!e.redirectUrl;if(r!==void 0||l){let y=await gF(e,a,{metadata:u,resource:c,authorizationCode:r,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}let d=await e.tokens();if(d?.refresh_token)try{let y=await mF(a,{metadata:u,clientInformation:p,refreshToken:d.refresh_token,resource:c,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(y),"AUTHORIZED"}catch(y){if(!(!(y instanceof Ge)||y instanceof $n))throw y}let f=e.state?await e.state():void 0,{authorizationUrl:h,codeVerifier:g}=await fF(a,{metadata:u,clientInformation:p,state:f,redirectUrl:e.redirectUrl,scope:n||s?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:c});return await e.saveCodeVerifier(g),await e.redirectToAuthorization(h),"REDIRECT"}function iF(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function sF(e,t,r){let n=kT(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!ST({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function Wy(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=Hy(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let s=Hy(e,"scope")||void 0,a=Hy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function Hy(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function aF(e,t,r=fetch){let n=await lF(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return _T.parse(await n.json())}async function Ky(e,t,r=fetch){try{return await r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?Ky(e,void 0,r):void 0;throw n}}function cF(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function CT(e,t,r=fetch){return await Ky(e,{"MCP-Protocol-Version":t},r)}function uF(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function lF(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??li,s;if(n?.metadataUrl)s=new URL(n.metadataUrl);else{let c=cF(t,o.pathname);s=new URL(c,n?.metadataServerUrl??o),s.search=o.search}let a=await CT(s,i,r);if(!n?.metadataUrl&&uF(a,o.pathname)){let c=new URL(`/.well-known/${t}`,o);a=await CT(c,i,r)}return a}function pF(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function dF(e,{fetchFn:t=fetch,protocolVersion:r=li}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=pF(e);for(let{url:i,type:s}of o){let a=await Ky(i,n,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?qy.parse(await a.json()):vT.parse(await a.json())}}}async function fF(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Gy))throw new Error(`Incompatible auth server: does not support response type ${Gy}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(By))throw new Error(`Incompatible auth server: does not support code challenge method ${By}`)}else a=new URL("/authorize",e);let c=await Uy(),u=c.code_verifier,p=c.code_challenge;return a.searchParams.set("response_type",Gy),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",p),a.searchParams.set("code_challenge_method",By),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:u}}function hF(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function AT(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),o)await o(c,r,a,t);else if(n){let p=t?.token_endpoint_auth_methods_supported??[],l=eF(n,p);tF(l,n,c,r)}let u=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!u.ok)throw await TT(u);return wT.parse(await u.json())}async function mF(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await AT(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:s});return{refresh_token:n,...c}}async function gF(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let s=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(s)),!a){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let u=await e.codeVerifier();a=hF(o,u,e.redirectUrl)}let c=await e.clientInformation();return AT(t,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function yF(e,{metadata:t,clientMetadata:r,fetchFn:n}){let o;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");o=new URL(t.registration_endpoint)}else o=new URL("/register",e);let i=await(n??fetch)(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw await TT(i);return xT.parse(await i.json())}var Pn,Gy,By,RT=b(()=>{gT();Rn();Fy();Fy();$T();ET();Pn=class extends Error{constructor(t){super(t??"Unauthorized")}};Gy="code",By="S256"});function Jy(e){}function IT(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Jy,onError:r=Jy,onRetry:n=Jy,onComment:o}=e,i="",s=!0,a,c="",u="";function p(g){let y=s?g.replace(/^\xEF\xBB\xBF/,""):g,[v,w]=_F(`${i}${y}`);for(let x of v)l(x);i=w,s=!1}function l(g){if(g===""){f();return}if(g.startsWith(":")){o&&o(g.slice(g.startsWith(": ")?2:1));return}let y=g.indexOf(":");if(y!==-1){let v=g.slice(0,y),w=g[y+1]===" "?2:1,x=g.slice(y+w);d(v,x,g);return}d(g,"",g)}function d(g,y,v){switch(g){case"event":u=y;break;case"data":c=`${c}${y}
|
|
326
327
|
`;break;case"id":a=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?n(parseInt(y,10)):r(new wp(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:v}));break;default:r(new wp(`Unknown field "${g.length>20?`${g.slice(0,20)}\u2026`:g}"`,{type:"unknown-field",field:g,value:y,line:v}));break}}function f(){c.length>0&&t({id:a,event:u||void 0,data:c.endsWith(`
|
|
327
|
-
`)?c.slice(0,-1):c}),a=void 0,c="",u=""}function h(g={}){i&&g.consume&&l(i),s=!0,a=void 0,c="",u="",i=""}return{feed:p,reset:h}}function
|
|
328
|
+
`)?c.slice(0,-1):c}),a=void 0,c="",u=""}function h(g={}){i&&g.consume&&l(i),s=!0,a=void 0,c="",u="",i=""}return{feed:p,reset:h}}function _F(e){let t=[],r="",n=0;for(;n<e.length;){let o=e.indexOf("\r",n),i=e.indexOf(`
|
|
328
329
|
`,n),s=-1;if(o!==-1&&i!==-1?s=Math.min(o,i):o!==-1?o===e.length-1?s=-1:s=o:i!==-1&&(s=i),s===-1){r=e.slice(n);break}else{let a=e.slice(n,s);t.push(a),n=s+1,e[n-1]==="\r"&&e[n]===`
|
|
329
|
-
`&&n++}}return[t,r]}var wp,zT=b(()=>{wp=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});var bp,DT=b(()=>{zT();bp=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(i){o=IT({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:r,onComment:n})},transform(i){o.feed(i)}})}}});var _F,oo,xp,OT=b(()=>{mT();An();RT();DT();_F={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},oo=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},xp=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=hT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??_F}async _authThenStart(){if(!this._authProvider)throw new $n("No auth provider");let t;try{t=await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new $n;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=vp(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new oo(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,s,a=!1,c=!1;(async()=>{try{let p=t.pipeThrough(new TextDecoderStream).pipeThrough(new bp({onRetry:f=>{this._serverRetryMs=f}})).getReader();for(;;){let{value:f,done:h}=await p.read();if(h)break;if(f.id&&(s=f.id,a=!0,o?.(f.id)),!!f.data&&(!f.event||f.event==="message"))try{let g=pi.parse(JSON.parse(f.data));mo(g)&&(c=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(p){if(this.onerror?.(new Error(`SSE stream disconnected: ${p}`)),(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(f){this.onerror?.(new Error(`Failed to reconnect: ${f instanceof Error?f.message:String(f)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new $n("No auth provider");if(await rc(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $n("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:ho(t)?t.id:void 0}).catch(d=>this.onerror?.(d));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let d=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new oo(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:h}=Wy(a);if(this._resourceMetadataUrl=f,this._scope=h,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $n;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:h,error:g}=Wy(a);if(g==="insufficient_scope"){let y=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===y)throw new oo(403,"Server returned 403 after trying upscoping");if(h&&(this._scope=h),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=y??void 0,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new $n;return this.send(t)}}throw new oo(a.status,`Error POSTing to endpoint: ${d}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),a0(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>this.onerror?.(d));return}let p=(Array.isArray(t)?t:[t]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,l=a.headers.get("content-type");if(p)if(l?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:o},!1);else if(l?.includes("application/json")){let d=await a.json(),f=Array.isArray(d)?d.map(h=>pi.parse(h)):[pi.parse(d)];for(let h of f)this.onmessage?.(h)}else throw await a.body?.cancel(),new oo(-1,`Unexpected content type: ${l}`);else await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new oo(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}}});var LT={};tr(LT,{RelayAuthError:()=>io,resolveRelayToken:()=>NT,resolveRelayUrl:()=>jT,runGoogleRelay:()=>xF,startGoogleRelay:()=>MT});function NT(e={}){let t=e.env??process.env,r=t.GODD_LICENSE_KEY?.trim();if(r)return{value:r,source:"license_key"};let n=e.paths??kr(t),o=[];try{o=pn(n).map(i=>i.registry_url)}catch{}try{let i=qa(void 0,{env:t,cwd:e.cwd,savedRegistries:o});return{value:Cf(i,{paths:n,warn:e.warn}),source:"device_token"}}catch(i){throw i instanceof Ye||i instanceof Error&&i.constructor===Error?new io(i.message):i}}function jT(e=process.env){let t=Py(e);if(!t)return{error:"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08http \u306F localhost / 127.0.0.1 / [::1] \u306E\u307F\uFF09\u3002"};let{hostname:r}=new URL(t);return vF.has(r)||r==="ripla.co.jp"||r.endsWith(".ripla.co.jp")?{url:t}:{error:`GODD_GOOGLE_MCP_URL \u306E\u63A5\u7D9A\u5148\uFF08${r}\uFF09\u306B\u306F\u4E2D\u7D99\u3057\u307E\u305B\u3093\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u9001\u308B\u306E\u306F ripla.co.jp\uFF08\u3068\u305D\u306E\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3068\u3001\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\uFF08localhost / 127.0.0.1 / [::1]\uFF09\u3060\u3051\u3067\u3059\u3002`}}function wF(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{error:r,detail:n}=t;if(typeof r=="string")return r;if(typeof n=="string")return n}}catch{}return e.trim().slice(0,200)}function bF(e,t,r){let n=`ripla-google \u304C\u63A5\u7D9A\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\uFF08HTTP ${e}${t?`: ${t}`:""}\uFF09\u3002`;return r==="device_token"?`${n}godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4E2D\u7D99\u306E\u518D\u8D77\u52D5\u306F\u4E0D\u8981\u3067\u3059\uFF09\u3002`:`${n}GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}async function MT(e){let t=e.log??(l=>console.error(l)),r=e.fetchImpl??fetch,{local:n}=e,o=null,i=l=>o?l.split(o).join("***"):l,s=null,a=l=>{l!==s&&(s=l,t(`${ss} ${l}`))},c=async(l,d)=>{let f=e.resolveToken();o=f.value;let h=new Headers(d?.headers);h.set("Authorization",`Bearer ${f.value}`);let g=await r(l,{...d,headers:h});if(g.status===401||g.status===403){let y=wF(await g.text().catch(()=>""));throw new io(i(bF(g.status,y,f.source)))}return g.ok&&(s=null),g},u=new xp(new URL(e.url),{fetch:c}),p=new Set;return u.onmessage=l=>{let d="id"in l?l.id:void 0;if(d!==void 0&&p.has(d)&&(p.delete(d),"result"in l)){let f=l.result.protocolVersion;typeof f=="string"&&u.setProtocolVersion(f)}n.send(l).catch(f=>{t(`${ss} IDE \u3078\u306E\u5FDC\u7B54\u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${f instanceof Error?f.message:String(f)}`)})},u.onerror=l=>{l instanceof io?a(l.message):t(`${ss} ripla-google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: ${i(l.message)}`)},n.onmessage=l=>{let d=ho(l)?l:null;d?.method==="initialize"&&p.add(d.id),u.send(l).catch(f=>{if(!d)return;p.delete(d.id);let h=f instanceof io?f.message:`ripla-google \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${i(f instanceof Error?f.message:String(f))}`;n.send({jsonrpc:"2.0",id:d.id,error:{code:ee.InternalError,message:h}}).catch(()=>{})})},n.onerror=l=>{t(`${ss} IDE \u304B\u3089\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u3081\u307E\u305B\u3093\u3067\u3057\u305F: ${l.message}`)},await u.start(),await n.start(),{close:async()=>{await u.close().catch(()=>{}),await n.close().catch(()=>{})}}}async function xF(){let e=jT(process.env);"error"in e&&(console.error(`${ss} ${e.error}`),process.exit(1));let{url:t}=e,r=new Set,n=a=>{r.has(a)||(r.add(a),console.error(a))},o=()=>NT({warn:n});try{o()}catch(a){if(!(a instanceof io))throw a;console.error(`${ss} ${a.message}\uFF08\u30ED\u30B0\u30A4\u30F3\u5F8C\u306B IDE \u3067 MCP \u3092\u518D\u63A5\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002Claude Code \u306A\u3089 /mcp\uFF09`)}let i=await MT({url:t,local:new hi,resolveToken:o}),s=()=>{i.close().finally(()=>process.exit(0))};process.stdin.once("end",s),process.stdin.once("close",s)}var ss,io,vF,ZT=b(()=>{"use strict";OT();sf();An();Ci();yp();Cy();Mn();Fa();ss="[GoDD google-relay]",io=class extends Error{name="RelayAuthError"};vF=new Set(["localhost","127.0.0.1","[::1]"])});var GT={};tr(GT,{runInstall:()=>EF});function kF(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,so.join)((0,kp.homedir)(),"AppData","Local");return(0,so.join)(e,"GoDD")}return(0,so.join)((0,kp.homedir)(),".godd","bin")}function SF(){return process.platform==="win32"?"godd.exe":"godd"}function FT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function $F(e){if(FT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}try{let t=["$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')","if ($currentPath -and $currentPath.Length -gt 0) {",` $newPath = $currentPath + ';' + '${e.replace(/'/g,"''")}'`,"} else {",` $newPath = '${e.replace(/'/g,"''")}'`,"}","[Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')"].join("; ");(0,UT.execSync)(`powershell -NoProfile -Command "${t}"`,{stdio:"pipe"}),console.log(" PATH: \u30E6\u30FC\u30B6\u30FC\u74B0\u5883\u5909\u6570\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002")}catch{console.error(` PATH: \u81EA\u52D5\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u4EE5\u4E0B\u3092\u624B\u52D5\u3067 PATH \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
330
|
-
${e}`)}}function
|
|
330
|
+
`&&n++}}return[t,r]}var wp,zT=b(()=>{wp=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});var bp,DT=b(()=>{zT();bp=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(i){o=IT({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:r,onComment:n})},transform(i){o.feed(i)}})}}});var vF,oo,xp,OT=b(()=>{mT();Rn();RT();DT();vF={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},oo=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},xp=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=hT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??vF}async _authThenStart(){if(!this._authProvider)throw new Pn("No auth provider");let t;try{t=await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new Pn;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=vp(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new oo(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,s,a=!1,c=!1;(async()=>{try{let p=t.pipeThrough(new TextDecoderStream).pipeThrough(new bp({onRetry:f=>{this._serverRetryMs=f}})).getReader();for(;;){let{value:f,done:h}=await p.read();if(h)break;if(f.id&&(s=f.id,a=!0,o?.(f.id)),!!f.data&&(!f.event||f.event==="message"))try{let g=pi.parse(JSON.parse(f.data));mo(g)&&(c=!0,i!==void 0&&(g.id=i)),this.onmessage?.(g)}catch(g){this.onerror?.(g)}}(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(p){if(this.onerror?.(new Error(`SSE stream disconnected: ${p}`)),(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(f){this.onerror?.(new Error(`Failed to reconnect: ${f instanceof Error?f.message:String(f)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new Pn("No auth provider");if(await rc(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Pn("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:ho(t)?t.id:void 0}).catch(d=>this.onerror?.(d));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let d=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new oo(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:h}=Wy(a);if(this._resourceMetadataUrl=f,this._scope=h,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Pn;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:h,error:g}=Wy(a);if(g==="insufficient_scope"){let y=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===y)throw new oo(403,"Server returned 403 after trying upscoping");if(h&&(this._scope=h),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=y??void 0,await rc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Pn;return this.send(t)}}throw new oo(a.status,`Error POSTing to endpoint: ${d}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),a0(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>this.onerror?.(d));return}let p=(Array.isArray(t)?t:[t]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,l=a.headers.get("content-type");if(p)if(l?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:o},!1);else if(l?.includes("application/json")){let d=await a.json(),f=Array.isArray(d)?d.map(h=>pi.parse(h)):[pi.parse(d)];for(let h of f)this.onmessage?.(h)}else throw await a.body?.cancel(),new oo(-1,`Unexpected content type: ${l}`);else await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new oo(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}}});var LT={};rr(LT,{RelayAuthError:()=>io,resolveRelayToken:()=>NT,resolveRelayUrl:()=>jT,runGoogleRelay:()=>kF,startGoogleRelay:()=>MT});function NT(e={}){let t=e.env??process.env,r=t.GODD_LICENSE_KEY?.trim();if(r)return{value:r,source:"license_key"};let n=e.paths??kr(t),o=[];try{o=dn(n).map(i=>i.registry_url)}catch{}try{let i=qa(void 0,{env:t,cwd:e.cwd,savedRegistries:o});return{value:Cf(i,{paths:n,warn:e.warn}),source:"device_token"}}catch(i){throw i instanceof Ye||i instanceof Error&&i.constructor===Error?new io(i.message):i}}function jT(e=process.env){let t=Py(e);if(!t)return{error:"GODD_GOOGLE_MCP_URL \u304C https \u306E URL \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08http \u306F localhost / 127.0.0.1 / [::1] \u306E\u307F\uFF09\u3002"};let{hostname:r}=new URL(t);return wF.has(r)||r==="ripla.co.jp"||r.endsWith(".ripla.co.jp")?{url:t}:{error:`GODD_GOOGLE_MCP_URL \u306E\u63A5\u7D9A\u5148\uFF08${r}\uFF09\u306B\u306F\u4E2D\u7D99\u3057\u307E\u305B\u3093\u3002\u30ED\u30B0\u30A4\u30F3\u306E\u30C8\u30FC\u30AF\u30F3\u3092\u9001\u308B\u306E\u306F ripla.co.jp\uFF08\u3068\u305D\u306E\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3068\u3001\u3053\u306E\u30B3\u30F3\u30D4\u30E5\u30FC\u30BF\u30FC\uFF08localhost / 127.0.0.1 / [::1]\uFF09\u3060\u3051\u3067\u3059\u3002`}}function bF(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{error:r,detail:n}=t;if(typeof r=="string")return r;if(typeof n=="string")return n}}catch{}return e.trim().slice(0,200)}function xF(e,t,r){let n=`ripla-google \u304C\u63A5\u7D9A\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\uFF08HTTP ${e}${t?`: ${t}`:""}\uFF09\u3002`;return r==="device_token"?`${n}godd login \u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4E2D\u7D99\u306E\u518D\u8D77\u52D5\u306F\u4E0D\u8981\u3067\u3059\uFF09\u3002`:`${n}GODD_LICENSE_KEY \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}async function MT(e){let t=e.log??(l=>console.error(l)),r=e.fetchImpl??fetch,{local:n}=e,o=null,i=l=>o?l.split(o).join("***"):l,s=null,a=l=>{l!==s&&(s=l,t(`${ss} ${l}`))},c=async(l,d)=>{let f=e.resolveToken();o=f.value;let h=new Headers(d?.headers);h.set("Authorization",`Bearer ${f.value}`);let g=await r(l,{...d,headers:h});if(g.status===401||g.status===403){let y=bF(await g.text().catch(()=>""));throw new io(i(xF(g.status,y,f.source)))}return g.ok&&(s=null),g},u=new xp(new URL(e.url),{fetch:c}),p=new Set;return u.onmessage=l=>{let d="id"in l?l.id:void 0;if(d!==void 0&&p.has(d)&&(p.delete(d),"result"in l)){let f=l.result.protocolVersion;typeof f=="string"&&u.setProtocolVersion(f)}n.send(l).catch(f=>{t(`${ss} IDE \u3078\u306E\u5FDC\u7B54\u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${f instanceof Error?f.message:String(f)}`)})},u.onerror=l=>{l instanceof io?a(l.message):t(`${ss} ripla-google \u3068\u306E\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: ${i(l.message)}`)},n.onmessage=l=>{let d=ho(l)?l:null;d?.method==="initialize"&&p.add(d.id),u.send(l).catch(f=>{if(!d)return;p.delete(d.id);let h=f instanceof io?f.message:`ripla-google \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${i(f instanceof Error?f.message:String(f))}`;n.send({jsonrpc:"2.0",id:d.id,error:{code:ee.InternalError,message:h}}).catch(()=>{})})},n.onerror=l=>{t(`${ss} IDE \u304B\u3089\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u3081\u307E\u305B\u3093\u3067\u3057\u305F: ${l.message}`)},await u.start(),await n.start(),{close:async()=>{await u.close().catch(()=>{}),await n.close().catch(()=>{})}}}async function kF(){let e=jT(process.env);"error"in e&&(console.error(`${ss} ${e.error}`),process.exit(1));let{url:t}=e,r=new Set,n=a=>{r.has(a)||(r.add(a),console.error(a))},o=()=>NT({warn:n});try{o()}catch(a){if(!(a instanceof io))throw a;console.error(`${ss} ${a.message}\uFF08\u30ED\u30B0\u30A4\u30F3\u5F8C\u306B IDE \u3067 MCP \u3092\u518D\u63A5\u7D9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002Claude Code \u306A\u3089 /mcp\uFF09`)}let i=await MT({url:t,local:new hi,resolveToken:o}),s=()=>{i.close().finally(()=>process.exit(0))};process.stdin.once("end",s),process.stdin.once("close",s)}var ss,io,wF,ZT=b(()=>{"use strict";OT();sf();Rn();Ci();yp();Cy();Ln();Fa();ss="[GoDD google-relay]",io=class extends Error{name="RelayAuthError"};wF=new Set(["localhost","127.0.0.1","[::1]"])});var GT={};rr(GT,{runInstall:()=>CF});function SF(){if(process.platform==="win32"){let e=process.env.LOCALAPPDATA??(0,so.join)((0,kp.homedir)(),"AppData","Local");return(0,so.join)(e,"GoDD")}return(0,so.join)((0,kp.homedir)(),".godd","bin")}function $F(){return process.platform==="win32"?"godd.exe":"godd"}function FT(e){let t=process.env.PATH??"",r=process.platform==="win32"?";":":";return t.split(r).map(o=>o.replace(/[\\/]+$/,"").toLowerCase()).includes(e.replace(/[\\/]+$/,"").toLowerCase())}function PF(e){if(FT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}try{let t=["$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')","if ($currentPath -and $currentPath.Length -gt 0) {",` $newPath = $currentPath + ';' + '${e.replace(/'/g,"''")}'`,"} else {",` $newPath = '${e.replace(/'/g,"''")}'`,"}","[Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')"].join("; ");(0,UT.execSync)(`powershell -NoProfile -Command "${t}"`,{stdio:"pipe"}),console.log(" PATH: \u30E6\u30FC\u30B6\u30FC\u74B0\u5883\u5909\u6570\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002")}catch{console.error(` PATH: \u81EA\u52D5\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u4EE5\u4E0B\u3092\u624B\u52D5\u3067 PATH \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
331
|
+
${e}`)}}function EF(e){if(FT(e)){console.log(" PATH: \u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002");return}let t=`
|
|
331
332
|
# GoDD CLI
|
|
332
333
|
export PATH="${e}:$PATH"
|
|
333
|
-
`,r=(0,kp.homedir)(),n=[],o=(0,so.join)(r,".zshrc"),i=(0,so.join)(r,".bashrc"),s=(0,so.join)(r,".bash_profile");if((0,Or.existsSync)(o)&&n.push(o),(0,Or.existsSync)(i)?n.push(i):(0,Or.existsSync)(s)&&n.push(s),n.length===0){let a=process.platform==="darwin"?o:i;n.push(a)}for(let a of n){try{if((0,Sp.readFileSync)(a,"utf-8").includes(e)){console.log(` PATH: ${a} \u306B\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002`);continue}}catch{}(0,Sp.appendFileSync)(a,t,"utf-8"),console.log(` PATH: ${a} \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002`)}}async function
|
|
334
|
-
${ye(l.error)}`);if(l.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931\u6557 (exit ${l.status}): ${e} ${
|
|
335
|
-
${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${r.slice(0,200)}`)}let o=t.filter(s=>!n[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of t)i[s]=n[s].value;return i}function oA(e){return e.match(/^https:\/\/storage\.googleapis\.com\/([^/]+)\//)?.[1]??null}function iA(e){try{let r=new URL(e).hostname.split(".")[0];return r.length>0?r:null}catch{return null}}function
|
|
334
|
+
`,r=(0,kp.homedir)(),n=[],o=(0,so.join)(r,".zshrc"),i=(0,so.join)(r,".bashrc"),s=(0,so.join)(r,".bash_profile");if((0,Or.existsSync)(o)&&n.push(o),(0,Or.existsSync)(i)?n.push(i):(0,Or.existsSync)(s)&&n.push(s),n.length===0){let a=process.platform==="darwin"?o:i;n.push(a)}for(let a of n){try{if((0,Sp.readFileSync)(a,"utf-8").includes(e)){console.log(` PATH: ${a} \u306B\u65E2\u306B\u767B\u9332\u6E08\u307F\u3067\u3059\u3002`);continue}}catch{}(0,Sp.appendFileSync)(a,t,"utf-8"),console.log(` PATH: ${a} \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002`)}}async function CF(){console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 GoDD CLI \u2014 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log("");let e=SF(),t=$F(),r=(0,so.join)(e,t),n=process.execPath;console.log(`\u30BD\u30FC\u30B9: ${n}`),console.log(`\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148: ${r}`),console.log(""),(0,Or.existsSync)(e)||((0,Or.mkdirSync)(e,{recursive:!0}),console.log(`\u2713 \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u4F5C\u6210\u3057\u307E\u3057\u305F: ${e}`));let o=n.replace(/\\/g,"/").toLowerCase(),i=r.replace(/\\/g,"/").toLowerCase();if(o===i?console.log("\u2713 \u65E2\u306B\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5148\u304B\u3089\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u3059\uFF08\u30B3\u30D4\u30FC\u3092\u30B9\u30AD\u30C3\u30D7\uFF09\u3002"):((0,Or.copyFileSync)(n,r),console.log("\u2713 \u30D0\u30A4\u30CA\u30EA\u3092\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F\u3002"),process.platform!=="win32"&&(0,Or.chmodSync)(r,493)),console.log(""),process.platform==="win32"?PF(e):EF(e),console.log(""),console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),console.log("\u2551 \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5B8C\u4E86\uFF01 \u2551"),console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),console.log(""),console.log("\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"),console.log(" 1. \u30BF\u30FC\u30DF\u30CA\u30EB\u3092\u518D\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044\uFF08PATH \u3092\u53CD\u6620\u3059\u308B\u305F\u3081\uFF09"),console.log(" 2. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067 godd init \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"),console.log(""),console.log("\u4F7F\u3044\u65B9:"),console.log(" godd init \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7"),console.log(" godd server MCP \u30B5\u30FC\u30D0\u30FC\u8D77\u52D5\uFF08Cursor \u304C\u81EA\u52D5\u5B9F\u884C\uFF09"),console.log(" godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u8868\u793A"),console.log(" godd help \u30D8\u30EB\u30D7\u8868\u793A"),console.log(""),process.platform==="win32"&&!process.env.TERM&&!process.env.CI){let s=qT.createInterface({input:process.stdin,output:process.stdout});await new Promise(a=>{s.question("Enter \u30AD\u30FC\u3092\u62BC\u3057\u3066\u9589\u3058\u307E\u3059...",()=>{s.close(),a()})})}}var Or,so,kp,UT,Sp,qT,BT=b(()=>{"use strict";Or=require("node:fs"),so=require("node:path"),kp=require("node:os"),UT=require("node:child_process"),Sp=require("node:fs"),qT=yt(require("node:readline"),1)});function IF(e){return!(0,VT.existsSync)((0,HT.join)(e,"node_modules"))}function zF(e,t){IF(e)&&t("pnpm",[...TF],{cwd:e,label:"\u4F9D\u5B58\u95A2\u4FC2\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB"}),t("pnpm",[...AF],{cwd:e,label:"esbuild \u30D3\u30EB\u30C9\u30B9\u30AF\u30EA\u30D7\u30C8\u5B9F\u884C"})}function nc(e,t){zF(e,t),t("pnpm",[...RF],{cwd:e,label:"\u30D5\u30ED\u30F3\u30C8\u30A8\u30F3\u30C9\u30D3\u30EB\u30C9",nonInteractive:!0})}var VT,HT,TF,AF,RF,Yy=b(()=>{"use strict";VT=require("node:fs"),HT=require("node:path"),TF=["install","--frozen-lockfile","--ignore-scripts"],AF=["rebuild","esbuild"],RF=["exec","vite","build","--logLevel","info"]});function NF(e){let t=e.containerDefinitions;return Array.isArray(t)?{...e,containerDefinitions:t.map(r=>Array.isArray(r.secrets)?{...r,secrets:r.secrets.filter(n=>typeof n.name!="string"||!OF.has(n.name))}:r)}:e}function WT(e,t){let r={...e};for(let o of DF)delete r[o];let n=NF(r);if(t?.image&&Array.isArray(n.containerDefinitions)){let[o,...i]=n.containerDefinitions;o&&(n.containerDefinitions=[{...o,image:t.image},...i])}return n}var DF,OF,KT=b(()=>{"use strict";DF=["taskDefinitionArn","revision","status","requiresAttributes","compatibilities","registeredAt","registeredBy"],OF=new Set(["GITHUB_TOKEN"])});function MF(e){return process.platform!=="win32"?!1:QT.has((0,oc.extname)(e).toLowerCase())}function UF(e){let t=[],r=!1;for(let n of e){if(r){t.push("***"),r=!1;continue}let o=LF.exec(n);if(o){t.push(`${o[1]}=***`);continue}if(ZF.test(n)){t.push(n),r=!0;continue}t.push(n)}return t.join(" ")}function qF(e,t){let r=t.findIndex(o=>JT.test(o));if(r===-1)return;let[n]=JT.exec(t[r])??[];throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5F15\u6570\u306B Windows shell \u4E88\u7D04\u6587\u5B57\uFF08${JSON.stringify(n)}\uFF09\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u305F\u3081\u5B9F\u884C\u3092\u4E2D\u6B62\u3057\u307E\u3057\u305F\uFF08\u30B3\u30DE\u30F3\u30C9\u30A4\u30F3\u30B8\u30A7\u30AF\u30B7\u30E7\u30F3\u5BFE\u7B56\uFF09: ${e} \u306E\u7B2C${r+1}\u5F15\u6570`)}function GF(e){if(process.platform!=="win32")return e;let t=(0,oc.extname)(e);if(t&&jF.has(t.toLowerCase()))return e;let r=(0,oc.basename)(e).toLowerCase();return FF.has(r)?`${e}.cmd`:e}function Le(e,t,r={}){VF(e,t,r)}function BF(e=process.env){return{...e,CI:"true",FORCE_COLOR:"0",npm_config_color:"false"}}function VF(e,t,r={}){let{cwd:n,label:o,env:i,stdin:s="ignore",nonInteractive:a=!1}=r;o&&console.log(` ${o}...`);let c=a?BF(i??process.env):i??process.env,u=GF(e),p=MF(u);p&&qF(u,t);let l=(0,YT.spawnSync)(u,[...t],{cwd:n,stdio:[s,"inherit","inherit"],env:c,windowsHide:!0,shell:p});if(l.error)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u8D77\u52D5\u5931\u6557: ${e}
|
|
335
|
+
${ye(l.error)}`);if(l.status!==0)throw new Error(`\u30B3\u30DE\u30F3\u30C9\u5931\u6557 (exit ${l.status}): ${e} ${UF(t)}`)}var YT,oc,QT,jF,JT,LF,ZF,FF,Qy=b(()=>{"use strict";YT=require("node:child_process"),oc=require("node:path");er();QT=new Set([".cmd",".bat"]),jF=new Set([...QT,".exe"]);JT=/[&|()<>^"%!\r\n]/,LF=/^(--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*)=(.+)$/i,ZF=/^--?[\w-]*(?:token|secret|password|apikey|api-key|credential)[\w-]*$/i;FF=new Set(["pnpm","npm","npx","yarn","yarnpkg","corepack","vercel","railway"])});var aA={};rr(aA,{SUPPORTED_DEPLOY_PROVIDERS:()=>nA,assertValidDeployEnv:()=>sA,executeAzureDeploy:()=>iG,executeGcpDeploy:()=>oG,executeVercelRailwayDeploy:()=>sG,extractAzureStorageAccountFromWebEndpoint:()=>iA,extractGcsBucketFromAppUrl:()=>oA,getTerraformDir:()=>$p,parseTerraformOutputValues:()=>Pp,resolveDeployProvider:()=>WF});function WF(e){return e&&nA.includes(e)?e:null}function $p(e,t){let r=t.env??"dev",n=t.outputDir??e;return(0,rA.join)(n,"terraform","godd-notes",r)}function Pp(e,t){if(!(0,e_.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let r;try{r=Xy.execSync("terraform output -json",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch(s){throw new Error(`terraform output \u306E\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002terraform init && terraform apply \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
336
|
+
${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${r.slice(0,200)}`)}let o=t.filter(s=>!n[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of t)i[s]=n[s].value;return i}function oA(e){return e.match(/^https:\/\/storage\.googleapis\.com\/([^/]+)\//)?.[1]??null}function iA(e){try{let r=new URL(e).hostname.split(".")[0];return r.length>0?r:null}catch{return null}}function tn(e,t,r){try{Xy.execSync(e,{stdio:"pipe",timeout:HF})}catch{r.push(t)}}function KF(){let e=[];return tn("gcloud --version","gcloud CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://cloud.google.com/sdk/docs/install",e),tn("gcloud auth print-access-token","GCP \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002gcloud auth login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),tn("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),tn("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function JF(){let e=[];return tn("az --version","Azure CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://learn.microsoft.com/cli/azure/install-azure-cli",e),tn("az account show","Azure \u8A8D\u8A3C\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002az login \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e),tn("docker --version","Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",e),tn("pnpm --version","pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm",e),{ok:e.length===0,errors:e}}function YF(){let e=[];return tn("vercel --version","Vercel CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g vercel",e),tn("railway --version","Railway CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g @railway/cli",e),process.env.VERCEL_TOKEN||e.push("VERCEL_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),process.env.RAILWAY_TOKEN||e.push("RAILWAY_TOKEN \u74B0\u5883\u5909\u6570\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),{ok:e.length===0,errors:e}}function QF(e){let t=Pp(e,["cloud_run_url","notes_app_url","artifact_registry"]),r=oA(t.notes_app_url);if(!r)throw new Error(`notes_app_url \u304B\u3089 GCS \u30D0\u30B1\u30C3\u30C8\u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${t.notes_app_url}`);return{cloud_run_url:t.cloud_run_url,notes_app_url:t.notes_app_url,artifact_registry:t.artifact_registry,gcs_bucket:r}}function XF(e,t){let r=Pp(e,["container_app_url","notes_app_url","cdn_endpoint","acr_login_server"]),n=iA(r.notes_app_url);if(!n)throw new Error(`notes_app_url \u304B\u3089 Storage Account \u540D\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${r.notes_app_url}`);return{container_app_url:r.container_app_url,notes_app_url:r.notes_app_url,cdn_endpoint:r.cdn_endpoint,acr_login_server:r.acr_login_server,resource_group:`godd-notes-${t}`,storage_account:n}}function eG(e){let t=Pp(e,["vercel_url","vercel_project_id","railway_api_url"]);return{vercel_url:t.vercel_url,vercel_project_id:t.vercel_project_id,railway_api_url:t.railway_api_url}}async function t_(e,t){if(t)return!0;let r=tA.createInterface({input:process.stdin,output:process.stdout});try{return(await new Promise(o=>{r.question(e,i=>o(i.trim()))})).toLowerCase()==="n"?(console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002"),!1):!0}finally{r.close()}}async function tG(e,t,r){let n=t.region??"asia-northeast1",o=t.projectId;if(!o)throw new Error("GCP \u30C7\u30D7\u30ED\u30A4\u306B\u306F .godd-notes-infra.json \u306E projectId \u304C\u5FC5\u8981\u3067\u3059\u3002");let i=`${e.artifact_registry}/notes-api:latest`;console.log(`
|
|
336
337
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
337
338
|
\u2551 GoDD Notes \u2014 GCP \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
338
339
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
@@ -349,7 +350,7 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
349
350
|
\u2551 Notes API: ${e.cloud_run_url.padEnd(35)}\u2551
|
|
350
351
|
\u2551 \u2551
|
|
351
352
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
352
|
-
`)}async function
|
|
353
|
+
`)}async function rG(e,t,r){let n=`${e.acr_login_server}/notes-api:latest`;console.log(`
|
|
353
354
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
354
355
|
\u2551 GoDD Notes \u2014 Azure \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
355
356
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
@@ -368,7 +369,7 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
368
369
|
\u2551 CDN: ${e.cdn_endpoint.padEnd(35)}\u2551
|
|
369
370
|
\u2551 \u2551
|
|
370
371
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
371
|
-
`)}function sA(e){if(e==="dev"||e==="prod")return e;throw new Error(`.godd-notes-infra.json \u306E env \u306F "dev" \u307E\u305F\u306F "prod" \u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059\uFF08\u5B9F\u969B: ${JSON.stringify(e)}\uFF09`)}async function
|
|
372
|
+
`)}function sA(e){if(e==="dev"||e==="prod")return e;throw new Error(`.godd-notes-infra.json \u306E env \u306F "dev" \u307E\u305F\u306F "prod" \u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059\uFF08\u5B9F\u969B: ${JSON.stringify(e)}\uFF09`)}async function nG(e,t,r){let n=sA(t.env??"dev"),o=process.env.VERCEL_TOKEN??"";console.log(`
|
|
372
373
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
373
374
|
\u2551 GoDD Notes \u2014 Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
374
375
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
@@ -382,47 +383,47 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
382
383
|
\u2551 Notes API: ${e.railway_api_url.padEnd(35)}\u2551
|
|
383
384
|
\u2551 \u2551
|
|
384
385
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
385
|
-
`)}async function
|
|
386
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=
|
|
386
|
+
`)}async function oG(e,t,r,n){console.log(`
|
|
387
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=KF();if(!o.ok){console.error(`
|
|
387
388
|
\u30A8\u30E9\u30FC: GCP \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let a of o.errors)console.error(` - ${a}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
388
|
-
`);let i=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`);let s=
|
|
389
|
+
`);let i=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`);let s=QF(i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
389
390
|
`),console.log("--- GCP \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Cloud Run: ${s.cloud_run_url}`),console.log(` GCS: ${s.gcs_bucket}`),console.log(` App URL: ${s.notes_app_url}`),await t_(`
|
|
390
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 GCP \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await
|
|
391
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=
|
|
391
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 GCP \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await tG(s,e,r)}async function iG(e,t,r,n){console.log(`
|
|
392
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=JF();if(!o.ok){console.error(`
|
|
392
393
|
\u30A8\u30E9\u30FC: Azure \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let c of o.errors)console.error(` - ${c}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
393
|
-
`);let i=e.env??"dev",s=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${s})`);let a=
|
|
394
|
+
`);let i=e.env??"dev",s=$p(t,e);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${s})`);let a=XF(s,i);console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
394
395
|
`),console.log("--- Azure \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Container App: ${a.container_app_url}`),console.log(` Storage: ${a.storage_account}`),console.log(` App URL: ${a.notes_app_url}`),await t_(`
|
|
395
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 Azure \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await
|
|
396
|
-
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=
|
|
396
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 Azure \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await rG(a,e,r)}async function sG(e,t,r,n){console.log(`
|
|
397
|
+
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=YF();if(!o.ok){console.error(`
|
|
397
398
|
\u30A8\u30E9\u30FC: Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let a of o.errors)console.error(` - ${a}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
398
|
-
`);let i=$p(t,e),s;(0,e_.existsSync)(i)?(console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`),s=
|
|
399
|
+
`);let i=$p(t,e),s;(0,e_.existsSync)(i)?(console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${i})`),s=eG(i),console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
399
400
|
`)):(s={vercel_url:"(vercel deploy \u5F8C\u306B\u78BA\u5B9A)",vercel_project_id:process.env.VERCEL_PROJECT_ID??"(\u672A\u8A2D\u5B9A)",railway_api_url:e.railwayApiUrl??"(Railway \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u3067\u78BA\u8A8D)"},console.log(` \u2139 Terraform output \u306A\u3057 \u2014 CLI \u30C7\u30D7\u30ED\u30A4\u306E\u307F\u5B9F\u884C\u3057\u307E\u3059
|
|
400
401
|
`)),console.log("--- Vercel \xD7 Railway \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` Vercel: ${s.vercel_url}`),console.log(` Railway: ${s.railway_api_url}`),await t_(`
|
|
401
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 Vercel \xD7 Railway \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await
|
|
402
|
-
\u26A0 notes-api / notes-app \u306E\u540C\u68B1\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u305F\u3081\u3001\u30A2\u30D7\u30EA scaffold \u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3057\u305F\u3002`),[];let r=[],n=[{label:"notes-api",src:t.apiDir,dest:(0,G.join)(e,"notes-api"),exclude:
|
|
403
|
-
[\u30A2\u30D7\u30EA] Notes \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30BD\u30FC\u30B9\u3092\u540C\u671F: ${e}`);for(let o of n){let i=(0,K.existsSync)(o.dest)?"\u66F4\u65B0":"\u914D\u7F6E";yA(o.src,o.dest,o.exclude),r.push(o.label),console.log(` \u2713 ${o.label}/ \u3092${i}`)}return r}function vA(e){return tp(e)}function wA(e){let t=(0,G.join)(e.outputDir,
|
|
404
|
-
`,"utf-8")}async function
|
|
402
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 Vercel \xD7 Railway \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `,n)&&await nG(s,e,r)}var Xy,tA,e_,rA,HF,XT,eA,nA,cA=b(()=>{"use strict";Xy=yt(require("node:child_process"),1),tA=yt(require("node:readline"),1),e_=require("node:fs"),rA=require("node:path");er();Yy();Qy();HF=1e4,XT="godd-notes-api",eA="godd-notes-api",nA=["aws","gcp","azure","vercel-railway"]});var xA={};rr(xA,{PROVIDER_LABELS:()=>Ep,formatAwsProfileExportLines:()=>bA,runNotesInfra:()=>kG,saveProjectConfig:()=>wA,scaffoldNotesApplicationSources:()=>_A,shouldExcludeNotesSourceEntry:()=>gA,validateSavedInfraConfig:()=>mA});function mA(e){if(!e)return{ok:!1,error:`${kn} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002--yes \u306B\u306F\u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002\u307E\u305A\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`};let t=e.provider;if(!t||!(t in Ep))return{ok:!1,error:`${kn} \u306E provider \u304C\u4E0D\u6B63\u3067\u3059: ${String(t)}`};let r=e,o=[...aG,...cG[t]].filter(i=>{let s=r[i];return typeof s=="string"?s==="":typeof s=="number"?!Number.isFinite(s):s==null});return o.length>0?{ok:!1,error:`${kn} \u306B\u5FC5\u9808\u30AD\u30FC\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059: ${o.join(", ")}\u3002\u5BFE\u8A71\u30E2\u30FC\u30C9\u3067 godd notes infra \u3092\u518D\u5B9F\u884C\u3057\u3066\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002`}:{ok:!0,config:e}}function uG(){return dA.createInterface({input:process.stdin,output:process.stdout})}function oe(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function lG(){try{return(0,G.dirname)((0,fA.fileURLToPath)(__goddBundleUrl))}catch{return(0,G.dirname)(process.execPath)}}function pG(e){let t=lG(),r=[(0,G.resolve)(t,".."),(0,G.resolve)(t,"..","..")];for(let n of r){let o=(0,G.join)(n,"templates","terraform",e),i=(0,G.join)(n,"templates","github-actions",e);if((0,K.existsSync)(o)&&(0,K.existsSync)(i))return{terraformDir:o,ghaDir:i}}return null}function gA(e,t){return e===".env"||e.startsWith(".env.")&&e!==".env.example"||e.endsWith(".pyc")||e.endsWith(".tsbuildinfo")?!0:dG.has(e)||t.has(e)}function yA(e,t,r){(0,K.mkdirSync)(t,{recursive:!0});for(let n of(0,K.readdirSync)(e)){if(gA(n,r))continue;let o=(0,G.join)(e,n),i=(0,G.join)(t,n);(0,K.statSync)(o).isDirectory()?yA(o,i,r):(0,K.copyFileSync)(o,i)}}function _A(e){let t=ep();if(!t)return console.warn(`
|
|
403
|
+
\u26A0 notes-api / notes-app \u306E\u540C\u68B1\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u305F\u3081\u3001\u30A2\u30D7\u30EA scaffold \u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3057\u305F\u3002`),[];let r=[],n=[{label:"notes-api",src:t.apiDir,dest:(0,G.join)(e,"notes-api"),exclude:hG},{label:"notes-app",src:t.appDir,dest:(0,G.join)(e,"notes-app"),exclude:fG}];console.log(`
|
|
404
|
+
[\u30A2\u30D7\u30EA] Notes \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30BD\u30FC\u30B9\u3092\u540C\u671F: ${e}`);for(let o of n){let i=(0,K.existsSync)(o.dest)?"\u66F4\u65B0":"\u914D\u7F6E";yA(o.src,o.dest,o.exclude),r.push(o.label),console.log(` \u2713 ${o.label}/ \u3092${i}`)}return r}function vA(e){return tp(e)}function wA(e){let t=(0,G.join)(e.outputDir,kn),r={...e,outputDir:"."};(0,K.writeFileSync)(t,JSON.stringify(r,null,2)+`
|
|
405
|
+
`,"utf-8")}async function mG(e,t){console.log(`
|
|
405
406
|
--- \u30AF\u30E9\u30A6\u30C9\u30D7\u30ED\u30D0\u30A4\u30C0\u9078\u629E ---`);let r=Object.entries(Ep);for(let s=0;s<r.length;s++){let[a,c]=r[s],u=a===(t??"aws");console.log(` ${s+1}. ${c}${u?" [\u30C7\u30D5\u30A9\u30EB\u30C8]":""}`)}let n=r.findIndex(([s])=>s===(t??"aws"))+1,o=await oe(e,`
|
|
406
|
-
\u9078\u629E [${n}]: `)||String(n),i=parseInt(o,10)-1;return(i<0||i>=r.length)&&(console.error("\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u9078\u629E\u3067\u3059\u3002"),process.exit(1)),r[i][0]}async function
|
|
407
|
+
\u9078\u629E [${n}]: `)||String(n),i=parseInt(o,10)-1;return(i<0||i>=r.length)&&(console.error("\u30A8\u30E9\u30FC: \u7121\u52B9\u306A\u9078\u629E\u3067\u3059\u3002"),process.exit(1)),r[i][0]}async function gG(e,t){console.log(`
|
|
407
408
|
--- AWS \u30A2\u30AB\u30A6\u30F3\u30C8\u8A2D\u5B9A ---`);let r=await oe(e,`AWS \u30A2\u30AB\u30A6\u30F3\u30C8 ID${t.accountId?` [${t.accountId}]`:""}: `)||t.accountId||"";(!r||!/^\d{12}$/.test(r))&&(console.error("\u30A8\u30E9\u30FC: 12\u6841\u306E AWS \u30A2\u30AB\u30A6\u30F3\u30C8 ID \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let n=await oe(e,`AWS \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"ap-northeast-1"}]: `)||t.region||"ap-northeast-1",o=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
408
409
|
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
409
410
|
--- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await oe(e,`VPC CIDR [${t.vpcCidr??"10.2.0.0/16"}]: `)||t.vpcCidr||"10.2.0.0/16";console.log(`
|
|
410
411
|
--- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await oe(e,`RDS \u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30AF\u30E9\u30B9 [${t.rdsInstanceClass??"db.t4g.micro"}]: `)||t.rdsInstanceClass||"db.t4g.micro",u=await oe(e,`ECS CPU (vCPU \u5358\u4F4D) [${t.ecsCpu??256}]: `)||String(t.ecsCpu??256),p=await oe(e,`ECS \u30E1\u30E2\u30EA (MB) [${t.ecsMemory??512}]: `)||String(t.ecsMemory??512);console.log(`
|
|
411
|
-
--- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseInt(u,10),f=parseInt(p,10);return{provider:"aws",accountId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,rdsInstanceClass:c,ecsCpu:Number.isFinite(d)?d:256,ecsMemory:Number.isFinite(f)?f:512,outputDir:(0,G.resolve)(l)}}async function
|
|
412
|
+
--- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseInt(u,10),f=parseInt(p,10);return{provider:"aws",accountId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,rdsInstanceClass:c,ecsCpu:Number.isFinite(d)?d:256,ecsMemory:Number.isFinite(f)?f:512,outputDir:(0,G.resolve)(l)}}async function yG(e,t){console.log(`
|
|
412
413
|
--- GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A2D\u5B9A ---`);let r=await oe(e,`GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ID${t.projectId?` [${t.projectId}]`:""}: `)||t.projectId||"";r||(console.error("\u30A8\u30E9\u30FC: GCP \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1));let n=await oe(e,`GCP \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"asia-northeast1"}]: `)||t.region||"asia-northeast1",o=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
413
414
|
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
414
415
|
--- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await oe(e,`VPC CIDR [${t.vpcCidr??"10.0.0.0/16"}]: `)||t.vpcCidr||"10.0.0.0/16";console.log(`
|
|
415
416
|
--- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await oe(e,`Cloud SQL \u30C6\u30A3\u30A2 [${t.dbTier??"db-f1-micro"}]: `)||t.dbTier||"db-f1-micro",u=await oe(e,`Cloud Run CPU [${t.cpuLimit??"1"}]: `)||t.cpuLimit||"1",p=await oe(e,`Cloud Run \u30E1\u30E2\u30EA [${t.memoryLimit??"512Mi"}]: `)||t.memoryLimit||"512Mi";console.log(`
|
|
416
|
-
--- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"gcp",projectId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbTier:c,cpuLimit:u,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function
|
|
417
|
+
--- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"gcp",projectId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbTier:c,cpuLimit:u,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function _G(e,t){console.log(`
|
|
417
418
|
--- Azure \u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A ---`);let r=await oe(e,`Azure Subscription ID${t.subscriptionId?` [${t.subscriptionId}]`:""}: `)||t.subscriptionId||"";r||(console.error("\u30A8\u30E9\u30FC: Azure Subscription ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1));let n=await oe(e,`Azure \u30EA\u30FC\u30B8\u30E7\u30F3 [${t.region??"japaneast"}]: `)||t.region||"japaneast",o=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
418
419
|
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let i=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",s=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!i||!s)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
419
420
|
--- \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A ---`);let a=await oe(e,`VNet CIDR [${t.vpcCidr??"10.0.0.0/16"}]: `)||t.vpcCidr||"10.0.0.0/16";console.log(`
|
|
420
421
|
--- \u30EA\u30BD\u30FC\u30B9\u30B5\u30A4\u30BA ---`);let c=await oe(e,`PostgreSQL SKU [${t.dbSku??"B_Standard_B1ms"}]: `)||t.dbSku||"B_Standard_B1ms",u=await oe(e,`Container App CPU [${t.cpuLimit??.25}]: `)||String(t.cpuLimit??.25),p=await oe(e,`Container App \u30E1\u30E2\u30EA [${t.memoryLimit??"0.5Gi"}]: `)||t.memoryLimit||"0.5Gi";console.log(`
|
|
421
|
-
--- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseFloat(u);return{provider:"azure",subscriptionId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbSku:c,cpuLimit:Number.isFinite(d)?d:.25,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function
|
|
422
|
+
--- \u51FA\u529B\u5148 ---`);let l=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".",d=parseFloat(u);return{provider:"azure",subscriptionId:r,region:n,env:o,githubOwner:i,githubRepo:s,vpcCidr:a,dbSku:c,cpuLimit:Number.isFinite(d)?d:.25,memoryLimit:p,outputDir:(0,G.resolve)(l)}}async function vG(e,t){console.log(`
|
|
422
423
|
--- Vercel + Railway \u8A2D\u5B9A ---`);let r=await oe(e,`\u74B0\u5883\u540D (dev/staging/prod) [${t.env??"dev"}]: `)||t.env||"dev";console.log(`
|
|
423
424
|
--- GitHub \u30EA\u30DD\u30B8\u30C8\u30EA ---`);let n=await oe(e,`GitHub Owner${t.githubOwner?` [${t.githubOwner}]`:""}: `)||t.githubOwner||"",o=await oe(e,`GitHub Repo${t.githubRepo?` [${t.githubRepo}]`:""}: `)||t.githubRepo||"";(!n||!o)&&(console.error("\u30A8\u30E9\u30FC: GitHub Owner \u3068 Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),process.exit(1)),console.log(`
|
|
424
425
|
--- Railway \u8A2D\u5B9A ---`);let i=await oe(e,`Railway API URL${t.railwayApiUrl?` [${t.railwayApiUrl}]`:""}: `)||t.railwayApiUrl||"";i||console.log(" \u203B Railway \u30C7\u30D7\u30ED\u30A4\u5F8C\u306B URL \u304C\u767A\u884C\u3055\u308C\u307E\u3059\u3002\u5F8C\u304B\u3089 .godd-notes-infra.json \u3067\u8A2D\u5B9A\u53EF\u80FD\u3067\u3059\u3002"),console.log(`
|
|
425
|
-
--- \u51FA\u529B\u5148 ---`);let s=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"vercel-railway",env:r,githubOwner:n,githubRepo:o,railwayApiUrl:i||"https://your-api.up.railway.app",outputDir:(0,G.resolve)(s)}}async function
|
|
426
|
+
--- \u51FA\u529B\u5148 ---`);let s=await oe(e,`\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [${t.outputDir??"."}]: `)||t.outputDir||".";return{provider:"vercel-railway",env:r,githubOwner:n,githubRepo:o,railwayApiUrl:i||"https://your-api.up.railway.app",outputDir:(0,G.resolve)(s)}}async function wG(e){console.log(`
|
|
426
427
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
427
428
|
\u2551 GoDD Notes \u30A4\u30F3\u30D5\u30E9\u69CB\u7BC9\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
|
|
428
429
|
\u2551 \u30A2\u30D7\u30EA + Terraform + GitHub Actions \u81EA\u52D5\u751F\u6210 \u2551
|
|
@@ -430,17 +431,17 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
430
431
|
\u2551 \u5BFE\u5FDC\u30D7\u30ED\u30D0\u30A4\u30C0: \u2551
|
|
431
432
|
\u2551 AWS / GCP / Azure / Vercel\xD7Railway \u2551
|
|
432
433
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
433
|
-
`);let t=vA(process.cwd());switch(await
|
|
434
|
-
--- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${Ep[e.provider]}`),console.log(` \u74B0\u5883: ${e.env}`),console.log(` GitHub: ${e.githubOwner}/${e.githubRepo}`),e.provider){case"aws":console.log(` AWS \u30A2\u30AB\u30A6\u30F3\u30C8: ${e.accountId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` VPC CIDR: ${e.vpcCidr}`),console.log(` RDS: ${e.rdsInstanceClass}`),console.log(` ECS: ${e.ecsCpu} CPU / ${e.ecsMemory} MB`);break;case"gcp":console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${e.projectId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` Cloud SQL: ${e.dbTier}`),console.log(` Cloud Run: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"azure":console.log(` Subscription: ${e.subscriptionId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` PostgreSQL: ${e.dbSku}`),console.log(` Container App: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"vercel-railway":console.log(` Railway API: ${e.railwayApiUrl}`);break}console.log(` \u51FA\u529B\u5148: ${e.outputDir}`)}function lA(e){let t=
|
|
435
|
-
\u2713 \u8A2D\u5B9A\u3092 ${(0,G.join)(e.outputDir,
|
|
436
|
-
[1/${f}] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let x of u){let k=x.replace(".hbs",""),P=
|
|
437
|
-
[2/${f}] IAM Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${i}`);for(let x of c){let k=x.replace(".hbs",""),P=
|
|
438
|
-
[3/${f}] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${s}`);let w=(0,K.readdirSync)(t).filter(x=>x.endsWith(".yml.hbs"));for(let x of w){let k=x.replace(".hbs",""),P=
|
|
439
|
-
[4/${f}] \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u751F\u6210: ${x}`);let k=
|
|
434
|
+
`);let t=vA(process.cwd());switch(await mG(e,t?.provider)){case"aws":return gG(e,t??{});case"gcp":return yG(e,t??{});case"azure":return _G(e,t??{});case"vercel-railway":return vG(e,t??{})}}function En(e,t){let r;try{r=(0,K.readFileSync)(e,"utf-8")}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\u304C\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: ${e} \u2014 ${ye(n)}`,{cause:n})}try{return hA.default.compile(r,{noEscape:!0})(t)}catch(n){throw new Error(`\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30B3\u30F3\u30D1\u30A4\u30EB/\u30EC\u30F3\u30C0\u30EA\u30F3\u30B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${e} \u2014 ${ye(n)}`,{cause:n})}}function uA(e){switch(console.log(`
|
|
435
|
+
--- \u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30D7\u30ED\u30D0\u30A4\u30C0: ${Ep[e.provider]}`),console.log(` \u74B0\u5883: ${e.env}`),console.log(` GitHub: ${e.githubOwner}/${e.githubRepo}`),e.provider){case"aws":console.log(` AWS \u30A2\u30AB\u30A6\u30F3\u30C8: ${e.accountId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` VPC CIDR: ${e.vpcCidr}`),console.log(` RDS: ${e.rdsInstanceClass}`),console.log(` ECS: ${e.ecsCpu} CPU / ${e.ecsMemory} MB`);break;case"gcp":console.log(` \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${e.projectId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` Cloud SQL: ${e.dbTier}`),console.log(` Cloud Run: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"azure":console.log(` Subscription: ${e.subscriptionId}`),console.log(` \u30EA\u30FC\u30B8\u30E7\u30F3: ${e.region}`),console.log(` PostgreSQL: ${e.dbSku}`),console.log(` Container App: ${e.cpuLimit} CPU / ${e.memoryLimit}`);break;case"vercel-railway":console.log(` Railway API: ${e.railwayApiUrl}`);break}console.log(` \u51FA\u529B\u5148: ${e.outputDir}`)}function lA(e){let t=pG(e.provider);t||(console.error(`\u30A8\u30E9\u30FC: ${e.provider} \u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002`),process.exit(1));let{terraformDir:r,ghaDir:n}=t,o=e;e.provider==="aws"?bG(r,n,e,o):xG(r,n,e,o),_A(e.outputDir),wA(e),console.log(`
|
|
436
|
+
\u2713 \u8A2D\u5B9A\u3092 ${(0,G.join)(e.outputDir,kn)} \u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F`)}function bG(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,"terraform","godd-notes",`${r.env}-iam`),s=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0}),(0,K.mkdirSync)(s,{recursive:!0});let a=(0,K.readdirSync)(e).filter(x=>x.endsWith(".tf.hbs")),c=["iam.tf.hbs"],u=a.filter(x=>!c.includes(x)),p=(0,G.resolve)(e,"..","..","scripts","aws"),l=(0,G.join)(p,"terraform-backend-setup.sh.hbs"),d=(0,K.existsSync)(l),f=d?4:3,h=[];console.log(`
|
|
437
|
+
[1/${f}] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let x of u){let k=x.replace(".hbs",""),P=En((0,G.join)(e,x),n);(0,K.writeFileSync)((0,G.join)(o,k),P,"utf-8"),console.log(` \u2713 ${k}`)}console.log(`
|
|
438
|
+
[2/${f}] IAM Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${i}`);for(let x of c){let k=x.replace(".hbs",""),P=En((0,G.join)(e,x),n);(0,K.writeFileSync)((0,G.join)(i,k),P,"utf-8"),console.log(` \u2713 ${k}`)}let g=(0,G.join)(e,"local.tf.hbs");if((0,K.existsSync)(g)){let x=En(g,n);(0,K.writeFileSync)((0,G.join)(i,"local.tf"),x,"utf-8"),console.log(" \u2713 local.tf")}else console.warn(` \u26A0 local.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${g}`),h.push("local.tf.hbs");let y=(0,G.join)(e,"provider.tf.hbs");if((0,K.existsSync)(y)){let x=En(y,n);(0,K.writeFileSync)((0,G.join)(i,"provider.tf"),x,"utf-8"),console.log(" \u2713 provider.tf")}else console.warn(` \u26A0 provider.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${y}`),h.push("provider.tf.hbs");let v=(0,G.join)(e,"backend.tf.hbs");if((0,K.existsSync)(v)){let x=En(v,{...n,env:`${r.env}-iam`});(0,K.writeFileSync)((0,G.join)(i,"backend.tf"),x,"utf-8"),console.log(" \u2713 backend.tf")}else console.warn(` \u26A0 backend.tf.hbs \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${v}`),h.push("backend.tf.hbs");console.log(`
|
|
439
|
+
[3/${f}] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${s}`);let w=(0,K.readdirSync)(t).filter(x=>x.endsWith(".yml.hbs"));for(let x of w){let k=x.replace(".hbs",""),P=En((0,G.join)(t,x),n);(0,K.writeFileSync)((0,G.join)(s,k),P,"utf-8"),console.log(` \u2713 ${k}`)}if(d){let x=(0,G.join)(r.outputDir,"scripts");(0,K.mkdirSync)(x,{recursive:!0}),console.log(`
|
|
440
|
+
[4/${f}] \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u751F\u6210: ${x}`);let k=En(l,n),P=(0,G.join)(x,"terraform-backend-setup.sh");(0,K.writeFileSync)(P,k,"utf-8");try{(0,K.chmodSync)(P,493)}catch{}console.log(" \u2713 terraform-backend-setup.sh")}else console.warn(`
|
|
440
441
|
\u26A0 \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u30B9\u30AF\u30EA\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: `+l),h.push("terraform-backend-setup.sh.hbs");if(h.length>0){console.warn(`
|
|
441
|
-
\u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${h.length} \u4EF6):`);for(let x of h)console.warn(` - ${x}`)}}function
|
|
442
|
-
[1/2] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let c of s){let u=c.replace(".hbs",""),p=
|
|
443
|
-
[2/2] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${i}`);let a=(0,K.readdirSync)(t).filter(c=>c.endsWith(".yml.hbs"));for(let c of a){let u=c.replace(".hbs",""),p=
|
|
442
|
+
\u26A0 \u30B9\u30AD\u30C3\u30D7\u3055\u308C\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8 (${h.length} \u4EF6):`);for(let x of h)console.warn(` - ${x}`)}}function xG(e,t,r,n){let o=(0,G.join)(r.outputDir,"terraform","godd-notes",r.env),i=(0,G.join)(r.outputDir,".github","workflows");(0,K.mkdirSync)(o,{recursive:!0}),(0,K.mkdirSync)(i,{recursive:!0});let s=(0,K.readdirSync)(e).filter(c=>c.endsWith(".tf.hbs"));console.log(`
|
|
443
|
+
[1/2] Terraform \u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210: ${o}`);for(let c of s){let u=c.replace(".hbs",""),p=En((0,G.join)(e,c),n);(0,K.writeFileSync)((0,G.join)(o,u),p,"utf-8"),console.log(` \u2713 ${u}`)}console.log(`
|
|
444
|
+
[2/2] GitHub Actions \u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u3092\u751F\u6210: ${i}`);let a=(0,K.readdirSync)(t).filter(c=>c.endsWith(".yml.hbs"));for(let c of a){let u=c.replace(".hbs",""),p=En((0,G.join)(t,c),n);(0,K.writeFileSync)((0,G.join)(i,u),p,"utf-8"),console.log(` \u2713 ${u}`)}}function bA(){return["export AWS_PROFILE=<PROFILE>",'$env:AWS_PROFILE="<PROFILE>"']}function pA(e){let[t,r]=bA();switch(e.provider){case"aws":console.log(`
|
|
444
445
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
445
446
|
\u2551 AWS \u30A4\u30F3\u30D5\u30E9\u30D5\u30A1\u30A4\u30EB\u751F\u6210\u5B8C\u4E86 \u2551
|
|
446
447
|
\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
|
|
@@ -551,7 +552,7 @@ ${ye(s)}`)}let n;try{n=JSON.parse(r)}catch{throw new Error(`terraform output \u3
|
|
|
551
552
|
\u2551 godd notes deploy -y \u2551
|
|
552
553
|
\u2551 \u2551
|
|
553
554
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
554
|
-
`);break}}async function
|
|
555
|
+
`);break}}async function kG(e){if(e.includes("--help")||e.includes("-h")){console.log(`
|
|
555
556
|
GoDD Notes Infra \u2014 \u30A2\u30D7\u30EA + \u30DE\u30EB\u30C1\u30AF\u30E9\u30A6\u30C9 \u30A4\u30F3\u30D5\u30E9\u81EA\u52D5\u751F\u6210
|
|
556
557
|
|
|
557
558
|
Usage: godd notes infra [options]
|
|
@@ -570,9 +571,9 @@ Options:
|
|
|
570
571
|
--yes, -y \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (.godd-notes-infra.json) \u3092\u5168\u9762\u63A1\u7528\u3057\u3066
|
|
571
572
|
\u975E\u5BFE\u8A71\u3067\u30D5\u30A1\u30A4\u30EB\u751F\u6210\u3059\u308B\uFF08CI / AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u5411\u3051\uFF09
|
|
572
573
|
--help, -h \u3053\u306E\u30D8\u30EB\u30D7\u3092\u8868\u793A
|
|
573
|
-
`);return}if(e.includes("--yes")||e.includes("-y")){let r=vA(process.cwd()),n=mA(r);n.ok||(console.error(`\u30A8\u30E9\u30FC: ${n.error}`),process.exit(1)),console.log(`--yes: \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (${
|
|
574
|
-
\u3053\u306E\u8A2D\u5B9A\u3067\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}lA(r),pA(r)}finally{t.close()}}var dA,K,G,fA,hA,Ep,
|
|
575
|
-
${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t.slice(0,200)}`)}let n=["ecr_repository_url","ecs_cluster_name","ecs_service_name","s3_bucket_name","cloudfront_distribution_id","cloudfront_domain","notes_app_url","notes_api_url"],o=n.filter(s=>!r[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of n)i[s]=r[s].value;return i}function RA(){let e=[];try{it.execSync("aws --version",{stdio:"pipe",timeout:as})}catch{e.push("AWS CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://aws.amazon.com/cli/")}try{it.execSync("aws sts get-caller-identity",{stdio:"pipe",timeout:as})}catch{e.push("AWS \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002aws configure \u307E\u305F\u306F AWS SSO \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}try{it.execSync("docker --version",{stdio:"pipe",timeout:as})}catch{e.push("Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002")}try{it.execSync("pnpm --version",{stdio:"pipe",timeout:as})}catch{e.push("pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm")}return{ok:e.length===0,errors:e}}async function
|
|
574
|
+
`);return}if(e.includes("--yes")||e.includes("-y")){let r=vA(process.cwd()),n=mA(r);n.ok||(console.error(`\u30A8\u30E9\u30FC: ${n.error}`),process.exit(1)),console.log(`--yes: \u4FDD\u5B58\u6E08\u307F\u8A2D\u5B9A (${kn}) \u3092\u4F7F\u7528\u3057\u3066\u975E\u5BFE\u8A71\u3067\u751F\u6210\u3057\u307E\u3059\u3002`),uA(n.config),lA(n.config),pA(n.config);return}process.stdin.isTTY||console.warn("\u26A0 \u975E\u5BFE\u8A71\u74B0\u5883\uFF08stdin \u304C TTY \u3067\u306F\u306A\u3044\uFF09\u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002\u30D1\u30A4\u30D7\u5165\u529B\u306F\u53D6\u308A\u3053\u307C\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002CI / AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304B\u3089\u306E\u5B9F\u884C\u306B\u306F --yes \u3092\u63A8\u5968\u3057\u307E\u3059\u3002");let t=uG();try{let r=await wG(t);if(uA(r),(await oe(t,`
|
|
575
|
+
\u3053\u306E\u8A2D\u5B9A\u3067\u751F\u6210\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}lA(r),pA(r)}finally{t.close()}}var dA,K,G,fA,hA,Ep,aG,cG,dG,fG,hG,kA=b(()=>{"use strict";dA=yt(require("node:readline"),1),K=require("node:fs"),G=require("node:path"),fA=require("node:url"),hA=yt(Ql(),1);er();rp();Ep={aws:"AWS (ECS Fargate + S3/CloudFront + RDS)",gcp:"GCP (Cloud Run + GCS + Cloud SQL)",azure:"Azure (Container Apps + Blob Storage + PostgreSQL)","vercel-railway":"Vercel \xD7 Railway (PaaS)"},aG=["env","githubOwner","githubRepo","outputDir"],cG={aws:["accountId","region","vpcCidr","rdsInstanceClass","ecsCpu","ecsMemory"],gcp:["projectId","region","vpcCidr","dbTier","cpuLimit","memoryLimit"],azure:["subscriptionId","region","vpcCidr","dbSku","cpuLimit","memoryLimit"],"vercel-railway":["railwayApiUrl"]};dG=new Set([".git","coverage","dist","node_modules"]),fG=new Set(["playwright-report","test-results"]),hG=new Set([".pytest_cache",".ruff_cache",".venv","__pycache__"])});var UA={};rr(UA,{checkAwsPrerequisites:()=>RA,checkDocker:()=>n_,ensureNotesComposeGitignoreEntries:()=>MA,generateEnvFile:()=>zA,generateSecret:()=>rn,getTerraformOutputs:()=>Tp,hasGithubReadAuth:()=>SG,loadComposeConfig:()=>jA,loadInfraConfig:()=>o_,parseDeployFlags:()=>OA,resolveComposeDeployDir:()=>NA,runNotes:()=>NG,saveComposeConfig:()=>ZA,toComposeEnvValue:()=>IA});function TA(){return EA.createInterface({input:process.stdin,output:process.stdout})}function Ht(e,t){return new Promise(r=>{e.question(t,n=>r(n.trim()))})}function rn(e=48){return CA.randomBytes(e).toString("base64url").slice(0,e)}function AA(e){return!!(e.githubAppId&&e.githubAppPrivateKey&&e.githubAppInstallationId)}function SG(e){return AA(e)}async function ic(e,t,r){for(;;){let n=await Ht(e,t);if(n)return n;console.log(r)}}function n_(){try{return it.execSync("docker --version",{stdio:"ignore",timeout:as}),it.execSync("docker compose version",{stdio:"ignore",timeout:as}),!0}catch{return!1}}function r_(e,t){(0,je.mkdirSync)(t,{recursive:!0});for(let r of(0,je.readdirSync)(e)){if($G.has(r)||r.endsWith(".pyc")||r.endsWith(".tsbuildinfo"))continue;let n=(0,ve.join)(e,r),o=(0,ve.join)(t,r);(0,je.statSync)(n).isDirectory()?r_(n,o):(0,je.copyFileSync)(n,o)}}function PG(e,t){return new Promise((r,n)=>{let o=it.spawn("docker",["compose",...t],{cwd:e,stdio:"inherit"});o.on("error",i=>n(i)),o.on("close",i=>r(i??1))})}async function SA(e){return new Promise(t=>{let r=Ap.get(e,{timeout:3e3},n=>{let o="";n.on("data",i=>{o+=i.toString("utf-8")}),n.on("end",()=>{if(n.statusCode!==200){t(null);return}try{t(JSON.parse(o))}catch{t(null)}})});r.on("error",()=>t(null)),r.on("timeout",()=>{r.destroy(),t(null)})})}async function $A(e){let r=`${e.replace(/\/api\/health\/?$/,"")}/api/health/github-app`;return new Promise(n=>{let o=Ap.get(r,{timeout:1e4},i=>{i.resume(),n(i.statusCode===200)});o.on("error",()=>n(!1)),o.on("timeout",()=>{o.destroy(),n(!1)})})}function PA(e,t,r){if(console.log(` ${e}:`),!t){console.log(" \u2717 \u5FDC\u7B54\u306A\u3057");return}console.log(` status: ${t.status}`),console.log(` github_app_configured: ${t.github_app_configured?"yes":"no"}`),console.log(` github_write_author: ${t.github_write_author??"unknown"}`),t.github_write_author==="bot"?r===!0?console.log(" installation token refresh: \u2713 OK"):r===!1&&console.log(" installation token refresh: \u2717 \u5931\u6557\uFF08credentials \u307E\u305F\u306F Installation ID \u3092\u78BA\u8A8D\uFF09"):(console.log(" \u26A0 \u30E2\u30C3\u30AF\u30E2\u30FC\u30C9\uFF08GitHub App \u672A\u8A2D\u5B9A\uFF09\u3002PAT \u306F\u7981\u6B62\u3067\u3059\u3002GitHub App 3\u5909\u6570\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),console.log(" \u624B\u9806: docs/007_guides/bot-token-setup.md"))}async function EG(e,t=12e4){let r=Date.now(),n=3e3;for(;Date.now()-r<t;){if(await new Promise(i=>{let s=Ap.get(e,{timeout:3e3},a=>{a.resume(),i(a.statusCode===200)});s.on("error",()=>i(!1)),s.on("timeout",()=>{s.destroy(),i(!1)})}))return!0;await new Promise(i=>setTimeout(i,n))}return!1}function o_(e){return tp(e)}function Tp(e){if(!(0,je.existsSync)(e))throw new Error(`Terraform \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=it.execSync("terraform output -json",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}catch(s){throw new Error(`terraform output \u306E\u5B9F\u884C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002terraform init && terraform apply \u3092\u5148\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
576
|
+
${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u306E JSON \u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t.slice(0,200)}`)}let n=["ecr_repository_url","ecs_cluster_name","ecs_service_name","s3_bucket_name","cloudfront_distribution_id","cloudfront_domain","notes_app_url","notes_api_url"],o=n.filter(s=>!r[s]?.value);if(o.length>0)throw new Error(`Terraform output \u306B\u5FC5\u8981\u306A\u5024\u304C\u3042\u308A\u307E\u305B\u3093: ${o.join(", ")}`);let i={};for(let s of n)i[s]=r[s].value;return i}function RA(){let e=[];try{it.execSync("aws --version",{stdio:"pipe",timeout:as})}catch{e.push("AWS CLI \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002https://aws.amazon.com/cli/")}try{it.execSync("aws sts get-caller-identity",{stdio:"pipe",timeout:as})}catch{e.push("AWS \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002aws configure \u307E\u305F\u306F AWS SSO \u3067\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}try{it.execSync("docker --version",{stdio:"pipe",timeout:as})}catch{e.push("Docker \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002")}try{it.execSync("pnpm --version",{stdio:"pipe",timeout:as})}catch{e.push("pnpm \u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002npm install -g pnpm")}return{ok:e.length===0,errors:e}}async function CG(e,t,r){let n=t.region??"ap-northeast-1",i=`${t.accountId??""}.dkr.ecr.${n}.amazonaws.com`;console.log(`
|
|
576
577
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
577
578
|
\u2551 GoDD Notes \u2014 AWS \u30C7\u30D7\u30ED\u30A4\u958B\u59CB \u2551
|
|
578
579
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
@@ -596,23 +597,23 @@ ${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u3
|
|
|
596
597
|
\u2551 --services ${e.ecs_service_name.padEnd(32)}\u2551
|
|
597
598
|
\u2551 \u2551
|
|
598
599
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
599
|
-
`)}async function
|
|
600
|
+
`)}async function TG(e){console.log(`
|
|
600
601
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
601
602
|
\u2551 GoDD Notes \u30C7\u30D7\u30ED\u30A4\u30A6\u30A3\u30B6\u30FC\u30C9 \u2551
|
|
602
603
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
603
604
|
`);let t=await Ht(e,"\u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA [./godd-notes]: ")||"./godd-notes";console.log(`
|
|
604
|
-
--- PostgreSQL \u8A2D\u5B9A ---`);let r=await Ht(e,"DB \u30E6\u30FC\u30B6\u30FC [app_user]: ")||"app_user",n=await Ht(e,"DB \u30D1\u30B9\u30EF\u30FC\u30C9 [\u81EA\u52D5\u751F\u6210]: ")||
|
|
605
|
+
--- PostgreSQL \u8A2D\u5B9A ---`);let r=await Ht(e,"DB \u30E6\u30FC\u30B6\u30FC [app_user]: ")||"app_user",n=await Ht(e,"DB \u30D1\u30B9\u30EF\u30FC\u30C9 [\u81EA\u52D5\u751F\u6210]: ")||rn(24),o=await Ht(e,"DB \u540D [godd_notes]: ")||"godd_notes",i=await Ht(e,"PostgreSQL \u30DD\u30FC\u30C8 [5432]: ")||"5432";console.log(`
|
|
605
606
|
--- \u30DD\u30FC\u30C8\u8A2D\u5B9A ---`);let s=await Ht(e,"Notes API \u30DD\u30FC\u30C8 [3100]: ")||"3100",a=await Ht(e,"Notes App \u30DD\u30FC\u30C8 [5175]: ")||"5175";console.log(`
|
|
606
607
|
--- GitHub \u9023\u643A ---`),console.log(" PR / Issue \u4F5C\u6210\u306B\u306F GitHub App \u8A2D\u5B9A\u304C\u5FC5\u9808\u3067\u3059\uFF08Bot author\uFF09\u3002"),console.log(" \u624B\u9806: docs/007_guides/bot-token-setup.md \u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),console.log(" Private Key \u306F1\u884C\u5165\u529B\u3067\u3059\u3002\u8907\u6570\u884C PEM \u306F \\n \u306B\u7F6E\u63DB\u3057\u3066\u8CBC\u308B\u304B\u3001--auto / --config \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002");let c=await ic(e,"GitHub App ID: "," GitHub App ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),u=await ic(e,"GitHub App Private Key PEM (\\n 1\u884C\u53EF): "," GitHub App Private Key \u306F\u5FC5\u9808\u3067\u3059\u3002"),p=await ic(e,"GitHub App Installation ID: "," GitHub App Installation ID \u306F\u5FC5\u9808\u3067\u3059\u3002"),l=await ic(e,"GitHub Owner (\u7D44\u7E54 or \u30E6\u30FC\u30B6\u30FC\u540D): "," GitHub Owner \u306F\u5FC5\u9808\u3067\u3059\u3002"),d=await ic(e,"GitHub Repo (\u30EA\u30DD\u30B8\u30C8\u30EA\u540D): "," GitHub Repo \u306F\u5FC5\u9808\u3067\u3059\u3002"),f=await Ht(e,"GitHub Branch [main]: ")||"main";console.log(`
|
|
607
|
-
--- \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3 ---`);let h=await Ht(e,"JWT \u30B7\u30FC\u30AF\u30EC\u30C3\u30C8 [\u81EA\u52D5\u751F\u6210]: ")||
|
|
608
|
-
--- \u7BA1\u7406\u8005\u30A2\u30AB\u30A6\u30F3\u30C8 ---`);let g=await Ht(e,"\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D [admin]: ")||"admin",y=await Ht(e,"\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9: ")||
|
|
608
|
+
--- \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3 ---`);let h=await Ht(e,"JWT \u30B7\u30FC\u30AF\u30EC\u30C3\u30C8 [\u81EA\u52D5\u751F\u6210]: ")||rn(48);console.log(`
|
|
609
|
+
--- \u7BA1\u7406\u8005\u30A2\u30AB\u30A6\u30F3\u30C8 ---`);let g=await Ht(e,"\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u540D [admin]: ")||"admin",y=await Ht(e,"\u7BA1\u7406\u8005\u30D1\u30B9\u30EF\u30FC\u30C9: ")||rn(16);return{deployDir:(0,ve.resolve)(t),postgresUser:r,postgresPassword:n,postgresDb:o,postgresPort:i,notesApiPort:s,notesAppPort:a,githubAppId:c,githubAppPrivateKey:u,githubAppInstallationId:p,githubOwner:l,githubRepo:d,githubBranch:f,jwtSecret:h,adminUsername:g,adminPassword:y}}function IA(e){return e.replace(/\r\n/g,`
|
|
609
610
|
`).replace(/\r/g,`
|
|
610
611
|
`).replace(/\n/g,"\\n")}function zA(e){return["# GoDD Notes \u74B0\u5883\u5909\u6570\uFF08\u81EA\u52D5\u751F\u6210\uFF09",`POSTGRES_USER=${e.postgresUser}`,`POSTGRES_PASSWORD=${e.postgresPassword}`,`POSTGRES_DB=${e.postgresDb}`,`POSTGRES_PORT=${e.postgresPort}`,`NOTES_API_PORT=${e.notesApiPort}`,`NOTES_APP_PORT=${e.notesAppPort}`,`GITHUB_APP_ID=${e.githubAppId}`,`GITHUB_APP_PRIVATE_KEY=${IA(e.githubAppPrivateKey)}`,`GITHUB_APP_INSTALLATION_ID=${e.githubAppInstallationId}`,`GITHUB_OWNER=${e.githubOwner}`,`GITHUB_REPO=${e.githubRepo}`,`GITHUB_BRANCH=${e.githubBranch}`,`JWT_SECRET=${e.jwtSecret}`,`NOTES_ADMIN_USERNAME=${e.adminUsername}`,`NOTES_ADMIN_PASSWORD=${e.adminPassword}`,""].join(`
|
|
611
612
|
`)}async function DA(e){let t=q2({preferredRoots:[process.cwd()]});t||(console.error("\u30A8\u30E9\u30FC: notes-api / notes-app \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),console.error("npm \u30D1\u30C3\u30B1\u30FC\u30B8\u304C\u6B63\u3057\u304F\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u308B\u304B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let{apiDir:r,appDir:n,composeTemplate:o}=t;try{console.log(`
|
|
612
613
|
[1/5] \u30C7\u30D7\u30ED\u30A4\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6E96\u5099: ${e.deployDir}`),(0,je.mkdirSync)(e.deployDir,{recursive:!0}),console.log("[2/5] notes-api \u3092\u30B3\u30D4\u30FC..."),r_(r,(0,ve.join)(e.deployDir,"notes-api")),console.log("[3/5] notes-app \u3092\u30B3\u30D4\u30FC..."),r_(n,(0,ve.join)(e.deployDir,"notes-app")),console.log("[4/5] docker-compose.yml \u3068 .env \u3092\u751F\u6210...");let p=(0,je.readFileSync)(o,"utf-8");(0,je.writeFileSync)((0,ve.join)(e.deployDir,"docker-compose.yml"),p,"utf-8"),(0,je.writeFileSync)((0,ve.join)(e.deployDir,".env"),zA(e),"utf-8")}catch(p){let l=p instanceof Error?p.message:String(p);console.error(`
|
|
613
|
-
\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${l}`),console.error(`\u30C7\u30D7\u30ED\u30A4\u5148\u306E\u30D1\u30B9\u3068\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044: ${e.deployDir}`),process.exit(1)}console.log("[5/5] Docker Compose \u3067\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5..."),await
|
|
614
|
+
\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${l}`),console.error(`\u30C7\u30D7\u30ED\u30A4\u5148\u306E\u30D1\u30B9\u3068\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044: ${e.deployDir}`),process.exit(1)}console.log("[5/5] Docker Compose \u3067\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5..."),await PG(e.deployDir,["up","-d","--build"])!==0&&(console.error(`
|
|
614
615
|
\u30A8\u30E9\u30FC: docker compose up \u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002`),console.error(`\u30ED\u30B0\u3092\u78BA\u8A8D: cd ${e.deployDir} && docker compose logs`),process.exit(1)),console.log(`
|
|
615
|
-
\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await
|
|
616
|
+
\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u5F85\u6A5F\u4E2D...`);let s=`http://localhost:${e.notesApiPort}/api/health`;await EG(s)||(console.warn(`
|
|
616
617
|
\u8B66\u544A: \u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF\u304C\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F\u3002`),console.warn("\u30B5\u30FC\u30D3\u30B9\u306E\u8D77\u52D5\u306B\u6642\u9593\u304C\u304B\u304B\u3063\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"),console.warn(`\u624B\u52D5\u3067\u78BA\u8A8D: curl ${s}`));let c=`http://localhost:${e.notesAppPort}`,u=`http://localhost:${e.notesApiPort}`;console.log(`
|
|
617
618
|
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
618
619
|
\u2551 GoDD Notes \u30C7\u30D7\u30ED\u30A4\u5B8C\u4E86 \u2551
|
|
@@ -636,10 +637,10 @@ ${ye(s)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`terraform output \u3
|
|
|
636
637
|
docker compose stop # \u505C\u6B62
|
|
637
638
|
docker compose start # \u518D\u958B
|
|
638
639
|
docker compose down -v # \u5B8C\u5168\u524A\u9664
|
|
639
|
-
`)}async function
|
|
640
|
+
`)}async function AG(e){n_()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let t=await TG(e);if(console.log(`
|
|
640
641
|
--- \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${t.deployDir}`),console.log(` DB: ${t.postgresUser}@localhost:${t.postgresPort}/${t.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${t.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${t.notesAppPort}`),console.log(` GitHub: ${t.githubOwner}/${t.githubRepo} (${t.githubBranch})`),console.log(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${t.adminUsername}`),(await Ht(e,`
|
|
641
|
-
\u3053\u306E\u8A2D\u5B9A\u3067\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}LA(),await DA(t)}function OA(e){let t=!1;for(let r=0;r<e.length;r++)(e[r]==="--yes"||e[r]==="-y")&&(t=!0);return{yes:t}}function
|
|
642
|
-
`,"utf-8")}async function
|
|
642
|
+
\u3053\u306E\u8A2D\u5B9A\u3067\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}LA(),await DA(t)}function OA(e){let t=!1;for(let r=0;r<e.length;r++)(e[r]==="--yes"||e[r]==="-y")&&(t=!0);return{yes:t}}function RG(e){let t=!1,r=null;for(let n=0;n<e.length;n++)e[n]==="--auto"?t=!0:e[n]==="--config"&&n+1<e.length&&(r=e[++n]);return{auto:t,configPath:r}}function NA(e,t){let r=(0,ve.resolve)(t,"godd-notes");return typeof e!="string"||e===""?r:oy(e)?(0,je.existsSync)(e)?(0,ve.resolve)(e):(console.warn(` \u26A0 ${i_} \u306E deployDir \u304C\u3053\u306E\u30DE\u30B7\u30F3\u306B\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059: ${e} \u2192 ${r}`),r):(0,ve.resolve)(t,e)}function jA(e){if(!(0,je.existsSync)(e))throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${e}`);let t;try{t=JSON.parse((0,je.readFileSync)(e,"utf-8"))}catch{throw new Error(`\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30FC\u30B9\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08JSON \u5F62\u5F0F\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF09: ${e}`)}return{deployDir:NA(t.deployDir,(0,ve.dirname)((0,ve.resolve)(e))),postgresUser:t.postgresUser??"app_user",postgresPassword:t.postgresPassword??rn(24),postgresDb:t.postgresDb??"godd_notes",postgresPort:t.postgresPort??"5432",notesApiPort:t.notesApiPort??"3100",notesAppPort:t.notesAppPort??"5175",githubAppId:t.githubAppId??"",githubAppPrivateKey:t.githubAppPrivateKey??"",githubAppInstallationId:t.githubAppInstallationId??"",githubOwner:t.githubOwner??"",githubRepo:t.githubRepo??"",githubBranch:t.githubBranch??"main",jwtSecret:t.jwtSecret??rn(48),adminUsername:t.adminUsername??"admin",adminPassword:t.adminPassword??rn(16)}}function IG(){return{deployDir:(0,ve.resolve)("./godd-notes"),postgresUser:"app_user",postgresPassword:rn(24),postgresDb:"godd_notes",postgresPort:"5432",notesApiPort:"3100",notesAppPort:"5175",githubAppId:process.env.GITHUB_APP_ID??"",githubAppPrivateKey:process.env.GITHUB_APP_PRIVATE_KEY??"",githubAppInstallationId:process.env.GITHUB_APP_INSTALLATION_ID??"",githubOwner:process.env.GITHUB_OWNER??"",githubRepo:process.env.GITHUB_REPO??"",githubBranch:process.env.GITHUB_BRANCH??"main",jwtSecret:rn(48),adminUsername:"admin",adminPassword:rn(16)}}function MA(e=process.cwd()){return fp(e,zG)}function LA(e=process.cwd()){MA(e)?console.log("\u2713 Notes compose \u751F\u6210\u7269\u3092 .gitignore \u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F"):console.log("\u2713 Notes compose \u751F\u6210\u7269\u306F .gitignore \u306B\u8FFD\u52A0\u6E08\u307F\u3067\u3059")}function ZA(e,t=process.cwd()){let{postgresPassword:r,jwtSecret:n,adminPassword:o,githubAppPrivateKey:i,...s}=e,a=(0,ve.relative)(t,e.deployDir),c=a===""?".":!a.startsWith("..")&&!(0,ve.isAbsolute)(a)?a:e.deployDir;(0,je.writeFileSync)((0,ve.join)(t,i_),JSON.stringify({...s,deployDir:c},null,2)+`
|
|
643
|
+
`,"utf-8")}async function DG(){let e=process.cwd(),t=o_(e);console.log(`
|
|
643
644
|
--- GoDD Notes \u30B9\u30C6\u30FC\u30BF\u30B9\u78BA\u8A8D ---
|
|
644
645
|
`);let r=(0,je.existsSync)((0,ve.join)(e,"godd-notes"))?(0,ve.join)(e,"godd-notes"):e;if((0,je.existsSync)((0,ve.join)(r,"docker-compose.yml"))){console.log("[Docker Compose]");try{it.spawnSync("docker",["compose","ps"],{cwd:r,stdio:"inherit"})}catch{console.log(" Docker Compose \u304C\u8D77\u52D5\u3057\u3066\u3044\u307E\u305B\u3093\u3002")}console.log()}if(t?.provider==="aws"){console.log("[AWS ECS]");let u=t.region??"ap-northeast-1";try{let p=t.env??"dev",l=(0,ve.join)(t.outputDir??e,"terraform","godd-notes",p),d=Tp(l);it.spawnSync("aws",["ecs","describe-services","--cluster",d.ecs_cluster_name,"--services",d.ecs_service_name,"--region",u,"--query","services[0].{status:status,running:runningCount,desired:desiredCount,deployments:length(deployments)}","--output","table"],{stdio:"inherit"})}catch(p){console.log(` ECS \u30B9\u30C6\u30FC\u30BF\u30B9\u53D6\u5F97\u306B\u5931\u6557: ${ye(p)}`)}console.log()}let o=(0,ve.join)(e,i_),s=((0,je.existsSync)(o)?(()=>{try{return JSON.parse((0,je.readFileSync)(o,"utf-8"))}catch{return null}})():null)?.notesApiPort??"3100",a=[s,...s!=="8000"?["8000"]:[]];console.log("[\u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF / GitHub App \u2014 #829]");let c=new Set;for(let u of a){let p=`http://localhost:${u}/api/health`,l=await SA(p),d=p.replace(/\/api\/health\/?$/,""),f=null;l?.github_app_configured&&(f=await $A(d)),PA(p,l,f),c.add(d),console.log()}if(t?.provider==="aws")try{let u=t.env??"dev",p=(0,ve.join)(t.outputDir??e,"terraform","godd-notes",u),d=`https://${Tp(p).cloudfront_domain}`;if(!c.has(d)){let f=`${d}/api/health`,h=await SA(f),g=null;h?.github_app_configured&&(g=await $A(d)),PA(f,h,g),console.log()}}catch{}}function Cp(){console.log(`
|
|
645
646
|
GoDD Notes \u30C7\u30D7\u30ED\u30A4\u7BA1\u7406
|
|
@@ -694,13 +695,13 @@ AI \u9023\u643A:
|
|
|
694
695
|
\u8A2D\u5B9A\u306E\u6C38\u7D9A\u5316:
|
|
695
696
|
infra \u30B3\u30DE\u30F3\u30C9\u306F .godd-notes-infra.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
|
|
696
697
|
compose --config/--auto \u306F .godd-notes-compose.json \u3092\u4FDD\u5B58\u3057\u518D\u5229\u7528\u3002
|
|
697
|
-
`)}async function
|
|
698
|
+
`)}async function OG(e,t,r,n){console.log(`
|
|
698
699
|
\u524D\u63D0\u6761\u4EF6\u3092\u78BA\u8A8D\u4E2D...`);let o=RA();if(!o.ok){console.error(`
|
|
699
700
|
\u30A8\u30E9\u30FC: AWS \u30C7\u30D7\u30ED\u30A4\u306E\u524D\u63D0\u6761\u4EF6\u3092\u6E80\u305F\u3057\u3066\u3044\u307E\u305B\u3093:`);for(let u of o.errors)console.error(` - ${u}`);process.exit(1)}console.log(` \u2713 \u524D\u63D0\u6761\u4EF6 OK
|
|
700
701
|
`);let i=e.env??"dev",s=e.outputDir??t,a=(0,ve.join)(s,"terraform","godd-notes",i);console.log(`Terraform output \u3092\u53D6\u5F97\u4E2D... (${a})`);let c=Tp(a);if(console.log(` \u2713 Terraform output \u53D6\u5F97\u5B8C\u4E86
|
|
701
702
|
`),console.log("--- AWS \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A\u306E\u78BA\u8A8D ---"),console.log(` ECR: ${c.ecr_repository_url}`),console.log(` ECS: ${c.ecs_cluster_name} / ${c.ecs_service_name}`),console.log(` S3: ${c.s3_bucket_name}`),console.log(` CloudFront: ${c.cloudfront_distribution_id}`),console.log(` App URL: ${c.notes_app_url}`),!n){let u=TA();try{if((await Ht(u,`
|
|
702
|
-
\u3053\u306E\u8A2D\u5B9A\u3067 AWS \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}}finally{u.close()}}await
|
|
703
|
-
--- \u975E\u5BFE\u8A71\u30E2\u30FC\u30C9: \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${n.deployDir}`),console.log(` DB: ${n.postgresUser}@localhost:${n.postgresPort}/${n.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${n.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${n.notesAppPort}`),console.log(` GitHub: ${n.githubOwner}/${n.githubRepo} (${n.githubBranch})`),console.log(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),LA(),ZA(n),await DA(n)}else{let n=TA();try{await
|
|
703
|
+
\u3053\u306E\u8A2D\u5B9A\u3067 AWS \u306B\u30C7\u30D7\u30ED\u30A4\u3057\u307E\u3059\u304B\uFF1F [Y/n]: `)).toLowerCase()==="n"){console.log("\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u307E\u3057\u305F\u3002");return}}finally{u.close()}}await CG(c,e,r)}async function NG(e){let t=e[0]??"help";switch(t){case"compose":{if(e.includes("--help")||e.includes("-h")){Cp();return}n_()||(console.error("\u30A8\u30E9\u30FC: Docker \u304A\u3088\u3073 Docker Compose \u304C\u5FC5\u8981\u3067\u3059\u3002"),console.error("https://docs.docker.com/get-docker/ \u304B\u3089\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let r=RG(e.slice(1));if(r.auto||r.configPath){let n=r.configPath?jA(r.configPath):IG();AA(n)||(console.error("\u30A8\u30E9\u30FC: GitHub App \u8A8D\u8A3C\u60C5\u5831\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"),console.error("PR / Issue \u4F5C\u6210\u306B\u306F GITHUB_APP_ID / GITHUB_APP_PRIVATE_KEY / GITHUB_APP_INSTALLATION_ID \u304C\u5FC5\u9808\u3067\u3059\u3002"),console.error("\u624B\u9806: docs/007_guides/bot-token-setup.md"),process.exit(1)),(!n.githubOwner||!n.githubRepo)&&(console.error("\u30A8\u30E9\u30FC: GITHUB_OWNER \u3068 GITHUB_REPO \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1)),console.log(`
|
|
704
|
+
--- \u975E\u5BFE\u8A71\u30E2\u30FC\u30C9: \u30C7\u30D7\u30ED\u30A4\u8A2D\u5B9A ---`),console.log(` \u30C7\u30D7\u30ED\u30A4\u5148: ${n.deployDir}`),console.log(` DB: ${n.postgresUser}@localhost:${n.postgresPort}/${n.postgresDb}`),console.log(` API \u30DD\u30FC\u30C8: ${n.notesApiPort}`),console.log(` App \u30DD\u30FC\u30C8: ${n.notesAppPort}`),console.log(` GitHub: ${n.githubOwner}/${n.githubRepo} (${n.githubBranch})`),console.log(" GitHub App: \u8A2D\u5B9A\u6E08\u307F (Bot author)"),console.log(` \u7BA1\u7406\u8005: ${n.adminUsername}`),LA(),ZA(n),await DA(n)}else{let n=TA();try{await AG(n)}finally{n.close()}}break}case"deploy":{if(e.includes("--help")||e.includes("-h")){Cp();return}let{yes:r}=OA(e),n=process.cwd(),o=o_(n);o||(console.error("\u30A8\u30E9\u30FC: .godd-notes-infra.json \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let{resolveDeployProvider:i,executeGcpDeploy:s,executeAzureDeploy:a,executeVercelRailwayDeploy:c}=await Promise.resolve().then(()=>(cA(),aA)),u=i(o.provider);u||(console.error(`\u30A8\u30E9\u30FC: \u4E0D\u660E\u306A provider \u3067\u3059: ${o.provider}`),console.error("\u5148\u306B godd notes infra \u3092\u5B9F\u884C\u3057\u3001AWS / GCP / Azure / Vercel\xD7Railway \u306E\u3044\u305A\u308C\u304B\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"),process.exit(1));let p=o.outputDir??n,l=ep({preferredRoots:[p,n]});switch(l||(console.error("\u30A8\u30E9\u30FC: notes-api / notes-app \u306E\u30BD\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"),process.exit(1)),F2(l),u){case"aws":await OG(o,n,l,r);break;case"gcp":await s(o,n,l,r);break;case"azure":await a(o,n,l,r);break;case"vercel-railway":await c(o,n,l,r);break}break}case"infra":{let{runNotesInfra:r}=await Promise.resolve().then(()=>(kA(),xA));await r(e.slice(1));break}case"status":{await DG();break}case"help":case"--help":case"-h":Cp();break;default:console.error(`\u4E0D\u660E\u306A\u30B5\u30D6\u30B3\u30DE\u30F3\u30C9: ${t}`),Cp(),process.exit(1)}}var EA,CA,je,ve,it,Ap,as,$G,i_,zG,qA=b(()=>{"use strict";EA=yt(require("node:readline"),1),CA=yt(require("node:crypto"),1),je=require("node:fs"),ve=require("node:path"),it=yt(require("node:child_process"),1),Ap=yt(require("node:http"),1);er();Sy();Yy();rp();KT();Qy();as=1e4;$G=new Set([".venv","__pycache__",".pytest_cache",".ruff_cache","node_modules",".git",".env","dist"]);i_=".godd-notes-compose.json",zG=["/godd-notes/",".godd-notes-*.json"]});var GA=require("node:fs"),sc=require("node:path"),s_=require("node:os");ri();Np();process.env.__GODD_CLI__="1";var cs=Nr();function jG(){return cs==="0.0.0"?`${cs} (development)`:`${cs} (${nr(cs)?.channel??"unknown"})`}function MG(){let e=process.platform==="win32"?"godd.exe":"godd",t=process.platform==="win32"?(0,sc.join)(process.env.LOCALAPPDATA??(0,sc.join)((0,s_.homedir)(),"AppData","Local"),"GoDD"):(0,sc.join)((0,s_.homedir)(),".godd","bin");return(0,GA.existsSync)((0,sc.join)(t,e))}var LG={i:"install",s:"server",n:"notes",v:"version",h:"help"};function ZG(){return MG()?"help":"install"}var Rp=process.argv[2],ac=Rp?LG[Rp]??Rp:ZG();function FA(){console.log(`
|
|
704
705
|
GoDD CLI v${cs}
|
|
705
706
|
|
|
706
707
|
Usage: godd <command>
|
|
@@ -727,7 +728,7 @@ Examples:
|
|
|
727
728
|
godd notes deploy \u30AF\u30E9\u30A6\u30C9\u306B\u30C7\u30D7\u30ED\u30A4\uFF08infra \u306E provider \u306B\u5F93\u3046\uFF09
|
|
728
729
|
godd notes infra Notes \u30A2\u30D7\u30EA\u96DB\u5F62\u3068\u30AF\u30E9\u30A6\u30C9\u30A4\u30F3\u30D5\u30E9\u3092\u5BFE\u8A71\u5F62\u5F0F\u3067\u69CB\u7BC9
|
|
729
730
|
godd version \u30D0\u30FC\u30B8\u30E7\u30F3\u78BA\u8A8D
|
|
730
|
-
`)}async function
|
|
731
|
+
`)}async function UG(){switch(ac){case"server":{let{startServer:e}=await Promise.resolve().then(()=>(cC(),aC));await e();break}case"init":{let{runInit:e}=await Promise.resolve().then(()=>(fT(),dT));await e();break}case"login":{let{runLogin:e}=await Promise.resolve().then(()=>(Fa(),Ny));await e(process.argv.slice(3));break}case"logout":{let{runLogout:e}=await Promise.resolve().then(()=>(Fa(),Ny));await e(process.argv.slice(3));break}case"google-relay":{let{runGoogleRelay:e}=await Promise.resolve().then(()=>(ZT(),LT));await e();break}case"install":{let{runInstall:e}=await Promise.resolve().then(()=>(BT(),GT));await e();break}case"notes":{let{runNotes:e}=await Promise.resolve().then(()=>(qA(),UA));await e(process.argv.slice(3));break}case"version":console.log(`GoDD CLI v${jG()}`);break;case"help":FA();break;default:console.error(`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${Rp}`),FA(),process.exit(1)}}var qG=ac==="server"||ac==="google-relay"?Promise.resolve(""):lc({version:cs})();UG().then(async()=>{if(ac==="server"||ac==="google-relay")return;let e=await qG;e&&console.log(`
|
|
731
732
|
${e}`)}).catch(e=>{console.error("GoDD CLI \u30A8\u30E9\u30FC:",e),process.exit(1)});
|
|
732
733
|
/*! Bundled license information:
|
|
733
734
|
|